Skip to content

Commit

Permalink
Merge pull request #1252 from hypercerts-org/chore/deprecate-goerli
Browse files Browse the repository at this point in the history
Chore/deprecate goerli
  • Loading branch information
Jipperism authored Jan 8, 2024
2 parents 0f3e7d8 + 0df2168 commit 1cc289e
Show file tree
Hide file tree
Showing 25 changed files with 50 additions and 70 deletions.
1 change: 0 additions & 1 deletion contracts/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ const OPENZEPPELIN_SECRET_KEY = requireEnv(process.env.OPENZEPPELIN_SECRET_KEY,
const chainIds = {
hardhat: 31337,
// Ethereum: https://docs.infura.io/infura/networks/ethereum/how-to/choose-a-network
goerli: 5,
sepolia: 11155111,
mainnet: 1,
// Optimism: https://docs.infura.io/infura/networks/optimism/how-to/choose-a-network
Expand Down
6 changes: 0 additions & 6 deletions defender/src/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ export interface SupportedNetworks {

export const NETWORKS: SupportedNetworks = {
TEST: [
{
networkKey: "goerli",
contractAddress: "0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07",
alchemyKeyEnvName: "ALCHEMY_GOERLI_KEY",
chainId: 5,
},
{
networkKey: "sepolia",
contractAddress: "0xa16DFb32Eb140a6f3F2AC68f41dAd8c7e83C4941",
Expand Down
4 changes: 2 additions & 2 deletions frontend/.env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ NEXT_PUBLIC_DOMAIN=testnet.hypercerts.org
## Web3
#######
### UUPS proxy contract address
NEXT_PUBLIC_CONTRACT_ADDRESS=0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07
NEXT_PUBLIC_CONTRACT_ADDRESS=0xa16DFb32Eb140a6f3F2AC68f41dAd8c7e83C4941
### Subgraph URL - currently using hosted service
NEXT_PUBLIC_GRAPH_URL=https://api.thegraph.com/subgraphs/name/hypercerts-admin/hypercerts-testnet
NEXT_PUBLIC_GRAPH_URL=https://api.thegraph.com/subgraphs/name/hypercerts-admin/hypercerts-sepolia
### Wallet connect ID
NEXT_PUBLIC_WALLETCONNECT_ID=GET_FROM_https://cloud.walletconnect.com/app

Expand Down
2 changes: 1 addition & 1 deletion frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This frontend application is currently configured to use Next.js as a static sit

All configurations are currently stored in environment variables.
See `.env.local.example` to see which variables need to be set.
We have pre-populated the file with the current testnet deployment on Goerli.
We have pre-populated the file with the current testnet deployment on Sepolia.

The easiest way to get started is to copy this into `.env.local` and modify the file directly, which `next` will automatically load when running the dev server below.

Expand Down
4 changes: 2 additions & 2 deletions frontend/components/dapp-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
import React, { ReactNode, useEffect } from "react";
import { celo, Chain, goerli, optimism, sepolia } from "viem/chains";
import { celo, Chain, optimism, sepolia } from "viem/chains";
import { configureChains, WagmiConfig, createConfig } from "wagmi";
import { publicProvider } from "wagmi/providers/public";

Expand All @@ -44,7 +44,7 @@ import {

const queryClient = new QueryClient();

const TEST_CHAINS = [goerli, sepolia];
const TEST_CHAINS = [sepolia];
const PROD_CHAINS = [optimism, celo];

export const CHAINS = (isProduction ? PROD_CHAINS : TEST_CHAINS) as Chain[];
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/dapp-state.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import { PlasmicCanvasContext } from "@plasmicapp/loader-nextjs";
import { DataProvider } from "@plasmicapp/loader-nextjs";
import "@rainbow-me/rainbowkit/styles.css";
import React, { ReactNode } from "react";
import { goerli, optimism, hardhat, Chain, sepolia } from "viem/chains";
import { optimism, hardhat, Chain, sepolia } from "viem/chains";
import { useNetwork } from "wagmi";

const DAPP_STATE_NAME = "DappState";

const ALL_CHAINS = [optimism, goerli, hardhat, sepolia];
const ALL_CHAINS = [optimism, hardhat, sepolia];

export interface DappStateData {
myAddress?: string;
Expand Down
2 changes: 1 addition & 1 deletion frontend/lib/formatting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const getOpenSeaFractionUrl = (
_tokenId = _tokenId.slice(0, -1);
}

return `https://testnets.opensea.io/assets/goerli/${contractAddress}/${_tokenId}`;
return `https://testnets.opensea.io/assets/sepolia/${contractAddress}/${_tokenId}`;
};

export const formatAddress = (address: string) =>
Expand Down
6 changes: 0 additions & 6 deletions graph/networks.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
"startBlock": 22079542
}
},
"goerli": {
"HypercertMinter": {
"address": "0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07",
"startBlock": 8537999
}
},
"optimism": {
"HypercertMinter": {
"address": "0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07",
Expand Down
3 changes: 1 addition & 2 deletions graph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@
"build": "pnpm build:graph && pnpm build:codegen",
"build:graph": "graph build",
"build:codegen": "graph codegen",
"deploy:test": "pnpm auth && pnpm deploy:goerli && pnpm deploy:sepolia",
"deploy:test": "pnpm auth && pnpm deploy:sepolia",
"deploy:prod": "pnpm auth && pnpm deploy:optimism && pnpm deploy:celo",
"deploy:celo": "graph deploy --node https://api.thegraph.com/deploy/ --network celo hypercerts-admin/hypercerts-celo",
"deploy:goerli": "graph deploy --node https://api.thegraph.com/deploy/ --network goerli hypercerts-admin/hypercerts-testnet",
"deploy:optimism": "graph deploy --node https://api.thegraph.com/deploy/ --network optimism hypercerts-admin/hypercerts-optimism-mainnet",
"deploy:sepolia": "graph deploy --node https://api.thegraph.com/deploy/ --network sepolia hypercerts-admin/hypercerts-sepolia",
"create-local": "graph create --node http://localhost:8020/ hypercerts-admin/hypercerts-testnet",
Expand Down
2 changes: 1 addition & 1 deletion graph/tests/.latest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "0.6.0",
"timestamp": 1702070097153
"timestamp": 1703510468280
}
4 changes: 0 additions & 4 deletions sdk/.env.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# Specifies the default chain ID to use if no chain ID is specified.
DEFAULT_CHAIN_ID=5

# Specifies the contract address to use for the Hypercert system.
CONTRACT_ADDRESS=0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07

Expand All @@ -15,7 +12,6 @@ NFT_STORAGE_TOKEN=your-nft-storage-token
# Specifies the NFT.storage API token to use for storing Hypercert metadata in a Next.js application.
NEXT_PUBLIC_NFT_STORAGE_TOKEN=your-next-public-nft-storage-token


# Specifies the Web3.storage API token to use for storing Hypercert data.
WEB3_STORAGE_TOKEN=your-web3-storage-token

Expand Down
10 changes: 5 additions & 5 deletions sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { HypercertClient } from "@hypercerts-org/sdk";
```js
const client = new HypercertClient({
chain: { id: 5 } // required
chain: { id: 11155111 }, // required
nftStorageToken,
web3StorageToken,
});
Expand All @@ -46,7 +46,7 @@ This will validate the metadata, store it on IPFS, create a new hypercert on-cha
You can also use the client to query the subgraph and retrieve which claims an address owns:
```js
const claims = await client.indexer.fractionsByOwner(owner),
const claims = await client.indexer.fractionsByOwner(owner);
```
For more information on how to use the SDK, check out the
Expand Down Expand Up @@ -103,7 +103,7 @@ HypercertIndexer, and HypercertMinter classes, respectively.
```js
const {
client: { storage },
} = new HypercertClient({ chain: { id: 5 } });
} = new HypercertClient({ chain: { id: 11155111 } });
```
The `storage` is a utility class that provides methods for storing and retrieving Hypercert metadata on IPFS and
Expand All @@ -112,7 +112,7 @@ NFT.storage. It is used by the HypercertClient to store metadata when creating n
```js
const {
client: { indexer },
} = new HypercertClient({ chain: { id: 5 } });
} = new HypercertClient({ chain: { id: 11155111 } });
```
The `indexer` is a utility class that provides methods for indexing and searching Hypercerts based on various criteria.
Expand All @@ -121,7 +121,7 @@ It is used by the HypercertClient to retrieve event-based data via the subgraph
```js
const {
client: { contract },
} = new HypercertClient({ chain: { id: 5 } });
} = new HypercertClient({ chain: { id: 11155111 } });
```
Finally we have a `contract` that provides methods for interacting with the HypercertMinter smart contract. It is used
Expand Down
4 changes: 4 additions & 0 deletions sdk/RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release notes

## 1.1.1

- Deprecate goerli chain

## 0.3.1 Update dependencies

- Updated graph package dependencies
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { logger } from "./utils";
*
* @example
* const config: Partial<HypercertClientConfig> = {
* chain: {id: 5},
* chain: {id: 11155111 },
* };
* const client = new HypercertClient(config);
*
Expand Down
5 changes: 0 additions & 5 deletions sdk/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ const DEFAULT_GRAPH_BASE_URL = "https://api.thegraph.com/subgraphs/name/hypercer

// These are the deployments we manage
const DEPLOYMENTS: { [key in SupportedChainIds]: Partial<Deployment> } = {
5: {
contractAddress: "0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07",
graphName: "hypercerts-testnet",
graphUrl: `${DEFAULT_GRAPH_BASE_URL}/hypercerts-testnet`,
} as const,
10: {
contractAddress: "0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07",
graphName: "hypercerts-optimism-mainnet",
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/types/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { HypercertMetadata } from "./metadata";
import { ByteArray, Chain, Hex, PublicClient, WalletClient, GetContractReturnType } from "viem";
import { HypercertMinterAbi } from "@hypercerts-org/contracts";

export type SupportedChainIds = 5 | 10 | 42220 | 11155111;
export type SupportedChainIds = 10 | 42220 | 11155111;
export type SupportedOverrides = {
value?: bigint;
gasPrice?: bigint;
Expand Down
5 changes: 2 additions & 3 deletions sdk/src/utils/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { sepolia, goerli, optimism, celo, Chain } from "viem/chains";
import { sepolia, optimism, celo, Chain } from "viem/chains";

import { DEPLOYMENTS } from "../constants";
import {
Expand All @@ -22,7 +22,6 @@ import { deployments } from "../../src";
* environment variables to create the final configuration object. If any required properties are missing, it logs a warning.
*
* Current supported chain IDs are:
* - 5: Goerli
* - 10: Optimism
* - 42220: Celo
* - 11155111: Sepolia
Expand Down Expand Up @@ -208,7 +207,7 @@ const getEasContractAddress = (overrides: Partial<HypercertClientConfig>) => {
};

const getDefaultChain = (chainId: number) => {
const _chains = [sepolia, goerli, optimism, celo];
const _chains = [sepolia, optimism, celo];

for (const chain of Object.values(_chains)) {
if ("id" in chain) {
Expand Down
6 changes: 3 additions & 3 deletions sdk/test/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe("HypercertClient setup tests", () => {

it("should be able to create a new read only instance when missing storage keys", () => {
const readOnlyClient = new HypercertClient({
chain: { id: 5 },
chain: { id: 11155111 },
publicClient,
});

Expand All @@ -24,7 +24,7 @@ describe("HypercertClient setup tests", () => {

it("should be able to create a new instance", () => {
const client = new HypercertClient({
chain: { id: 5 },
chain: { id: 11155111 },
publicClient,
walletClient,
nftStorageToken: "test",
Expand All @@ -51,7 +51,7 @@ describe("HypercertClient setup tests", () => {
});

it("should throw an error when executing write method in readonly mode", async () => {
const client = new HypercertClient({ chain: { id: 5 } });
const client = new HypercertClient({ chain: { id: 11155111 } });

// mintClaim
try {
Expand Down
2 changes: 1 addition & 1 deletion sdk/test/client/allowlist.minting.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe("Allows for minting claims from an allowlist", () => {
const wallet = walletClient;
const userAddress = wallet.account?.address;
const client = new HypercertClient({
chain: { id: 5 },
chain: { id: 11155111 },
walletClient,
publicClient,
nftStorageToken: "test",
Expand Down
2 changes: 1 addition & 1 deletion sdk/test/client/burn.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe("burn fraction tokens in HypercertClient", () => {
const wallet = walletClient;
const userAddress = wallet.account?.address;
const client = new HypercertClient({
chain: { id: 5 },
chain: { id: 11155111 },
walletClient,
publicClient,
nftStorageToken: "test",
Expand Down
2 changes: 1 addition & 1 deletion sdk/test/client/minting.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe("mintClaim in HypercertClient", () => {
const storeBlobMock = sinon.stub(NFTStorage, "storeBlob").resolves(mockCorrectMetadataCid);

const client = new HypercertClient({
chain: { id: 5 },
chain: { id: 11155111 },
walletClient,
publicClient,
nftStorageToken: "test",
Expand Down
2 changes: 1 addition & 1 deletion sdk/test/client/split.merge.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe("split and merge", () => {
let writeSpy = sinon.stub(walletClient, "writeContract");

const client = new HypercertClient({
chain: { id: 5 },
chain: { id: 11155111 },
walletClient,
publicClient,
nftStorageToken: "test",
Expand Down
4 changes: 2 additions & 2 deletions sdk/test/evaluations/evaluator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ chai.use(assertionsCount);
describe("HypercertEvaluator", () => {
const signer = walletClient.account;
const evaluator = new HypercertEvaluator({
chain: { id: 5 },
chain: { id: 11155111 },
easContractAddress: "0xC2679fBD37d54388Ce493F1DB75320D236e1815e",
publicClient,
});
Expand Down Expand Up @@ -72,7 +72,7 @@ describe("HypercertEvaluator", () => {
const evaluation: HypercertEvaluationSchema = getEvaluationData({ creator: signer?.address });

const readonlyEvaluator = new HypercertEvaluator({
chain: { id: 5 },
chain: { id: 11155111 },
easContractAddress: "0xC2679fBD37d54388Ce493F1DB75320D236e1815e",
publicClient,
});
Expand Down
Loading

0 comments on commit 1cc289e

Please sign in to comment.