From 75042fceabf2c4c01a507ffa3441a2faf816121c Mon Sep 17 00:00:00 2001 From: Tien Nam Dao <tien.dao2@tiki.vn> Date: Tue, 29 Nov 2022 14:15:22 +0700 Subject: [PATCH] fix: update contract code --- views/accounts/tabs/ContractCodeTab/Overview.tsx | 16 ---------------- views/accounts/tabs/ContractCodeTab/index.tsx | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/views/accounts/tabs/ContractCodeTab/Overview.tsx b/views/accounts/tabs/ContractCodeTab/Overview.tsx index d986b82d..6fe711fb 100644 --- a/views/accounts/tabs/ContractCodeTab/Overview.tsx +++ b/views/accounts/tabs/ContractCodeTab/Overview.tsx @@ -1,8 +1,6 @@ import { useMobileLayout } from '@astraprotocol/astra-ui' import clsx from 'clsx' import Row from 'components/Grid/Row' -import { LinkText } from 'components/Typography/LinkText' -import { LinkMaker } from 'utils/helper' import styles from './style.module.scss' interface Props { @@ -12,20 +10,6 @@ const ContractCodeOverview = ({ contractCode }: Props) => { const { isMobile } = useMobileLayout() return ( <div className={clsx(styles.overview, 'margin-bottom-xl ')}> - <div className="text text-sm contrast-color-30 margin-bottom-md"> - Contract is not verified.{' '} - {contractCode.SameBytecodeAddress && ( - <> - However, we found a verified contract with the same bytecode{' '} - <LinkText href={LinkMaker.address(contractCode.SameBytecodeAddress)}> - {contractCode.SameBytecodeAddress} - </LinkText> - </> - )} - . All metadata displayed below is from that contract. In order to verify current contract, click Verify - & Publish button. - </div> - <div className={isMobile ? 'col col-5' : 'col col-5 margin-right-xl'}> <Row style={{ justifyContent: 'space-between' }}> <span className="text text-sm contrast-color-30">Compiler Version: </span> diff --git a/views/accounts/tabs/ContractCodeTab/index.tsx b/views/accounts/tabs/ContractCodeTab/index.tsx index f2a5c3b6..9f58bb09 100644 --- a/views/accounts/tabs/ContractCodeTab/index.tsx +++ b/views/accounts/tabs/ContractCodeTab/index.tsx @@ -2,8 +2,10 @@ import { NormalButton, Spinner } from '@astraprotocol/astra-ui' import JsonView from 'components/CodeView/JsonView' import SolidityView from 'components/CodeView/SolidityView' import Row from 'components/Grid/Row' +import { LinkText } from 'components/Typography/LinkText' import ModalContractVerify from 'components/VerifyContract' import { useState } from 'react' +import { LinkMaker } from 'utils/helper' import useContractCode from 'views/accounts/hook/useContractCode' import ContractConstructorArguments from './ContructorArgs' import ContractCodeOverview from './Overview' @@ -40,6 +42,19 @@ const ContractCodeTab = ({ address }: Props) => { </div> ) : contractCode ? ( <div className="margin-left-xl margin-right-xl"> + <div className="text text-sm contrast-color-30 margin-bottom-md"> + Contract is not verified.{' '} + {contractCode.SameBytecodeAddress && ( + <> + However, we found a verified contract with the same bytecode{' '} + <LinkText href={LinkMaker.address(contractCode.SameBytecodeAddress)}> + {contractCode.SameBytecodeAddress} + </LinkText> + </> + )} + . All metadata displayed below is from that contract. In order to verify current contract, click + Verify & Publish button. + </div> <ContractCodeOverview contractCode={contractCode} /> <ContractConstructorArguments abi={contractCode.ABI}