This commit is contained in:
Georges KABBOUCHI 2023-03-06 14:02:27 +02:00
parent 7e879eb280
commit ca94be0501
3 changed files with 15 additions and 11 deletions

View File

@ -71,11 +71,11 @@
<Body class="h-full" />
</Html>
<div
class="min-h-full flex flex-col items-center justify-center py-12 sm:px-6 lg:px-8"
class="min-h-full flex flex-col items-center justify-center py-8 sm:px-6 lg:px-8"
>
<NuxtLink
to="/"
class="mt-5 text-center text-3xl font-extrabold text-gray-900"
class="text-center text-3xl font-extrabold text-gray-900"
>
Smart Address Lookup
</NuxtLink>

View File

@ -39,14 +39,14 @@ export const tasks: Array<Task> = [
},
{
description: "This is a smart contract address",
description: "Not a smart contract address",
statusStrategy: "some",
async check({ address, provider }) {
const code = await provider.getCode(address);
if (code === "0x") {
if (code !== "0x") {
return { status: "error" };
}
@ -55,7 +55,7 @@ export const tasks: Array<Task> = [
},
{
description: "This is a gnosis safe address",
description: "Not a gnosis safe address",
statusStrategy: "some",
@ -68,11 +68,11 @@ export const tasks: Array<Task> = [
contract.getThreshold(),
]);
return {
status: "success",
status: "error",
metadata: { owners, threshold: threshold.toString() },
};
} catch (error) {
return { status: "error" };
return { status: "success" };
}
},
@ -82,7 +82,7 @@ export const tasks: Array<Task> = [
return <div class="ml-8 sm:ml-10" >
<ul class="list-decimal">
{
value.map((owner) => <li>
value.map((owner : string) => <li>
<a
class="hover:underline"
target="_blank"

View File

@ -1,22 +1,26 @@
import { ethers } from "ethers";
export const networks = {
export const networks: Record<string, string> = {
mainnet: "https://rpc.ankr.com/eth",
polygon: "https://rpc.ankr.com/polygon",
avalanche: "https://rpc.ankr.com/avalanche",
fantom: "https://rpc.ankr.com/fantom",
optimism: "https://rpc.ankr.com/optimism",
arbitrum: "https://rpc.ankr.com/arbitrum",
gnosis: "https://rpc.ankr.com/gnosis",
bsc: "https://rpc.ankr.com/bsc",
};
export const networkScanBaseUrl = {
export const networkScanBaseUrl: Record<string, string> = {
mainnet: "https://etherscan.io/",
polygon: "https://polygonscan.com/",
avalanche: "https://snowtrace.io/",
fantom: "https://ftmscan.com/",
optimism: "https://optimistic.etherscan.io/",
arbitrum: "https://arbiscan.io/",
gnosis: "https://gnosisscan.io/",
bsc: "https://bscscan.com/",
};
export type Network = keyof typeof networks;
@ -43,4 +47,4 @@ export const gnosisSafeAbi = [
export const networkProviderMap = Object.keys(networks).reduce((acc, curr) => {
acc[curr] = new ethers.providers.JsonRpcProvider(networks[curr]);
return acc;
}, {});
}, {} as Record<string, ethers.providers.JsonRpcProvider>);