Skip to content

Commit

Permalink
Merge pull request #25 from daqhris/unsaved-changes-branch
Browse files Browse the repository at this point in the history
Commit unsaved changes
  • Loading branch information
daqhris authored Aug 11, 2024
2 parents 054f63b + 3d30235 commit a722180
Show file tree
Hide file tree
Showing 56 changed files with 3,081 additions and 3,003 deletions.
8 changes: 0 additions & 8 deletions babel.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion graphql/queries.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { gql } from '@apollo/client';
import { gql } from "@apollo/client";

export const GET_ATTESTATIONS = gql`
query GetAttestations($address: String!) {
Expand Down
14 changes: 7 additions & 7 deletions hardhat.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Load environment variables
require('dotenv').config();
require("dotenv").config();

// Ensure required environment variables are set
if (!process.env.INFURA_API_KEY || !process.env.PRIVATE_KEY) {
console.error('Please set INFURA_API_KEY and PRIVATE_KEY in your .env file');
console.error("Please set INFURA_API_KEY and PRIVATE_KEY in your .env file");
process.exit(1);
}

Expand All @@ -20,28 +20,28 @@ module.exports = {
},
networks: {
hardhat: {
chainId: 1337
chainId: 1337,
},
localhost: {
url: "http://127.0.0.1:7545"
url: "http://127.0.0.1:7545",
},
sepolia: {
url: `https://sepolia.infura.io/v3/${process.env.INFURA_API_KEY}`,
accounts: [process.env.PRIVATE_KEY],
chainId: 11155111
chainId: 11155111,
},
kovan: {
url: `https://kovan.infura.io/v3/${process.env.INFURA_API_KEY}`,
accounts: [process.env.PRIVATE_KEY],
chainId: 42
chainId: 42,
},
// Configuration for other networks can be added here
},
paths: {
sources: "./contracts",
tests: "./test",
cache: "./cache",
artifacts: "./artifacts"
artifacts: "./artifacts",
},
// Add any additional plugins or configurations needed
};
12 changes: 8 additions & 4 deletions hooks/scaffold-eth/useScaffoldEventHistory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
UseScaffoldEventHistoryConfig,
UseScaffoldEventHistoryData,
} from "~~/utils/scaffold-eth/contract";

// import { POAPClient, POAPEvent } from '@poap/poap-eth';

const getEvents = async (
Expand Down Expand Up @@ -84,7 +85,10 @@ export const useScaffoldEventHistory = <
enabled = true,
poapIntegration = false,
address,
}: UseScaffoldEventHistoryConfig<TContractName, TEventName, TBlockData, TTransactionData, TReceiptData> & { poapIntegration?: boolean, address?: string }) => {
}: UseScaffoldEventHistoryConfig<TContractName, TEventName, TBlockData, TTransactionData, TReceiptData> & {
poapIntegration?: boolean;
address?: string;
}) => {
const { targetNetwork } = useTargetNetwork();
const publicClient = usePublicClient({
chainId: targetNetwork.id,
Expand All @@ -100,14 +104,14 @@ export const useScaffoldEventHistory = <
// TODO: Replace with actual POAP API call when API key is available
const response = await fetch(`https://api.poap.tech/actions/scan/${address}`);
if (!response.ok) {
throw new Error('Failed to fetch POAP data');
throw new Error("Failed to fetch POAP data");
}
const poapData = await response.json();
// TODO: Process and store POAP data
console.log('POAP data:', poapData);
console.log("POAP data:", poapData);
setPoapData(poapData);
} catch (error) {
console.error('Error fetching POAP data:', error);
console.error("Error fetching POAP data:", error);
}
};
fetchPOAPData();
Expand Down
1 change: 1 addition & 0 deletions hooks/scaffold-eth/useScaffoldWatchContractEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Log } from "viem";
import { useWatchContractEvent } from "wagmi";
import { addIndexedArgsToEvent, useDeployedContractInfo } from "~~/hooks/scaffold-eth";
import { ContractAbi, ContractName, UseScaffoldEventConfig } from "~~/utils/scaffold-eth/contract";

// TODO: Import POAP API client and necessary types
// import { POAPClient } from '@poap/poap-eth-sdk';

Expand Down
15 changes: 5 additions & 10 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,10 @@ module.exports = {
"^.+\\.(ts|tsx)$": "babel-jest",
},
moduleNameMapper: {
"\\.(css|less|scss|sass)$": "identity-obj-proxy"
"\\.(css|less|scss|sass)$": "identity-obj-proxy",
},
preset: 'ts-jest/presets/js-with-babel',
transformIgnorePatterns: [
"/node_modules/(?!(wagmi|@wagmi|@tanstack|viem|@viem))"
],
extensionsToTreatAsEsm: ['.ts', '.tsx'],
setupFilesAfterEnv: [
require.resolve('@testing-library/jest-dom/extend-expect'),
'<rootDir>/jest.setup.js'
],
preset: "ts-jest/presets/js-with-babel",
transformIgnorePatterns: ["/node_modules/(?!(wagmi|@wagmi|@tanstack|viem|@viem))"],
extensionsToTreatAsEsm: [".ts", ".tsx"],
setupFilesAfterEnv: [require.resolve("@testing-library/jest-dom/extend-expect"), "<rootDir>/jest.setup.js"],
};
10 changes: 5 additions & 5 deletions jest.setup.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
const { TextEncoder, TextDecoder } = require('util');
const { TextEncoder, TextDecoder } = require("util");

