mirror of
https://github.com/Instadapp/smart-lookup.git
synced 2024-07-29 22:38:20 +00:00
wip
This commit is contained in:
parent
7e879eb280
commit
ca94be0501
4
app.vue
4
app.vue
|
@ -71,11 +71,11 @@
|
||||||
<Body class="h-full" />
|
<Body class="h-full" />
|
||||||
</Html>
|
</Html>
|
||||||
<div
|
<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
|
<NuxtLink
|
||||||
to="/"
|
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
|
Smart Address Lookup
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
|
|
|
@ -39,14 +39,14 @@ export const tasks: Array<Task> = [
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
description: "This is a smart contract address",
|
description: "Not a smart contract address",
|
||||||
|
|
||||||
statusStrategy: "some",
|
statusStrategy: "some",
|
||||||
|
|
||||||
async check({ address, provider }) {
|
async check({ address, provider }) {
|
||||||
const code = await provider.getCode(address);
|
const code = await provider.getCode(address);
|
||||||
|
|
||||||
if (code === "0x") {
|
if (code !== "0x") {
|
||||||
return { status: "error" };
|
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",
|
statusStrategy: "some",
|
||||||
|
|
||||||
|
@ -68,11 +68,11 @@ export const tasks: Array<Task> = [
|
||||||
contract.getThreshold(),
|
contract.getThreshold(),
|
||||||
]);
|
]);
|
||||||
return {
|
return {
|
||||||
status: "success",
|
status: "error",
|
||||||
metadata: { owners, threshold: threshold.toString() },
|
metadata: { owners, threshold: threshold.toString() },
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} 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" >
|
return <div class="ml-8 sm:ml-10" >
|
||||||
<ul class="list-decimal">
|
<ul class="list-decimal">
|
||||||
{
|
{
|
||||||
value.map((owner) => <li>
|
value.map((owner : string) => <li>
|
||||||
<a
|
<a
|
||||||
class="hover:underline"
|
class="hover:underline"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
|
10
core/web3.ts
10
core/web3.ts
|
@ -1,22 +1,26 @@
|
||||||
import { ethers } from "ethers";
|
import { ethers } from "ethers";
|
||||||
|
|
||||||
export const networks = {
|
export const networks: Record<string, string> = {
|
||||||
mainnet: "https://rpc.ankr.com/eth",
|
mainnet: "https://rpc.ankr.com/eth",
|
||||||
polygon: "https://rpc.ankr.com/polygon",
|
polygon: "https://rpc.ankr.com/polygon",
|
||||||
avalanche: "https://rpc.ankr.com/avalanche",
|
avalanche: "https://rpc.ankr.com/avalanche",
|
||||||
fantom: "https://rpc.ankr.com/fantom",
|
fantom: "https://rpc.ankr.com/fantom",
|
||||||
optimism: "https://rpc.ankr.com/optimism",
|
optimism: "https://rpc.ankr.com/optimism",
|
||||||
arbitrum: "https://rpc.ankr.com/arbitrum",
|
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/",
|
mainnet: "https://etherscan.io/",
|
||||||
polygon: "https://polygonscan.com/",
|
polygon: "https://polygonscan.com/",
|
||||||
avalanche: "https://snowtrace.io/",
|
avalanche: "https://snowtrace.io/",
|
||||||
fantom: "https://ftmscan.com/",
|
fantom: "https://ftmscan.com/",
|
||||||
optimism: "https://optimistic.etherscan.io/",
|
optimism: "https://optimistic.etherscan.io/",
|
||||||
arbitrum: "https://arbiscan.io/",
|
arbitrum: "https://arbiscan.io/",
|
||||||
|
gnosis: "https://gnosisscan.io/",
|
||||||
|
bsc: "https://bscscan.com/",
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Network = keyof typeof networks;
|
export type Network = keyof typeof networks;
|
||||||
|
@ -43,4 +47,4 @@ export const gnosisSafeAbi = [
|
||||||
export const networkProviderMap = Object.keys(networks).reduce((acc, curr) => {
|
export const networkProviderMap = Object.keys(networks).reduce((acc, curr) => {
|
||||||
acc[curr] = new ethers.providers.JsonRpcProvider(networks[curr]);
|
acc[curr] = new ethers.providers.JsonRpcProvider(networks[curr]);
|
||||||
return acc;
|
return acc;
|
||||||
}, {});
|
}, {} as Record<string, ethers.providers.JsonRpcProvider>);
|
Loading…
Reference in New Issue
Block a user