GithubHelp home page GithubHelp logo

yearn / yearn.fi Goto Github PK

View Code? Open in Web Editor NEW
22.0 3.0 48.0 11.13 MB

Home Page: https://yearn.fi

License: GNU General Public License v3.0

JavaScript 1.26% TypeScript 96.86% CSS 1.86% Shell 0.02%

yearn.fi's Introduction

yearn.fi

Why?

Initial Setup

  • Fork the original repo into your GitHub account

  • Clone the forked repo from your GitHub account to your local machine

    git clone https://github.com/<your-gh>/yearn.fi.git
    
  • Set origin to your fork. This is where you push your changes to. This is done automatically by the step above.

    git remote add origin https://github.com/<your-gh>/yearn.fi
    
  • Set upstream to original repo.

    git remote add upstream https://github.com/yearn/yearn.fi.git
    
  • Optional: Create .env file in root directory of repo then copy contents of .env.example to .env and replace values with your own keys. If you do not do this the default values from next.config.js will be used.

    cp .env.example .env
    

Install and run

  1. Run yarn
  2. Run yarn run dev
  3. Open the browser and navigate to http://localhost:3000

Run with Docker

This project can be run with Docker.

  1. Build the image: docker build -t [name-of-your-container] .
  2. Run the container: docker run -p 3000:3000 [name-of-your-container]
  3. Open the browser and navigate to http://localhost:3000

Making Changes

  • Create a new local branch from upstream/main for each PR that you will submit
    git fetch
    git checkout -b <your branch name> upstream/main
    
  • Commit your changes as you work
    git add .
    git commit -S -m "message"
    

Pushing Changes to your Repo

  • Commits are squashed when PR is merged so rebasing is optional
  • When ready to push
    git fetch
    git merge upstream/main
    git push origin <branch-name>
    

Submitting Pull Request

  • Go to your GitHub and navigate to your forked repo
  • Click on Pull requests and then click on New pull request
  • Click on compare across forks
  • Click on compare: and select branch that you want to create a pull request for then click on create pull request

yearn.fi's People

Contributors

0xbasically avatar 0xkorin avatar 0xmirim avatar dudesahn avatar engn33r avatar garywackett5 avatar itzabelli avatar jainkunal avatar karelianpie avatar kernelwhisperer avatar lazyfuhrer avatar majorfi avatar maraoz avatar marcoworms avatar murderteeth avatar nabioz avatar patcito avatar saltyfacu avatar sraver avatar w84april avatar xgambitox avatar

Stargazers

 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

yearn.fi's Issues

Bug: Can not connect to Metamask

Hi @Majorfi

What happened ๐Ÿ†˜

No event occurs when I click on Metamask in Login Modal

To Reproduce ๐Ÿ”‚

Steps to reproduce the behavior:

  1. Open https://yearn.finance/ in a browser tab
  2. Wait for the page to finish loading
  3. Copy https://yearn.finance/
  4. Open another tab and paste the URL
  5. Click Connect Wallet then Click Metamask
  6. If it works fine, redo step 4

More ๐Ÿ”Ž

  • Browser : Chrome v114

Bug: UI showing incorrect earned amount

What happened ๐Ÿ†˜

Yearn.finance showing incorrect 'earned' amount for vault token holders.

To Reproduce ๐Ÿ”‚

Steps to reproduce the behavior:
View earned amount in vault, see how it changes after a deposit and harvest

More ๐Ÿ”Ž

FRP: Deep link tabs

What is your proposal ๐Ÿš€

Ability to deep link to a specific tab

Screenshot 2023-03-09 at 13 17 39

What does this solve ? ๐Ÿ› 

Allows people to link to a specific tab directly, making it easier to link a a specific place rather than the whole page and then direct the user to a certain tab

More ๐Ÿ”Ž

N/A

Feat - Hook useCurrentApp

Create a basic hook to get the current App.

Ideally this should returns an identifier, but this could also returns all "specific" apps stuff (manifest, header, etc.)

    <img width="801" alt="Screenshot 2022-12-29 at 1 45 36 pm" src="https://user-images.githubusercontent.com/78794805/209946686-e3730117-ccce-4396-9aba-ea88f3e0213a.png">
function getCurrentApp(router) {
  if (router.pathname.startsWith('/ycrv')) {
    return 'yCRV';
  }
  if (router.pathname.startsWith('/vaults')) {
    return 'Vaults';
  }
  if (router.pathname.startsWith('/ybribe')) {
    return 'yBribe';
  }
  return 'Home';
}

