Coder Social home page Coder Social logo

pooltogether / pooltogether-community-ui Goto Github PK

View Code? Open in Web Editor NEW
45.0 5.0 47.0 18.32 MB

UI to use when creating your own custom pools, prize strategies or as reference code for integrating your own pools.

Home Page: https://pooltogether.com

License: MIT License

CSS 9.26% JavaScript 90.58% Shell 0.16%

pooltogether-community-ui's Introduction

PoolTogether Brand


PoolTogether v3 - Reference Frontend.

The newest UI for communicating with the (unreleased) v3 PoolTogether protocol.

A demo of this app is live here.

To run the project against a local node you can use the pooltogether-contracts. With those contracts you can bootstrap a local Buidler EVM instance with test data so that you can develop the app locally.

Setup

Install dependencies:

$ yarn

Make sure you have direnv installed and copy .envrc.example to .envrc:

$ cp .envrc.example .envrc

Fill in your own values for .envrc, then run:

$ direnv allow

To run the local server, run:

$ yarn dev

Developer Tools

pooltogether-community-ui's People

Contributors

asselstine avatar chuckbergeron avatar dependabot[bot] avatar irhonin avatar kamescg avatar praneshasp avatar rdp3 avatar robsecord avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pooltogether-community-ui's Issues

UI does not update after approving contract spending with zero token balance

I just found a (minor) issue with the PoolTogether UI, I am not quite sure if this here is the correct repo, but here is the issue:

Summary:

When visiting https://app.pooltogether.com/pools/PT-cDAI/deposit and approving DAI you can approve it and after the tx confirmed the UI tells you that it is still unapproved. That only seems to happen when you have 0 DAI in your wallet.

Steps to reproduce:

  1. Go to https://app.pooltogether.com/pools/PT-cDAI/deposit
  2. Enter 0 in the 'Ticket amount' field, click continue
  3. Approve DAI via Metamask etc.
  4. Now you see that 'Allow DAI' is still clickable, even though the connected wallet has already approved it. That only happens when you enter 0 DAI in the 'Ticket amount' field (Page reload is not helping)

I think users (Like I just did) want to approve DAI (or different tokens) while not actually holding any DAI/Token in the wallet (yet). This leads to confusion and probably double-approving without the UI telling you that it worked on the first time.

Total supply clarification needed

First time user, not sure what does Total supply mean ?. Is it what I'm max out to deposit or already deposited. Especially confusing considering zeros above. And would be good to have explanation why it's limited to 10000 ?

Screen Shot 2021-02-26 at 2 24 10 PM

Error with "Deposit" - See JS Console for details

  1. Create a new pool with ERC20 contract on Binance smart chain (Testnet).
  2. Deposit ERC20
  3. Error occurred, see also screenshot
    {
    "code": -32603,
    "message": "Internal JSON-RPC error.",
    "data": {
    "code": -32000,
    "message": "gas required exceeds allowance (30000000) or always failing transaction"
    }
    }

Error: "networkId" is required

After all steps, the app not builds, with an error "networkId" is required.

I guess it comes from @pooltogether/bnc-onboard package but could not find any solution...

Any idea how it can be solved?

Screenshot 2021-07-06 at 14 17 33

Bug: WalletConnect desktop using Trustwallet mobile

Step to reproduce:

Schermafbeelding 2021-06-10 om 11 38 40

- Select "WalletConnect"

Schermafbeelding 2021-06-10 om 11 39 56

  • Scan QR code with Trustwallet and approve
    -After approve Wallet connect in Trustwallet it gives error:
    ๐Ÿ‘‹ Your wallet is currently set to
    Ethereum Mainnet
    . Please connect to
    Binance Smart Chain Mainnet
    to participate in this pool.
    โš ๏ธ You will need to use MetaMask to connect to this network.

Schermafbeelding 2021-06-10 om 11 37 00

Problem
Trustwallet doensn't allow to switch network like Metamask can.

Solution
We need to add network select network

Workaround:
-Add wallet in useWalletNetwork:

export const useWalletNetwork = () => {
  const {
    isWalletConnected: walletConnected,
    network: walletChainId,
    walletName,
    wallet
  } = useOnboard()

  const walletOnUnsupportedNetwork = walletConnected && !SUPPORTED_NETWORKS.includes(walletChainId)

  let walletNetworkData = {}
  try {
    walletNetworkData = getChain(walletChainId)
  } catch (error) {}

  return {
    walletChainId,
    walletOnUnsupportedNetwork,
    walletConnected,
    walletName,
    walletNetworkShortName: walletNetworkData?.name || 'unknown network',
    walletNetwork: {
      ...walletNetworkData
    },
    wallet
  }
}

-Add code in ChangeWalletNetworkNotificationBanner (it's not pretty, but works well):

if (walletName === 'WalletConnect') {
    wallet.provider.chainId = 56
    wallet.provider.networkId = 56
    wallet.provider.rpcUrl = 'https://bsc-dataseed.binance.org/'
    wallet.provider.rpc = {
      56: 'https://bsc-dataseed.binance.org/'
    }
    return <div></div>
  }

Error: A "infuraKey" or a "rpc" object with a parameter of 1 must be included in the WalletConnect initialization object

Unhandled Runtime Error
Error: A "infuraKey" or a "rpc" object with a parameter of 1 must be included in the WalletConnect initialization object

Call Stack
Module.walletConnect [as default]
node_modules/@pooltogether/bnc-onboard/dist/esm/wallet-connect-ee7f8113.js (28:0)
eval
node_modules/@pooltogether/bnc-onboard/dist/esm/onboard-84493676.js (8046:0)

Steps:
Install dependencies:

$ yarn

Make sure you have direnv installed and copy .envrc.example to .envrc:

$ cp .envrc.example .envrc

Fill in your own values for .envrc, then run:

$ direnv allow

To run the local server, run:

$ yarn dev

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.