|
|
@ -8,7 +8,6 @@ import { |
|
|
|
getTokenERC721Assets, |
|
|
|
getTokenERC721Assets, |
|
|
|
getTokenERC1155Assets, |
|
|
|
getTokenERC1155Assets, |
|
|
|
getUserERC1155Balances, |
|
|
|
getUserERC1155Balances, |
|
|
|
getTokenERC1155Balances, |
|
|
|
|
|
|
|
} from "src/api/client"; |
|
|
|
} from "src/api/client"; |
|
|
|
import { useHistory, useParams } from "react-router-dom"; |
|
|
|
import { useHistory, useParams } from "react-router-dom"; |
|
|
|
import { useERC20Pool } from "src/hooks/ERC20_Pool"; |
|
|
|
import { useERC20Pool } from "src/hooks/ERC20_Pool"; |
|
|
@ -29,10 +28,10 @@ import { getAddress } from "src/utils"; |
|
|
|
import { useCurrency } from "src/hooks/ONE-ETH-SwitcherHook"; |
|
|
|
import { useCurrency } from "src/hooks/ONE-ETH-SwitcherHook"; |
|
|
|
import { HoldersTab } from "./tabs/holders/HoldersTab"; |
|
|
|
import { HoldersTab } from "./tabs/holders/HoldersTab"; |
|
|
|
import { parseHexToText } from "../../web3/parseHex"; |
|
|
|
import { parseHexToText } from "../../web3/parseHex"; |
|
|
|
import { EventsTab } from "./tabs/events/Events"; |
|
|
|
|
|
|
|
import { ToolsTab } from "./tabs/tools"; |
|
|
|
import { ToolsTab } from "./tabs/tools"; |
|
|
|
import useQuery from "../../hooks/useQuery"; |
|
|
|
import useQuery from "../../hooks/useQuery"; |
|
|
|
import {getContractByAddress} from "./ContractDetails/helpers"; |
|
|
|
import {getContractByAddress} from "./ContractDetails/helpers"; |
|
|
|
|
|
|
|
import {linkedContractsMap} from "../../config"; |
|
|
|
|
|
|
|
|
|
|
|
export function AddressPage() { |
|
|
|
export function AddressPage() { |
|
|
|
const history = useHistory(); |
|
|
|
const history = useHistory(); |
|
|
@ -57,7 +56,6 @@ export function AddressPage() { |
|
|
|
const erc20Map = useERC20Pool(); |
|
|
|
const erc20Map = useERC20Pool(); |
|
|
|
const erc721Map = useERC721Pool(); |
|
|
|
const erc721Map = useERC721Pool(); |
|
|
|
const erc1155Map = useERC1155Pool(); |
|
|
|
const erc1155Map = useERC1155Pool(); |
|
|
|
const currency = useCurrency(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//TODO remove hardcode
|
|
|
|
//TODO remove hardcode
|
|
|
|
// @ts-ignore
|
|
|
|
// @ts-ignore
|
|
|
@ -94,24 +92,6 @@ export function AddressPage() { |
|
|
|
getBal(); |
|
|
|
getBal(); |
|
|
|
}, [id]); |
|
|
|
}, [id]); |
|
|
|
|
|
|
|
|
|
|
|
// useEffect(() => {
|
|
|
|
|
|
|
|
// const loadCode = async () => {
|
|
|
|
|
|
|
|
// try {
|
|
|
|
|
|
|
|
// const data = await loadSourceCode(id, contractShardId || 0)
|
|
|
|
|
|
|
|
// setSourceCode(data)
|
|
|
|
|
|
|
|
// } catch (e) {
|
|
|
|
|
|
|
|
// setSourceCode(null)
|
|
|
|
|
|
|
|
// console.log('Error on loading source code:', e);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// // contract defined and contract address same as id
|
|
|
|
|
|
|
|
// // note: when we toggle there is scenarios where the id are not the same
|
|
|
|
|
|
|
|
// // @ts-ignore
|
|
|
|
|
|
|
|
// if (!!contracts && contracts?.address === id && contractShardId !== null) {
|
|
|
|
|
|
|
|
// loadCode()
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }, [id, contracts, contractShardId]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
const getContractCode = async (id: string, shardId: ShardID) => { |
|
|
|
const getContractCode = async (id: string, shardId: ShardID) => { |
|
|
|
try { |
|
|
|
try { |
|
|
@ -141,7 +121,6 @@ export function AddressPage() { |
|
|
|
console.log('Implementation contract loaded:', contractData) |
|
|
|
console.log('Implementation contract loaded:', contractData) |
|
|
|
setImplementation(contractData) |
|
|
|
setImplementation(contractData) |
|
|
|
setImplementationSourceCode(implCode) |
|
|
|
setImplementationSourceCode(implCode) |
|
|
|
// setSourceCode(implCode)
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
setImplementation(null) |
|
|
|
setImplementation(null) |
|
|
@ -274,15 +253,6 @@ export function AddressPage() { |
|
|
|
return "Address"; |
|
|
|
return "Address"; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const tabs: TRelatedTransaction[] = [ |
|
|
|
|
|
|
|
"transaction", |
|
|
|
|
|
|
|
"staking_transaction", |
|
|
|
|
|
|
|
"internal_transaction", |
|
|
|
|
|
|
|
"erc20", |
|
|
|
|
|
|
|
"erc721", |
|
|
|
|
|
|
|
"erc1155", |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const txsCommonProps = { |
|
|
|
const txsCommonProps = { |
|
|
|
onTxsLoaded: (txs: RelatedTransaction[]) => { |
|
|
|
onTxsLoaded: (txs: RelatedTransaction[]) => { |
|
|
|
let description = '' |
|
|
|
let description = '' |
|
|
@ -296,11 +266,20 @@ export function AddressPage() { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const linkedContract = linkedContractsMap[id] |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<BaseContainer pad={{ horizontal: "0" }}> |
|
|
|
<BaseContainer pad={{ horizontal: "0" }}> |
|
|
|
|
|
|
|
<Box direction={'row'} align={'baseline'} gap={'16px'}> |
|
|
|
<Text size="xlarge" weight="bold" margin={{ bottom: "medium" }}> |
|
|
|
<Text size="xlarge" weight="bold" margin={{ bottom: "medium" }}> |
|
|
|
{renderTitle()} |
|
|
|
{renderTitle()} |
|
|
|
</Text> |
|
|
|
</Text> |
|
|
|
|
|
|
|
{linkedContract && |
|
|
|
|
|
|
|
<a href={`/address/${linkedContract.address}`}> |
|
|
|
|
|
|
|
<Text color={'brand'} size={'medium'}>Open {linkedContract.name} contract ({linkedContract.type})</Text> |
|
|
|
|
|
|
|
</a> |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
</Box> |
|
|
|
<BasePage margin={{ vertical: "0" }} style={{ overflow: "inherit" }}> |
|
|
|
<BasePage margin={{ vertical: "0" }} style={{ overflow: "inherit" }}> |
|
|
|
<AddressDetailsDisplay |
|
|
|
<AddressDetailsDisplay |
|
|
|
address={id} |
|
|
|
address={id} |
|
|
@ -384,14 +363,6 @@ export function AddressPage() { |
|
|
|
<ToolsTab contractAddress={id} showTools={true} /> |
|
|
|
<ToolsTab contractAddress={id} showTools={true} /> |
|
|
|
</Tab> |
|
|
|
</Tab> |
|
|
|
) : null} |
|
|
|
) : null} |
|
|
|
|
|
|
|
|
|
|
|
{/*{type === "erc1155" && inventory.length ? (*/} |
|
|
|
|
|
|
|
{/* <Tab*/} |
|
|
|
|
|
|
|
{/* title={<Text size="small">Inventory ({inventory.length})</Text>}*/} |
|
|
|
|
|
|
|
{/* >*/} |
|
|
|
|
|
|
|
{/* <Inventory inventory={inventory} />*/} |
|
|
|
|
|
|
|
{/* </Tab>*/} |
|
|
|
|
|
|
|
{/*) : null}*/} |
|
|
|
|
|
|
|
</Tabs> |
|
|
|
</Tabs> |
|
|
|
</BasePage> |
|
|
|
</BasePage> |
|
|
|
</BaseContainer> |
|
|
|
</BaseContainer> |
|
|
|