Skip to content

Commit

Permalink
fix: update contract code
Browse files Browse the repository at this point in the history
  • Loading branch information
Tien Nam Dao committed Nov 29, 2022
1 parent 23d013c commit 75042fc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
16 changes: 0 additions & 16 deletions views/accounts/tabs/ContractCodeTab/Overview.tsx
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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>
Expand Down
15 changes: 15 additions & 0 deletions views/accounts/tabs/ContractCodeTab/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit 75042fc

Please sign in to comment.