Skip to content

Commit

Permalink
feat(mint): mint on base sepolia in fe
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbeckers committed Mar 1, 2024
1 parent 30e175a commit 74f9186
Show file tree
Hide file tree
Showing 14 changed files with 65 additions and 33 deletions.
4 changes: 4 additions & 0 deletions contracts/RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.1.2

- Add Base and Base Sepolia to types

# 1.1.1

- Improve ESM support by exporting `index.mjs` instead of `index.js`. @baumstern
Expand Down
2 changes: 1 addition & 1 deletion contracts/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@hypercerts-org/contracts",
"description": "EVM compatible protocol for managing impact claims",
"version": "1.1.1",
"version": "1.1.2",
"author": {
"name": "Hypercerts Foundation",
"url": "https://github.com/hypercerts-org/hypercerts"
Expand Down
6 changes: 6 additions & 0 deletions contracts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ const deployments = {
...DEPLOYMENTS.protocol["11155111"],
...DEPLOYMENTS.marketplace["11155111"],
},
84532: {
...DEPLOYMENTS.protocol["84532"],
},
8453: {
...DEPLOYMENTS.protocol["8453"],
},
} as Record<DeployedChains, Deployment>;

const asDeployedChain = (chainId: string | number) => {
Expand Down
2 changes: 1 addition & 1 deletion defender/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"dependencies": {
"@graphql-mesh/cache-localforage": "^0.95.7",
"@hypercerts-org/contracts": "1.1.1",
"@hypercerts-org/contracts": "1.1.2",
"@openzeppelin/defender-autotask-client": "1.54.1",
"@openzeppelin/defender-autotask-utils": "1.54.1",
"@openzeppelin/defender-base-client": "1.54.1",
Expand Down
6 changes: 3 additions & 3 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, optimism, sepolia } from "viem/chains";
import { celo, Chain, optimism, sepolia, baseSepolia, base } from "viem/chains";
import { configureChains, WagmiConfig, createConfig } from "wagmi";
import { publicProvider } from "wagmi/providers/public";

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

const queryClient = new QueryClient();

const TEST_CHAINS = [sepolia];
const PROD_CHAINS = [optimism, celo];
const TEST_CHAINS = [sepolia, baseSepolia];
const PROD_CHAINS = [optimism, celo, base];

export const CHAINS = (isProduction ? PROD_CHAINS : TEST_CHAINS) as Chain[];

Expand Down
2 changes: 1 addition & 1 deletion frontend/hooks/hypercerts-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { HypercertClient, HypercertClientConfig } from "@hypercerts-org/sdk";
import { useWalletClient, useNetwork } from "wagmi";

const isSupportedChain = (chainId: number) => {
const supportedChainIds = [10, 42220, 11155111]; // Replace with actual chain IDs
const supportedChainIds = [10, 42220, 11155111, 84532, 8453]; // Replace with actual chain IDs

return supportedChainIds.includes(chainId);
};
Expand Down
4 changes: 2 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"@graphprotocol/client-cli": "^2.2.16",
"@hypercerts-org/contracts": "1.1.1-alpha.0",
"@hypercerts-org/contracts": "1.1.2",
"@hypercerts-org/observabletreemap": "workspace: *",
"@hypercerts-org/sdk": "1.4.2-alpha.0",
"@hypercerts-org/sdk": "1.4.3",
"@mui/icons-material": "^5.11.9",
"@mui/material": "^5.11.2",
"@mui/x-date-pickers": "^5.0.12",
Expand Down
38 changes: 19 additions & 19 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions sdk/RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# Release notes

## 1.4.3

- Add Base and Base Sepolia to supported chains in config

## 1.4.2

- Improve ESM support by exporting `index.mjs` instead of `index.js`. @baumstern
- Added dweb IPFS gateway links and use `Promise.any` call to try and fetch data from multiple gateways.
- Expose timeout on HTTP requests from storage layer up to client wrapper methods as optional config.
- Default timeout on calls of 0 ms (no timeout) to avoid issues with large files or multiple IPFS calls.
- Updated contracts package to support Base and Base Sepolia

## New contributors

Expand Down
4 changes: 2 additions & 2 deletions sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hypercerts-org/sdk",
"version": "1.4.2-alpha.2",
"version": "1.4.3",
"description": "SDK for hypercerts protocol",
"repository": "git@github.com:hypercerts-org/hypercerts.git",
"author": "Hypercerts team",
Expand All @@ -24,7 +24,7 @@
"@ethereum-attestation-service/eas-sdk": "1.3.7",
"@ethersproject/abstract-signer": "^5.7.0",
"@graphql-typed-document-node/core": "^3.2.0",
"@hypercerts-org/contracts": "1.1.1-alpha.1",
"@hypercerts-org/contracts": "1.1.2",
"@openzeppelin/merkle-tree": "^1.0.5",
"@urql/core": "^4.2.0",
"@whatwg-node/fetch": "^0.9.13",
Expand Down
10 changes: 10 additions & 0 deletions sdk/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ const DEPLOYMENTS: { [key in SupportedChainIds]: Partial<Deployment> } = {
graphName: "hypercerts-sepolia",
graphUrl: `${DEFAULT_GRAPH_BASE_URL}/hypercerts-sepolia`,
} as const,
84532: {
addresses: deployments[84532],
graphName: "hypercerts-base-sepolia",
graphUrl: `${DEFAULT_GRAPH_BASE_URL}/hypercerts-base-sepolia`,
} as const,
8453: {
addresses: deployments[8453],
graphName: "hypercerts-base-mainnet",
graphUrl: `${DEFAULT_GRAPH_BASE_URL}/hypercerts-base-mainnet`,
} as const,
};

