Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
2c62f91
feat(optimism): integrate optimism into Mask ecosystem #4868
developerfred Dec 24, 2021
4f9a737
chore(optimistic): fixed import warnings
developerfred Dec 24, 2021
4d71edc
Merge remote-tracking branch 'upstream/master' into codingsh/Integrat…
developerfred Dec 30, 2021
647e3db
Merge remote-tracking branch 'upstream/develop' into codingsh/Integra…
developerfred Dec 30, 2021
3778cd3
Merge remote-tracking branch 'upstream/develop' into HEAD
developerfred Dec 30, 2021
787e6d0
Merge remote-tracking branch 'upstream/develop' into codingsh/Integra…
developerfred Dec 30, 2021
ba97f5a
feat(optimistc): add events optimistic
developerfred Dec 30, 2021
afccc31
Merge remote-tracking branch 'upstream/develop' into codingsh/Integra…
developerfred Dec 31, 2021
27d4c76
Merge remote-tracking branch 'origin/develop' into codingsh/Integrate…
developerfred Jan 4, 2022
2130a87
feat(optimistic): add contracts
developerfred Jan 4, 2022
a4f20b4
feat(dHEDGE): add optimistic network
developerfred Jan 4, 2022
232d7c8
feat(optimistic): enable unlock protocol
developerfred Jan 4, 2022
86d9313
Merge remote-tracking branch 'origin/develop' into codingsh/Integrate…
developerfred Jan 5, 2022
807e6f8
feat(optimistic): add contracts addres
developerfred Jan 6, 2022
2fccf7f
Merge branch 'develop' into codingsh/Integrate-Optimism
developerfred Jan 6, 2022
035c54f
Merge branch 'develop' into codingsh/Integrate-Optimism
developerfred Jan 10, 2022
9e304a3
chore(optimistic): add ignore word on cspell
developerfred Jan 10, 2022
60a385a
feat(optimistic): add mainnet contracts
developerfred Jan 13, 2022
56dd7cd
feat(optimistic): add maskbox contract mainnet
developerfred Jan 13, 2022
f8942dc
Merge branch 'develop' into codingsh/Integrate-Optimism
developerfred Jan 13, 2022
406a143
feat(optimistic): add mask token address on optimistic
developerfred Jan 13, 2022
d25c186
chore(optimistic): fixed trader plugin
developerfred Jan 13, 2022
250456c
chore(optimistic): rename optmistic to op
developerfred Jan 13, 2022
52e7d8d
chore(optimistic): change redPacket address to implementer Mask deployer
developerfred Jan 14, 2022
9b24670
chore(optimistic): change OETH to ETH
developerfred Jan 14, 2022
0953e82
Merge remote-tracking branch 'upstream/develop' into codingsh/Integra…
developerfred Jan 14, 2022
359f3a0
chore(optimistic): change mainnet name Optimistic to Optimism
developerfred Jan 14, 2022
f717ead
Merge branch 'develop' into codingsh/Integrate-Optimism
developerfred Jan 17, 2022
272fc63
feat(docs): improve docs for evm integrations and add contracts repo
developerfred Jan 18, 2022
a3a54d9
Merge branch 'develop' into codingsh/Integrate-Optimism
developerfred Jan 18, 2022
5636efd
Merge branch 'develop' into HEAD
developerfred Jan 25, 2022
c31470f
feat(optimistic): add jugglerred dex
developerfred Jan 25, 2022
36eea91
Merge branch 'develop' into codingsh/Integrate-Optimism
developerfred Jan 26, 2022
cbe8035
Merge branch 'develop' into codingsh/Integrate-Optimism
developerfred Jan 29, 2022
b285c5b
Merge branch 'develop' into codingsh/Integrate-Optimism
developerfred Jan 30, 2022
3873786
chore(optimistic): enable on Trader plugin
developerfred Feb 8, 2022
d7d71a1
Merge branch 'develop' into codingsh/Integrate-Optimism
developerfred Feb 8, 2022
635917a
chore(optimism): fixed multicall address
developerfred Feb 8, 2022
5f64a23
chore(optimistic): update uniswapV3 address
developerfred Feb 9, 2022
8e001b0
Merge remote-tracking branch 'upstream/develop' into codingsh/Integra…
developerfred Mar 7, 2022
e66049c
Merge branch 'develop' into codingsh/Integrate-Optimism
developerfred Mar 9, 2022
119b42b
Merge remote-tracking branch 'upstream/develop' into HEAD
developerfred Mar 19, 2022
cff60db
Merge remote-tracking branch 'upstream/develop' into codingsh/Integra…
developerfred Apr 23, 2022
aa3dda4
Merge remote-tracking branch 'upstream/develop' into codingsh/Integra…
developerfred May 13, 2022
751fd86
Merge remote-tracking branch 'upstream/develop' into codingsh/Integra…
developerfred May 13, 2022
c9ec998
Merge remote-tracking branch 'upstream/develop' into codingsh/Integra…
developerfred May 14, 2022
614a059
feat(otimism): add ELK finance
developerfred May 14, 2022
26d5672
chore(otimism): fixed token list
developerfred May 14, 2022
d9bebfb
chore(optimism): change rpc
developerfred May 16, 2022
78be94a
Merge remote-tracking branch 'upstream/develop' into codingsh/Integra…
developerfred May 16, 2022
e355bf5
feat(optimism): add zipswap dex
developerfred May 16, 2022
f0c8b67
chore(optmism): change name "Optimistic" to Optmism and add support O…
developerfred May 16, 2022
e4c03d9
Merge remote-tracking branch 'upstream/develop' into codingsh/Integra…
developerfred May 16, 2022
f04431c
chore(optmism): add zipswap on cspell
developerfred May 16, 2022
d558476
chore(optimism): add hardCode gasLimit and gasPrice on optimism
developerfred May 16, 2022
bcf0399
chore(optimism): enable sushiswap
developerfred May 16, 2022
6e185f5
fix: add missing deps (#6356)
nuanyang233 May 26, 2022
836f5f5
fix(ui): claim button && mind fb tool box hint (#6337)
hanszhoou May 26, 2022
0bf326e
refactor: update promote text for plugins. (#6217)
UncleBill May 26, 2022
e884294
Merge remote-tracking branch 'upstream/develop' into codingsh/Integra…
developerfred May 26, 2022
1cf6309
chore(optimism): fixed swap tokens
developerfred May 26, 2022
0e0e138
chore(optimism): remove unecessary assets
developerfred May 26, 2022
774ba3a
chore(op): need check trade on 0x000 address
developerfred May 27, 2022
5a49a47
Merge remote-tracking branch 'upstream/develop' into codingsh/Integra…
developerfred May 30, 2022
cb7b21a
chore(optimism): revert comment changes
developerfred Jun 1, 2022
390e132
chore(optmism): i18n-codegen fix
developerfred Jun 2, 2022
108734a
Merge remote-tracking branch 'upstream/develop' into codingsh/Integra…
developerfred Jun 14, 2022
38cfde0
chore(optimism): fixed review
developerfred Jun 21, 2022
63ae742
chore(op): fixed chain type optimism and logo token url
developerfred Jul 5, 2022
b11195c
Merge remote-tracking branch 'upstream/develop' into codingsh/Integra…
developerfred Jul 5, 2022
130a744
Merge branch 'develop' into codingsh/Integrate-Optimism
nuanyang233 Jul 26, 2022
befe600
fix: incorrect network type
nuanyang233 Jul 26, 2022
51ef4b5
fix: bugfix
nuanyang233 Jul 26, 2022
4985ffc
fix: remove useless dex
nuanyang233 Jul 26, 2022
3fbecd8
fix: uniswap v3 on op network
guanbinrui Jul 26, 2022
c844bcd
revert: add op to base against tokens
nuanyang233 Jul 26, 2022
da5a4a1
Merge branch 'develop' into codingsh/Integrate-Optimism
nuanyang233 Jul 26, 2022
7628600
fix: remove jugglerred network
nuanyang233 Jul 26, 2022
ea95a8d
fix: add op support at ito
nuanyang233 Jul 27, 2022
a3f7c21
Merge branch 'develop' into codingsh/Integrate-Optimism
guanbinrui Aug 3, 2022
b93c643
chore: linter error
nuanyang233 Aug 3, 2022
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
5 changes: 4 additions & 1 deletion .vscode/schema/constants.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
"Matic",
"Mumbai",
"Arbitrum",
"Arbitrum_Rinkeby"
"Arbitrum_Rinkeby",
"Optimism",
"Optimism_Kovan",
"Optimism_Goerli"
]
},
"primitive": {
Expand Down
4 changes: 4 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
"ipfshttp",
"ittr",
"jsbi",
"jsonml",
"juicebox",
"kdfparams",
"keccak",
Expand Down Expand Up @@ -150,8 +151,11 @@
"nftrss",
"nftscan",
"nums",
"oeth",
"opensea",
"openswap",
"openx",
"optimism",
"overridable",
"overscan",
"pageable",
Expand Down
2 changes: 1 addition & 1 deletion packages/dashboard/src/pages/Wallets/hooks/useGasConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const useGasConfig = (gasLimit: number, minGasLimit: number) => {
maxFeePerGas: toHex(new BigNumber(maxFee).integerValue().toFixed()),
maxPriorityFeePerGas: toHex(new BigNumber(priorityFee).integerValue().toFixed()),
}
: { gas: gasLimit_, gasPrice: new BigNumber(gasPrice).toNumber() }
: { gas: gasLimit_, gasPrice: toHex(formatGweiToWei(gasPrice).toString()) }
}, [is1559Supported, gasLimit_, maxFee, priorityFee, gasPrice, chainId])

