Skip to content

Instantly share code, notes, and snippets.

@jdaly13
jdaly13 / drops-dropdowns.tsx
Created March 17, 2022 03:23
search params bounties
import React, { Fragment } from "react";
import { Menu, Transition } from "@headlessui/react";
import { ContentfulBounty } from "~/types";
import { ChevronDown16 } from "@carbon/icons-react";
import { capitalize, startCase, toLower } from "lodash";
import { getBountyStatus } from "~/utils/helpers";
const allLevels = "All Levels";
const allProjects = "All Projects";
const allDrops = "All Drops";
@jdaly13
jdaly13 / gist:8d9c2ad85c3e46ed0618998f8abad37f
Last active July 25, 2022 20:14
QuestionStateController
//SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
import "@openzeppelin/contracts/access/Ownable.sol";
import "./interfaces/IQuestionStateController.sol";
import "./modifiers/OnlyAPI.sol";
contract QuestionStateController is IQuestionStateController, Ownable, OnlyApi {
mapping(uint256 => QuestionVote) public votes;
mapping(uint256 => STATE) public state;
@jdaly13
jdaly13 / gist:a53ebed99926dfd5bb4bfe0aaeb77a16
Last active September 19, 2022 19:43
question-generation
import { useLoaderData } from "@remix-run/react";
import type { SetStateAction, Dispatch } from "react";
import React from "react";
import WalletProvider from "~/components/WalletProvider";
import Wrapper from "~/components/Wrapper";
import ConnectWalletButton from "~/components/ConnectWalletButton";
import CreateQuestionContainer from "~/components/CreateQuestionContainer";
import { getContracts } from "~/services/contracts.server";
@jdaly13
jdaly13 / index.tsx
Last active November 3, 2022 03:51
switch out protocols
import { useState, useCallback, useRef, useEffect } from "react";
import { useSubmit } from "@remix-run/react";
import { Select } from "~/components/SelectMenu";
import { LogoIcon } from "~/components/LogoIcon";
import type { Chain } from "~/types";
import { getChainClient } from "~/chain-clients";
const options = [
{ name: "-- Select Value Below --", value: "" },
import { useState, useEffect } from "react";
import { Link, useFetcher } from "@remix-run/react";
import { createWallet, injectedProvider } from "thirdweb/wallets";
import { checksumAddress } from "thirdweb/utils";
import { useActiveWallet, useActiveAccount, useDisconnect, ConnectButton, useAutoConnect } from "thirdweb/react";
import { signLoginPayload } from "thirdweb/auth";
import LoginModal from "./LoginModal";
function truncateAddress(address) {
if (address && address.length > 25) {