Originally posted by @karelianpie in #24 (comment)

FRP: Prevent Multiple Reports

What is your proposal ๐Ÿš€

Prevent users from submitting Bug/Feature reports for 5 minutes after submission

What does this solve ? ๐Ÿ› 

Bug/Feature report spam

Bug: Negative zero

What happened ๐Ÿ†˜

We're showing negative zero:

Yearn_Vaults
{
    "earned": {
        "0x7D2382b1f8Af621229d33464340541Db362B4907": {
            "realizedGains": "0",
            "realizedGainsUSD": 0,
            "unrealizedGains": "-985900126704446",
            "unrealizedGainsUSD": -0.0017880314274915635
        }
    },
    "totalRealizedGainsUSD": 0,
    "totalUnrealizedGainsUSD": -0.0017880314274915635
}

FRP: Ledger Plugin banner

What is your proposal ๐Ÿš€

We have a plugin for ledger enabling user to sign without blind sign, but the users need to download a plugin on their device.
To make the plugin more obvious, we should put a banner/something with a deep link to download the ledger plugin if the user is connected via the ledger Iframe.
This banner should be controlled by localStorage (so closable and not displayed again after), and have a link to ledgerlive://myledger?installApp=yearn

Cf: https://github.com/LedgerHQ/ledger-live/blob/develop/apps/ledger-live-desktop/DEEPLINK.md

What does this solve ? ๐Ÿ› 

Blind signing

More ๐Ÿ”Ž

N/A

FRP: ETH zapIn/Out

nativeToken <-> yvToken is currently not supported and people have to move to wrappedNativeToken. We have a specific contract for Native <-> yvNative but not for Native <-> any.

This should be supported with some Zap provider (Wido for ex)

Bug: React Hydration Error

What happened ๐Ÿ†˜

Without suppressing hydration errors we have a few warnings that should be addressed

To Reproduce ๐Ÿ”‚

Run the app without suppressHydrationWarning as a prop

FRP: Improve vault search

What is your proposal ๐Ÿš€

Add a button in the empty result saying "not found, wanna search all"

Change the search box label to include the vault category

What does this solve ? ๐Ÿ› 

Makes it more intuitive to search all vaults

More ๐Ÿ”Ž

N/A

Bug: Missing strategies on OP

What happened ๐Ÿ†˜

A clear and concise description of what the bug is.

All vaults on OP show 0 strategies for each vault.

To Reproduce ๐Ÿ”‚

Steps to reproduce the behavior:

Open DAI vault on OP: https://yearn.finance/vaults/10/0x65343F414FFD6c97b0f6add33d16F6845Ac22BAc?tab=strategies
It shows 0 strategies but we know there are at least two active strategies. Here is one: https://optimistic.etherscan.io/address/0x9eDE0429c8ed578E5DdF1FE47717A5504C9A8fdb#readContract

More ๐Ÿ”Ž

  • Browser : Firefox 112.0.1

Portals approval bug

          I noticed a bug with portals: when I select USDT or DAI to be deposited in USDC vault, I directly go the button in deposit state, while it should be approve first.

Unrelated to this, but putting that here for issue creation

Originally posted by @Majorfi in #230 (comment)

Cleaning: export useAddToken

What is your proposal ๐Ÿš€

The useAddToken hook should be moved out of the common/hooks folder to the web-lib

What does this solve ? ๐Ÿ› 

Keeping the stuff organized

More ๐Ÿ”Ž

N/A

Cleaning: export useDismissToasts

What is your proposal ๐Ÿš€

The useDismissToasts hook should be moved out of the common/hooks folder to the web-lib

What does this solve ? ๐Ÿ› 

Keeping the stuff organized

More ๐Ÿ”Ž

N/A

Chore: Ensure safeChainID

What happened ๐Ÿ†˜

The behavior between safeChainID and vaultChainID can be unexpected when the user is connected on mainnet (for ex) but on the page for a vault on optimism (for ex). For actions related to this vault chainID, we need to ensure we are using the vaultChainID rather than the safeChainID

To Reproduce ๐Ÿ”‚

NA

More ๐Ÿ”Ž

NA

Bug: CSS

What happened ๐Ÿ†˜

CSS issue in vault details page on mobile

