Skip to content

Commit

Permalink
Merge pull request #83 from yearn/chore/upgrade-web-lib
Browse files Browse the repository at this point in the history
chore: Upgrade web-lib init
  • Loading branch information
Majorfi authored May 9, 2023
2 parents 2689b08 + a9cb43d commit 42dc38c
Show file tree
Hide file tree
Showing 13 changed files with 520 additions and 637 deletions.
2 changes: 1 addition & 1 deletion components/common/AppWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Link from 'next/link';
import Meta from 'components/common/Meta';
import Footer from 'components/common/StandardFooter';
import LogoYearn from 'components/icons/LogoYearn';
import Header from '@yearn-finance/web-lib/layouts/Header.next';
import Header from '@yearn-finance/web-lib/components/Header';

import type {AppLayoutProps, AppProps} from 'next/app';
import type {ReactElement, ReactNode} from 'react';
Expand Down
9 changes: 1 addition & 8 deletions components/common/StandardFooter.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React from 'react';
import React from 'react';
import Link from 'next/link';
import meta from 'public/manifest.json';
import {SwitchTheme} from '@yearn-finance/web-lib/components/SwitchTheme';
import {useUI} from '@yearn-finance/web-lib/contexts/useUI';
import IconSocialDiscord from '@yearn-finance/web-lib/icons/IconSocialDiscord';
import IconSocialGithub from '@yearn-finance/web-lib/icons/IconSocialGithub';
import IconSocialMedium from '@yearn-finance/web-lib/icons/IconSocialMedium';
Expand All @@ -12,8 +10,6 @@ import type {ReactElement} from 'react';


