diff --git a/docs/evm-integration.md b/docs/evm-integration.md index 65b18a1cb764..d4377758bc26 100644 --- a/docs/evm-integration.md +++ b/docs/evm-integration.md @@ -30,6 +30,10 @@ Mask Network fetches on-chain data from various data sources. Therefore, you can - +### Web3 Constants Compile Config + +Add the chain name to `compileConstants()` in `packages/web3-constants/compile-constants.ts`. + ### Token List The team maintains a token list . So free feel to create one for the chain. And add the token list link to `packages/web3-constants/evm/token-list.json`. diff --git a/packages/mask/src/components/shared/ApplicationBoard.tsx b/packages/mask/src/components/shared/ApplicationBoard.tsx index 1085906290d5..3762504887d9 100644 --- a/packages/mask/src/components/shared/ApplicationBoard.tsx +++ b/packages/mask/src/components/shared/ApplicationBoard.tsx @@ -1,8 +1,7 @@ import { Fragment } from 'react' import { makeStyles } from '@masknet/theme' import { useChainId } from '@masknet/web3-shared-evm' -import { useActivatedPluginsSNSAdaptor, useCurrentWeb3NetworkPluginID } from '@masknet/plugin-infra' -import type { Plugin } from '@masknet/plugin-infra' +import { useActivatedPluginsSNSAdaptor, useCurrentWeb3NetworkPluginID, Plugin, useAccount } from '@masknet/plugin-infra' import { getCurrentSNSNetwork } from '../../social-network-adaptor/utils' import { activatedSocialNetworkUI } from '../../social-network' @@ -32,6 +31,7 @@ export function ApplicationBoard() { const snsAdaptorPlugins = useActivatedPluginsSNSAdaptor('any') const currentWeb3Network = useCurrentWeb3NetworkPluginID() const chainId = useChainId() + const account = useAccount() const currentSNSNetwork = getCurrentSNSNetwork(activatedSocialNetworkUI.networkIdentifier) return ( @@ -46,7 +46,7 @@ export function ApplicationBoard() { currentWeb3NetworkSupportedChainIds === undefined || currentWeb3NetworkSupportedChainIds.supportedChainIds?.includes(chainId), ) - + const isWalletConnectedRequired = currentWeb3NetworkSupportedChainIds !== undefined const currentSNSIsSupportedNetwork = cur.enableRequirement.networks.networks[currentSNSNetwork] const isSNSEnabled = @@ -56,7 +56,7 @@ export function ApplicationBoard() { cur.ApplicationEntries.map((x) => { return { entry: x, - enabled: isWeb3Enabled && isSNSEnabled, + enabled: isSNSEnabled && (account ? isWeb3Enabled : !isWalletConnectedRequired), pluginId: cur.ID, } }) ?? [], diff --git a/packages/web3-constants/compile-constants.ts b/packages/web3-constants/compile-constants.ts index cafdb8aa29af..e9462b36f726 100644 --- a/packages/web3-constants/compile-constants.ts +++ b/packages/web3-constants/compile-constants.ts @@ -59,6 +59,7 @@ compileConstants(path.join(__dirname, 'evm'), [ 'Fantom', 'Aurora', 'Aurora_Testnet', + 'Conflux', ]) compileConstants(path.join(__dirname, 'solana'), ['Mainnet', 'Testnet', 'Devnet']) diff --git a/packages/web3-constants/evm/aave.json b/packages/web3-constants/evm/aave.json index 1967d793a144..4894405bcf10 100644 --- a/packages/web3-constants/evm/aave.json +++ b/packages/web3-constants/evm/aave.json @@ -17,7 +17,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" }, "AAVE_LENDING_POOL_ADDRESSES_PROVIDER_CONTRACT_ADDRESS": { "Mainnet": "0xb53c1a33016b2dc2ff3653530bff1848a515c8c5", @@ -37,7 +38,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" }, "AAVE_PROTOCOL_DATA_PROVIDER_CONTRACT_ADDRESS": { "Mainnet": "0x057835Ad21a177dbdd3090bB1CAE03EaCF78Fc6d", @@ -57,6 +59,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" } } diff --git a/packages/web3-constants/evm/airdrop.json b/packages/web3-constants/evm/airdrop.json index ab949267d4f5..28ca1f00abf1 100644 --- a/packages/web3-constants/evm/airdrop.json +++ b/packages/web3-constants/evm/airdrop.json @@ -17,6 +17,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" } } diff --git a/packages/web3-constants/evm/artblocks.json b/packages/web3-constants/evm/artblocks.json index b626e1dae9f6..0ac17edfdcae 100644 --- a/packages/web3-constants/evm/artblocks.json +++ b/packages/web3-constants/evm/artblocks.json @@ -17,6 +17,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" } } diff --git a/packages/web3-constants/evm/cryptoartai.json b/packages/web3-constants/evm/cryptoartai.json index edde7f04abdc..8819260601ef 100644 --- a/packages/web3-constants/evm/cryptoartai.json +++ b/packages/web3-constants/evm/cryptoartai.json @@ -17,7 +17,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" }, "ARTIST_ACCEPTING_BIDS_V2": { "Mainnet": "0x78C889749f29D2965a76Ede3BBb232A9729Ccf0b", @@ -37,7 +38,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" }, "CANFT_MARKET": { "Mainnet": "0x72d081953957723e540780a0C6bA31725469238E", @@ -57,6 +59,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" } } diff --git a/packages/web3-constants/evm/dhedge.json b/packages/web3-constants/evm/dhedge.json index 870f99083e7f..9aa7b2dbd671 100644 --- a/packages/web3-constants/evm/dhedge.json +++ b/packages/web3-constants/evm/dhedge.json @@ -17,7 +17,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" }, "API_URL": { "Mainnet": "https://api-v2.dhedge.org/graphql", @@ -37,6 +38,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" } } diff --git a/packages/web3-constants/evm/ethereum.json b/packages/web3-constants/evm/ethereum.json index 4e4fefb89d3b..9915418599d4 100644 --- a/packages/web3-constants/evm/ethereum.json +++ b/packages/web3-constants/evm/ethereum.json @@ -59,7 +59,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" }, "ENS_REVERSE_RECORDS_ADDRESS": { "Mainnet": "0x3671aE578E63FdF66ad4F3E12CC0c0d71Ac7510C", @@ -79,6 +80,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" } } diff --git a/packages/web3-constants/evm/explorer.json b/packages/web3-constants/evm/explorer.json index a3c5bf0d117e..55f6e2a86fc2 100644 --- a/packages/web3-constants/evm/explorer.json +++ b/packages/web3-constants/evm/explorer.json @@ -17,7 +17,8 @@ "Celo": [], "Fantom": ["AST4WWPNEYDURUXG2GH32JZMYWEFDP999S"], "Aurora": [], - "Aurora_Testnet": [] + "Aurora_Testnet": [], + "Conflux": [] }, "EXPLORER_API": { "Mainnet": "https://api.etherscan.io/api", @@ -37,6 +38,7 @@ "Celo": "https://explorer.celo.org/api", "Fantom": "https://api.ftmscan.com/api", "Aurora": "https://explorer.mainnet.aurora.dev/api", - "Aurora_Testnet": "https://explorer.testnet.aurora.dev/api" + "Aurora_Testnet": "https://explorer.testnet.aurora.dev/api", + "Conflux": "" } } diff --git a/packages/web3-constants/evm/gitcoin.json b/packages/web3-constants/evm/gitcoin.json index 708e296ea6de..c26772f90dd9 100644 --- a/packages/web3-constants/evm/gitcoin.json +++ b/packages/web3-constants/evm/gitcoin.json @@ -17,7 +17,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" }, "BULK_CHECKOUT_ADDRESS": { "Mainnet": "0x7d655c57f71464B6f83811C55D84009Cd9f5221C", @@ -37,7 +38,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" }, "GITCOIN_ETH_ADDRESS": { "Mainnet": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", @@ -57,7 +59,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" }, "GITCOIN_TIP_PERCENTAGE": { "Mainnet": 5, @@ -77,6 +80,7 @@ "Celo": 0, "Fantom": 0, "Aurora": 0, - "Aurora_Testnet": 0 + "Aurora_Testnet": 0, + "Conflux": 0 } } diff --git a/packages/web3-constants/evm/good-ghosting.json b/packages/web3-constants/evm/good-ghosting.json index e54f1e6ba1bf..9ab7b3a1ba84 100644 --- a/packages/web3-constants/evm/good-ghosting.json +++ b/packages/web3-constants/evm/good-ghosting.json @@ -17,7 +17,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" }, "GOOD_GHOSTING_INCENTIVES_CONTRACT_ADDRESS": { "Mainnet": "", @@ -37,6 +38,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" } } diff --git a/packages/web3-constants/evm/ito.json b/packages/web3-constants/evm/ito.json index f15c7c3a47e6..7a56f24e5d98 100644 --- a/packages/web3-constants/evm/ito.json +++ b/packages/web3-constants/evm/ito.json @@ -17,7 +17,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" }, "MASK_ITO_CONTRACT_ADDRESS": { "Mainnet": "0x86812da3A623ab9606976078588b80C315E55FA3", @@ -37,7 +38,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" }, "ITO2_CONTRACT_ADDRESS": { "Mainnet": "0xc2CFbF22d6Dc87D0eE18d38d73733524c109Ff46", @@ -99,7 +101,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" }, "DEFAULT_QUALIFICATION2_ADDRESS": { "Mainnet": "0x4dC5f343Fe57E4fbDA1B454d125D396A3181272c", @@ -140,6 +143,7 @@ "Celo": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-ito-celo", "Fantom": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-ito-fantom", "Aurora": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-ito-aurora", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" } } diff --git a/packages/web3-constants/evm/lbp.json b/packages/web3-constants/evm/lbp.json index 051943e8a62d..4e867a9c5741 100644 --- a/packages/web3-constants/evm/lbp.json +++ b/packages/web3-constants/evm/lbp.json @@ -17,6 +17,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" } } diff --git a/packages/web3-constants/evm/lido.json b/packages/web3-constants/evm/lido.json index 5b88bd5868e3..0a3c06476274 100644 --- a/packages/web3-constants/evm/lido.json +++ b/packages/web3-constants/evm/lido.json @@ -17,7 +17,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" }, "LIDO_REFERRAL_ADDRESS": { "Mainnet": "0x934b510d4c9103e6a87aef13b816fb080286d649", @@ -37,6 +38,7 @@ "Celo": "0x934b510d4c9103e6a87aef13b816fb080286d649", "Fantom": "0x934b510d4c9103e6a87aef13b816fb080286d649", "Aurora": "0x934b510d4c9103e6a87aef13b816fb080286d649", - "Aurora_Testnet": "0x934b510d4c9103e6a87aef13b816fb080286d649" + "Aurora_Testnet": "0x934b510d4c9103e6a87aef13b816fb080286d649", + "Conflux": "" } } diff --git a/packages/web3-constants/evm/mask-box.json b/packages/web3-constants/evm/mask-box.json index a391a2ea2256..d1bc8e10c0f8 100644 --- a/packages/web3-constants/evm/mask-box.json +++ b/packages/web3-constants/evm/mask-box.json @@ -17,7 +17,8 @@ "Celo": "", "Fantom": "", "Aurora": "0xf5056B96ab242C566002852d0b98ce0BcDf1af51", - "Aurora_Testnet": "0xB4D669bc117735FdA44e90e52795132187705B21" + "Aurora_Testnet": "0xB4D669bc117735FdA44e90e52795132187705B21", + "Conflux": "" }, "MASK_BOX_CONTRACT_FROM_BLOCK": { "Mainnet": 13687866, @@ -37,6 +38,7 @@ "Celo": 0, "Fantom": 0, "Aurora": 57259004, - "Aurora_Testnet": 77919118 + "Aurora_Testnet": 77919118, + "Conflux": 0 } } diff --git a/packages/web3-constants/evm/openocean.json b/packages/web3-constants/evm/openocean.json index 50fb7755a589..a0004c674b66 100644 --- a/packages/web3-constants/evm/openocean.json +++ b/packages/web3-constants/evm/openocean.json @@ -17,6 +17,7 @@ "Celo": "0x934B510D4C9103E6a87AEf13b816fb080286D649", "Fantom": "0x934B510D4C9103E6a87AEf13b816fb080286D649", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" } } diff --git a/packages/web3-constants/evm/opensea-api.json b/packages/web3-constants/evm/opensea-api.json index 8032d46e99ce..eec5cbdb1162 100644 --- a/packages/web3-constants/evm/opensea-api.json +++ b/packages/web3-constants/evm/opensea-api.json @@ -17,7 +17,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" }, "GET_SINGLE_ASSET_URL": { "Mainnet": "https://api.opensea.io/api/v1/asset", @@ -37,7 +38,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" }, "GET_ASSETS_URL": { "Mainnet": "https://api.opensea.io/api/v1/assets", @@ -57,6 +59,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" } } diff --git a/packages/web3-constants/evm/pooltogether.json b/packages/web3-constants/evm/pooltogether.json index 529a2e16bb28..ea3096e69ea4 100644 --- a/packages/web3-constants/evm/pooltogether.json +++ b/packages/web3-constants/evm/pooltogether.json @@ -17,7 +17,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" }, "MASK_POOL_ADDRESS": { "Mainnet": "", @@ -37,6 +38,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" } } diff --git a/packages/web3-constants/evm/red-packet.json b/packages/web3-constants/evm/red-packet.json index f88e4a77a16d..3fc873e50bb9 100644 --- a/packages/web3-constants/evm/red-packet.json +++ b/packages/web3-constants/evm/red-packet.json @@ -17,7 +17,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" }, "HAPPY_RED_PACKET_ADDRESS_V2": { "Mainnet": "0x8D8912E1237F9FF3EF661F32743CFB276E052F98", @@ -37,7 +38,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" }, "HAPPY_RED_PACKET_ADDRESS_V3": { "Mainnet": "", @@ -57,7 +59,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" }, "HAPPY_RED_PACKET_ADDRESS_V4": { "Mainnet": "0xaBBe1101FD8fa5847c452A6D70C8655532B03C33", @@ -119,6 +122,7 @@ "Celo": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-red-packet-celo", "Fantom": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-red-packet-fantom", "Aurora": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-red-packet-aurora", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" } } diff --git a/packages/web3-constants/evm/space-station-galaxy.json b/packages/web3-constants/evm/space-station-galaxy.json index 86b85572cdcd..28bd2f7c41ed 100644 --- a/packages/web3-constants/evm/space-station-galaxy.json +++ b/packages/web3-constants/evm/space-station-galaxy.json @@ -17,7 +17,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" }, "SUBGRAPH_URL": { "Mainnet": "", @@ -37,6 +38,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" } } diff --git a/packages/web3-constants/evm/trending.json b/packages/web3-constants/evm/trending.json index a115fe46afe5..4848e30aa5d4 100644 --- a/packages/web3-constants/evm/trending.json +++ b/packages/web3-constants/evm/trending.json @@ -17,7 +17,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" }, "UNISWAP_V2_HEALTH_URL": { "Mainnet": "https://api.thegraph.com/index-node/graphql", @@ -37,7 +38,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" }, "ETHEREUM_BLOCKS_SUBGRAPH_URL": { "Mainnet": "https://api.thegraph.com/subgraphs/name/blocklytics/ethereum-blocks", @@ -57,6 +59,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Conflux": "" } }