telegram-cloud-photo-size-4-5992042663337114790-y

When wallet not connected on mobile on the op stacking page

telegram-cloud-photo-size-4-5992042663337114791-y

Bug: Vault link to etherscan on OP

What happened ๐Ÿ†˜

On a specific vault page, there is a button that leads to etherscan with a predefined address of the vault.
This works for mainnet, but if you are on optimism, it will lead you to etherscan mainnet instead of optimism etherscan.

To Reproduce ๐Ÿ”‚

Steps to reproduce the behavior:
Here is a link to optimism vault: https://yearn.finance/vaults/10/0xb4E4CFA9971C7e1069685771DaB61CA56e72e5C3

Click on the button and it will lead you to etherscan mainnet address:
Screenshot 2023-03-02 at 12 23 46

More ๐Ÿ”Ž

Aribtrum and Fantom work as expected

Bug: Unable to clear input field

What happened ๐Ÿ†˜

Ability to clear the input field, so we can empty it and then add numbers (maybe web-lib)

To Reproduce ๐Ÿ”‚

In any input field, try and delete the 0

Screenshot 2023-05-18 at 21 17 32

FRP: for strategy name pull in the name in meta if exists

What is your proposal ๐Ÿš€

I currently see this one the website ui
image

you can see that is using the smart contract name and not the name field in meta.
For example this strategy should be called Idle Finance Reinvest not StrategyIdleV2 IdleUSDC v4 [Best yield]

What does this solve ? ๐Ÿ› 

Use nicer looking names for strategies, also if the meta file doesn't exist it can revert back to the strategy contract name.

Bug: Incorrect to vault amount

What happened ๐Ÿ†˜

On mobile when you go to deposit, it defaults to your max amount, but when you change it to a much smaller amount, the "To Vault" amount is still the original amount and when you go to approve, you could be approving a much larger deposit than you want

Sometimes it does this above, but another time I just ran it and when I adjusted the amount the deposit amount adjusted too.

Before it was like, flickering the amount between the amended and the original

telegram-cloud-photo-size-1-5145573393196755940-y

To Reproduce ๐Ÿ”‚

TBC

Bug: Crash on strategy reports none

What happened ๐Ÿ†˜

When the strategy has no report, the application crash because of this line:

return latestReport.results[0].APR * 100;

To Reproduce ๐Ÿ”‚

Go here

More ๐Ÿ”Ž

  • Browser : NA

FRP: Toggle to show all strategies

What is your proposal ๐Ÿš€

Toggle to show all strategies, follow up on d7c5b71

What does this solve ? ๐Ÿ› 

Currently we're hiding strategies that have total debt === 0

Bug: OpBoost staking indicator

What happened ๐Ÿ†˜

On Optimism, when the OP boost is used, the tokens are not deposited but stacked in another contract. Because of that, users need to go in a separate tab (OP Boost) to see both their deposit + the withdrawal actions.
We should display a warning, a message or an indicator, mostly on mobile, indicating that x tokens are staked and can be withdrawn on the opboost tab

Fix: Catch tx fails with sentry

          We could throw here if `receipt.status === 'success'` so we log this in Sentry

I feel in many places we are expecting the happy path, maybe sending to Sentry is a good first step then we can try and handle the errors a bit better

Originally posted by @karelianpie in #205 (comment)

Cleaning: export types

What is your proposal ๐Ÿš€

The following types should be exported to the web-lib:

  • VoidPromiseFunction
  • TNormalizedBN

What does this solve ? ๐Ÿ› 

Keeping the stuff organized

More ๐Ÿ”Ž

N/A

Bug: Allowance is not queried for current selected from token

What happened ๐Ÿ†˜

In case on Zaps when the from token is selected from the dropdown, allowance is not queried for the current selected token but for the token that was previously selected.

To Reproduce ๐Ÿ”‚

Steps to reproduce the behavior:

  1. Go to https://yearn.finance/vaults/1/0x8078198Fc424986ae89Ce4a910Fc109587b6aBF3 and connect your wallet
  2. In the From Wallet dropdown select a non-ETH and non-crv3crypto token
  3. Allowance queried in the above case is for the newly selected token
  4. Open Network tab in debug console
  5. Select ETH in From wallet dropdown, allowance is queried for the token selected in Step 2 and not for ETH.

At this time, Step 5 can be repeated with any other token and allowance is queried only for previously selected token.

FRP: Add Portals as zap option

Add Portals as a zap provider. This means create a new solver for it and enable the check to use it. This should work mostly the same way as Wido solver.

FRP: Add Phantom Wallet as a Connection option

What is your proposal ๐Ÿš€

Add Phantom Wallet as a Connection option

What does this solve ? ๐Ÿ› 

It gives Yearn a larger surface area for users. Phantom has over 2M unique users, many of which are using Ethereum for the first time through Phantom. This is a win/win as it gives yearn more net new users, and it gives Phantom users more dapps to interact with and gain utility from.

More ๐Ÿ”Ž

It looks like you have a custom modal as I haven't seen anything like it before and I don't see anything like web3-modal listed in your deps. I work at Phantom and would be happy to do the legwork here to get Phantom working on the website, but didn't want to make a PR if it wasn't something the yearn team was open to.

LMK what you think.

Bug: No undefined on fetch

With the recent changes, some fetchs are brokens. Here, for example, the ${address} can be undefined at start, causing a call to chain/earned/undefined, which should not happen.
We should also probably be able to send a list of arguments just like we would do with a useCallback/useEffect

const {data: earned} = useFetch<TYDaemonEarned>({
endpoint: `${YDAEMON_BASE_URI}/earned/${address}`,
schema: yDaemonEarnedSchema
});

Bug: On Optimism it shows New on the list but 0 inside

What happened ๐Ÿ†˜

On the vault list for Optimism, when a vault show new as the APR, on the inside of the vault page it still shows 0% and a sign saying there's an OP boost available.

Inside the vault page it should show: new instead of 0%. And the OP boost warning + tab shouldn't be shown unless there's data that the boost is available.

To Reproduce ๐Ÿ”‚

  1. Go to yearn.finance/vaults
  2. Change the network to Optimism
  3. Search for velo and you'll see the APY as New
  4. Go into this vault: https://yearn.finance/vaults/10/0x682dF61222A3FB64F3e88fEf41cE21499aDcc647 to see what's shown inside

More ๐Ÿ”Ž

IMAGE 2023-06-29 12:51:07
IMAGE 2023-06-29 12:51:09

Fix: Use client side validation for depositLimit

Right now, if the depositLimit returned by yDaemon is 0 (can be because of misconfiguration or node issue), the deposit is just disabled on the website.
Even if this should not happen, website should still be usable.

To correct this, the depositLimit should be fetched on the client side for this function:

function getMaxDepositPossible({vault, fromToken, fromDecimals, isDepositing, fromTokenBalance}: TGetMaxDepositPossible): TNormalizedBN {
const vaultDepositLimit = formatBN(vault?.details?.depositLimit);
const userBalance = formatBN(fromTokenBalance);
if (fromToken === vault?.token?.address && isDepositing) {
if (userBalance.gt(vaultDepositLimit)) {
return (toNormalizedBN(vaultDepositLimit, vault.token.decimals));
}
}
return (toNormalizedBN(userBalance, fromDecimals));
}

Cleaning: export functions/consts

What is your proposal ๐Ÿš€

The following functions should be exported to the web-lib:

export function handleInputChangeEventValue(
	value: string,
	decimals: number
): TNormalizedBN {
	let		amount = value.replace(/,/g, '.').replace(/[^0-9.]/g, '');
	const	amountParts = amount.split('.');
	if (amountParts.length === 2) {
		amount = amountParts[0] + '.' + amountParts[1].slice(0, decimals);
	}
	const	raw = ethers.utils.parseUnits(amount || '0', decimals);
	return ({raw: raw, normalized: amount});
}

export const DefaultTNormalizedBN: TNormalizedBN = {raw: ethers.constants.Zero, normalized: 0};

export const toNormalizedBN = (value: BigNumberish, decimals?: number): TNormalizedBN => ({
	raw: formatBN(value),
	normalized: formatToNormalizedValue(formatBN(value), decimals || 18)
});

What does this solve ? ๐Ÿ› 

Keeping the stuff organized

More ๐Ÿ”Ž

N/A

FRP: Gnosis batched TX

What is your proposal ๐Ÿš€

With a Gnosis safe transactions can be batched and triggered all at once. We should use this in the action flow when using a gnosis safe as wallet.

What does this solve ? ๐Ÿ› 

Make it more gas efficient and easier for Safe to interact with

More ๐Ÿ”Ž

N/A

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.