global.TextEncoder = TextEncoder;
global.TextDecoder = TextDecoder;

// Add BigInt polyfill for environments that don't support it
if (typeof BigInt === 'undefined') {
global.BigInt = function(value) {
if (typeof BigInt === "undefined") {
global.BigInt = function (value) {
return Number(value);
}
};
}

// Polyfill for BigInt.prototype.toJSON
if (BigInt.prototype.toJSON === undefined) {
BigInt.prototype.toJSON = function() {
BigInt.prototype.toJSON = function () {
return this.toString();
};
}
9 changes: 7 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@ const nextConfig = {
return config;
},
images: {
domains: ['api.poap.tech', 'placehold.co'],
domains: ["api.poap.tech", "placehold.co"],
},
swcMinify: true,
compiler: undefined,
compiler: {
styledComponents: true,
},
experimental: {
forceSwcTransforms: true,
},
};

module.exports = nextConfig;
13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,20 @@
"vercel": "vercel",
"vercel:yolo": "vercel --build-env NEXT_PUBLIC_IGNORE_BUILD_ERROR=true",
"test": "jest",
"postinstall": "npx patch-package"
"postinstall": "npx patch-package",
"type-check": "tsc --noEmit"
},
"dependencies": {
"@apollo/client": "^3.11.3",
"@chainlink/contracts": "^1.2.0",
"@chainlink/contracts-ccip": "^1.4.0",
"@ensdomains/ens-contracts": "file:./package",
"@ensdomains/ensjs": "^4.0.0",
"@ethereum-attestation-service/eas-sdk": "^2.5.0",
"@ethereum-attestation-service/eas-sdk": "2.5.0",
"@heroicons/react": "^2.0.11",
"@openzeppelin/contracts": "^5.0.2",
"@rainbow-me/rainbowkit": "2.1.2",
"@tanstack/react-query": "^5.51.21",
"@tanstack/react-query": "^5.51.23",
"@tanstack/react-query-devtools": "^5.51.21",
"@testing-library/dom": "^10.4.0",
"@uniswap/sdk-core": "^4.0.1",
Expand All @@ -34,7 +35,7 @@
"blo": "^1.0.1",
"burner-connector": "^0.0.8",
"daisyui": "4.5.0",
"ethers": "5.6.8",
"ethers": "6.13.2",
"express": "^4.19.2",
"graphql": "^16.9.0",
"graphql-tag": "^2.12.6",
Expand All @@ -60,6 +61,8 @@
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-transform-class-properties": "^7.24.7",
"@babel/plugin-transform-react-jsx": "^7.25.2",
"@babel/plugin-transform-runtime": "^7.24.7",
"@babel/preset-env": "^7.25.3",
Expand All @@ -69,7 +72,7 @@
"@testing-library/react": "^16.0.0",
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
"@types/jest": "^29.5.12",
"@types/node": "^17.0.35",
"@types/node": "^22.2.0",
"@types/nprogress": "^0",
"@types/react": "^18.0.9",
"@types/react-copy-to-clipboard": "^5.0.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,45 @@
// prettier-ignore
// tslint:disable
// eslint-disable

import type { Address } from "viem";
import type { GetContractReturnType } from "@nomicfoundation/hardhat-viem/types";
import "@nomicfoundation/hardhat-viem/types";
import type { Address } from "viem";

export interface Buffer$Type {
"_format": "hh-sol-artifact-1",
"contractName": "Buffer",
"sourceName": "@ensdomains/buffer/contracts/Buffer.sol",
"abi": [],
"bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122000adea6b32f5f0fa0301d3ad50a957da8b3925c422cc3e678d344eaf87efdffc64736f6c63430008110033",
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122000adea6b32f5f0fa0301d3ad50a957da8b3925c422cc3e678d344eaf87efdffc64736f6c63430008110033",
"linkReferences": {},
"deployedLinkReferences": {}
_format: "hh-sol-artifact-1";
contractName: "Buffer";
sourceName: "@ensdomains/buffer/contracts/Buffer.sol";
abi: [];
bytecode: "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122000adea6b32f5f0fa0301d3ad50a957da8b3925c422cc3e678d344eaf87efdffc64736f6c63430008110033";
deployedBytecode: "0x73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122000adea6b32f5f0fa0301d3ad50a957da8b3925c422cc3e678d344eaf87efdffc64736f6c63430008110033";
linkReferences: {};
deployedLinkReferences: {};
}

declare module "@nomicfoundation/hardhat-viem/types" {
export function deployContract(
contractName: "Buffer",
constructorArgs?: [],
config?: DeployContractConfig
config?: DeployContractConfig,
): Promise<GetContractReturnType<Buffer$Type["abi"]>>;
export function deployContract(
contractName: "@ensdomains/buffer/contracts/Buffer.sol:Buffer",
constructorArgs?: [],
config?: DeployContractConfig
config?: DeployContractConfig,
): Promise<GetContractReturnType<Buffer$Type["abi"]>>;

export function sendDeploymentTransaction(
contractName: "Buffer",
constructorArgs?: [],
config?: SendDeploymentTransactionConfig
config?: SendDeploymentTransactionConfig,
): Promise<{
contract: GetContractReturnType<Buffer$Type["abi"]>;
deploymentTransaction: GetTransactionReturnType;
}>;
export function sendDeploymentTransaction(
contractName: "@ensdomains/buffer/contracts/Buffer.sol:Buffer",
constructorArgs?: [],
config?: SendDeploymentTransactionConfig
config?: SendDeploymentTransactionConfig,
): Promise<{
contract: GetContractReturnType<Buffer$Type["abi"]>;
deploymentTransaction: GetTransactionReturnType;
Expand All @@ -50,11 +49,11 @@ declare module "@nomicfoundation/hardhat-viem/types" {
export function getContractAt(
contractName: "Buffer",
address: Address,
config?: GetContractAtConfig
config?: GetContractAtConfig,
): Promise<GetContractReturnType<Buffer$Type["abi"]>>;
export function getContractAt(
contractName: "@ensdomains/buffer/contracts/Buffer.sol:Buffer",
address: Address,
config?: GetContractAtConfig
config?: GetContractAtConfig,
): Promise<GetContractReturnType<Buffer$Type["abi"]>>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
// prettier-ignore
// tslint:disable
// eslint-disable

import "hardhat/types/artifacts";
import type { GetContractReturnType } from "@nomicfoundation/hardhat-viem/types";

import { Buffer$Type } from "./Buffer";
import type { GetContractReturnType } from "@nomicfoundation/hardhat-viem/types";
import "hardhat/types/artifacts";

declare module "hardhat/types/artifacts" {
interface ArtifactsMap {
Expand Down
49 changes: 24 additions & 25 deletions package/artifacts/@ensdomains/solsha1/contracts/SHA1.sol/SHA1.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,46 @@
// prettier-ignore
// tslint:disable
// eslint-disable

import type { Address } from "viem";
import type { GetContractReturnType } from "@nomicfoundation/hardhat-viem/types";
import "@nomicfoundation/hardhat-viem/types";
import type { Address } from "viem";

export interface SHA1$Type {
"_format": "hh-sol-artifact-1",
"contractName": "SHA1",
"sourceName": "@ensdomains/solsha1/contracts/SHA1.sol",
"abi": [
_format: "hh-sol-artifact-1";
contractName: "SHA1";
sourceName: "@ensdomains/solsha1/contracts/SHA1.sol";
abi: [
{
"anonymous": false,
"inputs": [
anonymous: false;
inputs: [
{
"indexed": false,
"internalType": "bytes32",
"name": "x",
"type": "bytes32"
}
],
"name": "Debug",
"type": "event"
}
],
"bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220a9dcbd59c18f1aded003fafefb12663f1b10512f02a856ada0b0c1fd23a5c63064736f6c63430008110033",
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220a9dcbd59c18f1aded003fafefb12663f1b10512f02a856ada0b0c1fd23a5c63064736f6c63430008110033",
"linkReferences": {},
"deployedLinkReferences": {}
indexed: false;
internalType: "bytes32";
name: "x";
type: "bytes32";
},
];
name: "Debug";
type: "event";
},
];
bytecode: "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220a9dcbd59c18f1aded003fafefb12663f1b10512f02a856ada0b0c1fd23a5c63064736f6c63430008110033";
deployedBytecode: "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220a9dcbd59c18f1aded003fafefb12663f1b10512f02a856ada0b0c1fd23a5c63064736f6c63430008110033";
linkReferences: {};
deployedLinkReferences: {};
}

declare module "@nomicfoundation/hardhat-viem/types" {
export function deployContract(
contractName: "@ensdomains/solsha1/contracts/SHA1.sol:SHA1",
constructorArgs?: [],
config?: DeployContractConfig
config?: DeployContractConfig,
): Promise<GetContractReturnType<SHA1$Type["abi"]>>;

export function sendDeploymentTransaction(
contractName: "@ensdomains/solsha1/contracts/SHA1.sol:SHA1",
constructorArgs?: [],
config?: SendDeploymentTransactionConfig
config?: SendDeploymentTransactionConfig,
): Promise<{
contract: GetContractReturnType<SHA1$Type["abi"]>;
deploymentTransaction: GetTransactionReturnType;
Expand All @@ -51,6 +50,6 @@ declare module "@nomicfoundation/hardhat-viem/types" {
export function getContractAt(
contractName: "@ensdomains/solsha1/contracts/SHA1.sol:SHA1",
address: Address,
config?: GetContractAtConfig
config?: GetContractAtConfig,
): Promise<GetContractReturnType<SHA1$Type["abi"]>>;
}
Loading

0 comments on commit a722180

Please sign in to comment.