Commit 4a98a541 authored by adadachao's avatar adadachao

mars up

parent 5f396d14
......@@ -46,7 +46,8 @@ const chain = Object.freeze({
symbol: getEnvValue('NEXT_PUBLIC_NETWORK_SECONDARY_COIN_SYMBOL'),
},
hasMultipleGasCurrencies: getEnvValue('NEXT_PUBLIC_NETWORK_MULTIPLE_GAS_CURRENCIES') === 'true',
tokenStandard: getEnvValue('NEXT_PUBLIC_NETWORK_TOKEN_STANDARD_NAME') || 'ERC',
// tokenStandard: getEnvValue('NEXT_PUBLIC_NETWORK_TOKEN_STANDARD_NAME') || 'MRC',
tokenStandard: 'MRC',
rpcUrls,
isTestnet: getEnvValue('NEXT_PUBLIC_IS_TESTNET') === 'true',
verificationType,
......
......@@ -11,8 +11,8 @@ NEXT_PUBLIC_API_WEBSOCKET_PROTOCOL=wss
# Instance ENVs
NEXT_PUBLIC_ADMIN_SERVICE_API_HOST=https://admin-rs.services.blockscout.com
NEXT_PUBLIC_API_BASE_PATH=https://scan.mova.bitheart.org/
NEXT_PUBLIC_API_HOST=scan.mova.bitheart.org
NEXT_PUBLIC_API_BASE_PATH=/
NEXT_PUBLIC_API_HOST=scan.mars.movachain.com
NEXT_PUBLIC_API_SPEC_URL=https://raw.githubusercontent.com/blockscout/blockscout-api-v2-swagger/main/swagger.yaml
NEXT_PUBLIC_CONTRACT_CODE_IDES=[{'title':'Remix IDE','url':'https://remix.ethereum.org/?address={hash}&blockscout={domain}','icon_url':'https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/ide-icons/remix.png'}]
NEXT_PUBLIC_CONTRACT_INFO_API_HOST=https://contracts-info.services.blockscout.com
......
......@@ -17,8 +17,8 @@ NEXT_PUBLIC_NETWORK_CURRENCY_DECIMALS=18
NEXT_PUBLIC_NETWORK_VERIFICATION_TYPE=validation
NEXT_PUBLIC_NETWORK_RPC_URL=https://rpc.mova.bitheart.org
# api configuration
NEXT_PUBLIC_API_BASE_PATH=https://scan.mova.bitheart.org/
NEXT_PUBLIC_API_HOST=localhost
NEXT_PUBLIC_API_BASE_PATH=
NEXT_PUBLIC_API_HOST=scan.mars.movachain.com
NEXT_PUBLIC_API_PROTOCOL=http
NEXT_PUBLIC_API_PORT=3001
......
......@@ -7,5 +7,5 @@ const weiName = config.chain.currency.weiName || 'wei';
export const currencyUnits: Record<Unit, string> = {
wei: weiName,
gwei: `G${ weiName }`,
ether: config.chain.currency.symbol || 'ETH',
ether: config.chain.currency.symbol || 'MARS',
};
import type { NovesResponseData, NovesClassificationData, NovesRawTransactionData } from 'types/api/noves';
const NOVES_TRANSLATE_CLASSIFIED: NovesClassificationData = {
description: 'Sent 0.04 ETH',
description: 'Sent 0.04 MARS',
received: [ {
action: 'Sent Token',
actionFormatted: 'Sent Token',
......@@ -10,8 +10,8 @@ const NOVES_TRANSLATE_CLASSIFIED: NovesClassificationData = {
to: { name: '', address: '0xa0393A76b132526a70450273CafeceB45eea6dEE' },
token: {
address: '',
name: 'ETH',
symbol: 'ETH',
name: 'MARS',
symbol: 'MARS',
decimals: 18,
},
} ],
......
......@@ -45,8 +45,8 @@ export const HOMEPAGE_STATS: HomeStats = {
const STATS_CHART_INFO: stats.LineChartInfo = {
id: 'chart_0',
title: 'Average transaction fee',
description: 'The average amount in ETH spent per transaction',
units: 'ETH',
description: 'The average amount in MARS spent per transaction',
units: 'MARS',
resolutions: [ 'DAY', 'MONTH' ],
};
......@@ -59,7 +59,7 @@ export const STATS_CHARTS_SECTION: stats.LineChartSection = {
id: 'chart_1',
title: 'Transactions fees',
description: 'Amount of tokens paid as fees',
units: 'ETH',
units: 'MARS',
resolutions: [ 'DAY', 'MONTH' ],
},
{
......@@ -86,7 +86,7 @@ export const STATS_CHARTS_SECTION_GAS: stats.LineChartSection = {
id: 'averageGasPrice',
title: 'Average gas price',
description: 'Average gas price',
units: 'ETH',
units: 'MARS',
resolutions: [ 'DAY', 'MONTH' ],
} ],
};
......
......@@ -7,7 +7,7 @@ export const ZKEVM_DEPOSITS_ITEM: ZkEvmL2DepositsItem = {
index: 181920,
l1_transaction_hash: '0xa74edfa5824a07a5f95ca1145140ed589df7f05bb17796bf18090b14c4566b5d',
l2_transaction_hash: '0x436d1c7ada270466ca0facdb96ecc22934d68d13b8a08f541b8df11b222967b5',
symbol: 'ETH',
symbol: 'MARS',
timestamp: '2023-06-01T14:46:48.000000Z',
value: '0.13040262',
};
......@@ -17,7 +17,7 @@ export const ZKEVM_WITHDRAWALS_ITEM: ZkEvmL2WithdrawalsItem = {
index: 47003,
l1_transaction_hash: '0x230cf46dabea287ac7d0ba83b8ea120bb83c1de58a81d34f44788f0459096c52',
l2_transaction_hash: '0x519d9f025ec47f08a48d708964d177189d2246ddf988686c481f5debcf097e34',
symbol: 'ETH',
symbol: 'MARS',
timestamp: '2024-04-17T08:51:58.000000Z',
value: '110.35',
};
......
......@@ -16,39 +16,46 @@ const PROXY_TYPES: Partial<Record<NonNullable<SmartContractProxyType>, {
description?: string;
}>> = {
eip1167: {
name: 'EIP-1167',
link: 'https://eips.ethereum.org/EIPS/eip-1167',
name: 'MRC-1167',
// link: 'https://eips.ethereum.org/EIPS/eip-1167',
link: '',
description: 'Minimal proxy',
},
eip1967: {
name: 'EIP-1967',
link: 'https://eips.ethereum.org/EIPS/eip-1967',
name: 'MRC-1967',
// link: 'https://eips.ethereum.org/EIPS/eip-1967',
link: '',
description: 'Proxy storage slots',
},
eip1822: {
name: 'EIP-1822',
link: 'https://eips.ethereum.org/EIPS/eip-1822',
name: 'MRC-1822',
// link: 'https://eips.ethereum.org/EIPS/eip-1822',
link: '',
description: 'Universal upgradeable proxy standard (UUPS)',
},
eip2535: {
name: 'EIP-2535',
link: 'https://eips.ethereum.org/EIPS/eip-2535',
name: 'MRC-2535',
// link: 'https://eips.ethereum.org/EIPS/eip-2535',
link: '',
description: 'Diamond proxy',
},
eip930: {
name: 'ERC-930',
link: 'https://github.com/ethereum/EIPs/issues/930',
name: 'MRC-930',
// link: 'https://github.com/ethereum/EIPs/issues/930',
link: '',
description: 'Eternal storage',
},
erc7760: {
name: 'ERC-7760',
link: 'https://eips.ethereum.org/EIPS/eip-7760',
name: 'MRC-7760',
// link: 'https://eips.ethereum.org/EIPS/eip-7760',
link: '',
description: 'Minimal Upgradeable Proxies',
},
resolved_delegate_proxy: {
name: 'ResolvedDelegateProxy',
// eslint-disable-next-line max-len
link: 'https://github.com/ethereum-optimism/optimism/blob/9580179013a04b15e6213ae8aa8d43c3f559ed9a/packages/contracts-bedrock/src/legacy/ResolvedDelegateProxy.sol',
// link: 'https://github.com/ethereum-optimism/optimism/blob/9580179013a04b15e6213ae8aa8d43c3f559ed9a/packages/contracts-bedrock/src/legacy/ResolvedDelegateProxy.sol',
link: '',
description: 'OP stack: legacy proxy contract that makes use of the AddressManager to resolve the implementation address',
},
clone_with_immutable_arguments: {
......@@ -85,12 +92,12 @@ const ContractCodeProxyPattern = ({ type, isLoading }: Props) => {
<Alert status="warning" whiteSpace="pre-wrap" loading={ isLoading }>
{ proxyInfo.link ? (
<>
This proxy smart-contract is detected via <Link href={ proxyInfo.link } external>{ proxyInfo.name }</Link>
This proxy smart-contract is detected via <Link href={ proxyInfo.link } external>{ proxyInfo.name?.replace(/ERC/g, 'MRC') }</Link>
{ proxyInfo.description && ` - ${ proxyInfo.description }` }
</>
) : (
<>
This proxy smart-contract is detected via { proxyInfo.name }
This proxy smart-contract is detected via { proxyInfo.name?.replace(/ERC/g, 'MRC') }
{ proxyInfo.description && ` - ${ proxyInfo.description }` }
</>
) }
......
......@@ -13,14 +13,7 @@ const ContractDetailsAlertVerificationSource = ({ data }: Props) => {
if (data?.is_verified && data?.is_verified_via_eth_bytecode_db) {
return (
<Alert status="warning" whiteSpace="pre-wrap">
<span>This contract has been { data.is_partially_verified ? 'partially ' : '' }verified using </span>
<Link
href="https://docs.blockscout.com/about/features/ethereum-bytecode-database-microservice"
textStyle="md"
external
>
Blockscout Bytecode Database
</Link>
<span>This contract has been { data.is_partially_verified ? 'partially ' : '' }verified using MovaChain Bytecode Database</span>
</Alert>
);
}
......
......@@ -24,7 +24,7 @@ interface Props {
const ContractDetailsInfo = ({ data, isLoading, addressHash }: Props) => {
const contractNameWithCertifiedIcon = data ? (
<Flex alignItems="center">
{ data.name }
{ data.name?.replace(/ERC/g, 'MRC') }
{ data.certified && <ContractCertifiedLabel iconSize={ 5 } boxSize={ 5 } ml={ 2 }/> }
</Flex>
) : null;
......@@ -148,7 +148,7 @@ const ContractDetailsInfo = ({ data, isLoading, addressHash }: Props) => {
wordBreak="break-word"
isLoading={ isLoading }
>
{ data.file_path }
{ data.file_path?.replace(/ERC/g, 'MRC') }
</ContractDetailsInfoItem>
) }
{ sourceCodeLink && (
......
......@@ -8,10 +8,9 @@ const EthRpcApi = () => {
<Box>
<Text>
In addition to the custom RPC endpoints documented here,
the Blockscout ETH RPC API supports 3 methods in the exact format specified for Ethereum nodes,
ee the Ethereum JSON-RPC Specification for more details.
the Mova chain RPC API supports 3 methods in the exact format specified for Mova chain nodes, see the JSON-RPC Specification for more details.
</Text>
<Link href="https://docs.blockscout.com/for-users/api/eth-rpc" external mt={ 6 }>View examples</Link>
<Link href="https://docs.movachain.com/json-rpc-api" external mt={ 6 }>View examples</Link>
</Box>
);
};
......
......@@ -7,10 +7,10 @@ const RpcApi = () => {
return (
<Box>
<Text>
This API is provided for developers transitioning applications from Etherscan to BlockScout and applications requiring general API and data support.
This API is provided for developers transitioning applications and applications requiring general API and data support.
It supports GET and POST requests.
</Text>
<Link href="https://docs.blockscout.com/for-users/api/rpc-endpoints" external mt={ 6 }>View modules</Link>
<Link href="https://docs.movachain.com/mova-rpc-endpoints" external mt={ 6 }>View modules</Link>
</Box>
);
};
......
......@@ -18,7 +18,7 @@ const ApiDocs = () => {
const tabs: Array<TabItemRegular> = [
{ id: 'rest_api', title: 'REST API', component: <RestApi/>, count: REST_API_SECTIONS.length },
{ id: 'eth_rpc_api', title: 'ETH RPC API', component: <EthRpcApi/> },
{ id: 'eth_rpc_api', title: 'MARS RPC API', component: <EthRpcApi/> },
{ id: 'rpc_api', title: 'RPC API endpoints', component: <RpcApi/> },
{ id: 'graphql_api', title: 'GraphQL API', component: <GraphQL/> },
].filter(({ id }) => feature.isEnabled && feature.tabs.includes(id));
......
......@@ -18,8 +18,8 @@ export interface Props extends Omit<IconButtonProps, 'type' | 'loading'> {
const CopyToClipboard = (props: Props) => {
const { text, type = 'text', isLoading, onClick, boxSize = 5, noTooltip, tooltipInteractive, ...rest } = props;
const { hasCopied, copy, disclosure } = useClipboard(text);
const newText = text.replace(/ERC/g, 'MRC');
const { hasCopied, copy, disclosure } = useClipboard(newText);
const handleClick = React.useCallback((event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {
event.stopPropagation();
......
......@@ -25,7 +25,7 @@ const props: Props = {
],
title: 'Native coin circulating supply',
description: 'Amount of token circulating supply for the period',
units: 'ETH',
units: 'MARS',
isLoading: false,
isError: false,
noAnimation: true,
......
......@@ -139,7 +139,7 @@ const Content = chakra((props: ContentProps) => {
const label = (
<VStack gap={ 0 } py={ 1 } color="inherit">
<Box fontWeight={ 600 } whiteSpace="pre-wrap" wordBreak="break-word">{ nameText }</Box>
<Box fontWeight={ 600 } whiteSpace="pre-wrap" wordBreak="break-word">{ nameText?.replace(/ERC/g, 'MRC') }</Box>
<Box whiteSpace="pre-wrap" wordBreak="break-word">
{ displayedAddress }
</Box>
......
......@@ -23,7 +23,7 @@ const AddressEntityContentProxy = (props: ContentProps) => {
<>
<Box fontWeight={ 600 }>
Proxy contract
{ props.address.name ? ` (${ props.address.name })` : '' }
{ props.address.name ? ` (${ props.address.name.replace(/ERC/g, 'MRC') })` : '' }
</Box>
<AddressEntity
address={{ hash: props.address.hash, filecoin: props.address.filecoin }}
......@@ -35,7 +35,7 @@ const AddressEntityContentProxy = (props: ContentProps) => {
/>
<Box fontWeight={ 600 } mt={ 2 }>
Implementation{ implementations.length > 1 ? 's' : '' }
{ implementationName ? ` (${ implementationName })` : '' }
{ implementationName ? ` (${ implementationName.replace(/ERC/g, 'MRC') })` : '' }
</Box>
<Flex flexWrap="wrap" columnGap={ 3 }>
{ implementations.map((item) => (
......@@ -61,7 +61,7 @@ const AddressEntityContentProxy = (props: ContentProps) => {
<EntityBase.Content
{ ...props }
truncation={ nameTag || implementationName || props.address.name ? 'tail' : props.truncation }
text={ nameTag || implementationName || props.address.name || props.altHash || props.address.hash }
text={ (nameTag || implementationName || props.address.name)?.replace(/ERC/g, 'MRC') || props.altHash || props.address.hash }
noTooltip
/>
</Box>
......
......@@ -48,6 +48,10 @@ interface Props {
}
const CodeEditor = ({ data, remappings, libraries, language, mainFile, contractName }: Props) => {
data.forEach((item) => {
item.file_path = item.file_path.replace(/ERC/g, 'MRC');
item.source_code = item.source_code.replace(/ERC/g, 'MRC');
});
const [ instance, setInstance ] = React.useState<Monaco | undefined>();
const [ editor, setEditor ] = React.useState<monaco.editor.IStandaloneCodeEditor | undefined>();
const [ index, setIndex ] = React.useState(0);
......@@ -302,7 +306,7 @@ const CodeEditor = ({ data, remappings, libraries, language, mainFile, contractN
<Box flexGrow={ 1 }>
<CodeEditorTabs
tabs={ tabs }
activeTab={ data[index].file_path }
activeTab={ data[index]?.file_path }
mainFile={ mainFile }
onTabSelect={ handleTabSelect }
onTabClose={ handleTabClose }
......
......@@ -185,7 +185,7 @@ export default function useQueryWithPages<Resource extends PaginatedResourceName
Object.entries(newFilters).forEach(([ key, value ]) => {
const isValidValue = typeof value === 'boolean' || (value && value.length);
if (isValidValue) {
newQuery[key] = Array.isArray(value) ? value.join(',') : (String(value) || '');
newQuery[key] = Array.isArray(value) ? value.join(',').replace(/ERC/g, 'MRC') : (String(value).replace(/ERC/g, 'MRC') || '');
}
});
}
......
......@@ -34,6 +34,10 @@ const ChartWidgetContainer = ({
href,
}: Props) => {
const { items, lineQuery } = useChartQuery(id, Resolution.DAY, interval, !isPlaceholderData);
// title 替换掉字符串中ETH
title = title.replace('ETH', 'MARS');
description = description.replace('ETH', 'MARS');
units = units?.replace('ETH', 'MARS');
useEffect(() => {
if (lineQuery.isError) {
......
......@@ -32,7 +32,7 @@ const NumberWidgetsList = () => {
if (units && UNITS_WITHOUT_SPACE.includes(units)) {
unitsStr = units;
} else if (units) {
unitsStr = ' ' + units;
unitsStr = units === 'ETH' ? ' MARS' : ' ' + units;
}
return (
......
......@@ -31,10 +31,10 @@ it('creates asset flows items', async() => {
amount: '0.000395521502109448',
flowDirection: 'toRight',
token: {
address: 'ETH',
address: 'MARS',
decimals: 18,
name: 'ETH',
symbol: 'ETH',
name: 'MARS',
symbol: 'MARS',
},
},
rightActor: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment