|
|
@ -1,6 +1,6 @@ |
|
|
|
import React, { useState } from "react"; |
|
|
|
import React, { useState } from "react"; |
|
|
|
import { Box, Text, TextArea } from "grommet"; |
|
|
|
import { Box, Text, TextArea } from "grommet"; |
|
|
|
import { AddressDetails } from "src/types"; |
|
|
|
import { AddressDetails, ShardID } from "src/types"; |
|
|
|
import { Item } from "../AddressDetails"; |
|
|
|
import { Item } from "../AddressDetails"; |
|
|
|
import { useHistory } from "react-router-dom"; |
|
|
|
import { useHistory } from "react-router-dom"; |
|
|
|
import styled from "styled-components"; |
|
|
|
import styled from "styled-components"; |
|
|
@ -19,6 +19,7 @@ export const ContractDetails = (props: { |
|
|
|
address: string; |
|
|
|
address: string; |
|
|
|
contracts?: AddressDetails | null; |
|
|
|
contracts?: AddressDetails | null; |
|
|
|
sourceCode?: ISourceCode | null; |
|
|
|
sourceCode?: ISourceCode | null; |
|
|
|
|
|
|
|
shard?: ShardID; |
|
|
|
}) => { |
|
|
|
}) => { |
|
|
|
// console.log(111, appendABI(abi, props.address));
|
|
|
|
// console.log(111, appendABI(abi, props.address));
|
|
|
|
|
|
|
|
|
|
|
@ -28,6 +29,7 @@ export const ContractDetails = (props: { |
|
|
|
sourceCode={props.sourceCode} |
|
|
|
sourceCode={props.sourceCode} |
|
|
|
contracts={props.contracts} |
|
|
|
contracts={props.contracts} |
|
|
|
address={props.address} |
|
|
|
address={props.address} |
|
|
|
|
|
|
|
shard={props.shard || 0} |
|
|
|
/> |
|
|
|
/> |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
@ -37,6 +39,7 @@ export const ContractDetails = (props: { |
|
|
|
<NoVerifiedContractDetails |
|
|
|
<NoVerifiedContractDetails |
|
|
|
contracts={props.contracts} |
|
|
|
contracts={props.contracts} |
|
|
|
address={props.address} |
|
|
|
address={props.address} |
|
|
|
|
|
|
|
shard={props.shard || 0} |
|
|
|
/> |
|
|
|
/> |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
@ -71,6 +74,7 @@ export const AbiMethods = (props: { |
|
|
|
|
|
|
|
|
|
|
|
export const VerifiedButMissingImplementation = (props: { |
|
|
|
export const VerifiedButMissingImplementation = (props: { |
|
|
|
address: string; |
|
|
|
address: string; |
|
|
|
|
|
|
|
shard: number; |
|
|
|
}) => { |
|
|
|
}) => { |
|
|
|
const history = useHistory(); |
|
|
|
const history = useHistory(); |
|
|
|
|
|
|
|
|
|
|
@ -94,7 +98,7 @@ export const VerifiedButMissingImplementation = (props: { |
|
|
|
size="small" |
|
|
|
size="small" |
|
|
|
style={{ cursor: "pointer" }} |
|
|
|
style={{ cursor: "pointer" }} |
|
|
|
onClick={() => |
|
|
|
onClick={() => |
|
|
|
history.push(`/verifycontract?address=${props.address}`) |
|
|
|
history.push(`/verifycontract?address=${props.address}&shard=${props.shard}`) |
|
|
|
} |
|
|
|
} |
|
|
|
color="brand" |
|
|
|
color="brand" |
|
|
|
> |
|
|
|
> |
|
|
@ -152,6 +156,7 @@ export const ProxyContractDetails = (props: { |
|
|
|
export const NoVerifiedContractDetails = (props: { |
|
|
|
export const NoVerifiedContractDetails = (props: { |
|
|
|
contracts: AddressDetails; |
|
|
|
contracts: AddressDetails; |
|
|
|
address: string; |
|
|
|
address: string; |
|
|
|
|
|
|
|
shard: number; |
|
|
|
}) => { |
|
|
|
}) => { |
|
|
|
const history = useHistory(); |
|
|
|
const history = useHistory(); |
|
|
|
|
|
|
|
|
|
|
@ -164,7 +169,7 @@ export const NoVerifiedContractDetails = (props: { |
|
|
|
size="small" |
|
|
|
size="small" |
|
|
|
style={{ cursor: "pointer" }} |
|
|
|
style={{ cursor: "pointer" }} |
|
|
|
onClick={() => |
|
|
|
onClick={() => |
|
|
|
history.push(`/verifycontract?address=${props.address}`) |
|
|
|
history.push(`/verifycontract?address=${props.address}&shard=${props.shard}`) |
|
|
|
} |
|
|
|
} |
|
|
|
color="brand" |
|
|
|
color="brand" |
|
|
|
> |
|
|
|
> |
|
|
@ -230,6 +235,7 @@ export const VerifiedContractDetails = (props: { |
|
|
|
sourceCode: ISourceCode; |
|
|
|
sourceCode: ISourceCode; |
|
|
|
address: string; |
|
|
|
address: string; |
|
|
|
contracts?: AddressDetails | null; |
|
|
|
contracts?: AddressDetails | null; |
|
|
|
|
|
|
|
shard: number; |
|
|
|
}) => { |
|
|
|
}) => { |
|
|
|
const [tab, setTab] = useState<V_TABS>(V_TABS.CODE); |
|
|
|
const [tab, setTab] = useState<V_TABS>(V_TABS.CODE); |
|
|
|
const [metamaskAddress, setMetamask] = useState(""); |
|
|
|
const [metamaskAddress, setMetamask] = useState(""); |
|
|
@ -250,7 +256,7 @@ export const VerifiedContractDetails = (props: { |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<Box direction="column"> |
|
|
|
<Box direction="column"> |
|
|
|
{props.sourceCode?.proxyAddress && !props.sourceCode?.proxy && <VerifiedButMissingImplementation address={props.sourceCode.proxyAddress}/>} |
|
|
|
{props.sourceCode?.proxyAddress && !props.sourceCode?.proxy && <VerifiedButMissingImplementation address={props.sourceCode.proxyAddress} shard={props.shard}/>} |
|
|
|
<Box direction="row" align="center" margin={{ top: props.sourceCode?.proxyAddress && !props.sourceCode?.proxy ? "" : "medium" }}> |
|
|
|
<Box direction="row" align="center" margin={{ top: props.sourceCode?.proxyAddress && !props.sourceCode?.proxy ? "" : "medium" }}> |
|
|
|
<TabButton |
|
|
|
<TabButton |
|
|
|
text={V_TABS.CODE} |
|
|
|
text={V_TABS.CODE} |
|
|
|