-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbundle.css.map
14 lines (14 loc) · 5.46 KB
/
bundle.css.map
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"version": 3,
"file": "bundle.css",
"sources": [
"../src/App.svelte",
"../src/Chapter.svelte"
],
"sourcesContent": [
"<script>\n import Router from \"svelte-spa-router\";\n import Chapter from \"./Chapter.svelte\";\n import Leaderboard from \"./Leaderboard.svelte\";\n import About from \"./About.svelte\";\n import Settings from \"./Settings.svelte\";\n import { wallet, provider, fundRequest, balance, thc } from \"./stores\";\n\n const routes = {\n \"/\": Chapter,\n \"/leaderboard\": Leaderboard,\n \"/about\": About,\n \"/settings\": Settings\n };\n</script>\n\n<style>\n .container {\n padding: var(--space-s);\n max-width: 666px;\n margin: 0 auto;\n }\n</style>\n\n<div class=\"container\">\n <nav>\n <ul>\n <li>\n <a href=\"#/\">Game</a>\n </li>\n <li>\n <a href=\"#/leaderboard\">Leaderboard</a>\n </li>\n <li>\n <a href=\"#/settings\">Settings</a>\n </li>\n <li>\n <a href=\"#/about\">???</a>\n </li>\n </ul>\n </nav>\n <main>\n {#if $fundRequest !== undefined && $fundRequest.error}\n <p class=\"error\">\n There was an error setting up the application. Would be great if you can\n message us\n <a href=\"https://twitter.com/dist0rtionproto\">on Twitter</a>\n .\n </p>\n {/if}\n {#if $wallet && $provider && $thc}\n <Router {routes} />\n {:else}\n <p>Loading... (Might take some time on old phones, like 30 seconds.)</p>\n {/if}\n </main>\n</div>\n",
"<script>\n import {\n wallet,\n balance,\n fundRequest,\n totalChapters,\n currentQuest,\n currentChapter,\n current,\n lastTransactionMined,\n provider,\n thc\n } from \"./stores\";\n import CONFIG from \"./config\";\n import marked from \"marked\";\n import ethers from \"ethers\";\n\n let solution = \"\";\n let state = \"idle\";\n\n async function submit() {\n solution = solution.toLowerCase();\n const address = $wallet.address;\n // Generate the hash of the value\n const hash = ethers.utils.keccak256(ethers.utils.toUtf8Bytes(solution));\n // Generate wallet using the 32 bytes from the hash\n const solutionWallet = new ethers.Wallet(hash);\n // Sign the raw bytes, not the hex string\n const signature = await solutionWallet.signMessage(\n ethers.utils.arrayify(address)\n );\n const { r, s, v } = ethers.utils.splitSignature(signature);\n state = \"check\";\n try {\n const transaction = await $thc.functions.submit(v, r, s);\n $current.solution = solution;\n console.log(transaction);\n state = \"mine\";\n const receipt = await $provider.waitForTransaction(transaction.hash);\n $lastTransactionMined = receipt.transactionHash;\n console.log(\"Transaction Mined: \" + receipt);\n console.log(receipt);\n solution = \"\";\n state = \"success\";\n } catch (e) {\n state = \"wrong\";\n }\n }\n</script>\n\n<style>\n .solution {\n margin-top: var(--space-m);\n }\n\n .info {\n font-size: 0.8em;\n margin-top: 1000em;\n }\n</style>\n\n{#if state === 'check'}\n <h1 class=\"hope\">Checking the solution</h1>\n{:else if state === 'wrong'}\n <h1>Wrong solution :(</h1>\n <button class=\"primary\" on:click={() => (state = 'idle')}>Try again</button>\n{:else if state === 'mine'}\n <h1>Please wait for a few seconds</h1>\n <p>\n We are calculating the right trajectory to throw your answer into the\n blockchain. This might take up to 10 seconds.\n </p>\n <p>\n If it takes longer, there might be a network problem, try to reload the\n page.\n </p>\n{:else if state === 'success'}\n <h1 class=\"hope\">Congrats, you've solved the challenge!</h1>\n <h2>But you are not done yet.</h2>\n <button class=\"primary\" on:click={() => (state = 'idle')}>\n Next Challenge\n </button>\n{:else if $totalChapters && $currentQuest && $currentChapter}\n {#if $currentChapter !== undefined && $currentChapter.toString() === '0'}\n <p class=\"warning\">\n This game stores the session in your browser (no cookie, no login, no\n recover password). Be aware that if you use incognito you might lose your\n progress.\n </p>\n {/if}\n <article>\n <h1>Chapter {$currentChapter}</h1>\n {@html marked($currentQuest)}\n </article>\n {#if $totalChapters.toNumber() - 1 !== $currentChapter.toNumber()}\n <div class=\"solution\">\n <input bind:value={solution} placeholder=\"solution to the puzzle\" />\n {#if $fundRequest === undefined && solution.length}\n <p class=\"warning\">\n You have to wait a bit more before submitting your first solution, the\n game is not fully initialized yet. If you wonder why, check the\n <a href=\"#/about\">about page</a>\n </p>\n {/if}\n <button class=\"primary\" disabled={!solution.length} on:click={submit}>\n Submit\n </button>\n </div>\n <p class=\"info\">\n <em>\n Are you stuck? Contact us at #6919, or\n <a href=\"https://twitter.com/dist0rtionproto\">send us a message</a>\n .\n </em>\n </p>\n {/if}\n{:else}\n <p>Loading... (Might take some time on old phones, like 30 seconds.)</p>\n{/if}\n"
],
"names": [],
"mappings": "AAiBE,UAAU,cAAC,CAAC,AACV,OAAO,CAAE,IAAI,SAAS,CAAC,CACvB,SAAS,CAAE,KAAK,CAChB,MAAM,CAAE,CAAC,CAAC,IAAI,AAChB,CAAC;AC8BD,SAAS,cAAC,CAAC,AACT,UAAU,CAAE,IAAI,SAAS,CAAC,AAC5B,CAAC,AAED,KAAK,cAAC,CAAC,AACL,SAAS,CAAE,KAAK,CAChB,UAAU,CAAE,MAAM,AACpB,CAAC"
}