Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Replace Rinkeby testnet with Goerli
Rūdolfs Ošiņš committed 3 years ago
commit 92c4353ba72609487c318acee10bcc940cfad08b
parent 71b5ce7de2c1d7fb3796275b01eb929809bd10d0
8 files changed +28 -21
modified src/Header.svelte
@@ -189,9 +189,9 @@
  </div>

  <div class="right">
-
    {#if config && config.network.name === "rinkeby"}
+
    {#if config && config.network.name === "goerli"}
      <a use:link href="/faucet">
-
        <span class="network">Rinkeby</span>
+
        <span class="network">Goerli</span>
      </a>
    {:else if config && config.network.name === "homestead"}
      <!-- Don't show anything -->
modified src/base/faucet/Index.svelte
@@ -2,7 +2,7 @@
  import type { Config } from "@app/config";

  import { session } from "@app/session";
-
  import { setOpenGraphMetaTag, toWei } from "@app/utils";
+
  import { setOpenGraphMetaTag, toWei, capitalize } from "@app/utils";
  import { formatEther } from "@ethersproject/units";
  import { navigate } from "svelte-routing";
  import {
@@ -22,7 +22,7 @@

  setOpenGraphMetaTag([
    { prop: "og:title", content: "Radicle Faucet" },
-
    { prop: "og:description", content: "Rinkeby Testnet Faucet" },
+
    { prop: "og:description", content: "Goerli Testnet Faucet" },
    { prop: "og:url", content: window.location.href },
  ]);

@@ -120,14 +120,14 @@
<main>
  <div class="title">
    Obtain RAD tokens on <span class="txt-bold">
-
      {config.network.name}
+
      {capitalize(config.network.name)}
    </span>
  </div>

  {#if config.network.name === "homestead"}
    <div class="subtitle">
      To get RAD tokens on <span class="txt-bold">
-
        {config.network.name},
+
        {capitalize(config.network.name)},
      </span>
      please
      <br />
@@ -140,7 +140,7 @@
  {:else if !$session}
    <div class="subtitle">
      To get RAD tokens on <span class="txt-bold">
-
        {config.network.name}
+
        {capitalize(config.network.name)}
      </span>
      &#8203;,
      <br />
modified src/base/registrations/Index.svelte
@@ -86,8 +86,8 @@
  <div class="subtitle">
    Register a unique name with our ENS registrar, under <br />
    the
-
    <span class="txt-bold">radicle.eth</span>
-
    domain (e.g. cloudhead.radicle.eth).
+
    <span class="txt-bold">{config.registrar.domain}</span>
+
    domain (e.g. cloudhead.{config.registrar.domain}).
    <br />
    Radicle names never expire and free to register.
  </div>
modified src/base/registrations/Submit.svelte
@@ -21,7 +21,9 @@
  const registrationOwner = owner || session.address;

  const view = () =>
-
    navigate(`/registrations/${name}.radicle.eth`, { state: { retry: true } });
+
    navigate(`/registrations/${name}.${config.registrar.domain}`, {
+
      state: { retry: true },
+
    });

  onMount(async () => {
    try {
modified src/config.json
@@ -16,20 +16,20 @@
    "tokens": [],
    "alchemy": { "key": "cQFlLK8EokIGlJhd_soImwEyUoC7Ec8r" }
  },
-
  "rinkeby": {
+
  "goerli": {
    "registrar": {
-
      "domain": "radicle.eth",
-
      "address": "0x80b68878442b6510D768Be1bd88712710B86eAcD"
+
      "domain": "radicle-goerli.eth",
+
      "address": "0xD88303A92577bFDF5A82FddeF342F3A27A972405"
    },
    "radToken": {
-
      "address": "0x7b6CbebC5646D996d258dcD4ca1d334B282e9948",
-
      "faucet": "0x9Aa75397eD632A3060aCb5dE7f96e2457bceED8d"
+
      "address": "0x3EE94D192397aAFAe438C9803825eb1Aa4402e09",
+
      "faucet": "0xc627191d2BB8839eAcbb7191f9500B84d201A066"
    },
    "users": {
      "pinned": []
    },
    "reverseRegistrar": {
-
      "address": "0x6F628b68b30Dc3c17f345c9dbBb1E483c2b7aE5c"
+
      "address": "0xD5610A08E370051a01fdfe4bB3ddf5270af1aA48"
    },
    "tokens": [],
    "alchemy": { "key": "1T6h-0rxu7SRzKEtmukIoxaJOXazLDNs" }
modified src/config.ts
@@ -5,6 +5,7 @@ import type { TypedDataSigner } from "@ethersproject/abstract-signer";
import WalletConnect from "@walletconnect/client";
import config from "@app/config.json";
import { WalletConnectSigner } from "./WalletConnectSigner";
+
import { capitalize } from "@app/utils";

declare global {
  interface Window {
@@ -241,7 +242,11 @@ export async function getConfig(): Promise<Config> {

  const networkConfig = (<Record<string, any>>config)[network.name];
  if (!networkConfig) {
-
    throw new Error(`Network ${network.name} is not supported`);
+
    throw new Error(
+
      `${capitalize(
+
        network.name,
+
      )} is not supported. Connect to Homestead or Goerli instead.`,
+
    );
  }

  const provider = getProvider(network, networkConfig, metamask);
modified src/utils.test.ts
@@ -159,9 +159,9 @@ describe("String Assertions", () => {
describe("Others", () => {
  test.each([
    {
-
      name: "rinkeby",
+
      name: "goerli",
      expected:
-
        "https://rinkeby.etherscan.io/address/0x5E813e48a81977c6Fdd565ed5097eb600C73C4f0",
+
        "https://goerli.etherscan.io/address/0x5E813e48a81977c6Fdd565ed5097eb600C73C4f0",
    },
    {
      name: "",
modified src/utils.ts
@@ -292,8 +292,8 @@ export function getSearchParam(

// Get the explorer link of an address, eg. Etherscan.
export function explorerLink(addr: string, config: Config): string {
-
  if (config.network.name === "rinkeby") {
-
    return `https://rinkeby.etherscan.io/address/${addr}`;
+
  if (config.network.name === "goerli") {
+
    return `https://goerli.etherscan.io/address/${addr}`;
  }
  return `https://etherscan.io/address/${addr}`;
}