Skip to content

Commit

Permalink
chore: remove rewards app, update permit types (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyrxng authored Mar 4, 2024
1 parent f087a36 commit 4181d26
Show file tree
Hide file tree
Showing 35 changed files with 72 additions and 1,390 deletions.
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",
"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;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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

0 comments on commit 4181d26

Please sign in to comment.