From 92c4353ba72609487c318acee10bcc940cfad08b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C5=ABdolfs=20O=C5=A1i=C5=86=C5=A1?= Date: Wed, 12 Oct 2022 14:45:03 +0200 Subject: [PATCH] Replace Rinkeby testnet with Goerli MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rinkeby has been sunsetted in favour of Goerli after the Ethereum merge. Deployed `phase0` from radicle-contracts, some vesting contracts and the faucet from `radicle-faucet` to the Goerli testnet and adjusted the code. The `reverseRegistrar` was obtained from: https://app.ens.domains/name/addr.reverse/details Signed-off-by: Rūdolfs Ošiņš --- src/Header.svelte | 4 ++-- src/base/faucet/Index.svelte | 10 +++++----- src/base/registrations/Index.svelte | 4 ++-- src/base/registrations/Submit.svelte | 4 +++- src/config.json | 12 ++++++------ src/config.ts | 7 ++++++- src/utils.test.ts | 4 ++-- src/utils.ts | 4 ++-- 8 files changed, 28 insertions(+), 21 deletions(-) diff --git a/src/Header.svelte b/src/Header.svelte index 125aff1ee..49ffc6317 100644 --- a/src/Header.svelte +++ b/src/Header.svelte @@ -189,9 +189,9 @@
- {#if config && config.network.name === "rinkeby"} + {#if config && config.network.name === "goerli"} - Rinkeby + Goerli {:else if config && config.network.name === "homestead"} diff --git a/src/base/faucet/Index.svelte b/src/base/faucet/Index.svelte index 724e42af1..e71a7aa4b 100644 --- a/src/base/faucet/Index.svelte +++ b/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 @@
Obtain RAD tokens on - {config.network.name} + {capitalize(config.network.name)}
{#if config.network.name === "homestead"}
To get RAD tokens on - {config.network.name}, + {capitalize(config.network.name)}, please
@@ -140,7 +140,7 @@ {:else if !$session}
To get RAD tokens on - {config.network.name} + {capitalize(config.network.name)} ​,
diff --git a/src/base/registrations/Index.svelte b/src/base/registrations/Index.svelte index ba27b1dce..9eebbddc2 100644 --- a/src/base/registrations/Index.svelte +++ b/src/base/registrations/Index.svelte @@ -86,8 +86,8 @@
Register a unique name with our ENS registrar, under
the - radicle.eth - domain (e.g. cloudhead.radicle.eth). + {config.registrar.domain} + domain (e.g. cloudhead.{config.registrar.domain}).
Radicle names never expire and free to register.
diff --git a/src/base/registrations/Submit.svelte b/src/base/registrations/Submit.svelte index 671fbd4dd..a34ca872d 100644 --- a/src/base/registrations/Submit.svelte +++ b/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 { diff --git a/src/config.json b/src/config.json index 86a6a7d2a..c602aa06c 100644 --- a/src/config.json +++ b/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" } diff --git a/src/config.ts b/src/config.ts index 288bff06a..ac77687cc 100644 --- a/src/config.ts +++ b/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 { const networkConfig = (>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); diff --git a/src/utils.test.ts b/src/utils.test.ts index c09703637..d5e1dbb79 100644 --- a/src/utils.test.ts +++ b/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: "", diff --git a/src/utils.ts b/src/utils.ts index ee1f9aeca..2cc948fdc 100644 --- a/src/utils.ts +++ b/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}`; }