return {
Expand Down
1 change: 0 additions & 1 deletion packages/mask/shared-ui/locales/ko-KR.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@
"wallet_rename": "월렛 이름 바꾸기",
"wallet_loading_nft_contract": "NFT 컨트렉트 로딩...",
"wallet_search_contract_no_result": "검색 포준에 맞추는 결과나 컨트렉트 주소가 없습니다.",
"wallet_search_no_result": "결과 없음.",
"wallet_airdrop_nft_unclaimed_title": "수령하지 않는 NFT 에어드랍:",
"plugin_airdrop_nft_start_time": "시작 시간: {{date}}",
"plugin_airdrop_nft_end_time": "종료 시간: {{date}}",
Expand Down
1 change: 0 additions & 1 deletion packages/mask/shared-ui/locales/qya-AA.json
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@
"wallet_rename": "crwdns4489:0crwdne4489:0",
"wallet_loading_nft_contract": "crwdns8135:0crwdne8135:0",
"wallet_search_contract_no_result": "crwdns8137:0crwdne8137:0",
"wallet_search_no_result": "crwdns8139:0crwdne8139:0",
"wallet_confirm_with_password": "crwdns10141:0crwdne10141:0",
"wallet_airdrop_nft_unclaimed_title": "crwdns8093:0crwdne8093:0",
"plugin_external_unknown_plugin": "crwdns10143:0crwdne10143:0",
Expand Down
1 change: 0 additions & 1 deletion packages/mask/shared-ui/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@
"wallet_rename": "重新命名钱包",
"wallet_loading_nft_contract": "正在加载 NFT 合约...",
"wallet_search_contract_no_result": "没有结果或合同地址不符合查询标准。",
"wallet_search_no_result": "没有任何结果。",
"wallet_confirm_with_password": "使用密码确认",
"wallet_airdrop_nft_unclaimed_title": "未认领的NFT Airdrop:",
"plugin_external_unknown_plugin": "发现新的未知Mask插件,您想要加载它们吗?",
Expand Down
1 change: 0 additions & 1 deletion packages/mask/shared-ui/locales/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@
"wallet_name": "錢包名稱",
"wallet_rename": "重新命名錢包",
"wallet_loading_nft_contract": "加載NFT合約中...",
"wallet_search_no_result": "無結果",
"wallet_confirm_with_password": "確認密碼",
"wallet_airdrop_nft_unclaimed_title": "尚未認領的NFT空投",
"plugin_external_loader_search_holder": "搜尋外部插件",
Expand Down
1 change: 1 addition & 0 deletions packages/mask/shared/flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const Flags = {
polygon_enabled: true,
arbitrum_enabled: true,
xdai_enabled: true,
optimism_enabled: true,
avalanche_enabled: true,
fantom_enabled: true,
celo_enabled: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/mask/src/plugins/Approval/SNSAdaptor/pipes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const resolveNetworkOnRabby = createLookupTableResolver<NetworkType, stri
[NetworkType.Fuse]: '',
[NetworkType.Metis]: '',
[NetworkType.Boba]: '',
[NetworkType.Optimistic]: '',
[NetworkType.Optimism]: '',
[NetworkType.Celo]: '',
[NetworkType.Conflux]: '',
},
Expand Down
9 changes: 2 additions & 7 deletions packages/mask/src/plugins/Gitcoin/SNSAdaptor/index.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
import { useMemo } from 'react'
import { ChainId } from '@masknet/web3-shared-evm'
import { Trans } from 'react-i18next'
import { usePostInfoDetails, Plugin, usePluginWrapper, PluginId } from '@masknet/plugin-infra/content-script'
import { useChainId } from '@masknet/plugin-infra/web3'
import { NetworkPluginID } from '@masknet/web3-shared-base'
import { extractTextFromTypedMessage } from '@masknet/typed-message'
import { parseURL } from '@masknet/shared-base'
import { Icons } from '@masknet/icons'
import { PreviewCard } from './PreviewCard'
import { Trans } from 'react-i18next'
import { base } from '../base'
import { PLUGIN_NAME, PLUGIN_META_KEY } from '../constants'
import { PLUGIN_META_KEY, PLUGIN_NAME } from '../constants'
import { DonateDialog } from './DonateDialog'

const isGitcoin = (x: string): boolean => /^https:\/\/gitcoin.co\/grants\/\d+/.test(x)
const isGitCoinSupported = (chainId: ChainId) => [ChainId.Mainnet, ChainId.Matic].includes(chainId)

const sns: Plugin.SNSAdaptor.Definition = {
...base,
Expand Down Expand Up @@ -56,7 +52,6 @@ const sns: Plugin.SNSAdaptor.Definition = {

function Renderer(props: React.PropsWithChildren<{ url: string }>) {
const [id = ''] = props.url.match(/\d+/) ?? []
const chainId = useChainId(NetworkPluginID.PLUGIN_EVM)
usePluginWrapper(true)
return <PreviewCard id={id} />
}
Expand Down
1 change: 1 addition & 0 deletions packages/mask/src/plugins/ITO/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export const base: Plugin.Shared.Definition = {
ChainId.Avalanche,
ChainId.Fantom,
ChainId.Harmony,
ChainId.Optimism,
],
},
[NetworkPluginID.PLUGIN_FLOW]: { supportedChainIds: [] },
Expand Down
1 change: 1 addition & 0 deletions packages/mask/src/plugins/NextID/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const base: Plugin.Shared.Definition = {
ChainId.Fantom,
ChainId.Harmony,
ChainId.Conflux,
ChainId.Optimism,
],
},
[NetworkPluginID.PLUGIN_FLOW]: { supportedChainIds: [] },
Expand Down
6 changes: 3 additions & 3 deletions packages/mask/src/plugins/RedPacket/SNSAdaptor/NftList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { ChainId, formatTokenId, SchemaType } from '@masknet/web3-shared-evm'
import { List, ListItem, ListProps, Typography } from '@mui/material'
import classnames from 'classnames'
import { FC, HTMLProps, useState } from 'react'
import { useI18N } from '../../../utils'
import { NFTCardStyledAssetPlayer } from '@masknet/shared'
import type { NonFungibleTokenContract } from '@masknet/web3-shared-base'
import { useI18N } from '../locales'

const useStyles = makeStyles()((theme) => {
const smallQuery = `@media (max-width: ${theme.breakpoints.values.sm}px)`
Expand Down Expand Up @@ -100,7 +100,7 @@ interface NftItemProps extends HTMLProps<HTMLDivElement> {
}

export const NftItem: FC<NftItemProps> = ({ contract, tokenId, className, claimed, renderOrder, ...rest }) => {
const { t } = useI18N()
const t = useI18N()
const { classes } = useStyles()
const [name, setName] = useState(formatTokenId(tokenId, 2))

Expand All @@ -117,7 +117,7 @@ export const NftItem: FC<NftItemProps> = ({ contract, tokenId, className, claime
setERC721TokenName={setName}
/>
<Typography className={classes.name}>{name}</Typography>
{claimed && <Typography className={classes.claimedBadge}>{t('plugin_red_packet_claimed')}</Typography>}
{claimed && <Typography className={classes.claimedBadge}>{t.claimed()}</Typography>}
</div>
)
}
Expand Down
1 change: 1 addition & 0 deletions packages/mask/src/plugins/RedPacket/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const base: Plugin.Shared.Definition = {
ChainId.Arbitrum,
ChainId.xDai,
ChainId.Fantom,
ChainId.Optimism,
ChainId.Avalanche,
ChainId.Aurora,
ChainId.Harmony,
Expand Down
1 change: 1 addition & 0 deletions packages/mask/src/plugins/Savings/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const base: Plugin.Shared.Definition = {
ChainId.Aurora,
ChainId.Avalanche,
ChainId.Fantom,
ChainId.Optimism,
ChainId.Harmony,
],
},
Expand Down
6 changes: 3 additions & 3 deletions packages/mask/src/plugins/Trader/apis/trader/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export async function getAvailableTraderProviders(chainId: ChainId) {
TradeProvider.DODO,
TradeProvider.BANCOR,
TradeProvider.OPENOCEAN,
TradeProvider.MDEX,
]
case NetworkType.Polygon:
return [
Expand All @@ -42,12 +43,12 @@ export async function getAvailableTraderProviders(chainId: ChainId) {
return [TradeProvider.SUSHISWAP, TradeProvider.OPENOCEAN]
case NetworkType.Avalanche:
return [TradeProvider.SUSHISWAP, TradeProvider.OPENOCEAN, TradeProvider.TRADERJOE, TradeProvider.PANGOLIN]
case NetworkType.xDai:
return [TradeProvider.SUSHISWAP, TradeProvider.OPENOCEAN]
case NetworkType.Celo:
return [TradeProvider.SUSHISWAP]
case NetworkType.Fantom:
return [TradeProvider.SUSHISWAP]
case NetworkType.Optimism:
return [TradeProvider.UNISWAP_V3]
case NetworkType.Aurora:
return [TradeProvider.DODO, TradeProvider.WANNASWAP, TradeProvider.TRISOLARIS]
case NetworkType.Harmony:
Expand All @@ -60,7 +61,6 @@ export async function getAvailableTraderProviders(chainId: ChainId) {
case NetworkType.Boba:
case NetworkType.Fuse:
case NetworkType.Metis:
case NetworkType.Optimistic:
case NetworkType.Conflux:
console.error('To be implement network: ', networkType)
return []
Expand Down
1 change: 1 addition & 0 deletions packages/mask/src/plugins/Trader/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const base: Plugin.Shared.Definition<ChainId> = {
ChainId.Aurora,
ChainId.Avalanche,
ChainId.Fantom,
ChainId.Optimism,
ChainId.Harmony,
],
},
Expand Down
2 changes: 1 addition & 1 deletion packages/mask/src/plugins/Trader/constants/0x.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ export const ZRX_BASE_URL: Record<NetworkType, string> = {
[NetworkType.Polygon]: 'https://polygon.api.0x.org/',
[NetworkType.Arbitrum]: 'https://arbitrum.api.0x.org/',
[NetworkType.xDai]: 'https://xdai.api.0x.org/',
[NetworkType.Optimism]: 'https://optimism.api.0x.org/',
[NetworkType.Avalanche]: 'https://avalanche.api.0x.org/',
[NetworkType.Celo]: 'https://celo.api.0x.org/',
[NetworkType.Fantom]: 'https://fantom.api.0x.org/',
[NetworkType.Aurora]: 'https://aurora.api.0x.org/',
[NetworkType.Boba]: '',
[NetworkType.Fuse]: '',
[NetworkType.Metis]: '',
[NetworkType.Optimistic]: '',
[NetworkType.Harmony]: '',
[NetworkType.Conflux]: '',
}
Expand Down
3 changes: 2 additions & 1 deletion packages/mask/src/plugins/Trader/constants/dodo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ export const networkNames: Record<NetworkType, string> = {
[NetworkType.Polygon]: 'matic',
[NetworkType.Arbitrum]: 'arbitrum',
[NetworkType.xDai]: 'xdai',
[NetworkType.Optimism]: 'Optimism',
[NetworkType.Avalanche]: 'avalanche',
[NetworkType.Celo]: 'celo',
[NetworkType.Fantom]: 'fantom',
[NetworkType.Aurora]: 'aurora',
[NetworkType.Boba]: '',
[NetworkType.Fuse]: '',
[NetworkType.Metis]: '',
[NetworkType.Optimistic]: '',
[NetworkType.Optimism]: '',
[NetworkType.Harmony]: 'harmony',
[NetworkType.Conflux]: '',
}
3 changes: 2 additions & 1 deletion packages/mask/src/plugins/Trader/constants/openocean.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export const networkNames: Record<NetworkType, string> = {
[NetworkType.Boba]: '',
[NetworkType.Fuse]: '',
[NetworkType.Metis]: '',
[NetworkType.Optimistic]: '',
[NetworkType.Optimism]: 'Optimism',
[NetworkType.Optimism]: '',
[NetworkType.Harmony]: '',
[NetworkType.Conflux]: '',
}
1 change: 1 addition & 0 deletions packages/mask/src/plugins/Trader/constants/sushiswap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ export const SUSHISWAP_BASE_AGAINST_TOKENS: ERC20AgainstToken = {
[ChainId.Fantom]: [WNATIVE, DAI, USDC, fUSDT, WBTC].map((x) => x[ChainId.Fantom]),
[ChainId.Avalanche]: [WNATIVE, DAI, USDC, WBTC, USDT].map((x) => x[ChainId.Avalanche]),
[ChainId.Harmony]: [WNATIVE, DAI, USDC, WBTC, USDT].map((x) => x[ChainId.Harmony]),
[ChainId.Optimism]: [WNATIVE, DAI, USDC, WBTC, USDT].map((x) => x[ChainId.Optimism]),
}
3 changes: 2 additions & 1 deletion packages/mask/src/plugins/Trader/constants/uniswap.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChainId, AMPL, DAI, USDC, USDT, WBTC, WNATIVE, WNATIVE_ONLY } from '@masknet/web3-shared-evm'
import { ChainId, AMPL, DAI, USDC, USDT, WBTC, WNATIVE, WNATIVE_ONLY, OP } from '@masknet/web3-shared-evm'
import { Percent } from '@uniswap/sdk-core'
import JSBI from 'jsbi'
import type { ERC20AgainstToken, ERC20TokenCustomizedBase } from './types'
Expand All @@ -20,6 +20,7 @@ export const UNISWAP_BASE_AGAINST_TOKENS: ERC20AgainstToken = {
...WNATIVE_ONLY,
[ChainId.Mainnet]: [WNATIVE, DAI, USDC, USDT, WBTC].map((x) => x[ChainId.Mainnet]),
[ChainId.Matic]: [WNATIVE, DAI, USDC, USDT, WBTC].map((x) => x[ChainId.Matic]),
[ChainId.Optimism]: [WNATIVE, DAI, USDC, USDT, WBTC, OP].map((x) => x[ChainId.Optimism]),
}

export const MAX_HOP = 3
Expand Down
2 changes: 1 addition & 1 deletion packages/mask/src/plugins/Trader/trader/0x/useTrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function getNativeTokenLabel(networkType: NetworkType) {
case NetworkType.Fuse:
case NetworkType.Metis:
case NetworkType.Avalanche:
case NetworkType.Optimistic:
case NetworkType.Optimism:
case NetworkType.Harmony:
case NetworkType.Conflux:
return NATIVE_TOKEN_ADDRESS
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useMemo } from 'react'
import type { Currency, Token } from '@uniswap/sdk-core'
import { FeeAmount, Pool } from '@uniswap/v3-sdk'
import { useMemo } from 'react'
import { TradeProvider } from '@masknet/public-api'
import { useAllCurrencyCombinations } from './useAllCommonPairs'
import { PoolState, usePools } from './usePools'
import { TradeProvider } from '@masknet/public-api'

/**
* Returns all the existing pools that should be considered for swapping between an input currency and an output currency
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { noop } from 'lodash-unified'
import type { Trade as V2Trade } from '@uniswap/v2-sdk'
import type { Trade as V3Trade } from '@uniswap/v3-sdk'
import type { Currency, TradeType } from '@uniswap/sdk-core'
Expand All @@ -24,7 +25,6 @@ import { isNativeTokenWrapper } from '../helpers'
import { useGetTradeContext } from './useGetTradeContext'
import { TargetChainIdContext } from '@masknet/plugin-infra/web3-evm'
import type { GasOptionConfig } from '@masknet/web3-shared-evm'
import { noop } from 'lodash-unified'
import type { AsyncFnReturn } from 'react-use/lib/useAsyncFn'

export function useTradeCallback(
Expand Down
1 change: 1 addition & 0 deletions packages/mask/src/plugins/UnlockProtocol/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const graphEndpointKeyVal = {
[ChainId.xDai]: 'https://api.thegraph.com/subgraphs/name/unlock-protocol/xdai',
[ChainId.Matic]: 'https://api.thegraph.com/subgraphs/name/unlock-protocol/polygon',
[ChainId.Avalanche]: '',
[ChainId.Optimism]: '',
}

export const keyServerEndpoint = 'https://unlock.r2d2.to/'
Expand Down
1 change: 1 addition & 0 deletions packages/mask/src/plugins/Wallet/services/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export async function getSupportedNetworks() {
Flags.polygon_enabled ? NetworkType.Polygon : undefined,
Flags.arbitrum_enabled ? NetworkType.Arbitrum : undefined,
Flags.xdai_enabled ? NetworkType.xDai : undefined,
Flags.optimism_enabled ? NetworkType.Optimism : undefined,
Flags.celo_enabled ? NetworkType.Celo : undefined,
Flags.fantom_enabled ? NetworkType.Fantom : undefined,
Flags.avalanche_enabled ? NetworkType.Avalanche : undefined,
Expand Down
3 changes: 3 additions & 0 deletions packages/web3-constants/compile-constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ compileConstants(path.join(__dirname, 'evm'), [
'Arbitrum',
'Arbitrum_Rinkeby',
'xDai',
'Optimism',
'Optimism_Kovan',
'Optimism_Goerli',
'Avalanche',
'Avalanche_Fuji',
'Celo',
Expand Down
9 changes: 9 additions & 0 deletions packages/web3-constants/evm/aave.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"Arbitrum": "",
"Arbitrum_Rinkeby": "",
"xDai": "",
"Optimism": "",
"Optimism_Kovan": "",
"Optimism_Goerli": "",
"Avalanche": "",
"Avalanche_Fuji": "",
"Celo": "",
Expand All @@ -35,6 +38,9 @@
"Arbitrum": "",
"Arbitrum_Rinkeby": "",
"xDai": "",
"Optimism": "",
"Optimism_Kovan": "",
"Optimism_Goerli": "",
"Avalanche": "",
"Avalanche_Fuji": "",
"Celo": "",
Expand All @@ -58,6 +64,9 @@
"Arbitrum": "",
"Arbitrum_Rinkeby": "",
"xDai": "",
"Optimism": "",
"Optimism_Kovan": "",
"Optimism_Goerli": "",
"Avalanche": "",
"Avalanche_Fuji": "",
"Celo": "",
Expand Down
3 changes: 3 additions & 0 deletions packages/web3-constants/evm/airdrop.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"Arbitrum": "",
"Arbitrum_Rinkeby": "",
"xDai": "",
"Optimism": "",
"Optimism_Kovan": "",
"Optimism_Goerli": "",
"Avalanche": "",
"Avalanche_Fuji": "",
"Celo": "",
Expand Down
3 changes: 3 additions & 0 deletions packages/web3-constants/evm/artblocks.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"Arbitrum": "",
"Arbitrum_Rinkeby": "",
"xDai": "",
"Optimism": "",
"Optimism_Kovan": "",
"Optimism_Goerli": "",
"Avalanche": "",
"Avalanche_Fuji": "",
"Celo": "",
Expand Down
Loading