diff --git a/build.crx b/build.crx index 90c6812..784d07d 100644 Binary files a/build.crx and b/build.crx differ diff --git a/landing/index.html b/landing/index.html index df36270..7de658f 100644 --- a/landing/index.html +++ b/landing/index.html @@ -73,7 +73,7 @@

get started

download
-

Cobweb is MIT-licensed and fully open source - the source is available on GitHub should you wish to build from source. The checksum of the current version is 5b29cc1cfefd9db1e69fce3bf787b1fa7368b4be769b3c7d426311d45089ba9b. +

Cobweb is MIT-licensed and fully open source - the source is available on GitHub should you wish to build from source. The checksum of the current version is a0f59c908c6d6f65a22348d2abfe51c01ee530072da6a8ded98e84fd1ef3dda5.

view source
diff --git a/package.json b/package.json index ef6990c..69230f7 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Cobweb", - "version": "0.0.8", + "version": "0.0.9", "description": "A Web3-based tool enabling creative teens to learn and earn on the blockchain.", "license": "MIT", "repository": { diff --git a/src/manifest.json b/src/manifest.json index 6c0c958..0dcb317 100755 --- a/src/manifest.json +++ b/src/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 3, "name": "Cobweb", "description": "A Web3-based tool empowering teens to learn and earn on the blockchain.", - "version": "0.0.8", + "version": "0.0.9", "background": { "service_worker": "background.bundle.js" }, "action": { "default_popup": "popup.html", diff --git a/src/pages/Popup/CobwebInfo.tsx b/src/pages/Popup/CobwebInfo.tsx index cafddf8..1c58825 100644 --- a/src/pages/Popup/CobwebInfo.tsx +++ b/src/pages/Popup/CobwebInfo.tsx @@ -103,7 +103,7 @@ const CobwebInfo = () => { onClick={requestVerification} disabled={reactRequested} > - {!reactRequested ? "Request verification + ETH" : "Requested!"} + {!reactRequested ? "Request verification" : "Requested!"} ) : null} diff --git a/src/pages/Popup/components/InfoPopover.tsx b/src/pages/Popup/components/InfoPopover.tsx index 45b3907..53ebe27 100644 --- a/src/pages/Popup/components/InfoPopover.tsx +++ b/src/pages/Popup/components/InfoPopover.tsx @@ -9,15 +9,15 @@ const InfoPopover = ({ text, moreSquare = true, darker, + id = "info-popover", }: { text: string; moreSquare?: boolean; darker?: boolean; + id?: string; }) => { useEffect(() => { - const popover = new bootstrap.Popover( - document.getElementById("info-popover") - ); + const popover = new bootstrap.Popover(document.getElementById(id)); return () => { try { popover.dispose(); @@ -30,7 +30,7 @@ const InfoPopover = ({ Information icon { const [hasJoined, setHasJoined] = useState(false); @@ -209,7 +209,7 @@ const Onboarding = () => { .

