Skip to content

Commit

Permalink
chore: remove other apps, update readme (#186)
Browse files Browse the repository at this point in the history
* chore: remove other apps, update readme

* chore: the htmls too
  • Loading branch information
Keyrxng authored Mar 4, 2024
1 parent e96d10c commit 53de54f
Show file tree
Hide file tree
Showing 16 changed files with 35 additions and 2,010 deletions.
25 changes: 20 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,26 @@ http://localhost:8080?claim=eyJwZXJtaXQiOnsicGVybWl0dGVkIjp7InRva2VuIjoiMHgxMWZF
## How to test locally

1. Set `.env` variables.
2. In the project root run `npx http-server`. Set `env.FRONTEND_URL` to `http://localhost:8080`.
3. Run `npx tsx generate-permit2-url.ts` to generate an offline permit URL.
4. Open the generated permit URL in the `localhost`.
5. Connect the bounty hunter's address.
6. Click the "withdraw" button to get a reward.
2. Run `anvil --chain-id 31337 --fork-url https://rpc.gnosis.gateway.fm` in a separate terminal.
3. Run the Anvil commands (uses the Anvil default wallets).
4. In the project root run `yarn start`.
5. A permit URL for both ERC20 and ERC721 is generated in the terminal.
6. Open the generated permit URL defaulting to the variable values in the `.env` file.
7. Connect the bounty hunter's address.
8. Click the "withdraw" button to get a reward.
9. Testing the ERC721 permit is easiest deploying the `nft-rewards` contract from the [repository](https://github.com/ubiquity/nft-rewards)

#### Anvil commands

###### Using any other `--chain-id` will hit real RPC endpoints.

```
cast rpc anvil_impersonateAccount 0xba12222222228d8ba445958a75a0704d566bf2c8 &
cast send 0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d --unlocked --from 0xba12222222228d8ba445958a75a0704d566bf2c8 "transfer(address,uint256)(bool)" 0x70997970C51812dc3A010C7d01b50e0d17dc79C8 337888400000000000000000 &
cast send 0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d --unlocked --from 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 "approve(address,uint256)(bool)" 0x000000000022D473030F116dDEE9F6B43aC78BA3 9999999999999991111111119999999999999999 &
cast send 0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d --unlocked --from 0x70997970C51812dc3A010C7d01b50e0d17dc79C8 "approve(address,uint256)(bool)" 0x000000000022D473030F116dDEE9F6B43aC78BA3 999999999999999111119999999999999999
```

## CloudFlare Setup (GitHub Secrets)

Expand Down
9 changes: 2 additions & 7 deletions build/esbuild-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@ import * as dotenv from "dotenv";
import esbuild from "esbuild";
import extraRpcs from "../lib/chainlist/constants/extraRpcs";

const typescriptEntries = [
"static/scripts/rewards/init.ts",
"static/scripts/audit-report/audit.ts",
"static/scripts/onboarding/onboarding.ts",
"static/scripts/key-generator/keygen.ts",
];
const cssEntries = ["static/styles/rewards/rewards.css", "static/styles/audit-report/audit.css", "static/styles/onboarding/onboarding.css"];
const typescriptEntries = ["static/scripts/rewards/init.ts"];
const cssEntries = ["static/styles/rewards/rewards.css"];
export const entries = [...typescriptEntries, ...cssEntries];

const allNetworkUrls: Record<string, string[]> = {};
Expand Down
27 changes: 13 additions & 14 deletions scripts/typescript/generate-permit2-url.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import {generateERC20Permit} from "./generate-erc20-permit-url";
import {generateERC721Permit} from "./generate-erc721-permit-url";
import { generateERC20Permit } from "./generate-erc20-permit-url";
import { generateERC721Permit } from "./generate-erc721-permit-url";
import { verifyEnvironmentVariables } from "./utils";

(async () => {
generateERC721Permit().catch((error) => {
console.error(error);
verifyEnvironmentVariables();
process.exitCode = 1;
});

generateERC721Permit().catch((error) => {
console.error(error);
verifyEnvironmentVariables();
process.exitCode = 1;
});

generateERC20Permit().catch((error) => {
console.error(error);
verifyEnvironmentVariables();
process.exitCode = 1;
});
})().catch(console.error);
generateERC20Permit().catch((error) => {
console.error(error);
verifyEnvironmentVariables();
process.exitCode = 1;
});
})().catch(console.error);
73 changes: 0 additions & 73 deletions static/audit.html

This file was deleted.

40 changes: 0 additions & 40 deletions static/keygen.html

This file was deleted.

76 changes: 0 additions & 76 deletions static/onboarding.html

This file was deleted.

Loading

0 comments on commit 53de54f

Please sign in to comment.