function Footer(): ReactElement {
const {theme, switchTheme} = useUI();

return (
<footer className={'mx-auto mt-auto hidden w-full max-w-6xl flex-row items-center py-8 md:flex'}>
<Link href={'/disclaimer'}>
Expand Down Expand Up @@ -73,9 +69,6 @@ function Footer(): ReactElement {
<IconSocialMedium className={'h-5 w-5'} />
</a>
</div>
<div className={'pl-3'}>
<SwitchTheme theme={theme} switchTheme={switchTheme} />
</div>
</footer>
);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"dependencies": {
"@headlessui/react": "^1.7.3",
"@yearn-finance/web-lib": "^0.17.55",
"@yearn-finance/web-lib": "^0.18.34",
"axios": "^1.1.3",
"ethcall": "^4.8.5",
"ethers": "^5.7.2",
Expand Down
2 changes: 1 addition & 1 deletion pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ class MyDocument extends Document {
}
}

export default MyDocument;
export default MyDocument;
11 changes: 4 additions & 7 deletions pages/bar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import Wrapper from 'components/common/Wrapper';
import {Banner} from '@yearn-finance/web-lib/components/Banner';

import type {NextRouter} from 'next/router';
import type {ReactElement} from 'react';
Expand All @@ -9,12 +8,10 @@ function Bar(): ReactElement {
return (
<section aria-label={'some default section'}>
<div className={'mb-4'}>
<Banner title={'Bar'}>
<div className={'space-y-4'}>
<p className={'text-primary-500'}>{'Duis dignissim id nisi id consequat. Maecenas accumsan ac magna sit amet tincidunt. Aliquam lacinia dolor sit amet eros efficitur, at tincidunt neque pharetra. Maecenas aliquet gravida tellus vitae sollicitudin. Phasellus ac massa accumsan, dapibus tortor vitae, dignissim eros. Sed sit amet ex vel sem euismod ornare et sed libero. Vestibulum suscipit nisl ac convallis consectetur. Nulla sollicitudin felis orci, et tristique sapien maximus ut. Vivamus consectetur augue nisi, luctus vulputate sem sodales a. Donec quis blandit libero. Quisque dolor nisi, congue in consequat ut, euismod eu dolor.'}</p>
<p className={'text-primary-500'}>{'Praesent facilisis lectus sit amet ante vulputate vulputate. Mauris pulvinar sollicitudin justo, sit amet semper lectus efficitur eu. Vestibulum congue, metus dapibus elementum ultrices, massa arcu interdum augue, nec ultrices augue nisl id mauris. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed nec risus vitae nisi cursus euismod. Aenean et tristique turpis. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus imperdiet efficitur quam sed viverra. Aliquam cursus turpis sit amet est blandit, et rhoncus urna finibus.'}</p>
</div>
</Banner>
<div className={'space-y-4'}>
<p className={'text-primary-500'}>{'Duis dignissim id nisi id consequat. Maecenas accumsan ac magna sit amet tincidunt. Aliquam lacinia dolor sit amet eros efficitur, at tincidunt neque pharetra. Maecenas aliquet gravida tellus vitae sollicitudin. Phasellus ac massa accumsan, dapibus tortor vitae, dignissim eros. Sed sit amet ex vel sem euismod ornare et sed libero. Vestibulum suscipit nisl ac convallis consectetur. Nulla sollicitudin felis orci, et tristique sapien maximus ut. Vivamus consectetur augue nisi, luctus vulputate sem sodales a. Donec quis blandit libero. Quisque dolor nisi, congue in consequat ut, euismod eu dolor.'}</p>
<p className={'text-primary-500'}>{'Praesent facilisis lectus sit amet ante vulputate vulputate. Mauris pulvinar sollicitudin justo, sit amet semper lectus efficitur eu. Vestibulum congue, metus dapibus elementum ultrices, massa arcu interdum augue, nec ultrices augue nisl id mauris. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed nec risus vitae nisi cursus euismod. Aenean et tristique turpis. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus imperdiet efficitur quam sed viverra. Aliquam cursus turpis sit amet est blandit, et rhoncus urna finibus.'}</p>
</div>
</div>
</section>
);
Expand Down
105 changes: 51 additions & 54 deletions pages/disclaimer.tsx
Original file line number Diff line number Diff line change
@@ -1,71 +1,68 @@
import React from 'react';
import Link from 'next/link';
import {Card} from '@yearn-finance/web-lib/components/Card';
import IconCross from '@yearn-finance/web-lib/icons/IconCross';

import type {ReactElement} from 'react';

function DisclaimerPage(): ReactElement {
return (
<div className={'w-full'}>
<Card>
<div className={'flex w-full flex-row justify-between pb-6'}>
<h4>{'Disclaimer'}</h4>
<Link href={'/'}>
<IconCross className={'text-typo-primary hover:text-typo-primary-variant h-6 w-6 cursor-pointer transition-colors'} />
</Link>
</div>
<div className={'space-y-6 text-justify'}>
<p>
{'When used on this website, the terms “debt”, “lend”, “borrow”, “collateral”, “credit”, “leverage”, “bank”, “borrow”, “yield”, “invest” and other similar terms are not meant to be interpreted literally. Rather, such terms are being used to draw rough, fuzzy-logic analogies between the heavily automated and mostly deterministic operations of a decentralized-finance smart contract system and the discretionary performance of traditional-finance transactions by people.'}
</p>
<div className={'flex w-full flex-row justify-between pb-6'}>
<h4>{'Disclaimer'}</h4>
<Link href={'/'}>
<IconCross className={'text-typo-primary hover:text-typo-primary-variant h-6 w-6 cursor-pointer transition-colors'} />
</Link>
</div>
<div className={'space-y-6 text-justify'}>
<p>
{'When used on this website, the terms “debt”, “lend”, “borrow”, “collateral”, “credit”, “leverage”, “bank”, “borrow”, “yield”, “invest” and other similar terms are not meant to be interpreted literally. Rather, such terms are being used to draw rough, fuzzy-logic analogies between the heavily automated and mostly deterministic operations of a decentralized-finance smart contract system and the discretionary performance of traditional-finance transactions by people.'}
</p>

<p>
{'For example, “debt” is a legally enforceable promise from a debtor to a creditor to pay an interest rate and eventually repay the principal. Therefore, “debt” cannot exist without legal agreements and cannot be enforced without courts of law. '}
<i>
{'By contrast, with the Iron Bank, there are no legal agreements, promises of payment or courts of law, and therefore there are no debts, loans or other traditional finance transactions involved.'}
</i>
</p>
<p>
{'For example, “debt” is a legally enforceable promise from a debtor to a creditor to pay an interest rate and eventually repay the principal. Therefore, “debt” cannot exist without legal agreements and cannot be enforced without courts of law. '}
<i>
{'By contrast, with the Iron Bank, there are no legal agreements, promises of payment or courts of law, and therefore there are no debts, loans or other traditional finance transactions involved.'}
</i>
</p>

<p>
{'Instead, the Iron Bank consists of software (including embedded game-theoretic incentives and assumptions) through which people can share their tokens with other people or smart contract systems and, '}
<i>
{'under normal and expected conditions and subject to various assumptions regarding the behavioral effects of incentives, probably get their tokens back eventually, plus extra tokens, most of the time or in most cases. '}
</i>
{'Unlike in traditional lending, the "lender"s’ financial return does not depend primarily on the creditworthiness, solvency or financial skill of the “borrower” or on legal nuances such as the perfection of liens or the priority of creditor claims in a bankruptcy–it depends primarily on the incentive model assumed by the software design and how reliably the software implements that model. Unlike a debtor, people who “borrow” tokens from the Iron Bank smart contract system are not required to and have not promised to pay the tokens back; if the “borrowers” never pay the tokens back, no promise has been broken, no legal agreement has been breached and the token “lenders” cannot sue the “borrowers” to get their tokens back. Instead, by not repaying the borrowed tokens, the token “borrowers” merely demonstrate either that they lacked sufficient incentive to want to do so–for example, because their smart-contract-bound “collateral” was worth much less than the “borrowed” tokens–or that a technical issue–such as congestion of Ethereum–prevented them from doing so. Regardless, the “borrowers” do not have an obligation to repay tokens when they do not want to or cannot do so, and there is no legal remedy for damaged “lenders” when insufficient incentives or technical problems result in a token shortfall.'}
</p>
<p>
{'Instead, the Iron Bank consists of software (including embedded game-theoretic incentives and assumptions) through which people can share their tokens with other people or smart contract systems and, '}
<i>
{'under normal and expected conditions and subject to various assumptions regarding the behavioral effects of incentives, probably get their tokens back eventually, plus extra tokens, most of the time or in most cases. '}
</i>
{'Unlike in traditional lending, the "lender"s’ financial return does not depend primarily on the creditworthiness, solvency or financial skill of the “borrower” or on legal nuances such as the perfection of liens or the priority of creditor claims in a bankruptcy–it depends primarily on the incentive model assumed by the software design and how reliably the software implements that model. Unlike a debtor, people who “borrow” tokens from the Iron Bank smart contract system are not required to and have not promised to pay the tokens back; if the “borrowers” never pay the tokens back, no promise has been broken, no legal agreement has been breached and the token “lenders” cannot sue the “borrowers” to get their tokens back. Instead, by not repaying the borrowed tokens, the token “borrowers” merely demonstrate either that they lacked sufficient incentive to want to do so–for example, because their smart-contract-bound “collateral” was worth much less than the “borrowed” tokens–or that a technical issue–such as congestion of Ethereum–prevented them from doing so. Regardless, the “borrowers” do not have an obligation to repay tokens when they do not want to or cannot do so, and there is no legal remedy for damaged “lenders” when insufficient incentives or technical problems result in a token shortfall.'}
</p>

<p>
{'When the Iron Bank or Vaults are used to “lend” or “deposit” tokens into a third-party smart-contract system, the situation is even less like traditional debt: the “borrowing” smart contract has not posted “collateral” and could malfunction or suffer a loss that results in complete or partial failure to return the “borrowed” tokens. In this case, the token “lenders” do not have a contractual remedy against the smart contract “borrower” or its creators–the third-party smart contract is not a person, is usually not under the full control of any person or persons and may be impossible to pause or reverse. A malfunctioning, exploited or underperforming smart contract cannot be forced (in court or otherwise) to pay the “borrowed” tokens back.'}
</p>
<p>
{'When the Iron Bank or Vaults are used to “lend” or “deposit” tokens into a third-party smart-contract system, the situation is even less like traditional debt: the “borrowing” smart contract has not posted “collateral” and could malfunction or suffer a loss that results in complete or partial failure to return the “borrowed” tokens. In this case, the token “lenders” do not have a contractual remedy against the smart contract “borrower” or its creators–the third-party smart contract is not a person, is usually not under the full control of any person or persons and may be impossible to pause or reverse. A malfunctioning, exploited or underperforming smart contract cannot be forced (in court or otherwise) to pay the “borrowed” tokens back.'}
</p>

<p>
{'The stated APR or APY for a given token, vault or strategy (the “Rate”) is denominated in terms of a specific relevant token, not in terms of U.S. Dollars or other fiat currencies. Each Rate is a forward-looking projection based on a good faith belief of how to reasonably project results over the relevant period, but such belief is subject to numerous assumptions, risks and uncertainties (including smart contract security risks and third-party actions) which could result in a materially different (lower or higher) token-denominated APR or APY. Rates are not offers, promises, agreements, guarantees or undertakings on the part of any person or group of persons, but depend primarily on the results of operation of smart contracts and other autonomous or semi-autonomous systems (including third-party systems) and how third parties interact with those systems after the time of your deposit. Even if a particular projected Rate is achieved, you may still suffer a financial loss in fiat-denominated terms if the fiat-denominated value of the relevant tokens (your deposit and any tokens allocated or distributed to you pursuant to the Rate) declines during the deposit period. APRs and APYs are not interest rates being paid on a debt.'}
</p>
<p>
{'The stated APR or APY for a given token, vault or strategy (the “Rate”) is denominated in terms of a specific relevant token, not in terms of U.S. Dollars or other fiat currencies. Each Rate is a forward-looking projection based on a good faith belief of how to reasonably project results over the relevant period, but such belief is subject to numerous assumptions, risks and uncertainties (including smart contract security risks and third-party actions) which could result in a materially different (lower or higher) token-denominated APR or APY. Rates are not offers, promises, agreements, guarantees or undertakings on the part of any person or group of persons, but depend primarily on the results of operation of smart contracts and other autonomous or semi-autonomous systems (including third-party systems) and how third parties interact with those systems after the time of your deposit. Even if a particular projected Rate is achieved, you may still suffer a financial loss in fiat-denominated terms if the fiat-denominated value of the relevant tokens (your deposit and any tokens allocated or distributed to you pursuant to the Rate) declines during the deposit period. APRs and APYs are not interest rates being paid on a debt.'}
</p>

<p>
{'Thus, the transactions you can effect through the Iron Bank, Vaults and other Yearn decentralized finance systems, while superficially similar to traditional financial transactions in some ways, are in fact very different. DeFi and TradFi each have unique costs and benefits, risks and protection mechanisms. '}
<i>
{'Please, bear this fact in mind when using this website, and do not use Yearn, the Yearn vaults, the Iron Bank or any other system described on this website without a sufficient understanding of their unique risks and how they differ from traditional financial transactions. '}
</i>
{'The only way to fully understand such risks is to have a strong understanding of the relevant technical systems and the incentive design mechanisms they embody–we strongly encourage you to review Yearn"s technical '}
<a
href={'https://docs.yearn.finance'}
target={'_blank'}
rel={'noreferrer'}
className={'link'}>{'documentation'}
</a>
{' and '}
<a
href={'https://github.com/yearn/'}
target={'_blank'}
rel={'noreferrer'}
className={'link'}>{'code'}
</a>
{' before use.'}
</p>
</div>
</Card>
<p>
{'Thus, the transactions you can effect through the Iron Bank, Vaults and other Yearn decentralized finance systems, while superficially similar to traditional financial transactions in some ways, are in fact very different. DeFi and TradFi each have unique costs and benefits, risks and protection mechanisms. '}
<i>
{'Please, bear this fact in mind when using this website, and do not use Yearn, the Yearn vaults, the Iron Bank or any other system described on this website without a sufficient understanding of their unique risks and how they differ from traditional financial transactions. '}
</i>
{'The only way to fully understand such risks is to have a strong understanding of the relevant technical systems and the incentive design mechanisms they embody–we strongly encourage you to review Yearn"s technical '}
<a
href={'https://docs.yearn.finance'}
target={'_blank'}
rel={'noreferrer'}
className={'link'}>{'documentation'}
</a>
{' and '}
<a
href={'https://github.com/yearn/'}
target={'_blank'}
rel={'noreferrer'}
className={'link'}>{'code'}
</a>
{' before use.'}
</p>
</div>
</div>
);
}
Expand Down
Loading

1 comment on commit 42dc38c

@vercel
Copy link

@vercel vercel bot commented on 42dc38c May 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

web-lib-template – ./

web-template-bay.vercel.app
web.ycorpo.com
web-lib-template-git-main.yearn.farm
web-lib-template.yearn.farm

Please sign in to comment.