- To get started, you'll need to have some Ether in your wallet, and + To get started, you'll need to have some ETH in your wallet, and upgrade it by clicking 'Manage balances'. Learn more{" "} { style={{ height: 180, marginBottom: "0.75rem" }} >

- To help you get started, we're offering a limited-time 0.003 ETH - (~$5) top-up to your account! Verify your account to request the - ETH tokens and get started. + We're excited for you to begin your blockchain journey with + Cobweb! +
+
+ Verify your account to get started.


@@ -246,9 +250,7 @@ const Onboarding = () => { disabled={hasJoined} onClick={joinCobweb} > - {hasJoined - ? "Thanks, and welcome!" - : "Request verification + ETHx"} + {hasJoined ? "Thanks, and welcome!" : "Request verification"}
diff --git a/worker/src/index.ts b/worker/src/index.ts index 2baef5d..7600220 100644 --- a/worker/src/index.ts +++ b/worker/src/index.ts @@ -1,6 +1,3 @@ -import { ethers } from "ethers"; -import { Framework } from "@superfluid-finance/sdk-core"; - export interface Env { COBWEB_KV: KVNamespace; ADMIN_KEY: string; @@ -33,131 +30,6 @@ const worker = { ); }; - const addNewUser = async () => { - const auth = request.headers.get("Authorization") ?? ""; - if (env.ENVIRONMENT === "dev") { - logger(request.headers.get("Authorization") ?? "null", "AUTH"); - } - - if ( - atob(auth.substring(auth.lastIndexOf(" ") + 1)).endsWith( - `:${env.ADMIN_KEY}` - ) - ) { - const provider = new ethers.providers.InfuraProvider( - env.ENVIRONMENT === "dev" ? "goerli" : "homestead", - { - projectSecret: env.INFURA_API_KEY, - projectId: env.INFURA_ID, - } - ); - if (env.ENVIRONMENT === "dev") { - logger( - "Connected to Infura on chain " + - (await provider.getNetwork()).chainId + - ".", - "ETH" - ); - } - - const params = new URLSearchParams(new URL(request.url).search); - const identifier = params.get("identifier"); - const address = params.get("address"); - - if (identifier && address && ethers.utils.isAddress(address)) { - await env.COBWEB_KV.put(address.toLowerCase(), identifier); - const total = await env.COBWEB_KV.get("total"); - if (!total) { - await env.COBWEB_KV.put("total", String(100)); - } - if (total) { - await env.COBWEB_KV.put("total", String(parseInt(total) - 1)); - if (env.ENVIRONMENT === "dev") { - logger( - String(parseInt(total) - 1) + " giveaways remaining.", - "ETH" - ); - } - } - const sf = await Framework.create({ - chainId: env.ENVIRONMENT === "dev" ? 5 : 1, - provider, - }); - const sfToken = await sf.loadSuperToken(env.SF_TOKEN_ADDRESS); - const wallet = new ethers.Wallet(env.MASTER_WALLET_PKEY); - const signer = wallet.connect(provider); - const transferOperation = sfToken.transfer({ - receiver: address, - amount: ethers.utils.formatEther(0.2 / 500), - }); - try { - transferOperation - .exec(signer) - .then((transaction) => transaction.wait()) - .then((transaction) => { - if (env.ENVIRONMENT === "dev") { - logger(String(transaction), "ETH"); - } - return new Response( - JSON.stringify({ - message: `Associated ${identifier} to ${address} and transferred starter ETH.`, - }), - { - ...HEADERS, - status: 200, - } - ); - }) - .catch((err) => { - if (env.ENVIRONMENT === "dev") { - logger("Error - " + err, "ERROR"); - } - return new Response( - JSON.stringify({ error: "Could not transfer" }), - { - ...HEADERS, - status: 500, - } - ); - }); - } catch (err) { - if (env.ENVIRONMENT === "dev") { - logger("Error - " + err, "ERROR"); - } - return new Response( - JSON.stringify({ error: "Could not transfer" }), - { - ...HEADERS, - status: 500, - } - ); - } - } - if (env.ENVIRONMENT === "dev") { - logger("Could not get params - " + params, "PARAMS"); - } - return new Response( - JSON.stringify({ error: "No address or no identifier provided" }), - { - ...HEADERS, - status: 400, - } - ); - } else { - if (env.ENVIRONMENT === "dev") { - logger( - "Unauthorized, attempted: " + - atob(auth.substring(auth.lastIndexOf(" ") + 1)), - "AUTH" - ); - } - return new Response(JSON.stringify({ error: "Unauthorized" }), { - ...HEADERS, - status: 401, - }); - } - }; - const returnUserInformation = async (): Promise => { const params = new URLSearchParams(new URL(request.url).search); const address = params.get("address"); @@ -256,9 +128,7 @@ const worker = { try { const url = new URL(request.url); - if (url.pathname === "/add") { - return addNewUser(); - } else if (url.pathname === "/request") { + if (url.pathname === "/request") { return requestNewUser(); } else if (url.pathname === "/report") { return reportUser();