Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove rewards app, update permit types #6

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
"language": "en",
"words": [
"binkey",
"Knip",
"binsec",
"chainlist",
"cirip",
"dataurl",
"devpool",
"xrandomwallet",
gitcoindev marked this conversation as resolved.
Show resolved Hide resolved
"ethersproject",
"fract",
"gnosisscan",
Expand All @@ -37,7 +39,6 @@
"xmark",
"supabase",
"SUPABASE"

],
"dictionaries": ["typescript", "node", "software-terms", "html"],
"import": ["@cspell/dict-typescript/cspell-ext.json", "@cspell/dict-node/cspell-ext.json", "@cspell/dict-software-terms"],
Expand Down
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
MY_SECRET="MY_SECRET"
SUPABASE_URL=
SUPABASE_ANON_KEY=
2 changes: 1 addition & 1 deletion .github/workflows/knip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
comment_id: ${{ github.workflow }}-reporter
command_script_name: knip-ci
annotations: true
ignore_results: false
ignore_results: false
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ node_modules
.pnp.cjs
.pnp.loader.mjs
.env
static/dist
static/out
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# `@ubiquity/audit.ubq.fi`

#### Install Dependencies

- yarn

#### Build

- yarn build

### Start UI
Expand All @@ -18,3 +20,4 @@ Test Uses:
"REPO": "https://github.com/repo/repo",
"PAT": "YOUR_PAT"
}
```
2 changes: 1 addition & 1 deletion build/esbuild-build.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import esbuild from "esbuild";
import * as dotenv from "dotenv";

const typescriptEntries = ["static/scripts/rewards/index.ts", "static/scripts/audit-report/audit.ts"];
const typescriptEntries = ["static/scripts/audit-report/audit.ts"];
const cssEntries = ["static/styles/rewards/rewards.css", "static/styles/audit-report/audit.css"];
export const entries = [...typescriptEntries, ...cssEntries];

Expand Down
2 changes: 1 addition & 1 deletion knip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ const config: KnipConfig = {
ignoreDependencies: [],
};

export default config;
export default config;
6 changes: 3 additions & 3 deletions static/scripts/audit-report/audit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { createClient } from "@supabase/supabase-js";
import axios from "axios";
import { ethers } from "ethers";
import GoDB from "godb";
import { permit2Abi } from "../rewards/abis";
import { permit2Abi } from "./abis";
import { Chain, ChainScan, DATABASE_NAME, NULL_HASH, NULL_ID } from "./constants";
import {
getCurrency,
Expand All @@ -25,9 +25,9 @@ import {
GoDBSchema,
ObserverKeys,
QuickImport,
RewardPermit,
SavedData,
StandardInterface,
TxData,
} from "./types";
import { getTxInfo } from "./utils/getTransaction";

Expand Down Expand Up @@ -562,7 +562,7 @@ async function handleRPCData(data: ChainScanResult) {
transferDetails: { to },
owner,
signature,
} = decodedFunctionData as unknown as TxData;
} = decodedFunctionData as RewardPermit;
updateQueue.add(signature, {
k: signature,
t: "ether",
Expand Down
58 changes: 58 additions & 0 deletions static/scripts/audit-report/types/audit.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,61 @@ interface GoDBTableSchema {
export interface GoDBSchema {
[table: string]: GoDBTableSchema;
}

export type ERC20Permit = {
type: "erc20-permit";
permit: {
permitted: {
token: string;
amount: string;
};
nonce: string;
deadline: string;
};
transferDetails: {
to: string;
requestedAmount: string;
};
owner: string;
signature: string;
networkId: number;
};

export type ERC721Permit = {
type: "erc721-permit";
permit: {
permitted: {
token: string;
amount: string;
};
nonce: string;
deadline: string;
};
transferDetails: {
to: string;
requestedAmount: string;
};
owner: string;
signature: string;
networkId: number;
nftMetadata: {
GITHUB_ORGANIZATION_NAME: string;
GITHUB_REPOSITORY_NAME: string;
GITHUB_ISSUE_ID: string;
GITHUB_USERNAME: string;
GITHUB_CONTRIBUTION_TYPE: string;
};
request: {
beneficiary: string;
deadline: string;
keys: string[];
nonce: string;
values: string[];
};
};

export type RewardPermit = ERC20Permit | ERC721Permit;

export function permitCheck(permit: RewardPermit): permit is Erc20Permit {
return permit.type === "erc20-permit";
}
67 changes: 0 additions & 67 deletions static/scripts/rewards/cirip/ens-lookup.ts

This file was deleted.

12 changes: 0 additions & 12 deletions static/scripts/rewards/cirip/fetch-ens.ts

This file was deleted.

12 changes: 0 additions & 12 deletions static/scripts/rewards/cirip/query-graph.ts

This file was deleted.

20 changes: 0 additions & 20 deletions static/scripts/rewards/cirip/query-reverse-ens.ts

This file was deleted.

56 changes: 0 additions & 56 deletions static/scripts/rewards/constants.ts

This file was deleted.

Loading
Loading