// Example schema on Sepolia
Expand Down
5 changes: 5 additions & 0 deletions sdk/src/indexer/gql/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ export enum AcceptedToken_OrderBy {
TokenSymbol = "token__symbol",
}

export enum Aggregation_Interval {
Day = "day",
Hour = "hour",
}

export type Allowlist = {
__typename?: "Allowlist";
claim: Claim;
Expand Down
4 changes: 2 additions & 2 deletions sdk/src/types/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import { HypercertMinterAbi } from "@hypercerts-org/contracts";
/**
* Enum to verify the supported chainIds
*
* @note 10 = Optimism, 42220 = Celo, 11155111 = Sepolia
* @note 10 = Optimism, 42220 = Celo, 11155111 = Sepolia, 84532 = Base Sepolia, 8453 = Base Mainnet
*/
export type SupportedChainIds = 10 | 42220 | 11155111;
export type SupportedChainIds = 10 | 42220 | 11155111 | 84532 | 8453;

export type SupportedOverrides = ContractOverrides & StorageConfigOverrides;

Expand Down
6 changes: 4 additions & 2 deletions sdk/src/utils/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { sepolia, optimism, celo, Chain } from "viem/chains";
import { sepolia, optimism, celo, Chain, baseSepolia, base } from "viem/chains";

import { DEPLOYMENTS } from "../constants";
import {
Expand All @@ -25,6 +25,8 @@ import { deployments } from "../../src";
* - 10: Optimism
* - 42220: Celo
* - 11155111: Sepolia
* - 84532: Base Sepolia
* - 8453: Base Mainnet
*
* @param {Partial<HypercertClientConfig>} overrides - An object containing any configuration values to override. This should be a partial HypercertClientConfig object.
* @returns {Partial<HypercertClientConfig>} The final configuration object for the Hypercert client.
Expand Down Expand Up @@ -181,7 +183,7 @@ const getEasContractAddress = (overrides: Partial<HypercertClientConfig>) => {
};

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

for (const chain of Object.values(_chains)) {
if ("id" in chain) {
Expand Down

0 comments on commit 74f9186

Please sign in to comment.