Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Remove remaining Gnosis safe code
Rūdolfs Ošiņš committed 3 years ago
commit f6165978f8d83f72d319df46cbdb91f6a0029046
parent 0b27e4bbfdd304a8b334b188be2f019e1aeac2a4
5 files changed +0 -60
modified src/Address.svelte
@@ -3,7 +3,6 @@
  import { link } from "svelte-routing";
  import { ethers } from "ethers";
  import {
-
    safeLink,
    explorerLink,
    identifyAddress,
    formatAddress,
@@ -100,11 +99,6 @@
      {#if !noBadge}
        <Badge variant="foreground">org</Badge>
      {/if}
-
    {:else if addressType === AddressType.Safe}
-
      <a href={safeLink(address, config)} target="_blank">{addressLabel}</a>
-
      {#if !noBadge}
-
        <Badge variant="caution">safe</Badge>
-
      {/if}
    {:else if addressType === AddressType.Contract}
      <a href={explorerLink(address, config)} target="_blank">{addressLabel}</a>
      {#if !noBadge}
modified src/config.json
@@ -10,10 +10,6 @@
    "users": {
      "pinned": ["cloudhead.radicle.eth"]
    },
-
    "safe": {
-
      "api": "https://safe-transaction.gnosis.io",
-
      "viewer": "https://gnosis-safe.io/app/#/safes"
-
    },
    "reverseRegistrar": {
      "address": "0x084b1c3C81545d370f3634392De611CaaBFf8148"
    },
@@ -32,10 +28,6 @@
    "users": {
      "pinned": []
    },
-
    "safe": {
-
      "api": "https://safe-transaction.rinkeby.gnosis.io",
-
      "viewer": "https://rinkeby.gnosis-safe.io/app/#/safes"
-
    },
    "reverseRegistrar": {
      "address": "0x6F628b68b30Dc3c17f345c9dbBb1E483c2b7aE5c"
    },
modified src/config.ts
@@ -45,10 +45,6 @@ export class Config {
        connected: false;
        signer: (ethers.Signer & TypedDataSigner) | null;
      };
-
  safe: {
-
    api?: string;
-
    viewer: string | null;
-
  };
  abi: { [contract: string]: string[] };
  seed: {
    api: { port: number };
@@ -97,7 +93,6 @@ export class Config {
    this.radToken = cfg.radToken;
    this.reverseRegistrar = cfg.reverseRegistrar;
    this.users = cfg.users;
-
    this.safe = cfg.safe;
    this.provider = provider;
    this.signer = null;
    this.projects = config.projects;
modified src/utils.test.ts
@@ -159,32 +159,6 @@ describe("String Assertions", () => {
describe("Others", () => {
  test.each([
    {
-
      viewer: "https://gnosis-safe.io/app/#/safes",
-
      name: "",
-
      expected:
-
        "https://gnosis-safe.io/app/#/safes/0x5E813e48a81977c6Fdd565ed5097eb600C73C4f0",
-
    },
-
    {
-
      viewer: null,
-
      name: "",
-
      expected:
-
        "https://etherscan.io/address/0x5E813e48a81977c6Fdd565ed5097eb600C73C4f0",
-
    },
-
  ])("safeLink $viewer => $expected", ({ name, viewer, expected }) => {
-
    expect(
-
      utils.safeLink("0x5E813e48a81977c6Fdd565ed5097eb600C73C4f0", {
-
        network: {
-
          name,
-
        },
-
        safe: {
-
          viewer,
-
        },
-
      } as Config),
-
    ).toEqual(expected);
-
  });
-

-
  test.each([
-
    {
      name: "rinkeby",
      expected:
        "https://rinkeby.etherscan.io/address/0x5E813e48a81977c6Fdd565ed5097eb600C73C4f0",
modified src/utils.ts
@@ -21,16 +21,9 @@ import emojis from "@app/emojis";
export enum AddressType {
  Contract,
  Org,
-
  Safe,
  EOA,
}

-
export interface Safe {
-
  address: string;
-
  owners: string[];
-
  threshold: number;
-
}
-

export interface Token {
  name: string;
  symbol: string;
@@ -305,14 +298,6 @@ export function explorerLink(addr: string, config: Config): string {
  return `https://etherscan.io/address/${addr}`;
}

-
// Get the Gnosis Safe link of an address, eg. Etherscan.
-
export function safeLink(addr: string, config: Config): string {
-
  if (config.safe.viewer) {
-
    return `${config.safe.viewer}/${addr}`;
-
  }
-
  return explorerLink(addr, config);
-
}
-

// Format a name.
export function formatName(input: string, config: Config): string {
  return parseEnsLabel(input, config);