├── .nvmrc ├── .husky ├── .gitignore ├── commit-msg └── pre-commit ├── src ├── modules │ ├── bridge │ │ └── OnRamp.json │ ├── dashboard │ │ ├── lists │ │ │ ├── constants.ts │ │ │ ├── ListBottomText.tsx │ │ │ ├── ListItemIsolationBadge.tsx │ │ │ ├── SupplyAssetsList │ │ │ │ └── types.ts │ │ │ ├── ListHeader.tsx │ │ │ └── ListButtonsColumn.tsx │ │ └── DashboardContentNoData.tsx │ ├── umbrella │ │ ├── helpers │ │ │ ├── StakedUnderlyingTooltip.tsx │ │ │ ├── SharesTooltip.tsx │ │ │ └── ApyTooltip.tsx │ │ └── NoStakeAssets.tsx │ ├── history │ │ └── PriceUnavailable.tsx │ ├── governance │ │ └── helpers.ts │ ├── staking │ │ └── StakingPanelSkeleton.tsx │ ├── reserve-overview │ │ └── graphs │ │ │ ├── GraphTimeRangeSelector.tsx │ │ │ └── GraphLegend.tsx │ ├── faucet │ │ ├── FaucetMobileItemLoader.tsx │ │ └── FaucetItemLoader.tsx │ └── migration │ │ └── MigrationListItemToggler.tsx ├── styles │ └── variables.css ├── uiConfig.ts ├── components │ ├── caps │ │ └── helper.ts │ ├── transactions │ │ ├── Emode │ │ │ ├── EmodeNaming.ts │ │ │ └── EmodeModal.tsx │ │ ├── ClaimRewards │ │ │ ├── constants.ts │ │ │ └── ClaimRewardsModal.tsx │ │ ├── Switch │ │ │ ├── slippage.helpers.ts │ │ │ ├── cowprotocol │ │ │ │ ├── CowOrderToast.tsx │ │ │ │ └── cowprotocol.errors.ts │ │ │ ├── SwitchErrors.tsx │ │ │ └── common.ts │ │ ├── FlowCommons │ │ │ └── TxModalTitle.tsx │ │ ├── Bridge │ │ │ ├── BridgeModal.tsx │ │ │ └── Oracle-abi.json │ │ ├── Warnings │ │ │ ├── CowLowerThanMarketWarning.tsx │ │ │ ├── USDTResetWarning.tsx │ │ │ ├── SNXWarning.tsx │ │ │ └── AAVEWarning.tsx │ │ ├── StakingMigrate │ │ │ └── StakingMigrateModal.tsx │ │ ├── GovRepresentatives │ │ │ └── GovRepresentativesModal.tsx │ │ ├── Stake │ │ │ └── StakeModal.tsx │ │ ├── UnStake │ │ │ └── UnStakeModal.tsx │ │ ├── GovVote │ │ │ └── GovVoteModal.tsx │ │ ├── StakeCooldown │ │ │ └── StakeCooldownModal.tsx │ │ ├── StakeRewardClaim │ │ │ └── StakeRewardClaimModal.tsx │ │ ├── GovDelegation │ │ │ └── GovDelegationModal.tsx │ │ ├── StakeRewardClaimRestake │ │ │ └── StakeRewardClaimRestakeModal.tsx │ │ ├── Faucet │ │ │ └── FaucetModal.tsx │ │ ├── CancelCowOrder │ │ │ └── CancelCowOrderModal.tsx │ │ ├── SavingsGho │ │ │ ├── SavingsGhoDepositModal.tsx │ │ │ └── SavingsGhoWithdrawModal.tsx │ │ └── GasStation │ │ │ └── GasButton.tsx │ ├── primitives │ │ ├── NoData.tsx │ │ ├── Warning.tsx │ │ ├── TypographyGradient.tsx │ │ └── Row.tsx │ ├── Warnings │ │ ├── StETHCollateralWarning.tsx │ │ ├── AMPLWarning.tsx │ │ ├── BorrowDisabledWarning.tsx │ │ └── OffboardingWarning.tsx │ ├── infoTooltips │ │ ├── TotalBorrowAPYTooltip.tsx │ │ ├── TotalSupplyAPYTooltip.tsx │ │ ├── NetworkCostTooltip.tsx │ │ ├── VariableAPYTooltip.tsx │ │ ├── CollateralTooltip.tsx │ │ ├── ReadOnlyModeTooltip.tsx │ │ ├── BorrowPowerTooltip.tsx │ │ ├── StableAPYTooltip.tsx │ │ ├── CollateralSwitchTooltip.tsx │ │ ├── StETHCollateralToolTip.tsx │ │ ├── GhoRateTooltip.tsx │ │ ├── NetAPYTooltip.tsx │ │ ├── MaxLTVTooltip.tsx │ │ ├── AMPLToolTip.tsx │ │ ├── LiquidationPenaltyTooltip.tsx │ │ ├── TokenContractTooltip.tsx │ │ ├── SwapFeeTooltip.tsx │ │ ├── GasTooltip.tsx │ │ ├── LiquidationThresholdTooltip.tsx │ │ ├── OffboardingToolTip.tsx │ │ ├── ApprovalTooltip.tsx │ │ ├── ReserveFactorTooltip.tsx │ │ ├── BorrowDisabledToolTip.tsx │ │ ├── AvailableTooltip.tsx │ │ └── PausedTooltip.tsx │ ├── ContentContainer.tsx │ ├── infoModalContents │ │ └── InfoContentWrapper.tsx │ ├── lists │ │ ├── ListHeaderWrapper.tsx │ │ └── ListItem.tsx │ ├── badges │ │ └── ExclamationBadge.tsx │ ├── UserAuthenticated.tsx │ ├── BridgeButton.tsx │ ├── StyledToggleButtonGroup.tsx │ ├── incentives │ │ ├── EthenaIncentivesTooltipContent.tsx │ │ ├── SonicIncentivesTooltipContent.tsx │ │ └── EtherfiIncentivesTooltipContent.tsx │ └── SecondsToString.tsx ├── store │ ├── utils │ │ ├── domain-fetchers │ │ │ └── index.ts │ │ └── queryParams.ts │ ├── layoutSlice.ts │ └── transactionsSelectors.ts ├── utils │ ├── eMode.ts │ ├── __tests__ │ │ └── marketsAndNetworkConfig.spec.ts │ └── tFetch.ts ├── hooks │ ├── commonTypes.ts │ ├── usePreviousState.ts │ ├── useGasStation.tsx │ ├── governance │ │ ├── useRepresentatives.ts │ │ ├── usePayloadsData.ts │ │ ├── useVotingPowerAt.ts │ │ └── usePowers.ts │ ├── useIsWrongNetwork.tsx │ ├── useSonicIncentives.tsx │ ├── pool │ │ └── selectors.ts │ ├── useIsContractAddress.ts │ ├── useCoinGeckoCategories.ts │ └── stake │ │ ├── common.ts │ │ └── apyCalculator.ts ├── helpers │ ├── text-center-ellipsis.ts │ ├── toggle-local-storage-click.ts │ ├── timeHelper.tsx │ └── types.ts ├── createEmotionCache.ts ├── layouts │ └── components │ │ └── MobileCloseButton.tsx ├── libs │ ├── hooks │ │ └── useWeb3Context.tsx │ └── web3-data-provider │ │ └── adapters │ │ └── EthersAdapter.ts ├── architecture │ └── FixedPointDecimal.ts └── ui-config │ └── onRampServicesConfig.tsx ├── LICENSE.md ├── cypress ├── support │ ├── e2e.ts │ └── tools │ │ └── math.util.ts ├── tsconfig.json ├── fixtures │ ├── poolConfig.json │ ├── donors.json │ └── constans.json ├── configs │ ├── widgets.config.ts │ ├── governance-stake.config.ts │ ├── settings.config.ts │ ├── v3-markets │ │ ├── bnb-v3-smoke.config.ts │ │ ├── base-v3-smoke.config.ts │ │ ├── base-v3-full.config.ts │ │ ├── gnosis-v3-full.config.ts │ │ ├── ethereum-v3-full.config.ts │ │ ├── gnosis-v3-smoke.config.ts │ │ ├── arbitrum-v3-smoke.config.ts │ │ ├── ethereum-v3-smoke.config.ts │ │ ├── optimism-v3-smoke.config.ts │ │ ├── arbitrum-v3-additional.config.ts │ │ ├── avalanche-v3-smoke.config.ts │ │ ├── optimism-v3-additional.config.ts │ │ ├── ethereum-v3-additional.config.ts │ │ ├── polygon-v3-smoke.config.ts │ │ ├── optimism-v3-full.config.ts │ │ ├── arbitrum-v3-full.config.ts │ │ ├── avalanche-v3-additional.config.ts │ │ ├── avalanche-v3-full.config.ts │ │ ├── polygon-v3-additional.config.ts │ │ └── polygon-v3-full.config.ts │ ├── v2-markets │ │ ├── ethereum-v2-smoke.config.ts │ │ ├── ethereum-v2-full.config.ts │ │ └── ethereum-v2-additional.config.ts │ ├── general.config.ts │ ├── base.cypress.ts │ ├── local │ │ └── full.config.ts │ └── mobile.config.ts ├── types │ └── window.d.ts └── e2e │ └── 1-v3-markets │ ├── 10-metis-v3-market │ └── general.metis-v3.cy.ts │ └── 11-scroll-v3-market │ └── general.scroll-v3.cy.ts ├── index.d.ts ├── .gitattributes ├── public ├── aave_180.png ├── favicon.ico ├── aave-com-opengraph.png ├── illustration_token.png ├── fork-config-example.png ├── illustration_borrow.png ├── illustration_desktop.png ├── fonts │ └── inter │ │ ├── Inter-Bold.woff │ │ ├── Inter-Thin.woff │ │ ├── Inter.var.woff2 │ │ ├── Inter-Black.woff │ │ ├── Inter-Black.woff2 │ │ ├── Inter-Bold.woff2 │ │ ├── Inter-Italic.woff │ │ ├── Inter-Italic.woff2 │ │ ├── Inter-Light.woff │ │ ├── Inter-Light.woff2 │ │ ├── Inter-Medium.woff │ │ ├── Inter-Medium.woff2 │ │ ├── Inter-Regular.woff │ │ ├── Inter-Thin.woff2 │ │ ├── Inter-ExtraBold.woff │ │ ├── Inter-Regular.woff2 │ │ ├── Inter-SemiBold.woff │ │ ├── Inter-SemiBold.woff2 │ │ ├── Inter-BlackItalic.woff │ │ ├── Inter-BlackItalic.woff2 │ │ ├── Inter-BoldItalic.woff │ │ ├── Inter-BoldItalic.woff2 │ │ ├── Inter-ExtraBold.woff2 │ │ ├── Inter-ExtraLight.woff │ │ ├── Inter-ExtraLight.woff2 │ │ ├── Inter-LightItalic.woff │ │ ├── Inter-LightItalic.woff2 │ │ ├── Inter-MediumItalic.woff │ │ ├── Inter-ThinItalic.woff │ │ ├── Inter-ThinItalic.woff2 │ │ ├── Inter-italic.var.woff2 │ │ ├── Inter-roman.var.woff2 │ │ ├── Inter-MediumItalic.woff2 │ │ ├── Inter-SemiBoldItalic.woff │ │ ├── Inter-ExtraBoldItalic.woff │ │ ├── Inter-ExtraBoldItalic.woff2 │ │ ├── Inter-ExtraLightItalic.woff │ │ ├── Inter-ExtraLightItalic.woff2 │ │ └── Inter-SemiBoldItalic.woff2 ├── illustration_friendly_ghost.png ├── icons │ ├── flags │ │ ├── jp.svg │ │ ├── vt.svg │ │ ├── fr.svg │ │ ├── it.svg │ │ ├── el.svg │ │ ├── cn.svg │ │ └── tr.svg │ ├── tokens │ │ ├── xaut0.svg │ │ ├── fdusd.svg │ │ ├── mkr.svg │ │ ├── celo.svg │ │ ├── usdt0.svg │ │ ├── usd₮0.svg │ │ ├── zk.svg │ │ ├── pol.svg │ │ ├── wpol.svg │ │ ├── sd.svg │ │ ├── link.svg │ │ ├── busd.svg │ │ ├── ezeth.svg │ │ ├── ldo.svg │ │ ├── fei.svg │ │ ├── knc.svg │ │ ├── bat.svg │ │ ├── ceur.svg │ │ ├── usdt.svg │ │ ├── eth.svg │ │ ├── cusd.svg │ │ ├── pools │ │ │ └── bpt.svg │ │ ├── lend.svg │ │ ├── stkaave.svg │ │ ├── aave.svg │ │ ├── gho.svg │ │ ├── dai.svg │ │ ├── aave-token-round.svg │ │ ├── uscc.svg │ │ ├── ustb.svg │ │ ├── tribe.svg │ │ ├── usdbc.svg │ │ ├── syrupusdt.svg │ │ ├── bal.svg │ │ ├── xaut.svg │ │ ├── tbtc.svg │ │ ├── ethx.svg │ │ ├── pyusd.svg │ │ ├── gno.svg │ │ ├── seth.svg │ │ ├── kncl.svg │ │ ├── ausd.svg │ │ ├── wsteth.svg │ │ ├── usdc.svg │ │ └── vbill.svg │ ├── networks │ │ ├── celo.svg │ │ ├── base.svg │ │ ├── zksync.svg │ │ ├── ethereum.svg │ │ ├── linea.svg │ │ ├── optimism.svg │ │ ├── soneium.svg │ │ └── ink.svg │ ├── staking │ │ ├── trust-staking-icon.svg │ │ └── emission-staking-icon.svg │ ├── markets │ │ ├── linea.svg │ │ └── aptos.svg │ ├── other │ │ ├── aci-black.svg │ │ ├── aci-white.svg │ │ ├── kernel.svg │ │ └── spark.svg │ ├── bridge │ │ ├── polygon.svg │ │ ├── optimism.svg │ │ └── avalanche.svg │ ├── wallets │ │ ├── frame.svg │ │ └── torus.svg │ ├── github.svg │ ├── lenster.svg │ └── onRampServices │ │ └── transak.svg ├── manifest.json └── lightningBoltGradient.svg ├── .babelrc ├── .prettierrc ├── commitlint.config.js ├── .github ├── release-template.md ├── workflows │ ├── dependency-review.yml │ ├── build-fork.yml │ ├── i18n-check.yml │ └── crowdin-upload.yml ├── ISSUE_TEMPLATE │ └── feature-request---.md ├── dependabot.yml ├── pull_request_template.md └── actions │ └── fork-result-comment │ └── action.yml ├── next-env.d.ts ├── .eslintignore ├── jest.setup.js ├── .prettierignore ├── .editorconfig ├── svgo.config.js ├── .linguirc ├── .env.development ├── pages ├── index.page.tsx ├── _error.page.tsx ├── api │ └── SGhoService.types.ts ├── faucet.page.tsx ├── bridge.page.tsx └── history.page.tsx ├── cypress.config.ts ├── custom.d.ts └── .gitignore /.nvmrc: -------------------------------------------------------------------------------- 1 | 18 2 | -------------------------------------------------------------------------------- /.husky/.gitignore: -------------------------------------------------------------------------------- 1 | _ 2 | -------------------------------------------------------------------------------- /src/modules/bridge/OnRamp.json: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | All Rights Reserved © Aave Labs -------------------------------------------------------------------------------- /cypress/support/e2e.ts: -------------------------------------------------------------------------------- 1 | import './commands'; 2 | -------------------------------------------------------------------------------- /index.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'eth-provider'; 2 | -------------------------------------------------------------------------------- /src/styles/variables.css: -------------------------------------------------------------------------------- 1 | body { 2 | --wcm-z-index: 1300; 3 | } 4 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # generated files 2 | src/locales/*.js linguist-vendored 3 | -------------------------------------------------------------------------------- /public/aave_180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/aave_180.png -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /src/uiConfig.ts: -------------------------------------------------------------------------------- 1 | export const uiConfig = { 2 | appLogo: '/aave-com-logo-header.svg', 3 | }; 4 | -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npx --no -- commitlint --edit "${1}" 5 | -------------------------------------------------------------------------------- /public/aave-com-opengraph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/aave-com-opengraph.png -------------------------------------------------------------------------------- /public/illustration_token.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/illustration_token.png -------------------------------------------------------------------------------- /public/fork-config-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fork-config-example.png -------------------------------------------------------------------------------- /public/illustration_borrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/illustration_borrow.png -------------------------------------------------------------------------------- /public/illustration_desktop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/illustration_desktop.png -------------------------------------------------------------------------------- /public/fonts/inter/Inter-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-Bold.woff -------------------------------------------------------------------------------- /public/fonts/inter/Inter-Thin.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-Thin.woff -------------------------------------------------------------------------------- /public/fonts/inter/Inter.var.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter.var.woff2 -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["next/babel"], 3 | "plugins": ["macros", "@babel/plugin-proposal-class-properties"] 4 | } 5 | -------------------------------------------------------------------------------- /public/fonts/inter/Inter-Black.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-Black.woff -------------------------------------------------------------------------------- /public/fonts/inter/Inter-Black.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-Black.woff2 -------------------------------------------------------------------------------- /public/fonts/inter/Inter-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-Bold.woff2 -------------------------------------------------------------------------------- /public/fonts/inter/Inter-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-Italic.woff -------------------------------------------------------------------------------- /public/fonts/inter/Inter-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-Italic.woff2 -------------------------------------------------------------------------------- /public/fonts/inter/Inter-Light.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-Light.woff -------------------------------------------------------------------------------- /public/fonts/inter/Inter-Light.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-Light.woff2 -------------------------------------------------------------------------------- /public/fonts/inter/Inter-Medium.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-Medium.woff -------------------------------------------------------------------------------- /public/fonts/inter/Inter-Medium.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-Medium.woff2 -------------------------------------------------------------------------------- /public/fonts/inter/Inter-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-Regular.woff -------------------------------------------------------------------------------- /public/fonts/inter/Inter-Thin.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-Thin.woff2 -------------------------------------------------------------------------------- /src/components/caps/helper.ts: -------------------------------------------------------------------------------- 1 | export enum CapType { 2 | 'supplyCap' = 'supplyCap', 3 | 'borrowCap' = 'borrowCap', 4 | } 5 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npx lint-staged 5 | yarn i18n 6 | git add ./src/locales 7 | -------------------------------------------------------------------------------- /public/fonts/inter/Inter-ExtraBold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-ExtraBold.woff -------------------------------------------------------------------------------- /public/fonts/inter/Inter-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-Regular.woff2 -------------------------------------------------------------------------------- /public/fonts/inter/Inter-SemiBold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-SemiBold.woff -------------------------------------------------------------------------------- /public/fonts/inter/Inter-SemiBold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-SemiBold.woff2 -------------------------------------------------------------------------------- /public/illustration_friendly_ghost.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/illustration_friendly_ghost.png -------------------------------------------------------------------------------- /public/fonts/inter/Inter-BlackItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-BlackItalic.woff -------------------------------------------------------------------------------- /public/fonts/inter/Inter-BlackItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-BlackItalic.woff2 -------------------------------------------------------------------------------- /public/fonts/inter/Inter-BoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-BoldItalic.woff -------------------------------------------------------------------------------- /public/fonts/inter/Inter-BoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-BoldItalic.woff2 -------------------------------------------------------------------------------- /public/fonts/inter/Inter-ExtraBold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-ExtraBold.woff2 -------------------------------------------------------------------------------- /public/fonts/inter/Inter-ExtraLight.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-ExtraLight.woff -------------------------------------------------------------------------------- /public/fonts/inter/Inter-ExtraLight.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-ExtraLight.woff2 -------------------------------------------------------------------------------- /public/fonts/inter/Inter-LightItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-LightItalic.woff -------------------------------------------------------------------------------- /public/fonts/inter/Inter-LightItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-LightItalic.woff2 -------------------------------------------------------------------------------- /public/fonts/inter/Inter-MediumItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-MediumItalic.woff -------------------------------------------------------------------------------- /public/fonts/inter/Inter-ThinItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-ThinItalic.woff -------------------------------------------------------------------------------- /public/fonts/inter/Inter-ThinItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-ThinItalic.woff2 -------------------------------------------------------------------------------- /public/fonts/inter/Inter-italic.var.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-italic.var.woff2 -------------------------------------------------------------------------------- /public/fonts/inter/Inter-roman.var.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-roman.var.woff2 -------------------------------------------------------------------------------- /src/store/utils/domain-fetchers/index.ts: -------------------------------------------------------------------------------- 1 | import { getEnsDomain } from './ens'; 2 | 3 | export const domainFetchers = [getEnsDomain]; 4 | -------------------------------------------------------------------------------- /public/fonts/inter/Inter-MediumItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-MediumItalic.woff2 -------------------------------------------------------------------------------- /public/fonts/inter/Inter-SemiBoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-SemiBoldItalic.woff -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 100, 3 | "singleQuote": true, 4 | "semi": true, 5 | "tabWidth": 2, 6 | "trailingComma": "es5" 7 | } 8 | -------------------------------------------------------------------------------- /public/fonts/inter/Inter-ExtraBoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-ExtraBoldItalic.woff -------------------------------------------------------------------------------- /public/fonts/inter/Inter-ExtraBoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-ExtraBoldItalic.woff2 -------------------------------------------------------------------------------- /public/fonts/inter/Inter-ExtraLightItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-ExtraLightItalic.woff -------------------------------------------------------------------------------- /public/fonts/inter/Inter-ExtraLightItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-ExtraLightItalic.woff2 -------------------------------------------------------------------------------- /public/fonts/inter/Inter-SemiBoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stalim17/interface/HEAD/public/fonts/inter/Inter-SemiBoldItalic.woff2 -------------------------------------------------------------------------------- /src/utils/eMode.ts: -------------------------------------------------------------------------------- 1 | import { t } from '@lingui/macro'; 2 | 3 | export const eModeInfo: { [key: number]: { label: string } } = { 4 | 1: { 5 | label: t`Stablecoin`, 6 | }, 7 | }; 8 | -------------------------------------------------------------------------------- /src/hooks/commonTypes.ts: -------------------------------------------------------------------------------- 1 | export type HookOpts = { 2 | select?: (originalValue: T) => V; 3 | refetchInterval?: number | false | (() => number | false); 4 | staleTime?: number; 5 | }; 6 | -------------------------------------------------------------------------------- /src/components/transactions/Emode/EmodeNaming.ts: -------------------------------------------------------------------------------- 1 | export const getEmodeMessage = (label: string): string => { 2 | if (label === '') { 3 | return 'Disabled'; 4 | } 5 | return label; 6 | }; 7 | -------------------------------------------------------------------------------- /commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // See https://github.com/conventional-changelog/commitlint/tree/master/@commitlint/config-conventional 3 | extends: ['@commitlint/config-conventional'], 4 | }; 5 | -------------------------------------------------------------------------------- /src/helpers/text-center-ellipsis.ts: -------------------------------------------------------------------------------- 1 | export const textCenterEllipsis = (str: string, from: number, to: number) => { 2 | return `${str.substr(0, from)}...${str.substr(str.length - to, str.length)}`; 3 | }; 4 | -------------------------------------------------------------------------------- /.github/release-template.md: -------------------------------------------------------------------------------- 1 | ### Links to the latest release 2 | 3 | 4 | https://.ipfs.cf-ipfs.com/ 5 | https://.ipfs.dweb.link/ 6 | https://.ipfs.infura-ipfs.io/ 7 | -------------------------------------------------------------------------------- /next-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | 4 | // NOTE: This file should not be edited 5 | // see https://nextjs.org/docs/basic-features/typescript for more information. 6 | -------------------------------------------------------------------------------- /public/icons/flags/jp.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/icons/flags/vt.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/components/transactions/ClaimRewards/constants.ts: -------------------------------------------------------------------------------- 1 | export enum RewardSymbol { 2 | ALL = 'all', 3 | MERIT_ALL = 'merit-all', 4 | PROTOCOL_ALL = 'protocol-all', 5 | } 6 | 7 | export enum ControllerIdentifier { 8 | MERIT_REWARD = 'MERIT_REWARD', 9 | } 10 | -------------------------------------------------------------------------------- /src/hooks/usePreviousState.ts: -------------------------------------------------------------------------------- 1 | import { useEffect, useRef } from 'react'; 2 | 3 | export default function usePreviousState(value: T): T { 4 | const ref = useRef(); 5 | useEffect(() => { 6 | ref.current = value; 7 | }); 8 | return ref.current as T; 9 | } 10 | -------------------------------------------------------------------------------- /public/icons/flags/fr.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/icons/flags/it.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/icons/tokens/xaut0.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | # General Ignores 2 | .gitignore 3 | .prettierignore 4 | .eslintcache 5 | node_modules/ 6 | public/ 7 | 8 | # Artifacts 9 | .next/ 10 | out/ 11 | src/locales/ 12 | 13 | # IDE 14 | .vscode 15 | 16 | # Specific Ignores 17 | *.svg 18 | *.ico 19 | *.json 20 | *.md 21 | *.log 22 | *.lock 23 | -------------------------------------------------------------------------------- /src/components/primitives/NoData.tsx: -------------------------------------------------------------------------------- 1 | import Typography, { TypographyProps } from '@mui/material/Typography'; 2 | import React from 'react'; 3 | 4 | export const NoData = ( 5 | props: TypographyProps 6 | ) => { 7 | return ; 8 | }; 9 | -------------------------------------------------------------------------------- /cypress/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "noEmit": true, 5 | "types": ["cypress", "cypress-wait-until"], 6 | "sourceMap": false, 7 | }, 8 | "include": [ 9 | "../node_modules/cypress", 10 | "./**/*.ts", 11 | "./types/*.d.ts" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /jest.setup.js: -------------------------------------------------------------------------------- 1 | // Optional: configure or set up a testing framework before each test. 2 | // If you delete this file, remove `setupFilesAfterEnv` from `jest.config.js` 3 | 4 | // Used for __tests__/testing-library.js 5 | // Learn more: https://github.com/testing-library/jest-dom 6 | import '@testing-library/jest-dom/extend-expect'; 7 | -------------------------------------------------------------------------------- /public/icons/tokens/fdusd.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/icons/tokens/mkr.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cypress/fixtures/poolConfig.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "bool", 6 | "name": "paused", 7 | "type": "bool" 8 | } 9 | ], 10 | "name": "setPoolPause", 11 | "outputs": [], 12 | "stateMutability": "nonpayable", 13 | "type": "function" 14 | } 15 | ] 16 | -------------------------------------------------------------------------------- /cypress/configs/widgets.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'cypress'; 2 | import { defaultConfig } from './base.cypress'; 3 | 4 | const folder = `./cypress/e2e/5-widgets`; 5 | 6 | export default defineConfig({ 7 | ...defaultConfig, 8 | e2e: { 9 | specPattern: [folder + '**/*.*'], 10 | excludeSpecPattern: [], 11 | }, 12 | }); 13 | -------------------------------------------------------------------------------- /src/components/primitives/Warning.tsx: -------------------------------------------------------------------------------- 1 | import { Alert, AlertProps } from '@mui/material'; 2 | 3 | export const Warning = ({ children, sx, ...rest }: AlertProps) => { 4 | const styles = { mb: 6, alignItems: 'center', width: '100%', ...sx }; 5 | 6 | return ( 7 | 8 | {children} 9 | 10 | ); 11 | }; 12 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # General Ignores 2 | .gitignore 3 | .eslintcache 4 | .eslintignore 5 | .gitattributes 6 | node_modules/ 7 | public/ 8 | .nvmrc 9 | 10 | # Artifacts 11 | .next/ 12 | out/ 13 | src/locales/ 14 | 15 | # IDE 16 | .vscode 17 | 18 | # Env 19 | .env.* 20 | 21 | # Specific Ignores 22 | *.svg 23 | *.ico 24 | *.json 25 | *.md 26 | *.log 27 | *.lock 28 | -------------------------------------------------------------------------------- /cypress/configs/governance-stake.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'cypress'; 2 | import { defaultConfig } from './base.cypress'; 3 | 4 | const folder = `./cypress/e2e/3-stake-governance`; 5 | 6 | export default defineConfig({ 7 | ...defaultConfig, 8 | e2e: { 9 | specPattern: [folder + '**/*.*'], 10 | excludeSpecPattern: [], 11 | }, 12 | }); 13 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # https://editorconfig.org 2 | root = true 3 | 4 | # Base ruleset for all files 5 | [*] 6 | indent_style = space 7 | indent_size = 2 8 | end_of_line = lf 9 | charset = utf-8 10 | trim_trailing_whitespace = true 11 | insert_final_newline = true 12 | 13 | # Allow colons at end of line in markdown files 14 | [.md] 15 | trim_trailing_whitespace = false 16 | -------------------------------------------------------------------------------- /public/icons/tokens/celo.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/createEmotionCache.ts: -------------------------------------------------------------------------------- 1 | import createCache from '@emotion/cache'; 2 | 3 | // prepend: true moves MUI styles to the top of the so they're loaded first. 4 | // It allows developers to easily override MUI styles with other styling solutions, like CSS modules. 5 | export default function createEmotionCache() { 6 | return createCache({ key: 'css', prepend: true }); 7 | } 8 | -------------------------------------------------------------------------------- /public/icons/networks/celo.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/components/Warnings/StETHCollateralWarning.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | 3 | export const StETHCollateralWarning = () => { 4 | return ( 5 | 6 | Due to internal stETH mechanics required for rebasing support, it is not possible to perform a 7 | collateral switch where stETH is the source token. 8 | 9 | ); 10 | }; 11 | -------------------------------------------------------------------------------- /public/icons/networks/base.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /svgo.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | multipass: true, 3 | plugins: [ 4 | { 5 | name: 'preset-default', 6 | params: { 7 | overrides: { 8 | // viewBox is required to resize SVGs with CSS. 9 | // @see https://github.com/svg/svgo/issues/1128 10 | removeViewBox: false, 11 | }, 12 | }, 13 | }, 14 | ], 15 | }; 16 | -------------------------------------------------------------------------------- /cypress/support/tools/math.util.ts: -------------------------------------------------------------------------------- 1 | export function getRoundDegree(number: number) { 2 | let _number = number; 3 | let _degree = 1; 4 | while (_number <= 1) { 5 | _degree = _degree * 10; 6 | _number = number * _degree; 7 | } 8 | return _degree; 9 | } 10 | 11 | export function randomNumber(maxValue: number) { 12 | return Math.floor(Math.random() * maxValue); 13 | } 14 | -------------------------------------------------------------------------------- /src/helpers/toggle-local-storage-click.ts: -------------------------------------------------------------------------------- 1 | export const toggleLocalStorageClick = ( 2 | value: boolean, 3 | func: (val: boolean) => void, 4 | localStorageName: string 5 | ) => { 6 | if (value) { 7 | localStorage.setItem(localStorageName, 'false'); 8 | func(false); 9 | } else { 10 | localStorage.setItem(localStorageName, 'true'); 11 | func(true); 12 | } 13 | }; 14 | -------------------------------------------------------------------------------- /cypress/configs/settings.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'cypress'; 2 | 3 | import { defaultConfig } from './base.cypress'; 4 | 5 | const folder = `./cypress/e2e/2-settings/`; 6 | 7 | export default defineConfig({ 8 | ...defaultConfig, 9 | e2e: { 10 | specPattern: [folder + '**/*.*'], 11 | excludeSpecPattern: ['/**/mobile.cy.ts', '/**/change-languages.cy.ts'], 12 | }, 13 | }); 14 | -------------------------------------------------------------------------------- /cypress/configs/v3-markets/bnb-v3-smoke.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'cypress'; 2 | 3 | import { defaultConfig } from '../base.cypress'; 4 | 5 | const folder = `./cypress/e2e/1-v3-markets/8-bnb-v3-market/`; 6 | 7 | export default defineConfig({ 8 | ...defaultConfig, 9 | e2e: { 10 | specPattern: [folder + '0-assets/bnb.bnb-v3.cy.ts', folder + '0-assets/usdc.bnb-v3.cy.ts'], 11 | }, 12 | }); 13 | -------------------------------------------------------------------------------- /src/components/transactions/Switch/slippage.helpers.ts: -------------------------------------------------------------------------------- 1 | import { getAssetGroup } from 'src/components/transactions/Switch/assetCorrelation.helpers'; 2 | 3 | export const getParaswapSlippage = (inputSymbol: string, outputSymbol: string): string => { 4 | const inputGroup = getAssetGroup(inputSymbol); 5 | const outputGroup = getAssetGroup(outputSymbol); 6 | 7 | return inputGroup === outputGroup ? '0.10' : '0.20'; 8 | }; 9 | -------------------------------------------------------------------------------- /src/hooks/useGasStation.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { GasStationContext } from 'src/components/transactions/GasStation/GasStationProvider'; 3 | 4 | export function useGasStation() { 5 | const context = React.useContext(GasStationContext); 6 | 7 | if (context === undefined) { 8 | throw new Error('useGasStation must be used within a GasStationProvider'); 9 | } 10 | return context; 11 | } 12 | -------------------------------------------------------------------------------- /cypress/configs/v2-markets/ethereum-v2-smoke.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'cypress'; 2 | 3 | import { defaultConfig } from '../base.cypress'; 4 | 5 | const folder = `./cypress/e2e/0-v2-markets/0-main-v2-market/`; 6 | 7 | export default defineConfig({ 8 | ...defaultConfig, 9 | e2e: { 10 | specPattern: [folder + '0-assets/eth.aave-v2.cy.ts', folder + '0-assets/dai.aave-v2.cy.ts'], 11 | }, 12 | }); 13 | -------------------------------------------------------------------------------- /cypress/configs/v3-markets/base-v3-smoke.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'cypress'; 2 | 3 | import { defaultConfig } from '../base.cypress'; 4 | 5 | const folder = `./cypress/e2e/1-v3-markets/6-base-v3-market/`; 6 | 7 | export default defineConfig({ 8 | ...defaultConfig, 9 | e2e: { 10 | specPattern: [folder + '0-assets/weth.base-v3.cy.ts', folder + '0-assets/usdbc.base-v3.cy.ts'], 11 | }, 12 | }); 13 | -------------------------------------------------------------------------------- /cypress/configs/general.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'cypress'; 2 | 3 | import { defaultConfig } from './base.cypress'; 4 | 5 | export default defineConfig({ 6 | ...defaultConfig, 7 | e2e: { 8 | specPattern: [ 9 | './cypress/e2e/1-v3-markets/10-metis-v3-market/general.metis-v3.cy.ts', 10 | './cypress/e2e/1-v3-markets/11-scroll-v3-market/general.scroll-v3.cy.ts', 11 | ], 12 | }, 13 | }); 14 | -------------------------------------------------------------------------------- /cypress/configs/v3-markets/base-v3-full.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'cypress'; 2 | 3 | import { defaultConfig } from '../base.cypress'; 4 | 5 | const folder = `./cypress/e2e/1-v3-markets/6-base-v3-market/`; 6 | 7 | export default defineConfig({ 8 | ...defaultConfig, 9 | e2e: { 10 | specPattern: [folder + '**/*.*'], 11 | excludeSpecPattern: ['/**/weth.base-v3.cy.ts', '/**/usdbc.base-v3.cy.ts'], 12 | }, 13 | }); 14 | -------------------------------------------------------------------------------- /public/icons/tokens/usdt0.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/icons/tokens/usd₮0.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cypress/configs/v3-markets/gnosis-v3-full.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'cypress'; 2 | 3 | import { defaultConfig } from '../base.cypress'; 4 | 5 | const folder = `./cypress/e2e/1-v3-markets/7-gnosis-v3-market/`; 6 | 7 | export default defineConfig({ 8 | ...defaultConfig, 9 | e2e: { 10 | specPattern: [folder + '**/*.*'], 11 | excludeSpecPattern: ['/**/usdc.gnosis-v3.cy.ts', '/**/xdai.gnosis-v3.cy.ts'], 12 | }, 13 | }); 14 | -------------------------------------------------------------------------------- /public/icons/staking/trust-staking-icon.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "Aave", 3 | "name": "Aave", 4 | "description": "Non-custodial liquidity protocol", 5 | "iconPath": "aave.svg", 6 | "icons": [ 7 | { 8 | "src": "favicon32.png", 9 | "sizes": "32x32", 10 | "type": "image/png" 11 | } 12 | ], 13 | "start_url": "./index.html", 14 | "display": "standalone", 15 | "theme_color": "#1B2030", 16 | "background_color": "#ffffff" 17 | } 18 | -------------------------------------------------------------------------------- /cypress/configs/v3-markets/ethereum-v3-full.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'cypress'; 2 | 3 | import { defaultConfig } from '../base.cypress'; 4 | 5 | const folder = `./cypress/e2e/1-v3-markets/0-ethereum-v3-market/`; 6 | 7 | export default defineConfig({ 8 | ...defaultConfig, 9 | e2e: { 10 | specPattern: [folder + '**/*.*'], 11 | excludeSpecPattern: ['/**/eth.ethereum-v3.cy.ts', '/**/dai.ethereum-v3.cy.ts'], 12 | }, 13 | }); 14 | -------------------------------------------------------------------------------- /src/components/transactions/FlowCommons/TxModalTitle.tsx: -------------------------------------------------------------------------------- 1 | import { Typography } from '@mui/material'; 2 | import { ReactNode } from 'react'; 3 | 4 | export type TxModalTitleProps = { 5 | title: ReactNode; 6 | symbol?: string; 7 | }; 8 | 9 | export const TxModalTitle = ({ title, symbol }: TxModalTitleProps) => { 10 | return ( 11 | 12 | {title} {symbol ?? ''} 13 | 14 | ); 15 | }; 16 | -------------------------------------------------------------------------------- /src/utils/__tests__/marketsAndNetworkConfig.spec.ts: -------------------------------------------------------------------------------- 1 | import { ChainId } from '@aave/contract-helpers'; 2 | 3 | import { getProvider } from '../marketsAndNetworksConfig'; 4 | import { RotationProvider } from '../rotationProvider'; 5 | 6 | it('should use a RotationProvider when there are multiple rpc urls configured for a network', () => { 7 | const provider = getProvider(ChainId.mainnet); 8 | expect(provider).toBeInstanceOf(RotationProvider); 9 | }); 10 | -------------------------------------------------------------------------------- /cypress/configs/v3-markets/gnosis-v3-smoke.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'cypress'; 2 | 3 | import { defaultConfig } from '../base.cypress'; 4 | 5 | const folder = `./cypress/e2e/1-v3-markets/7-gnosis-v3-market/`; 6 | 7 | export default defineConfig({ 8 | ...defaultConfig, 9 | e2e: { 10 | specPattern: [ 11 | folder + '0-assets/usdc.gnosis-v3.cy.ts', 12 | folder + '0-assets/sdai.gnosis-v3.cy.ts', 13 | ], 14 | }, 15 | }); 16 | -------------------------------------------------------------------------------- /public/icons/flags/el.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/components/infoTooltips/TotalBorrowAPYTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | 3 | import { TextWithTooltip, TextWithTooltipProps } from '../TextWithTooltip'; 4 | 5 | export const TotalBorrowAPYTooltip = ({ ...rest }: TextWithTooltipProps) => { 6 | return ( 7 | 8 | The weighted average of APY for all borrowed assets, including incentives. 9 | 10 | ); 11 | }; 12 | -------------------------------------------------------------------------------- /src/components/infoTooltips/TotalSupplyAPYTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | 3 | import { TextWithTooltip, TextWithTooltipProps } from '../TextWithTooltip'; 4 | 5 | export const TotalSupplyAPYTooltip = ({ ...rest }: TextWithTooltipProps) => { 6 | return ( 7 | 8 | The weighted average of APY for all supplied assets, including incentives. 9 | 10 | ); 11 | }; 12 | -------------------------------------------------------------------------------- /cypress/configs/v3-markets/arbitrum-v3-smoke.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'cypress'; 2 | 3 | import { defaultConfig } from '../base.cypress'; 4 | 5 | const folder = `./cypress/e2e/1-v3-markets/1-arbitrum-v3-market/`; 6 | 7 | export default defineConfig({ 8 | ...defaultConfig, 9 | e2e: { 10 | specPattern: [ 11 | folder + '0-assets/eth.arbitrum-v3.cy.ts', 12 | folder + '0-assets/usdt.arbitrum-v3.cy.ts', 13 | ], 14 | }, 15 | }); 16 | -------------------------------------------------------------------------------- /cypress/configs/v3-markets/ethereum-v3-smoke.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'cypress'; 2 | 3 | import { defaultConfig } from '../base.cypress'; 4 | 5 | const folder = `./cypress/e2e/1-v3-markets/0-ethereum-v3-market/`; 6 | 7 | export default defineConfig({ 8 | ...defaultConfig, 9 | e2e: { 10 | specPattern: [ 11 | folder + '0-assets/eth.ethereum-v3.cy.ts', 12 | folder + '0-assets/dai.ethereum-v3.cy.ts', 13 | ], 14 | }, 15 | }); 16 | -------------------------------------------------------------------------------- /cypress/configs/v3-markets/optimism-v3-smoke.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'cypress'; 2 | 3 | import { defaultConfig } from '../base.cypress'; 4 | 5 | const folder = `./cypress/e2e/1-v3-markets/4-optimism-v3-market/`; 6 | 7 | export default defineConfig({ 8 | ...defaultConfig, 9 | e2e: { 10 | specPattern: [ 11 | folder + '0-assets/eth.optimism-v3.cy.ts', 12 | folder + '0-assets/dai.optimism-v3.cy.ts', 13 | ], 14 | }, 15 | }); 16 | -------------------------------------------------------------------------------- /cypress/configs/v3-markets/arbitrum-v3-additional.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'cypress'; 2 | 3 | import { defaultConfig } from '../base.cypress'; 4 | 5 | const folder = `./cypress/e2e/1-v3-markets/1-arbitrum-v3-market/`; 6 | 7 | export default defineConfig({ 8 | ...defaultConfig, 9 | e2e: { 10 | specPattern: [ 11 | folder + 'e-mode.arbitrum-v3.cy.ts', 12 | folder + 'critical-conditions.arbitrum-v3.cy.ts', 13 | ], 14 | }, 15 | }); 16 | -------------------------------------------------------------------------------- /cypress/configs/v3-markets/avalanche-v3-smoke.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'cypress'; 2 | 3 | import { defaultConfig } from '../base.cypress'; 4 | 5 | const folder = `./cypress/e2e/1-v3-markets/2-avalanche-v3-market/`; 6 | 7 | export default defineConfig({ 8 | ...defaultConfig, 9 | e2e: { 10 | specPattern: [ 11 | folder + '0-assets/avax.avalanche-v3.cy.ts', 12 | folder + '0-assets/dai.avalanche-v3.cy.ts', 13 | ], 14 | }, 15 | }); 16 | -------------------------------------------------------------------------------- /cypress/configs/v3-markets/optimism-v3-additional.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'cypress'; 2 | 3 | import { defaultConfig } from '../base.cypress'; 4 | 5 | const folder = `./cypress/e2e/1-v3-markets/4-optimism-v3-market/`; 6 | 7 | export default defineConfig({ 8 | ...defaultConfig, 9 | e2e: { 10 | specPattern: [ 11 | folder + 'critical-conditions.optimism-v3.cy.ts', 12 | folder + 'e-mode.optimism-v3.cy.ts', 13 | ], 14 | }, 15 | }); 16 | -------------------------------------------------------------------------------- /cypress/configs/v3-markets/ethereum-v3-additional.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'cypress'; 2 | 3 | import { defaultConfig } from '../base.cypress'; 4 | 5 | const folder = `./cypress/e2e/1-v3-markets/0-ethereum-v3-market/`; 6 | 7 | export default defineConfig({ 8 | ...defaultConfig, 9 | e2e: { 10 | specPattern: [ 11 | folder + '/**/swap.ethereum-v3.cy.ts', 12 | folder + '/**/critical-conditions.ethereum-v3.cy.ts', 13 | ], 14 | }, 15 | }); 16 | -------------------------------------------------------------------------------- /src/components/infoTooltips/NetworkCostTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | 3 | import { TextWithTooltip } from '../TextWithTooltip'; 4 | 5 | export const NetworkCostTooltip = () => { 6 | return ( 7 | Network costs}> 8 | 9 | This is the cost of settling your order on-chain, including gas and any LP fees. 10 | 11 | 12 | ); 13 | }; 14 | -------------------------------------------------------------------------------- /src/components/infoTooltips/VariableAPYTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | 3 | import { TextWithTooltip, TextWithTooltipProps } from '../TextWithTooltip'; 4 | 5 | export const VariableAPYTooltip = ({ ...rest }: TextWithTooltipProps) => { 6 | return ( 7 | 8 | 9 | Variable interest rate will fluctuate based on the market conditions. 10 | 11 | 12 | ); 13 | }; 14 | -------------------------------------------------------------------------------- /public/icons/flags/cn.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cypress/configs/v2-markets/ethereum-v2-full.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'cypress'; 2 | 3 | import { defaultConfig } from '../base.cypress'; 4 | 5 | const folder = `./cypress/e2e/0-v2-markets/0-main-v2-market/`; 6 | 7 | export default defineConfig({ 8 | ...defaultConfig, 9 | e2e: { 10 | specPattern: [ 11 | folder + '0-assets/usdt.aave-v2.cy.ts', 12 | folder + 'swap.aave-v2.cy.ts', 13 | folder + 'switch.aave-v2.cy.ts', 14 | ], 15 | }, 16 | }); 17 | -------------------------------------------------------------------------------- /public/icons/tokens/zk.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/icons/tokens/pol.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/lightningBoltGradient.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/icons/networks/zksync.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/icons/tokens/wpol.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/hooks/governance/useRepresentatives.ts: -------------------------------------------------------------------------------- 1 | import { useQuery } from '@tanstack/react-query'; 2 | import { useSharedDependencies } from 'src/ui-config/SharedDependenciesProvider'; 3 | 4 | export const useRepresentatives = (user: string) => { 5 | const { governanceV3Service } = useSharedDependencies(); 6 | return useQuery({ 7 | queryFn: () => governanceV3Service.getRepresentationData(user), 8 | queryKey: ['governance', user, 'representatives'], 9 | enabled: !!user, 10 | }); 11 | }; 12 | -------------------------------------------------------------------------------- /src/modules/dashboard/lists/constants.ts: -------------------------------------------------------------------------------- 1 | import { CustomMarket } from 'src/ui-config/marketsConfig'; 2 | 3 | export const HIDDEN_ASSETS: Partial> = { 4 | // [CustomMarket.proto_horizon_v3]: [ 5 | // '0x2255718832bc9fd3be1caf75084f4803da14ff01'.toLowerCase(), // VBILL 6 | // ], 7 | }; 8 | 9 | export const isAssetHidden = (market: CustomMarket, underlyingAsset: string) => { 10 | return HIDDEN_ASSETS[market]?.includes(underlyingAsset.toLowerCase()); 11 | }; 12 | -------------------------------------------------------------------------------- /src/components/transactions/Bridge/BridgeModal.tsx: -------------------------------------------------------------------------------- 1 | import { BasicModal } from 'src/components/primitives/BasicModal'; 2 | import { ModalType, useModalContext } from 'src/hooks/useModal'; 3 | 4 | import { BridgeModalContent } from './BridgeModalContent'; 5 | 6 | export const BridgeModal = () => { 7 | const { type, close } = useModalContext(); 8 | return ( 9 | 10 | 11 | 12 | ); 13 | }; 14 | -------------------------------------------------------------------------------- /.linguirc: -------------------------------------------------------------------------------- 1 | { 2 | "locales": [ 3 | "en", 4 | "es", 5 | "fr", 6 | "el" 7 | ], 8 | "catalogs": [ 9 | { 10 | "path": "src/locales/{locale}/messages", 11 | "include": [ 12 | "src", 13 | "pages" 14 | ] 15 | } 16 | ], 17 | "format": "po", 18 | "formatOptions": { 19 | "origins": true, 20 | "lineNumbers": false 21 | }, 22 | "orderBy": "messageId", 23 | "sourceLocale": "en", 24 | "fallbackLocales": { 25 | "default": "en" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/modules/dashboard/DashboardContentNoData.tsx: -------------------------------------------------------------------------------- 1 | import { Box, Typography } from '@mui/material'; 2 | import { ReactNode } from 'react'; 3 | 4 | interface DashboardContentNoDataProps { 5 | text: ReactNode; 6 | } 7 | 8 | export const DashboardContentNoData = ({ text }: DashboardContentNoDataProps) => { 9 | return ( 10 | 11 | {text} 12 | 13 | ); 14 | }; 15 | -------------------------------------------------------------------------------- /.env.development: -------------------------------------------------------------------------------- 1 | NEXT_PUBLIC_ENV=prod 2 | NEXT_PUBLIC_API_BASEURL=https://aave-api-v2.aave.com 3 | NEXT_PUBLIC_FIAT_ON_RAMP=false 4 | #NEXT_PUBLIC_FORK_BASE_CHAIN_ID=1 5 | #NEXT_PUBLIC_FORK_CHAIN_ID=1 6 | #NEXT_PUBLIC_FORK_URL_RPC="https://rpc.tenderly.co/fork/1234567" 7 | NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID= 8 | NEXT_PUBLIC_ENABLE_STAKING=true 9 | NEXT_PUBLIC_ENABLE_GOVERNANCE=true 10 | NEXT_PUBLIC_API_BASEURL=https://aave-api-v2.aave.com 11 | NEXT_PUBLIC_SUBGRAPH_API_KEY= 12 | FAMILY_API_KEY= 13 | FAMILY_API_URL= 14 | -------------------------------------------------------------------------------- /src/components/infoTooltips/CollateralTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | 3 | import { TextWithTooltip, TextWithTooltipProps } from '../TextWithTooltip'; 4 | 5 | export const CollateralTooltip = ({ ...rest }: TextWithTooltipProps) => { 6 | return ( 7 | 8 | 9 | The total amount of your assets denominated in USD that can be used as collateral for 10 | borrowing assets. 11 | 12 | 13 | ); 14 | }; 15 | -------------------------------------------------------------------------------- /src/components/infoTooltips/ReadOnlyModeTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | 3 | import { TextWithTooltip, TextWithTooltipProps } from '../TextWithTooltip'; 4 | 5 | export const ReadOnlyModeTooltip = ({ ...rest }: TextWithTooltipProps) => { 6 | return ( 7 | 8 | 9 | Read-only mode allows to see address positions in Aave, but you won't be able to 10 | perform transactions. 11 | 12 | 13 | ); 14 | }; 15 | -------------------------------------------------------------------------------- /src/components/Warnings/AMPLWarning.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | 3 | import { Link } from '../primitives/Link'; 4 | 5 | export const AMPLWarning = () => { 6 | return ( 7 | 8 | Ampleforth is a rebasing asset. Visit the{' '} 9 | 13 | documentation 14 | {' '} 15 | to learn more. 16 | 17 | ); 18 | }; 19 | -------------------------------------------------------------------------------- /public/icons/flags/tr.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cypress/configs/v3-markets/polygon-v3-smoke.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'cypress'; 2 | 3 | import { defaultConfig } from '../base.cypress'; 4 | 5 | const folder = `./cypress/e2e/1-v3-markets/3-polygon-v3-market/`; 6 | 7 | // eslint-disable-next-line @typescript-eslint/ban-ts-comment 8 | // @ts-ignore 9 | export default defineConfig({ 10 | ...defaultConfig, 11 | e2e: { 12 | specPattern: [ 13 | folder + '0-assets/matic.polygon-v3.cy.ts', 14 | folder + '0-assets/dai.polygon-v3.cy.ts', 15 | ], 16 | }, 17 | }); 18 | -------------------------------------------------------------------------------- /public/icons/tokens/sd.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/components/infoTooltips/BorrowPowerTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | 3 | import { TextWithTooltip, TextWithTooltipProps } from '../TextWithTooltip'; 4 | 5 | export const BorrowPowerTooltip = ({ ...rest }: TextWithTooltipProps) => { 6 | return ( 7 | 8 | 9 | The % of your total borrowing power used. This is based on the amount of your collateral 10 | supplied and the total amount that you can borrow. 11 | 12 | 13 | ); 14 | }; 15 | -------------------------------------------------------------------------------- /src/components/primitives/TypographyGradient.tsx: -------------------------------------------------------------------------------- 1 | import { Typography, TypographyProps } from '@mui/material'; 2 | 3 | export const TypographyGradient = ({ ...rest }: TypographyProps) => { 4 | return ( 5 | ({ 7 | color: 'transparent', 8 | backgroundClip: 'text !important', 9 | webkitTextFillColor: 'transparent', 10 | background: theme.palette.gradients.aaveGradient, 11 | })} 12 | {...rest} 13 | > 14 | {rest.children} 15 | 16 | ); 17 | }; 18 | -------------------------------------------------------------------------------- /src/utils/tFetch.ts: -------------------------------------------------------------------------------- 1 | export const tFetch = (url: string, opts?: RequestInit): Promise => { 2 | return fetch(url, opts).then((response) => { 3 | if (!response.ok) { 4 | throw new Error(response.statusText); 5 | } 6 | // HEAD Method doesn't return anything in the body, so response.json() fails, since it's only a method to check 7 | // if the resource is available it's okay to return never 8 | if (opts?.method === 'HEAD') return Promise.resolve() as Promise; 9 | return response.json() as Promise; 10 | }); 11 | }; 12 | -------------------------------------------------------------------------------- /.github/workflows/dependency-review.yml: -------------------------------------------------------------------------------- 1 | name: 'Dependency Review' 2 | on: [pull_request] 3 | 4 | permissions: 5 | contents: read 6 | pull-requests: write 7 | 8 | jobs: 9 | dependency-review: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: 'Checkout Repository' 13 | uses: actions/checkout@v5 14 | - name: 'Dependency Review' 15 | uses: actions/dependency-review-action@v4 16 | with: 17 | comment-summary-in-pr: on-failure 18 | fail-on-severity: moderate 19 | license-check: false 20 | -------------------------------------------------------------------------------- /public/icons/tokens/link.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/icons/tokens/busd.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/components/infoTooltips/StableAPYTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | 3 | import { TextWithTooltip, TextWithTooltipProps } from '../TextWithTooltip'; 4 | 5 | export const StableAPYTooltip = ({ ...rest }: TextWithTooltipProps) => { 6 | return ( 7 | 8 | 9 | Stable interest rate will stay the same for the duration of your loan. Recommended 10 | for long-term loan periods and for users who prefer predictability. 11 | 12 | 13 | ); 14 | }; 15 | -------------------------------------------------------------------------------- /src/hooks/governance/usePayloadsData.ts: -------------------------------------------------------------------------------- 1 | import { useQuery } from '@tanstack/react-query'; 2 | import { PayloadParams } from 'src/services/GovernanceV3Service'; 3 | import { useSharedDependencies } from 'src/ui-config/SharedDependenciesProvider'; 4 | 5 | export const usePayloadsData = (params: PayloadParams[]) => { 6 | const { governanceV3Service } = useSharedDependencies(); 7 | return useQuery({ 8 | queryFn: () => governanceV3Service.getMultiChainPayloadsData(params), 9 | queryKey: ['payloadsData'], 10 | enabled: params.length > 0, 11 | }); 12 | }; 13 | -------------------------------------------------------------------------------- /cypress/configs/v3-markets/optimism-v3-full.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'cypress'; 2 | 3 | import { defaultConfig } from '../base.cypress'; 4 | 5 | const folder = `./cypress/e2e/1-v3-markets/4-optimism-v3-market/`; 6 | 7 | export default defineConfig({ 8 | ...defaultConfig, 9 | e2e: { 10 | specPattern: [ 11 | folder + '0-assets/usdt.optimism-v3.cy.ts', 12 | folder + '0-assets/wbtc.optimism-v3.cy.ts', 13 | folder + 'critical-conditions.optimism-v3.cy.ts', 14 | folder + 'e-mode.optimism-v3.cy.ts', 15 | ], 16 | }, 17 | }); 18 | -------------------------------------------------------------------------------- /public/icons/networks/ethereum.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/components/infoTooltips/CollateralSwitchTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | 3 | import { TextWithTooltip, TextWithTooltipProps } from '../TextWithTooltip'; 4 | 5 | export const CollateralSwitchTooltip = ({ ...rest }: TextWithTooltipProps) => { 6 | return ( 7 | 8 | 9 | Allows you to decide whether to use a supplied asset as collateral. An asset used as 10 | collateral will affect your borrowing power and health factor. 11 | 12 | 13 | ); 14 | }; 15 | -------------------------------------------------------------------------------- /src/components/infoTooltips/StETHCollateralToolTip.tsx: -------------------------------------------------------------------------------- 1 | import { ExclamationIcon } from '@heroicons/react/outline'; 2 | 3 | import { TextWithTooltip } from '../TextWithTooltip'; 4 | import { StETHCollateralWarning } from '../Warnings/StETHCollateralWarning'; 5 | 6 | export const StETHCollateralToolTip = () => { 7 | return ( 8 | } 13 | > 14 | 15 | 16 | ); 17 | }; 18 | -------------------------------------------------------------------------------- /src/components/infoTooltips/GhoRateTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | 3 | import { TextWithTooltip, TextWithTooltipProps } from '../TextWithTooltip'; 4 | 5 | export const GhoRateTooltip = ({ ...rest }: TextWithTooltipProps) => { 6 | return ( 7 | 8 | 9 | Estimated compounding interest rate, that is determined by Aave Governance. This rate may be 10 | changed over time depending on the need for the GHO supply to contract/expand. 11 | 12 | 13 | ); 14 | }; 15 | -------------------------------------------------------------------------------- /cypress/configs/v3-markets/arbitrum-v3-full.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'cypress'; 2 | 3 | import { defaultConfig } from '../base.cypress'; 4 | 5 | const folder = `./cypress/e2e/1-v3-markets/1-arbitrum-v3-market/`; 6 | 7 | export default defineConfig({ 8 | ...defaultConfig, 9 | e2e: { 10 | specPattern: [folder + '**/*.*'], 11 | excludeSpecPattern: [ 12 | '/**/eth.arbitrum-v3.cy.ts', 13 | '/**/usdt.arbitrum-v3.cy.ts', 14 | '/**/e-mode.arbitrum-v3.cy.ts', 15 | '/**/critical-conditions.arbitrum-v3.cy.ts', 16 | ], 17 | }, 18 | }); 19 | -------------------------------------------------------------------------------- /src/components/infoTooltips/NetAPYTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | 3 | import { TextWithTooltip, TextWithTooltipProps } from '../TextWithTooltip'; 4 | 5 | export const NetAPYTooltip = ({ ...rest }: TextWithTooltipProps) => { 6 | return ( 7 | 8 | 9 | Net APY is the combined effect of all supply and borrow positions on net worth, including 10 | incentives. It is possible to have a negative net APY if debt APY is higher than supply APY. 11 | 12 | 13 | ); 14 | }; 15 | -------------------------------------------------------------------------------- /src/components/transactions/Warnings/CowLowerThanMarketWarning.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import { Typography } from '@mui/material'; 3 | import { Warning } from 'src/components/primitives/Warning'; 4 | 5 | export const CowLowerThanMarketWarning = () => { 6 | return ( 7 | 8 | 9 | 10 | The selected rate is lower than the market price. You might incur a loss if you proceed. 11 | 12 | 13 | 14 | ); 15 | }; 16 | -------------------------------------------------------------------------------- /src/components/ContentContainer.tsx: -------------------------------------------------------------------------------- 1 | import { Box, Container } from '@mui/material'; 2 | import { ReactNode } from 'react'; 3 | 4 | interface ContentContainerProps { 5 | children: ReactNode; 6 | } 7 | 8 | export const ContentContainer = ({ children }: ContentContainerProps) => { 9 | return ( 10 | 18 | {children} 19 | 20 | ); 21 | }; 22 | -------------------------------------------------------------------------------- /pages/index.page.tsx: -------------------------------------------------------------------------------- 1 | import { MainLayout } from '../src/layouts/MainLayout'; 2 | import { useWeb3Context } from '../src/libs/hooks/useWeb3Context'; 3 | import Dashboard from './dashboard.page'; 4 | import Markets from './markets.page'; 5 | 6 | export default function Home() { 7 | const { currentAccount } = useWeb3Context(); 8 | 9 | // Show dashboard if wallet is connected, otherwise show markets 10 | return currentAccount ? : ; 11 | } 12 | 13 | Home.getLayout = function getLayout(page: React.ReactElement) { 14 | return {page}; 15 | }; 16 | -------------------------------------------------------------------------------- /public/icons/markets/linea.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/icons/networks/linea.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/icons/tokens/ezeth.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/icons/tokens/ldo.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/components/transactions/StakingMigrate/StakingMigrateModal.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { BasicModal } from 'src/components/primitives/BasicModal'; 3 | import { ModalType, useModalContext } from 'src/hooks/useModal'; 4 | 5 | import { StakingMigrateModalContent } from './StakingMigrateModalContent'; 6 | 7 | export const StakingMigrateModal = () => { 8 | const { type, close } = useModalContext(); 9 | 10 | return ( 11 | 12 | 13 | 14 | ); 15 | }; 16 | -------------------------------------------------------------------------------- /src/modules/umbrella/helpers/StakedUnderlyingTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import { TextWithTooltip } from 'src/components/TextWithTooltip'; 3 | 4 | export const StakedUnderlyingTooltip = () => { 5 | return ( 6 | Staked Underlying}> 7 | <> 8 | 9 | Total amount of underlying assets staked. This number represents the combined sum of your 10 | original asset and the corresponding aTokens staked in Umbrella. 11 | 12 | 13 | 14 | ); 15 | }; 16 | -------------------------------------------------------------------------------- /src/components/transactions/Warnings/USDTResetWarning.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import { Typography } from '@mui/material'; 3 | import { Warning } from 'src/components/primitives/Warning'; 4 | 5 | export const USDTResetWarning = () => { 6 | return ( 7 | 8 | 9 | 10 | USDT on Ethereum requires approval reset before a new approval. This will require an 11 | additional transaction. 12 | 13 | 14 | 15 | ); 16 | }; 17 | -------------------------------------------------------------------------------- /src/hooks/useIsWrongNetwork.tsx: -------------------------------------------------------------------------------- 1 | import { useWeb3Context } from 'src/libs/hooks/useWeb3Context'; 2 | import { useRootStore } from 'src/store/root'; 3 | 4 | export function useIsWrongNetwork(_requiredChainId?: number) { 5 | const currentChainId = useRootStore((store) => store.currentChainId); 6 | const { chainId: connectedChainId } = useWeb3Context(); 7 | 8 | const requiredChainId = _requiredChainId ? _requiredChainId : currentChainId; 9 | 10 | const isWrongNetwork = connectedChainId !== requiredChainId; 11 | 12 | return { 13 | isWrongNetwork, 14 | requiredChainId, 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /src/components/transactions/Switch/cowprotocol/CowOrderToast.tsx: -------------------------------------------------------------------------------- 1 | import { useTheme } from '@mui/material'; 2 | import { Toaster } from 'sonner'; 3 | 4 | export const CowOrderToast = () => { 5 | const theme = useTheme(); 6 | 7 | return ( 8 | 19 | ); 20 | }; 21 | -------------------------------------------------------------------------------- /src/layouts/components/MobileCloseButton.tsx: -------------------------------------------------------------------------------- 1 | import { XIcon } from '@heroicons/react/outline'; 2 | import { IconButton, SvgIcon } from '@mui/material'; 3 | import React from 'react'; 4 | 5 | interface MobileCloseButtonProps { 6 | setOpen: (value: boolean) => void; 7 | } 8 | 9 | export const MobileCloseButton = ({ setOpen }: MobileCloseButtonProps) => { 10 | return ( 11 | setOpen(false)} sx={{ p: 0, mr: { xs: -2, xsm: 1 } }}> 12 | 13 | 14 | 15 | 16 | ); 17 | }; 18 | -------------------------------------------------------------------------------- /cypress/configs/v3-markets/avalanche-v3-additional.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'cypress'; 2 | 3 | import { defaultConfig } from '../base.cypress'; 4 | 5 | const folder = `./cypress/e2e/1-v3-markets/2-avalanche-v3-market/`; 6 | 7 | export default defineConfig({ 8 | ...defaultConfig, 9 | e2e: { 10 | specPattern: [ 11 | folder + 'swap.avalanche-v3.cy.ts', 12 | folder + 'e-mode.avalanche-v3.cy.ts', 13 | folder + 'isolated-mode.avalanche-v3.cy.ts', 14 | folder + 'critical-conditions.avalanche-v3.cy.ts', 15 | folder + 'switch.avalanche-v3.cy.ts', 16 | ], 17 | }, 18 | }); 19 | -------------------------------------------------------------------------------- /public/icons/tokens/fei.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cypress/fixtures/donors.json: -------------------------------------------------------------------------------- 1 | { 2 | "stkAAVE": { 3 | "name": "stkAAVE", 4 | "donorWalletAddress": "0xaFDAbFb6227507fF6522b8a242168F6b5F353a6E", 5 | "tokenAddress": "0x4da27a545c0c5B758a6BA100e3a049001de870f5" 6 | }, 7 | "aAAVE": { 8 | "name": "aAAVE", 9 | "donorWalletAddress": "0xE466d6Cf6E2C3F3f8345d39633d4A968EC879bD5", 10 | "tokenAddress": "0xFFC97d72E13E01096502Cb8Eb52dEe56f74DAD7B" 11 | }, 12 | "aDAI": { 13 | "name": "aDAI", 14 | "donorWalletAddress": "0x2DEE59010CBb5DD5dfC4aB90F7A63C423041B2Bb", 15 | "tokenAddress": "0x018008bfb33d285247A21d44E50697654f754e63" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /public/icons/other/aci-black.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/modules/umbrella/NoStakeAssets.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import { Box, Typography } from '@mui/material'; 3 | 4 | export const NoStakeAssets = () => { 5 | return ( 6 | 17 | 18 | There are no stake assets configured for this market 19 | 20 | 21 | ); 22 | }; 23 | -------------------------------------------------------------------------------- /public/icons/other/aci-white.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/icons/tokens/knc.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /pages/_error.page.tsx: -------------------------------------------------------------------------------- 1 | import type { NextPageContext } from 'next'; 2 | import Error from 'next/error'; 3 | 4 | type ErrorPageProps = { 5 | statusCode: number; 6 | }; 7 | 8 | function ErrorPage({ statusCode }: ErrorPageProps) { 9 | return ; 10 | } 11 | 12 | ErrorPage.getInitialProps = (ctx: NextPageContext) => { 13 | const { res, err } = ctx; 14 | // Inspect the status code and show the given template based off of it 15 | // Default to 404 page 16 | const statusCode = res ? res.statusCode : err ? err.statusCode : 404; 17 | return { statusCode }; 18 | }; 19 | 20 | export default ErrorPage; 21 | -------------------------------------------------------------------------------- /src/hooks/useSonicIncentives.tsx: -------------------------------------------------------------------------------- 1 | import { AaveV3Sonic } from '@bgd-labs/aave-address-book'; 2 | 3 | const getSonicData = (assetAddress: string): number | undefined => SONIC_DATA_MAP.get(assetAddress); 4 | 5 | const SONIC_DATA_MAP: Map = new Map([ 6 | [AaveV3Sonic.ASSETS.WETH.A_TOKEN, 4], 7 | [AaveV3Sonic.ASSETS.USDC.A_TOKEN, 8], 8 | [AaveV3Sonic.ASSETS.wS.A_TOKEN, 12], 9 | [AaveV3Sonic.ASSETS.stS.A_TOKEN, 12], 10 | ]); 11 | 12 | export const useSonicIncentives = (rewardedAsset?: string) => { 13 | if (!rewardedAsset) { 14 | return undefined; 15 | } 16 | 17 | return getSonicData(rewardedAsset); 18 | }; 19 | -------------------------------------------------------------------------------- /src/modules/dashboard/lists/ListBottomText.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import { Typography } from '@mui/material'; 3 | 4 | import { Link } from '../../../components/primitives/Link'; 5 | 6 | export const ListBottomText = () => { 7 | return ( 8 | 9 | 10 | Since this is a test network, you can get any of the assets if you have ETH on your wallet 11 | 12 | 13 | Faucet 14 | 15 | . 16 | 17 | ); 18 | }; 19 | -------------------------------------------------------------------------------- /cypress/configs/v2-markets/ethereum-v2-additional.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'cypress'; 2 | 3 | import { defaultConfig } from '../base.cypress'; 4 | 5 | const folder = `./cypress/e2e/0-v2-markets/0-main-v2-market/`; 6 | 7 | export default defineConfig({ 8 | ...defaultConfig, 9 | defaultCommandTimeout: 80000, 10 | e2e: { 11 | specPattern: [ 12 | folder + '/**/swap.aave-v2.cy.ts', 13 | folder + '/**/reward.aave-v2.cy.ts', 14 | folder + '/**/critical-conditions.aave-v2.cy.ts', 15 | folder + '/**/migration.aave-v2.cy.ts', 16 | folder + '/**/switch.aave-v2.cy.ts', 17 | ], 18 | }, 19 | }); 20 | -------------------------------------------------------------------------------- /public/icons/tokens/bat.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/components/transactions/GovRepresentatives/GovRepresentativesModal.tsx: -------------------------------------------------------------------------------- 1 | import { BasicModal } from 'src/components/primitives/BasicModal'; 2 | import { ModalType, useModalContext } from 'src/hooks/useModal'; 3 | 4 | import { GovRepresentativesContent } from './GovRepresentativesModalContent'; 5 | 6 | export const GovRepresentativesModal = () => { 7 | const { type, close, args } = useModalContext(); 8 | return ( 9 | 10 | {args.representatives && } 11 | 12 | ); 13 | }; 14 | -------------------------------------------------------------------------------- /src/components/transactions/Stake/StakeModal.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { ModalType, useModalContext } from 'src/hooks/useModal'; 3 | 4 | import { BasicModal } from '../../primitives/BasicModal'; 5 | import { StakeModalContent } from './StakeModalContent'; 6 | 7 | export const StakeModal = () => { 8 | const { type, close, args } = useModalContext(); 9 | return ( 10 | 11 | {args?.icon && args?.stakeAssetName && ( 12 | 13 | )} 14 | 15 | ); 16 | }; 17 | -------------------------------------------------------------------------------- /src/modules/umbrella/helpers/SharesTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import { TextWithTooltip } from 'src/components/TextWithTooltip'; 3 | 4 | export const SharesTooltip = () => { 5 | return ( 6 | Shares}> 7 | <> 8 | 9 | Shares are Umbrella Stake Tokens you receive when staking. They represent your ownership 10 | in the pool, and the amount of underlying you can redeem depends on the current exchange 11 | rate between shares and the underlying. 12 | {' '} 13 | 14 | 15 | ); 16 | }; 17 | -------------------------------------------------------------------------------- /cypress/types/window.d.ts: -------------------------------------------------------------------------------- 1 | import { TenderlyFork } from '../cypress/support/tools/tenderly'; 2 | import { JsonRpcProvider } from '@ethersproject/providers'; 3 | import { Wallet } from '@ethersproject/wallet'; 4 | 5 | declare global { 6 | // eslint-disable-next-line @typescript-eslint/naming-convention 7 | interface Window { 8 | tenderly: TenderlyFork; 9 | address: string; 10 | chainId: string; 11 | rpc: string; 12 | market: string; 13 | testnetsEnabled: string; 14 | url: string; 15 | privateKey: string; 16 | provider: JsonRpcProvider; 17 | signer: Wallet; 18 | auth: Cypress.AUTWindow; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /public/icons/bridge/polygon.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/icons/other/kernel.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/icons/tokens/ceur.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/components/infoTooltips/MaxLTVTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | 3 | import { TextWithTooltip, TextWithTooltipProps } from '../TextWithTooltip'; 4 | 5 | export const MaxLTVTooltip = ({ ...rest }: TextWithTooltipProps) => { 6 | return ( 7 | 8 | 9 | The Maximum LTV ratio represents the maximum borrowing power of a specific collateral. For 10 | example, if a collateral has an LTV of 75%, the user can borrow up to 0.75 worth of ETH in 11 | the principal currency for every 1 ETH worth of collateral. 12 | 13 | 14 | ); 15 | }; 16 | -------------------------------------------------------------------------------- /src/components/transactions/Emode/EmodeModal.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { UserAuthenticated } from 'src/components/UserAuthenticated'; 3 | import { ModalType, useModalContext } from 'src/hooks/useModal'; 4 | 5 | import { BasicModal } from '../../primitives/BasicModal'; 6 | import { EmodeModalContent } from './EmodeModalContent'; 7 | 8 | export const EmodeModal = () => { 9 | const { type, close } = useModalContext(); 10 | return ( 11 | 12 | {(user) => } 13 | 14 | ); 15 | }; 16 | -------------------------------------------------------------------------------- /src/hooks/pool/selectors.ts: -------------------------------------------------------------------------------- 1 | import { ReservesDataHumanized } from '@aave/contract-helpers'; 2 | import { UserReservesDataHumanized } from 'src/services/UIPoolService'; 3 | 4 | export const selectBaseCurrencyData = (poolReserve: ReservesDataHumanized) => 5 | poolReserve.baseCurrencyData; 6 | export const selectReserves = (poolReserve: ReservesDataHumanized) => poolReserve.reservesData; 7 | 8 | export const selectUserReservesData = (userPoolReserves: UserReservesDataHumanized) => 9 | userPoolReserves.userReserves; 10 | export const selectUserEModeCategory = (userPoolReserves: UserReservesDataHumanized) => 11 | userPoolReserves.userEmodeCategoryId; 12 | -------------------------------------------------------------------------------- /public/icons/tokens/usdt.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/components/transactions/UnStake/UnStakeModal.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { ModalType, useModalContext } from 'src/hooks/useModal'; 3 | 4 | import { BasicModal } from '../../primitives/BasicModal'; 5 | import { UnStakeModalContent } from './UnStakeModalContent'; 6 | 7 | export const UnStakeModal = () => { 8 | const { type, close, args } = useModalContext(); 9 | return ( 10 | 11 | {args?.icon && args?.stakeAssetName && ( 12 | 13 | )} 14 | 15 | ); 16 | }; 17 | -------------------------------------------------------------------------------- /src/components/infoTooltips/AMPLToolTip.tsx: -------------------------------------------------------------------------------- 1 | import { ExclamationIcon } from '@heroicons/react/outline'; 2 | import { Box, SvgIcon } from '@mui/material'; 3 | 4 | import { ContentWithTooltip } from '../ContentWithTooltip'; 5 | import { AMPLWarning } from '../Warnings/AMPLWarning'; 6 | 7 | export const AMPLToolTip = () => { 8 | return ( 9 | 12 | 13 | 14 | } 15 | > 16 | 17 | 18 | 19 | 20 | ); 21 | }; 22 | -------------------------------------------------------------------------------- /src/components/infoTooltips/LiquidationPenaltyTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | 3 | import { TextWithTooltip, TextWithTooltipProps } from '../TextWithTooltip'; 4 | 5 | export const LiquidationPenaltyTooltip = ({ ...rest }: TextWithTooltipProps) => { 6 | return ( 7 | 8 | 9 | When a liquidation occurs, liquidators repay up to 50% of the outstanding borrowed amount on 10 | behalf of the borrower. In return, they can buy the collateral at a discount and keep the 11 | difference (liquidation penalty) as a bonus. 12 | 13 | 14 | ); 15 | }; 16 | -------------------------------------------------------------------------------- /src/components/transactions/Warnings/SNXWarning.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import { Typography } from '@mui/material'; 3 | 4 | import { Warning } from '../../primitives/Warning'; 5 | 6 | export const SNXWarning = () => { 7 | return ( 8 | 9 | 10 | Before supplying SNX{' '} 11 | 12 | {' '} 13 | please check that the amount you want to supply is not currently being used for staking. 14 | If it is being used for staking, your transaction might fail. 15 | 16 | 17 | 18 | ); 19 | }; 20 | -------------------------------------------------------------------------------- /public/icons/staking/emission-staking-icon.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/components/infoModalContents/InfoContentWrapper.tsx: -------------------------------------------------------------------------------- 1 | import Box from '@mui/material/Box'; 2 | import Typography from '@mui/material/Typography'; 3 | import { ReactNode } from 'react'; 4 | 5 | interface InfoContentWrapperProps { 6 | children: ReactNode; 7 | caption: ReactNode; 8 | } 9 | 10 | export const InfoContentWrapper = ({ children, caption }: InfoContentWrapperProps) => { 11 | return ( 12 | 15 | 16 | {caption} 17 | 18 | {children} 19 | 20 | ); 21 | }; 22 | -------------------------------------------------------------------------------- /src/components/transactions/Bridge/Oracle-abi.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "name": "decimals", 5 | "outputs": [ 6 | { 7 | "internalType": "uint8", 8 | "name": "", 9 | "type": "uint8" 10 | } 11 | ], 12 | "stateMutability": "view", 13 | "type": "function" 14 | }, 15 | { 16 | "inputs": [], 17 | "name": "latestAnswer", 18 | "outputs": [ 19 | { 20 | "internalType": "int256", 21 | "name": "", 22 | "type": "int256" 23 | } 24 | ], 25 | "stateMutability": "view", 26 | "type": "function" 27 | } 28 | ] 29 | -------------------------------------------------------------------------------- /src/hooks/useIsContractAddress.ts: -------------------------------------------------------------------------------- 1 | import { useQuery } from '@tanstack/react-query'; 2 | import { useRootStore } from 'src/store/root'; 3 | import { getProvider } from 'src/utils/marketsAndNetworksConfig'; 4 | 5 | export const useIsContractAddress = (address: string, chainId?: number) => { 6 | const defaultChainId = useRootStore((store) => store.currentChainId); 7 | const provider = getProvider(chainId ?? defaultChainId); 8 | 9 | return useQuery({ 10 | queryFn: () => provider.getCode(address), 11 | queryKey: ['isContractAddress', address], 12 | enabled: address !== '', 13 | staleTime: Infinity, 14 | select: (data) => data !== '0x', 15 | }); 16 | }; 17 | -------------------------------------------------------------------------------- /public/icons/tokens/eth.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/icons/wallets/frame.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/components/infoTooltips/TokenContractTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { ExternalLinkIcon } from '@heroicons/react/outline'; 2 | import { IconButton, SvgIcon } from '@mui/material'; 3 | 4 | import { Link } from '../primitives/Link'; 5 | import { DarkTooltip } from './DarkTooltip'; 6 | 7 | export const TokenContractTooltip = ({ explorerUrl }: { explorerUrl: string }) => ( 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | ); 16 | -------------------------------------------------------------------------------- /src/components/transactions/GovVote/GovVoteModal.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { ModalType, useModalContext } from 'src/hooks/useModal'; 3 | 4 | import { BasicModal } from '../../primitives/BasicModal'; 5 | import { GovVoteModalContent } from './GovVoteModalContent'; 6 | 7 | export const GovVoteModal = () => { 8 | const { type, close, args } = useModalContext(); 9 | return ( 10 | 11 | {args?.power && args?.proposal && args?.support !== undefined && ( 12 | 13 | )} 14 | 15 | ); 16 | }; 17 | -------------------------------------------------------------------------------- /public/icons/github.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/components/transactions/StakeCooldown/StakeCooldownModal.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { ModalType, useModalContext } from 'src/hooks/useModal'; 3 | 4 | import { BasicModal } from '../../primitives/BasicModal'; 5 | import { StakeCooldownModalContent } from './StakeCooldownModalContent'; 6 | 7 | export const StakeCooldownModal = () => { 8 | const { type, close, args } = useModalContext(); 9 | return ( 10 | 11 | {args?.stakeAssetName && args.icon && ( 12 | 13 | )} 14 | 15 | ); 16 | }; 17 | -------------------------------------------------------------------------------- /public/icons/tokens/cusd.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request---.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "Feature request \U0001F47B" 3 | about: Suggest an idea for this project 4 | labels: 'new issue, feature' 5 | --- 6 | 7 | **Is your feature request related to a problem? Please describe.** 8 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 9 | 10 | **Describe the solution you'd like** 11 | A clear and concise description of what you want to happen. 12 | 13 | **Describe alternatives you've considered** 14 | A clear and concise description of any alternative solutions or features you've considered. 15 | 16 | **Additional context** 17 | Add any other context or screenshots about the feature request here. 18 | -------------------------------------------------------------------------------- /public/icons/other/spark.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cypress.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'cypress'; 2 | 3 | export default defineConfig({ 4 | viewportWidth: 1000, 5 | viewportHeight: 800, 6 | defaultCommandTimeout: 40000, 7 | pageLoadTimeout: 120000, 8 | video: true, 9 | watchForFileChanges: false, 10 | scrollBehavior: 'center', 11 | retries: { 12 | runMode: 1, 13 | openMode: 0, 14 | }, 15 | e2e: { 16 | // We've imported your old cypress plugins here. 17 | // You may want to clean this up later by importing these. 18 | setupNodeEvents(on, config) { 19 | // eslint-disable-next-line @typescript-eslint/no-var-requires 20 | return require('./cypress/plugins/index.js')(on, config); 21 | }, 22 | }, 23 | }); 24 | -------------------------------------------------------------------------------- /public/icons/bridge/optimism.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/icons/networks/optimism.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/components/transactions/StakeRewardClaim/StakeRewardClaimModal.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { ModalType, useModalContext } from 'src/hooks/useModal'; 3 | 4 | import { BasicModal } from '../../primitives/BasicModal'; 5 | import { StakeRewardClaimModalContent } from './StakeRewardClaimModalContent'; 6 | 7 | export const StakeRewardClaimModal = () => { 8 | const { type, close, args } = useModalContext(); 9 | return ( 10 | 11 | {args?.icon && args?.stakeAssetName && ( 12 | 13 | )} 14 | 15 | ); 16 | }; 17 | -------------------------------------------------------------------------------- /src/components/infoTooltips/SwapFeeTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | 3 | import { Link } from '../primitives/Link'; 4 | import { TextWithTooltip } from '../TextWithTooltip'; 5 | 6 | export const SwapFeeTooltip = () => { 7 | return ( 8 | Fee}> 9 | 10 | Fees help support the user experience and security of the Aave application.{' '} 11 | 16 | Learn more. 17 | 18 | 19 | 20 | ); 21 | }; 22 | -------------------------------------------------------------------------------- /cypress/configs/v3-markets/avalanche-v3-full.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'cypress'; 2 | 3 | import { defaultConfig } from '../base.cypress'; 4 | 5 | const folder = `./cypress/e2e/1-v3-markets/2-avalanche-v3-market/`; 6 | 7 | export default defineConfig({ 8 | ...defaultConfig, 9 | e2e: { 10 | specPattern: [ 11 | folder + '0-assets/wbtc.avalanche-v3.cy.ts', 12 | folder + '0-assets/usdt.avalanche-v3.cy.ts', 13 | folder + 'critical-conditions.avalanche-v3.cy.ts', 14 | folder + 'e-mode.avalanche-v3.cy.ts', 15 | folder + 'isolated-mode.avalanche-v3.cy.ts', 16 | folder + 'swap.avalanche-v3.cy.ts', 17 | folder + 'switch.avalanche-v3.cy.ts', 18 | ], 19 | }, 20 | }); 21 | -------------------------------------------------------------------------------- /src/helpers/timeHelper.tsx: -------------------------------------------------------------------------------- 1 | export const daysFromSeconds = (time: number) => time / 60 / 60 / 24; 2 | export const hoursFromSeconds = (time: number) => time / 60 / 60; 3 | export const minutesFromSeconds = (time: number) => time / 60; 4 | 5 | export const timeMessage = (time: number) => { 6 | return `${formattedTime(time)} ${timeText(time)}`; 7 | }; 8 | 9 | export const formattedTime = (time: number) => 10 | daysFromSeconds(time) < 1 11 | ? hoursFromSeconds(time) < 1 12 | ? minutesFromSeconds(time) 13 | : hoursFromSeconds(time) 14 | : daysFromSeconds(time); 15 | 16 | export const timeText = (time: number) => 17 | daysFromSeconds(time) < 1 ? (hoursFromSeconds(time) < 1 ? 'minutes' : 'hours') : 'days'; 18 | -------------------------------------------------------------------------------- /src/modules/dashboard/lists/ListItemIsolationBadge.tsx: -------------------------------------------------------------------------------- 1 | import { Box } from '@mui/material'; 2 | import { ReactNode } from 'react'; 3 | 4 | import { IsolatedEnabledBadge } from '../../../components/isolationMode/IsolatedBadge'; 5 | 6 | interface ListItemIsolationBadgeProps { 7 | children: ReactNode; 8 | } 9 | 10 | export const ListItemIsolationBadge = ({ children }: ListItemIsolationBadgeProps) => { 11 | return ( 12 | 20 | {children} 21 | 22 | 23 | ); 24 | }; 25 | -------------------------------------------------------------------------------- /src/hooks/governance/useVotingPowerAt.ts: -------------------------------------------------------------------------------- 1 | import { useQuery } from '@tanstack/react-query'; 2 | import { useRootStore } from 'src/store/root'; 3 | import { queryKeysFactory } from 'src/ui-config/queries'; 4 | import { useSharedDependencies } from 'src/ui-config/SharedDependenciesProvider'; 5 | 6 | export const useVotingPowerAt = (blockhash: string, votingAssets: string[]) => { 7 | const { governanceV3Service } = useSharedDependencies(); 8 | const user = useRootStore((store) => store.account); 9 | return useQuery({ 10 | queryFn: () => governanceV3Service.getVotingPowerAt(blockhash, user, votingAssets), 11 | queryKey: queryKeysFactory.votingPowerAt(user, blockhash, votingAssets), 12 | enabled: !!user, 13 | }); 14 | }; 15 | -------------------------------------------------------------------------------- /cypress/configs/base.cypress.ts: -------------------------------------------------------------------------------- 1 | export const defaultConfig = { 2 | viewportWidth: 1200, 3 | viewportHeight: 800, 4 | defaultCommandTimeout: 50000, 5 | pageLoadTimeout: 120000, 6 | video: false, 7 | watchForFileChanges: false, 8 | retries: { 9 | runMode: 0, 10 | openMode: 0, 11 | }, 12 | e2e: { 13 | // eslint-disable-next-line @typescript-eslint/ban-ts-comment 14 | // @ts-ignore 15 | setupNodeEvents(on, config) { 16 | // eslint-disable-next-line @typescript-eslint/no-var-requires,@typescript-eslint/ban-ts-comment 17 | // @ts-ignore 18 | // eslint-disable-next-line @typescript-eslint/no-var-requires 19 | return require('../plugins/index.js')(on, config); 20 | }, 21 | }, 22 | }; 23 | -------------------------------------------------------------------------------- /src/hooks/useCoinGeckoCategories.ts: -------------------------------------------------------------------------------- 1 | import { useQuery } from '@tanstack/react-query'; 2 | 3 | export function useCoingeckoCategories() { 4 | return useQuery({ 5 | queryFn: async () => { 6 | const response = await fetch('/api/coingecko-categories'); 7 | if (!response.ok) throw new Error('Failed to fetch CoinGecko categories'); 8 | return await response.json(); 9 | }, 10 | queryKey: ['coingecko-categories'], 11 | staleTime: 1000 * 60 * 60 * 24 * 7, 12 | refetchOnWindowFocus: false, 13 | select: (data) => { 14 | return { 15 | stablecoinSymbols: data.uniqueSymbolsStablecoins || [], 16 | ethCorrelatedSymbols: data.uniqueSymbolsEth || [], 17 | }; 18 | }, 19 | }); 20 | } 21 | -------------------------------------------------------------------------------- /custom.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*/locales/en/messages.js'; 2 | 3 | // eslint-disable-next-line @typescript-eslint/no-unused-vars 4 | namespace NodeJS { 5 | // eslint-disable-next-line @typescript-eslint/no-unused-vars 6 | interface ProcessEnv { 7 | NEXT_PUBLIC_ENABLE_GOVERNANCE: string; 8 | NEXT_PUBLIC_ENABLE_STAKING: string; 9 | NEXT_PUBLIC_ENV: string; 10 | NEXT_PUBLIC_API_BASEURL: string; 11 | NEXT_PUBLIC_FORK_BASE_CHAIN_ID?: string; 12 | NEXT_PUBLIC_FORK_CHAIN_ID?: string; 13 | NEXT_PUBLIC_FORK_URL_RPC?: string; 14 | NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID: string; 15 | NEXT_PUBLIC_FIAT_ON_RAMP: string; 16 | NEXT_PUBLIC_SUBGRAPH_API_KEY: string; 17 | NEXT_PUBLIC_IS_CYPRESS_ENABLED: string; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /cypress/configs/v3-markets/polygon-v3-additional.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'cypress'; 2 | 3 | import { defaultConfig } from '../base.cypress'; 4 | 5 | const folder = `./cypress/e2e/1-v3-markets/3-polygon-v3-market/`; 6 | 7 | // eslint-disable-next-line @typescript-eslint/ban-ts-comment 8 | // @ts-ignore 9 | export default defineConfig({ 10 | ...defaultConfig, 11 | e2e: { 12 | specPattern: [ 13 | folder + 'swap.polygon-v3.cy.ts', 14 | folder + 'e-mode.polygon-v3.cy.ts', 15 | folder + 'isolated-mode.polygon-v3.cy.ts', 16 | folder + 'isolated-and-emode.polygon-v3.cy.ts', 17 | folder + 'critical-conditions.polygon-v3.cy.ts', 18 | folder + 'switch.polygon-v3.cy.ts', 19 | ], 20 | }, 21 | }); 22 | -------------------------------------------------------------------------------- /src/components/infoTooltips/GasTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import { GENERAL } from 'src/utils/events'; 3 | 4 | import { TextWithTooltip, TextWithTooltipProps } from '../TextWithTooltip'; 5 | 6 | export const GasTooltip = ({ ...rest }: TextWithTooltipProps) => { 7 | return ( 8 | 15 | 16 | This gas calculation is only an estimation. Your wallet will set the price of the 17 | transaction. You can modify the gas settings directly from your wallet provider. 18 | 19 | 20 | ); 21 | }; 22 | -------------------------------------------------------------------------------- /src/components/transactions/Warnings/AAVEWarning.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import { Link, Typography } from '@mui/material'; 3 | 4 | import { ROUTES } from '../../primitives/Link'; 5 | import { Warning } from '../../primitives/Warning'; 6 | 7 | export const AAVEWarning = () => { 8 | return ( 9 | 10 | 11 | Supplying your AAVE{' '} 12 | tokens is not the same as staking them. If you wish to stake your AAVE{' '} 13 | tokens, please go to the {' '} 14 | 15 | staking view 16 | 17 | 18 | 19 | ); 20 | }; 21 | -------------------------------------------------------------------------------- /src/modules/dashboard/lists/SupplyAssetsList/types.ts: -------------------------------------------------------------------------------- 1 | import { ReserveIncentiveResponse } from '@aave/math-utils/dist/esm/formatters/incentive/calculate-reserve-incentives'; 2 | 3 | export type SupplyAssetsItem = { 4 | underlyingAsset: string; 5 | symbol: string; 6 | iconSymbol: string; 7 | name: string; 8 | walletBalance: string; 9 | walletBalanceUSD: string; 10 | availableToDeposit: string; 11 | availableToDepositUSD: string; 12 | supplyAPY: number | string; 13 | aIncentivesData?: ReserveIncentiveResponse[]; 14 | isFreezed?: boolean; 15 | isIsolated: boolean; 16 | totalLiquidity: string; 17 | supplyCap: string; 18 | isActive?: boolean; 19 | usageAsCollateralEnabledOnUser: boolean; 20 | detailsAddress: string; 21 | }; 22 | -------------------------------------------------------------------------------- /public/icons/tokens/pools/bpt.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/components/Warnings/BorrowDisabledWarning.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | 3 | import { getFrozenProposalLink } from '../infoTooltips/FrozenTooltip'; 4 | import { Link } from '../primitives/Link'; 5 | 6 | interface BorrowDisabledWarningProps { 7 | symbol: string; 8 | currentMarket: string; 9 | } 10 | export const BorrowDisabledWarning = ({ symbol, currentMarket }: BorrowDisabledWarningProps) => { 11 | return ( 12 | 13 | Borrowing is disabled due to an Aave community decision.{' '} 14 | 18 | More details 19 | 20 | 21 | ); 22 | }; 23 | -------------------------------------------------------------------------------- /src/components/infoTooltips/LiquidationThresholdTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | 3 | import { TextWithTooltip, TextWithTooltipProps } from '../TextWithTooltip'; 4 | 5 | export const LiquidationThresholdTooltip = ({ ...rest }: TextWithTooltipProps) => { 6 | return ( 7 | 8 | 9 | This represents the threshold at which a borrow position will be considered 10 | undercollateralized and subject to liquidation for each collateral. For example, if a 11 | collateral has a liquidation threshold of 80%, it means that the position will be liquidated 12 | when the debt value is worth 80% of the collateral value. 13 | 14 | 15 | ); 16 | }; 17 | -------------------------------------------------------------------------------- /src/components/infoTooltips/OffboardingToolTip.tsx: -------------------------------------------------------------------------------- 1 | import { ExclamationIcon } from '@heroicons/react/outline'; 2 | import { Box, SvgIcon } from '@mui/material'; 3 | 4 | import { ContentWithTooltip } from '../ContentWithTooltip'; 5 | import { OffboardingWarning } from '../Warnings/OffboardingWarning'; 6 | 7 | export const OffboardingTooltip = ({ discussionLink }: { discussionLink: string }) => { 8 | return ( 9 | 12 | 13 | 14 | } 15 | > 16 | 17 | 18 | 19 | 20 | ); 21 | }; 22 | -------------------------------------------------------------------------------- /src/libs/hooks/useWeb3Context.tsx: -------------------------------------------------------------------------------- 1 | import React, { useContext } from 'react'; 2 | 3 | import { Web3Data } from '../web3-data-provider/Web3Provider'; 4 | // import { Web3Data } from '../web3-data-provider/Web3ContextProvider'; 5 | 6 | export type Web3ContextData = { 7 | web3ProviderData: Web3Data; 8 | }; 9 | 10 | export const Web3Context = React.createContext({} as Web3ContextData); 11 | 12 | export const useWeb3Context = () => { 13 | const { web3ProviderData } = useContext(Web3Context); 14 | if (Object.keys(web3ProviderData).length === 0) { 15 | throw new Error( 16 | 'useWeb3Context() can only be used inside of , ' + 17 | 'please declare it at a higher level.' 18 | ); 19 | } 20 | 21 | return web3ProviderData; 22 | }; 23 | -------------------------------------------------------------------------------- /src/modules/history/PriceUnavailable.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import { Box } from '@mui/material'; 3 | import { FormattedNumber } from 'src/components/primitives/FormattedNumber'; 4 | 5 | export const PriceUnavailable = ({ value }: { value: number }) => { 6 | if (value > 0) { 7 | return ( 8 | 15 | ); 16 | } else { 17 | return ( 18 | 19 | 20 | Price data is not currently available for this reserve on the protocol subgraph 21 | 22 | 23 | ); 24 | } 25 | }; 26 | -------------------------------------------------------------------------------- /src/modules/umbrella/helpers/ApyTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import { Link } from 'src/components/primitives/Link'; 3 | import { TextWithTooltip } from 'src/components/TextWithTooltip'; 4 | 5 | export const ApyTooltip = () => { 6 | return ( 7 | APY}> 8 | <> 9 | 10 | Reward APY adjusts with total staked amount, following a curve that targets optimal 11 | staking levels. 12 | {' '} 13 | 17 | Learn more 18 | 19 | 20 | 21 | ); 22 | }; 23 | -------------------------------------------------------------------------------- /cypress/configs/v3-markets/polygon-v3-full.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'cypress'; 2 | 3 | import { defaultConfig } from '../base.cypress'; 4 | 5 | const folder = `./cypress/e2e/1-v3-markets/3-polygon-v3-market/`; 6 | 7 | // eslint-disable-next-line @typescript-eslint/ban-ts-comment 8 | // @ts-ignore 9 | export default defineConfig({ 10 | ...defaultConfig, 11 | e2e: { 12 | specPattern: [ 13 | folder + '0-assets/wbtc.polygon-v3.cy.ts', 14 | folder + '0-assets/eurs.polygon-v3.cy.ts', 15 | folder + 'critical-conditions.polygon-v3.cy.ts', 16 | folder + 'e-mode.polygon-v3.cy.ts', 17 | folder + 'swap.polygon-v3.cy.ts', 18 | folder + 'isolated-mode.polygon-v3.cy.ts', 19 | folder + 'switch.polygon-v3.cy.ts', 20 | ], 21 | }, 22 | }); 23 | -------------------------------------------------------------------------------- /src/components/transactions/GovDelegation/GovDelegationModal.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { ModalType, useModalContext } from 'src/hooks/useModal'; 3 | 4 | import { BasicModal } from '../../primitives/BasicModal'; 5 | import { GovDelegationModalContent } from './GovDelegationModalContent'; 6 | 7 | export const GovDelegationModal = () => { 8 | const { type, close } = useModalContext(); 9 | return ( 10 | 14 | 19 | 20 | ); 21 | }; 22 | -------------------------------------------------------------------------------- /src/modules/governance/helpers.ts: -------------------------------------------------------------------------------- 1 | import { valueToBigNumber } from '@aave/math-utils'; 2 | 3 | export const isQuorumReached = (forVotes: string, quorum: string, precisionDivider: string) => { 4 | return valueToBigNumber(forVotes).gte(valueToBigNumber(quorum).multipliedBy(precisionDivider)); 5 | }; 6 | 7 | export const isDifferentialReached = ( 8 | forVotes: string, 9 | againstVotes: string, 10 | differential: string, 11 | precisionDivider: string 12 | ) => { 13 | const forVotesBN = valueToBigNumber(forVotes); 14 | const againstVotesBN = valueToBigNumber(againstVotes); 15 | 16 | return ( 17 | forVotesBN.gte(againstVotesBN) && 18 | forVotesBN 19 | .minus(againstVotesBN) 20 | .gt(valueToBigNumber(differential).multipliedBy(precisionDivider)) 21 | ); 22 | }; 23 | -------------------------------------------------------------------------------- /cypress/fixtures/constans.json: -------------------------------------------------------------------------------- 1 | { 2 | "repayType": { 3 | "collateral": "collateral", 4 | "wallet": "wallet", 5 | "default": "default" 6 | }, 7 | "dashboardTypes": { 8 | "deposit": "deposit", 9 | "borrow": "borrow" 10 | }, 11 | "collateralType": { 12 | "isCollateral": "Yes", 13 | "isNotCollateral": "No" 14 | }, 15 | "borrowAPYType": { 16 | "variable": "Variable", 17 | "stable": "Stable", 18 | "default": "Default", 19 | "fixed": "fixed" 20 | }, 21 | "actionTypes": { 22 | "supply": "Supply", 23 | "borrow": "Borrow", 24 | "repay": "Repay", 25 | "withdraw": "Withdraw", 26 | "switchApy": "Switch rate", 27 | "faucet": "Faucet" 28 | }, 29 | "apyType": { 30 | "stable": "Stable", 31 | "variable": "Variable" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | cypress/screenshots 11 | cypress/videos 12 | 13 | # next.js 14 | /.next/ 15 | /out/ 16 | 17 | # production 18 | /build 19 | 20 | # misc 21 | .DS_Store 22 | *.pem 23 | 24 | # debug 25 | npm-debug.log* 26 | yarn-debug.log* 27 | yarn-error.log* 28 | 29 | # local env files 30 | .env.local 31 | .env.development.local 32 | .env.test.local 33 | .env.dev.development 34 | .env.production.local 35 | 36 | # vercel 37 | .vercel 38 | 39 | .out 40 | 41 | # ignore package lock due the mandatory usage of yarn 42 | package-lock.json 43 | 44 | .eslintcache 45 | 46 | # IDE specific 47 | .idea 48 | .vscode 49 | .env.development 50 | -------------------------------------------------------------------------------- /src/components/transactions/StakeRewardClaimRestake/StakeRewardClaimRestakeModal.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { ModalType, useModalContext } from 'src/hooks/useModal'; 3 | 4 | import { BasicModal } from '../../primitives/BasicModal'; 5 | import { StakeRewardClaimRestakeModalContent } from './StakeRewardClaimRestakeModalContent'; 6 | 7 | export const StakeRewardClaimRestakeModal = () => { 8 | const { type, close, args } = useModalContext(); 9 | return ( 10 | 11 | {args?.icon && args?.stakeAssetName && ( 12 | 16 | )} 17 | 18 | ); 19 | }; 20 | -------------------------------------------------------------------------------- /src/architecture/FixedPointDecimal.ts: -------------------------------------------------------------------------------- 1 | import { BigNumber, BigNumberish } from 'ethers'; 2 | import { formatUnits } from 'ethers/lib/utils'; 3 | 4 | export class FixedPointDecimal { 5 | private readonly _value: BigNumber; 6 | 7 | constructor(_value: BigNumberish, private readonly _decimals: number) { 8 | this._value = BigNumber.from(_value); 9 | } 10 | 11 | get value() { 12 | return this._value; 13 | } 14 | 15 | get decimals() { 16 | return this._decimals; 17 | } 18 | 19 | add(value: FixedPointDecimal) { 20 | return new FixedPointDecimal(this._value.add(value._value), this._decimals); 21 | } 22 | 23 | eq(value: FixedPointDecimal) { 24 | return this._value.eq(value._value); 25 | } 26 | 27 | format() { 28 | return formatUnits(this._value, this._decimals); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/modules/staking/StakingPanelSkeleton.tsx: -------------------------------------------------------------------------------- 1 | import { Paper, Skeleton, Stack } from '@mui/material'; 2 | 3 | export const StakingPanelSkeleton = () => { 4 | return ( 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | ); 16 | }; 17 | -------------------------------------------------------------------------------- /public/icons/tokens/lend.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/components/lists/ListHeaderWrapper.tsx: -------------------------------------------------------------------------------- 1 | import { Box, BoxProps } from '@mui/material'; 2 | import { ReactNode } from 'react'; 3 | 4 | interface ListHeaderWrapperProps extends BoxProps { 5 | px?: 4 | 6; 6 | children: ReactNode; 7 | } 8 | 9 | export const ListHeaderWrapper = ({ px = 4, children, ...rest }: ListHeaderWrapperProps) => { 10 | return ( 11 | 28 | {children} 29 | 30 | ); 31 | }; 32 | -------------------------------------------------------------------------------- /pages/api/SGhoService.types.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Types for sGHO APY data service 3 | */ 4 | 5 | export type SGhoRatesData = { 6 | blockHour: string; 7 | apr: number; 8 | }; 9 | 10 | export type GraphQLResponse = { 11 | data?: { 12 | aaveV3RatesSgho: SGhoRatesData[]; 13 | }; 14 | errors?: Array<{ 15 | message: string; 16 | locations?: Array<{ line: number; column: number }>; 17 | path?: string[]; 18 | }>; 19 | }; 20 | 21 | export type ApiResponse = { 22 | data?: Array<{ 23 | day: { value: string }; 24 | merit_apy: number; 25 | }>; 26 | error?: string; 27 | }; 28 | 29 | export type SGhoApyQueryOptions = { 30 | limit?: number; 31 | startDate?: string; 32 | endDate?: string; 33 | }; 34 | 35 | export type TransformedDailyData = { 36 | day: { value: string }; 37 | merit_apy: number; 38 | }; 39 | -------------------------------------------------------------------------------- /src/components/badges/ExclamationBadge.tsx: -------------------------------------------------------------------------------- 1 | import { ExclamationIcon } from '@heroicons/react/solid'; 2 | import { SvgIcon, SvgIconProps } from '@mui/material'; 3 | 4 | export enum BadgeSize { 5 | SM = 15, 6 | MD = 20, 7 | } 8 | 9 | type ExclamationBadgeProps = { 10 | size: BadgeSize; 11 | iconProps?: SvgIconProps; 12 | }; 13 | 14 | export const ExclamationBadge: React.FC = ({ size, iconProps = {} }) => { 15 | const { sx: iconSx, ...restIconProps } = iconProps; 16 | return ( 17 | 28 | 29 | 30 | ); 31 | }; 32 | -------------------------------------------------------------------------------- /src/hooks/governance/usePowers.ts: -------------------------------------------------------------------------------- 1 | import { useQuery } from '@tanstack/react-query'; 2 | import { useRootStore } from 'src/store/root'; 3 | import { governanceV3Config } from 'src/ui-config/governanceConfig'; 4 | import { POLLING_INTERVAL, queryKeysFactory } from 'src/ui-config/queries'; 5 | import { useSharedDependencies } from 'src/ui-config/SharedDependenciesProvider'; 6 | 7 | export const usePowers = (blockHash?: string) => { 8 | const { governanceService } = useSharedDependencies(); 9 | const user = useRootStore((store) => store.account); 10 | return useQuery({ 11 | queryFn: () => governanceService.getPowers(governanceV3Config.coreChainId, user, blockHash), 12 | queryKey: queryKeysFactory.powers(user, governanceV3Config.coreChainId), 13 | enabled: !!user, 14 | refetchInterval: POLLING_INTERVAL, 15 | }); 16 | }; 17 | -------------------------------------------------------------------------------- /public/icons/tokens/stkaave.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/icons/wallets/torus.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/modules/dashboard/lists/ListHeader.tsx: -------------------------------------------------------------------------------- 1 | import { ReactNode } from 'react'; 2 | 3 | import { ListColumn } from '../../../components/lists/ListColumn'; 4 | import { ListHeaderTitle } from '../../../components/lists/ListHeaderTitle'; 5 | import { ListHeaderWrapper } from '../../../components/lists/ListHeaderWrapper'; 6 | import { ListButtonsColumn } from './ListButtonsColumn'; 7 | 8 | interface ListHeaderProps { 9 | head: ReactNode[]; 10 | } 11 | 12 | export const ListHeader = ({ head }: ListHeaderProps) => { 13 | return ( 14 | 15 | {head.map((title, i) => ( 16 | 17 | {title} 18 | 19 | ))} 20 | 21 | 22 | 23 | ); 24 | }; 25 | -------------------------------------------------------------------------------- /src/store/layoutSlice.ts: -------------------------------------------------------------------------------- 1 | import { StateCreator } from 'zustand'; 2 | 3 | import { RootStore } from './root'; 4 | 5 | export type LayoutSlice = { 6 | setMobileDrawerOpen: (eventName: boolean) => void; 7 | mobileDrawerOpen: boolean; 8 | feedbackDialogOpen: boolean; 9 | setFeedbackOpen: (eventName: boolean) => void; 10 | }; 11 | 12 | export const createLayoutSlice: StateCreator< 13 | RootStore, 14 | [['zustand/subscribeWithSelector', never], ['zustand/devtools', never]], 15 | [], 16 | LayoutSlice 17 | > = (set) => { 18 | return { 19 | mobileDrawerOpen: false, 20 | feedbackDialogOpen: false, 21 | setMobileDrawerOpen: (value: boolean) => { 22 | set({ mobileDrawerOpen: value }); 23 | }, 24 | setFeedbackOpen: (value: boolean) => { 25 | set({ feedbackDialogOpen: value }); 26 | }, 27 | }; 28 | }; 29 | -------------------------------------------------------------------------------- /public/icons/networks/soneium.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/components/infoTooltips/ApprovalTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | 3 | import { Link } from '../primitives/Link'; 4 | import { TextWithTooltip, TextWithTooltipProps } from '../TextWithTooltip'; 5 | 6 | export const ApprovalTooltip = ({ ...rest }: TextWithTooltipProps) => { 7 | return ( 8 | 9 | 10 | To continue, you need to grant smart contracts permission to move your funds from your 11 | wallet. Depending on the asset and wallet you use, it is done by signing the permission 12 | message (gas free), or by submitting an approval transaction (requires gas).{' '} 13 | 14 | Learn more 15 | 16 | 17 | 18 | ); 19 | }; 20 | -------------------------------------------------------------------------------- /src/modules/reserve-overview/graphs/GraphTimeRangeSelector.tsx: -------------------------------------------------------------------------------- 1 | import { TimeWindow } from '@aave/react'; 2 | 3 | import { TimeRangeSelector } from '../TimeRangeSelector'; 4 | 5 | export interface GraphTimeRangeSelectorProps { 6 | disabled: boolean; 7 | timeRange: TimeWindow; 8 | onTimeRangeChanged: (value: TimeWindow) => void; 9 | } 10 | 11 | export const GraphTimeRangeSelector = ({ 12 | disabled, // require disabled from parent 13 | timeRange, 14 | onTimeRangeChanged, 15 | }: GraphTimeRangeSelectorProps) => ( 16 | 27 | ); 28 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: 'npm' # See documentation for possible values 9 | directory: '/' # Location of package manifests 10 | schedule: 11 | interval: 'weekly' 12 | open-pull-requests-limit: 10 13 | labels: 14 | - 'dependencies' 15 | - 'Ready for Dev Review' 16 | - package-ecosystem: 'github-actions' 17 | directory: '/' 18 | schedule: 19 | # Check for updates to GitHub Actions every weekday 20 | interval: 'weekly' 21 | -------------------------------------------------------------------------------- /public/icons/tokens/aave.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/icons/tokens/gho.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/components/lists/ListItem.tsx: -------------------------------------------------------------------------------- 1 | import { Box, BoxProps } from '@mui/material'; 2 | import { ReactNode } from 'react'; 3 | 4 | interface ListItemProps extends BoxProps { 5 | children: ReactNode; 6 | minHeight?: number; 7 | px?: number; 8 | button?: boolean; 9 | } 10 | 11 | export const ListItem = ({ children, minHeight = 71, px = 4, button, ...rest }: ListItemProps) => { 12 | return ( 13 | 28 | {children} 29 | 30 | ); 31 | }; 32 | -------------------------------------------------------------------------------- /public/icons/lenster.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/icons/tokens/dai.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/modules/faucet/FaucetMobileItemLoader.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import { Box, Button, Skeleton } from '@mui/material'; 3 | 4 | import { ListColumn } from '../../components/lists/ListColumn'; 5 | import { ListItem } from '../../components/lists/ListItem'; 6 | 7 | export const FaucetMobileItemLoader = () => { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 20 | 21 | 22 | ); 23 | }; 24 | -------------------------------------------------------------------------------- /.github/workflows/build-fork.yml: -------------------------------------------------------------------------------- 1 | name: Build PR From Fork 2 | 3 | concurrency: 4 | group: ${{ github.workflow }}-${{ github.head_ref }} 5 | cancel-in-progress: true 6 | 7 | on: 8 | pull_request: 9 | branches: ['main'] 10 | 11 | jobs: 12 | build: 13 | runs-on: ubuntu-latest 14 | if: | # check if PR opened from fork 15 | github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name || contains(github.head_ref, 'dependabot') 16 | steps: 17 | - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 18 | with: 19 | persist-credentials: false 20 | 21 | - name: Build App 22 | uses: ./.github/actions/build 23 | with: 24 | NEXT_PUBLIC_ENV: 'prod' 25 | 26 | - name: Upload artifacts 27 | uses: ./.github/actions/upload-artifacts 28 | -------------------------------------------------------------------------------- /public/icons/tokens/aave-token-round.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/icons/tokens/uscc.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/icons/tokens/ustb.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/components/UserAuthenticated.tsx: -------------------------------------------------------------------------------- 1 | import { Box, CircularProgress } from '@mui/material'; 2 | import React, { ReactNode } from 'react'; 3 | import { 4 | ExtendedFormattedUser, 5 | useAppDataContext, 6 | } from 'src/hooks/app-data-provider/useAppDataProvider'; 7 | import invariant from 'tiny-invariant'; 8 | 9 | interface UserAuthenticatedProps { 10 | children: (user: ExtendedFormattedUser) => ReactNode; 11 | } 12 | 13 | export const UserAuthenticated = ({ children }: UserAuthenticatedProps) => { 14 | const { user, loading } = useAppDataContext(); 15 | if (loading) { 16 | return ( 17 | 18 | 19 | 20 | ); 21 | } 22 | invariant(user, 'User data loaded but no user found'); 23 | return <>{children(user)}; 24 | }; 25 | -------------------------------------------------------------------------------- /src/components/transactions/Faucet/FaucetModal.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import React from 'react'; 3 | import { ModalContextType, ModalType, useModalContext } from 'src/hooks/useModal'; 4 | 5 | import { BasicModal } from '../../primitives/BasicModal'; 6 | import { ModalWrapper } from '../FlowCommons/ModalWrapper'; 7 | import { FaucetModalContent } from './FaucetModalContent'; 8 | 9 | export const FaucetModal = () => { 10 | const { type, close, args } = useModalContext() as ModalContextType<{ 11 | underlyingAsset: string; 12 | }>; 13 | 14 | return ( 15 | 16 | Faucet} underlyingAsset={args.underlyingAsset}> 17 | {(params) => } 18 | 19 | 20 | ); 21 | }; 22 | -------------------------------------------------------------------------------- /public/icons/tokens/tribe.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/components/transactions/ClaimRewards/ClaimRewardsModal.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { UserAuthenticated } from 'src/components/UserAuthenticated'; 3 | import { useAppDataContext } from 'src/hooks/app-data-provider/useAppDataProvider'; 4 | import { ModalType, useModalContext } from 'src/hooks/useModal'; 5 | 6 | import { BasicModal } from '../../primitives/BasicModal'; 7 | import { ClaimRewardsModalContent } from './ClaimRewardsModalContent'; 8 | 9 | export const ClaimRewardsModal = () => { 10 | const { type, close } = useModalContext(); 11 | const { reserves } = useAppDataContext(); 12 | return ( 13 | 14 | 15 | {(user) => } 16 | 17 | 18 | ); 19 | }; 20 | -------------------------------------------------------------------------------- /public/icons/markets/aptos.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/icons/tokens/usdbc.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/helpers/types.ts: -------------------------------------------------------------------------------- 1 | export type TxState = { 2 | txError?: string; 3 | success: boolean; 4 | gasEstimationError?: string; 5 | }; 6 | 7 | export type Reward = { 8 | assets: string[]; 9 | incentiveControllerAddress: string; 10 | symbol: string; 11 | balance: string; 12 | balanceUsd: string; 13 | rewardTokenAddress: string; 14 | }; 15 | 16 | export type EmodeCategory = { 17 | id: number; 18 | label: string; 19 | ltv: string; 20 | liquidationThreshold: string; 21 | liquidationBonus: string; 22 | assets: Array<{ 23 | underlyingAsset: string; 24 | symbol: string; 25 | iconSymbol: string; 26 | collateral: boolean; 27 | borrowable: boolean; 28 | }>; 29 | }; 30 | 31 | export enum CollateralType { 32 | ENABLED, 33 | ISOLATED_ENABLED, 34 | DISABLED, 35 | ISOLATED_DISABLED, 36 | UNAVAILABLE, 37 | UNAVAILABLE_DUE_TO_ISOLATION, 38 | } 39 | -------------------------------------------------------------------------------- /src/libs/web3-data-provider/adapters/EthersAdapter.ts: -------------------------------------------------------------------------------- 1 | import { type Config, getConnectorClient } from '@wagmi/core'; 2 | import { providers } from 'ethers'; 3 | import type { Account, Chain, Client, Transport } from 'viem'; 4 | 5 | /** Action to convert a Viem Client to an ethers.js Signer. */ 6 | export async function getEthersProvider(config: Config, { chainId }: { chainId?: number } = {}) { 7 | const client = await getConnectorClient(config, { chainId }); 8 | return clientToWeb3Provider(client); 9 | } 10 | 11 | function clientToWeb3Provider(client: Client) { 12 | const { chain, transport } = client; 13 | const network = { 14 | chainId: chain.id, 15 | name: chain.name, 16 | ensAddress: chain.contracts?.ensRegistry?.address, 17 | }; 18 | const provider = new providers.Web3Provider(transport, network); 19 | return provider; 20 | } 21 | -------------------------------------------------------------------------------- /src/store/transactionsSelectors.ts: -------------------------------------------------------------------------------- 1 | import { RootStore } from './root'; 2 | import { TransactionEvent, Transactions } from './transactionsSlice'; 3 | 4 | export const selectSuccessfulTransactions = (state: RootStore) => { 5 | const successfulTransactions: Transactions = {}; 6 | 7 | Object.keys(state.transactions).forEach((chainId) => { 8 | const chainIdNumber = +chainId; 9 | const successfulTxHashes = Object.keys(state.transactions[chainIdNumber]).filter( 10 | (txHash) => state.transactions[chainIdNumber][txHash].txState === 'success' 11 | ); 12 | successfulTransactions[chainIdNumber] = successfulTxHashes.reduce<{ 13 | [hash: string]: TransactionEvent; 14 | }>((acc, txHash) => { 15 | acc[txHash] = state.transactions[chainIdNumber][txHash]; 16 | return acc; 17 | }, {}); 18 | }); 19 | 20 | return successfulTransactions; 21 | }; 22 | -------------------------------------------------------------------------------- /cypress/configs/local/full.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'cypress'; 2 | 3 | export default defineConfig({ 4 | viewportWidth: 1200, 5 | viewportHeight: 800, 6 | defaultCommandTimeout: 40000, 7 | pageLoadTimeout: 120000, 8 | video: true, 9 | watchForFileChanges: false, 10 | scrollBehavior: 'center', 11 | retries: { 12 | runMode: 1, 13 | openMode: 0, 14 | }, 15 | e2e: { 16 | // We've imported your old cypress plugins here. 17 | // You may want to clean this up later by importing these. 18 | setupNodeEvents(on, config) { 19 | // eslint-disable-next-line @typescript-eslint/no-var-requires 20 | return require('../../../cypress/plugins/index.js')(on, config); 21 | }, 22 | excludeSpecPattern: [ 23 | './cypress/e2e/2-settings/*', 24 | './cypress/e2e/1-v3-markets/1-arbitrum-v3-market/*', 25 | ], 26 | }, 27 | }); 28 | -------------------------------------------------------------------------------- /src/modules/dashboard/lists/ListButtonsColumn.tsx: -------------------------------------------------------------------------------- 1 | import { Box } from '@mui/material'; 2 | import { ReactNode } from 'react'; 3 | import { DASHBOARD_LIST_COLUMN_WIDTHS } from 'src/utils/dashboardSortUtils'; 4 | 5 | interface ListButtonsColumnProps { 6 | children?: ReactNode; 7 | isColumnHeader?: boolean; 8 | } 9 | 10 | export const ListButtonsColumn = ({ children, isColumnHeader = false }: ListButtonsColumnProps) => { 11 | return ( 12 | 25 | {children} 26 | 27 | ); 28 | }; 29 | -------------------------------------------------------------------------------- /.github/workflows/i18n-check.yml: -------------------------------------------------------------------------------- 1 | name: i18n Check 2 | 3 | concurrency: 4 | group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} 5 | cancel-in-progress: true 6 | 7 | on: 8 | pull_request: 9 | branches: ['main'] 10 | push: 11 | branches: ['main'] 12 | 13 | jobs: 14 | i18n-check: 15 | runs-on: ubuntu-latest 16 | steps: 17 | - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 18 | 19 | - name: i18n compile 20 | uses: ./.github/actions/build 21 | with: 22 | YARN_COMMAND: i18n 23 | USE_NEXT_CACHE: 'false' 24 | 25 | - name: check diff 26 | run: | 27 | if [[ -z $(git status -s) ]] 28 | then 29 | echo "i18n up to date" 30 | else 31 | echo "please run yarn i18n" 32 | exit 1 33 | exit 34 | fi 35 | -------------------------------------------------------------------------------- /cypress/configs/mobile.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'cypress'; 2 | 3 | const folder = `./cypress/e2e/2-settings/`; 4 | 5 | export default defineConfig({ 6 | viewportWidth: 375, 7 | viewportHeight: 812, 8 | defaultCommandTimeout: 40000, 9 | pageLoadTimeout: 120000, 10 | video: false, 11 | watchForFileChanges: false, 12 | retries: { 13 | runMode: 1, 14 | openMode: 0, 15 | }, 16 | e2e: { 17 | // eslint-disable-next-line @typescript-eslint/ban-ts-comment 18 | // @ts-ignore 19 | setupNodeEvents(on, config) { 20 | // eslint-disable-next-line @typescript-eslint/no-var-requires,@typescript-eslint/ban-ts-comment 21 | // @ts-ignore 22 | // eslint-disable-next-line @typescript-eslint/no-var-requires 23 | return require('../plugins/index.js')(on, config); 24 | }, 25 | specPattern: [folder + 'mobile.cy.ts'], 26 | }, 27 | }); 28 | -------------------------------------------------------------------------------- /public/icons/onRampServices/transak.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/components/BridgeButton.tsx: -------------------------------------------------------------------------------- 1 | import { ExternalLinkIcon } from '@heroicons/react/outline'; 2 | import { Button, SvgIcon, Typography } from '@mui/material'; 3 | 4 | import { NetworkConfig } from '../ui-config/networksConfig'; 5 | import { Link } from './primitives/Link'; 6 | 7 | export const BridgeButton = ({ bridge }: Pick) => { 8 | if (!bridge) return null; 9 | 10 | return ( 11 | 25 | ); 26 | }; 27 | -------------------------------------------------------------------------------- /src/components/transactions/Switch/cowprotocol/cowprotocol.errors.ts: -------------------------------------------------------------------------------- 1 | const MESSAGE_MAP: { [key: string]: string } = { 2 | NoLiquidity: 'No liquidity found for the given amount and asset pair.', 3 | NoRoutesFound: 'No routes found with enough liquidity.', 4 | SellAmountDoesNotCoverFee: 'Sell amount is too small to cover the fee.', 5 | }; 6 | 7 | const MESSAGE_REGEX_MAP: Array<{ regex: RegExp; message: string }> = [ 8 | { 9 | regex: /^Source and destination tokens cannot be the same$/, 10 | message: 'Source and destination tokens cannot be the same', 11 | }, 12 | ]; 13 | 14 | export function convertCowProtocolErrorMessage(message: string): string | undefined { 15 | if (message in MESSAGE_MAP) { 16 | return MESSAGE_MAP[message]; 17 | } 18 | 19 | const newMessage = MESSAGE_REGEX_MAP.find((mapping) => mapping.regex.test(message))?.message; 20 | return newMessage; 21 | } 22 | -------------------------------------------------------------------------------- /pages/faucet.page.tsx: -------------------------------------------------------------------------------- 1 | import dynamic from 'next/dynamic'; 2 | import { MainLayout } from 'src/layouts/MainLayout'; 3 | import FaucetAssetsList from 'src/modules/faucet/FaucetAssetsList'; 4 | import { FaucetTopPanel } from 'src/modules/faucet/FaucetTopPanel'; 5 | 6 | import { ContentContainer } from '../src/components/ContentContainer'; 7 | 8 | const FaucetModal = dynamic(() => 9 | import('../src/components/transactions/Faucet/FaucetModal').then((module) => module.FaucetModal) 10 | ); 11 | export default function Faucet() { 12 | return ( 13 | <> 14 | 15 | 16 | 17 | 18 | 19 | ); 20 | } 21 | 22 | Faucet.getLayout = function getLayout(page: React.ReactElement) { 23 | return ( 24 | 25 | {page} 26 | 27 | 28 | ); 29 | }; 30 | -------------------------------------------------------------------------------- /public/icons/tokens/syrupusdt.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/components/StyledToggleButtonGroup.tsx: -------------------------------------------------------------------------------- 1 | import { styled, ToggleButtonGroup, ToggleButtonGroupProps } from '@mui/material'; 2 | 3 | const CustomToggleGroup = styled(ToggleButtonGroup)({ 4 | backgroundColor: '#383D51', 5 | border: '1px solid rgba(235, 235, 237, 0.12)', 6 | padding: '4px', 7 | }) as typeof ToggleButtonGroup; 8 | 9 | const CustomTxModalToggleGroup = styled(ToggleButtonGroup)(({ theme }) => ({ 10 | backgroundColor: theme.palette.background.header, 11 | padding: '2px', 12 | height: '36px', 13 | width: '100%', 14 | })) as typeof ToggleButtonGroup; 15 | 16 | export function StyledTxModalToggleGroup(props: ToggleButtonGroupProps) { 17 | return ; 18 | } 19 | 20 | export default function StyledToggleGroup(props: ToggleButtonGroupProps) { 21 | return ; 22 | } 23 | -------------------------------------------------------------------------------- /src/components/infoTooltips/ReserveFactorTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | 3 | import { Link } from '../primitives/Link'; 4 | import { TextWithTooltip, TextWithTooltipProps } from '../TextWithTooltip'; 5 | 6 | interface ReserveFactorTooltipProps extends TextWithTooltipProps { 7 | collectorLink?: string; 8 | } 9 | 10 | export const ReserveFactorTooltip = ({ collectorLink, ...rest }: ReserveFactorTooltipProps) => { 11 | return ( 12 | 13 | 14 | Reserve factor is a percentage of interest which goes to a{' '} 15 | {collectorLink ? ( 16 | collector contract 17 | ) : ( 18 | 'collector contract' 19 | )}{' '} 20 | that is controlled by Aave governance to promote ecosystem growth.{' '} 21 | 22 | 23 | ); 24 | }; 25 | -------------------------------------------------------------------------------- /src/components/transactions/CancelCowOrder/CancelCowOrderModal.tsx: -------------------------------------------------------------------------------- 1 | import { BasicModal } from 'src/components/primitives/BasicModal'; 2 | import { ModalContextType, ModalType, useModalContext } from 'src/hooks/useModal'; 3 | import { ActionFields, TransactionHistoryItem } from 'src/modules/history/types'; 4 | 5 | import { TxModalTitle } from '../FlowCommons/TxModalTitle'; 6 | import { CancelCowOrderModalContent } from './CancelCowOrderModalContent'; 7 | 8 | export const CancelCowOrderModal = () => { 9 | const { type, close, args } = useModalContext() as ModalContextType<{ 10 | cowOrder: TransactionHistoryItem; 11 | }>; 12 | return ( 13 | 14 | 15 | 16 | 17 | ); 18 | }; 19 | -------------------------------------------------------------------------------- /public/icons/networks/ink.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/components/Warnings/OffboardingWarning.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import { CustomMarket } from 'src/ui-config/marketsConfig'; 3 | 4 | import { Link } from '../primitives/Link'; 5 | 6 | export const AssetsBeingOffboarded: { [market: string]: { [symbol: string]: string } } = { 7 | [CustomMarket.proto_mainnet]: { 8 | BUSD: 'https://governance.aave.com/t/arfc-busd-offboarding-plan/12170', 9 | TUSD: 'https://governance.aave.com/t/arfc-tusd-offboarding-plan/14008', 10 | }, 11 | }; 12 | 13 | export const OffboardingWarning = ({ discussionLink }: { discussionLink: string }) => { 14 | return ( 15 | 16 | This asset is planned to be offboarded due to an Aave Protocol Governance decision.{' '} 17 | 18 | More details 19 | 20 | 21 | ); 22 | }; 23 | -------------------------------------------------------------------------------- /src/components/infoTooltips/BorrowDisabledToolTip.tsx: -------------------------------------------------------------------------------- 1 | import { ExclamationIcon } from '@heroicons/react/outline'; 2 | import { Box, SvgIcon } from '@mui/material'; 3 | 4 | import { ContentWithTooltip } from '../ContentWithTooltip'; 5 | import { BorrowDisabledWarning } from '../Warnings/BorrowDisabledWarning'; 6 | 7 | interface BorrowDisabledToolTipProps { 8 | symbol: string; 9 | currentMarket: string; 10 | } 11 | export const BorrowDisabledToolTip = ({ symbol, currentMarket }: BorrowDisabledToolTipProps) => { 12 | return ( 13 | 16 | 17 | 18 | } 19 | > 20 | 21 | 22 | 23 | 24 | ); 25 | }; 26 | -------------------------------------------------------------------------------- /public/icons/tokens/bal.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/ui-config/onRampServicesConfig.tsx: -------------------------------------------------------------------------------- 1 | import TransakLogo from 'public/icons/onRampServices/transak.svg'; 2 | import { ReactNode } from 'react'; 3 | 4 | interface MakeLinkParams { 5 | cryptoSymbol: string; 6 | network: string; 7 | walletAddress: string; 8 | } 9 | 10 | interface OnRampServices { 11 | name: string; 12 | makeLink: ({ cryptoSymbol, network, walletAddress }: MakeLinkParams) => string; 13 | icon: ReactNode; 14 | } 15 | 16 | export const onRampServices: OnRampServices[] = [ 17 | { 18 | name: 'Transak', 19 | makeLink: ({ cryptoSymbol, network, walletAddress }) => 20 | `${process.env.NEXT_PUBLIC_TRANSAK_APP_URL}/?apiKey=${ 21 | process.env.NEXT_PUBLIC_TRANSAK_API_KEY 22 | }&network=${ 23 | network.split(' ')[0] 24 | }&cryptoCurrencyCode=${cryptoSymbol}&walletAddress=${walletAddress}&disableWalletAddressForm=true`, 25 | icon: , 26 | }, 27 | ]; 28 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ## General Changes 2 | 3 | - Fixes XYZ bug 4 | - Adds XYZ feature 5 | - … 6 | 7 | ## Developer Notes 8 | 9 | Add any notes here that may be helpful for reviewers. 10 | 11 | --- 12 | 13 | ## Reviewer Checklist 14 | 15 | Please ensure you, as the reviewer(s), have gone through this checklist to ensure that the code changes are ready to ship safely and to help mitigate any downstream issues that may occur. 16 | 17 | - [ ] End-to-end tests are passing without any errors 18 | - [ ] Code changes do not significantly increase the application bundle size 19 | - [ ] If there are new 3rd-party packages, they do not introduce potential security threats 20 | - [ ] If there are new environment variables being added, they have been added to the `.env.example` file as well as the pertinant `.github/actions/*` files 21 | - [ ] There are no CI changes, or they have been approved by the DevOps and Engineering team(s) 22 | -------------------------------------------------------------------------------- /public/icons/tokens/xaut.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/components/incentives/EthenaIncentivesTooltipContent.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import { Box } from '@mui/material'; 3 | 4 | import { Link } from '../primitives/Link'; 5 | 6 | export const EthenaAirdropTooltipContent = ({ points }: { points: number }) => { 7 | return ( 8 | 9 | {`This asset is eligible for ${({points}x)} Ethena Rewards.\n`} 10 |
11 | {'Learn more about Ethena Rewards program'}{' '} 12 | 18 | {'here'} 19 | 20 | {'.'} 21 |
22 |
23 | 24 | {`Aave Labs does not 25 | guarantee the program and accepts no liability.\n`} 26 | 27 |
28 | ); 29 | }; 30 | -------------------------------------------------------------------------------- /src/hooks/stake/common.ts: -------------------------------------------------------------------------------- 1 | import { Stake } from '@aave/contract-helpers'; 2 | import { stakeConfig } from 'src/ui-config/stakeConfig'; 3 | 4 | export const { 5 | tokens: { 6 | aave: { TOKEN_STAKING: STK_AAVE, TOKEN_ORACLE: STK_AAVE_ORACLE }, 7 | bpt: { TOKEN_STAKING: STK_BPT, TOKEN_ORACLE: STK_BPT_ORACLE }, 8 | gho: { TOKEN_STAKING: STK_GHO, TOKEN_ORACLE: STK_GHO_ORACLE }, 9 | bptv2: { TOKEN_STAKING: STK_BPTV2, TOKEN_ORACLE: STK_BPTV2_ORACLE }, 10 | }, 11 | } = stakeConfig; 12 | 13 | export const stakedTokens = [STK_AAVE, STK_BPT, STK_GHO, STK_BPTV2]; 14 | export const oracles = [STK_AAVE_ORACLE, STK_BPT_ORACLE, STK_GHO_ORACLE, STK_BPTV2_ORACLE]; 15 | 16 | export function getStakeIndex(stake: Stake) { 17 | switch (stake) { 18 | case Stake.aave: 19 | return 0; 20 | case Stake.bpt: 21 | return 1; 22 | case Stake.gho: 23 | return 2; 24 | case Stake.bptv2: 25 | return 3; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/modules/migration/MigrationListItemToggler.tsx: -------------------------------------------------------------------------------- 1 | import { Box, Switch } from '@mui/material'; 2 | import React from 'react'; 3 | 4 | import { IsolatedEnabledBadge } from '../../components/isolationMode/IsolatedBadge'; 5 | 6 | interface MigrationListItemTogglerProps { 7 | enableAsCollateral: () => void; 8 | enabledAsCollateral?: boolean; 9 | } 10 | 11 | export const MigrationListItemToggler = ({ 12 | enableAsCollateral, 13 | enabledAsCollateral, 14 | }: MigrationListItemTogglerProps) => { 15 | return ( 16 | 24 | 30 | 31 | 32 | ); 33 | }; 34 | -------------------------------------------------------------------------------- /cypress/e2e/1-v3-markets/10-metis-v3-market/general.metis-v3.cy.ts: -------------------------------------------------------------------------------- 1 | import assets from '../../../fixtures/assets.json'; 2 | import constants from '../../../fixtures/constans.json'; 3 | import { skipState } from '../../../support/steps/common'; 4 | import { configEnvMetis } from '../../../support/steps/configuration.steps'; 5 | import { dashboardAssetValuesVerification } from '../../../support/steps/verification.steps'; 6 | 7 | const testData = { 8 | dashboard: [ 9 | { 10 | type: constants.dashboardTypes.deposit, 11 | assetName: assets.metisV3Market.METIS.shortName, 12 | collateralType: constants.collateralType.isCollateral, 13 | isCollateral: false, 14 | }, 15 | ], 16 | }; 17 | 18 | describe.skip('METIS GENERAL SPEC', () => { 19 | const skipTestState = skipState(false); 20 | configEnvMetis('0xea4198Fa2BD2b459967E72f508ff42dDaBb0ff27'); 21 | dashboardAssetValuesVerification(testData.dashboard, skipTestState); 22 | }); 23 | -------------------------------------------------------------------------------- /public/icons/tokens/tbtc.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/components/primitives/Row.tsx: -------------------------------------------------------------------------------- 1 | import { Box, BoxProps, Typography } from '@mui/material'; 2 | import { ReactNode } from 'react'; 3 | 4 | interface RowProps extends BoxProps { 5 | caption?: ReactNode; 6 | captionVariant?: 'secondary16' | 'description' | 'subheader1' | 'caption' | 'h3'; 7 | captionColor?: string; 8 | align?: 'center' | 'flex-start'; 9 | } 10 | 11 | export const Row = ({ 12 | caption, 13 | children, 14 | captionVariant = 'secondary16', 15 | captionColor, 16 | align = 'center', 17 | ...rest 18 | }: RowProps) => { 19 | return ( 20 | 24 | {caption && ( 25 | 26 | {caption} 27 | 28 | )} 29 | 30 | {children} 31 | 32 | ); 33 | }; 34 | -------------------------------------------------------------------------------- /src/modules/faucet/FaucetItemLoader.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import { Box, Button, Skeleton } from '@mui/material'; 3 | 4 | import { ListColumn } from '../../components/lists/ListColumn'; 5 | import { ListItem } from '../../components/lists/ListItem'; 6 | 7 | export const FaucetItemLoader = () => { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 25 | 26 | 27 | ); 28 | }; 29 | -------------------------------------------------------------------------------- /cypress/e2e/1-v3-markets/11-scroll-v3-market/general.scroll-v3.cy.ts: -------------------------------------------------------------------------------- 1 | import assets from '../../../fixtures/assets.json'; 2 | import constants from '../../../fixtures/constans.json'; 3 | import { skipState } from '../../../support/steps/common'; 4 | import { configEnvScroll } from '../../../support/steps/configuration.steps'; 5 | import { dashboardAssetValuesVerification } from '../../../support/steps/verification.steps'; 6 | 7 | const testData = { 8 | dashboard: [ 9 | { 10 | type: constants.dashboardTypes.deposit, 11 | assetName: assets.scrollV3Market.ETH.shortName, 12 | collateralType: constants.collateralType.isCollateral, 13 | isCollateral: true, 14 | }, 15 | ], 16 | }; 17 | 18 | describe.skip('SCROLL GENERAL SPEC', () => { 19 | const skipTestState = skipState(false); 20 | configEnvScroll('0xF93457533efd041D2A5200A82ccA718Fcdc42103'); 21 | dashboardAssetValuesVerification(testData.dashboard, skipTestState); 22 | }); 23 | -------------------------------------------------------------------------------- /public/icons/tokens/ethx.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/icons/tokens/pyusd.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/components/transactions/SavingsGho/SavingsGhoDepositModal.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import { BasicModal } from 'src/components/primitives/BasicModal'; 3 | import { ModalContextType, ModalType, useModalContext } from 'src/hooks/useModal'; 4 | 5 | import { ModalWrapper } from '../FlowCommons/ModalWrapper'; 6 | import { SavingsGhoModalDepositContent } from './SavingsGhoModalDepositContent'; 7 | 8 | export const SavingsGhoDepositModal = () => { 9 | const { type, close, args } = useModalContext() as ModalContextType<{ 10 | underlyingAsset: string; 11 | }>; 12 | 13 | return ( 14 | 15 | Deposit GHO} 17 | underlyingAsset={args.underlyingAsset} 18 | hideTitleSymbol 19 | > 20 | {() => } 21 | 22 | 23 | ); 24 | }; 25 | -------------------------------------------------------------------------------- /src/components/transactions/Switch/SwitchErrors.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import { SxProps, Typography } from '@mui/material'; 3 | import { Warning } from 'src/components/primitives/Warning'; 4 | 5 | import { SwitchRatesError } from './SwitchRatesError'; 6 | 7 | interface SwitchErrorsProps { 8 | ratesError: unknown; 9 | balance: string; 10 | inputAmount: string; 11 | sx?: SxProps; 12 | } 13 | 14 | export const SwitchErrors = ({ ratesError, balance, inputAmount, sx }: SwitchErrorsProps) => { 15 | if (ratesError) { 16 | return ; 17 | } else if (Number(inputAmount) > Number(balance)) { 18 | return ( 19 | 20 | 21 | Your balance is lower than the selected amount. 22 | 23 | 24 | ); 25 | } 26 | return null; 27 | }; 28 | -------------------------------------------------------------------------------- /pages/bridge.page.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import { useEffect } from 'react'; 3 | import { ContentContainer } from 'src/components/ContentContainer'; 4 | import { MainLayout } from 'src/layouts/MainLayout'; 5 | import { BridgeTopPanel } from 'src/modules/bridge/BridgeTopPanel'; 6 | import { BridgeWrapper } from 'src/modules/bridge/BridgeWrapper'; 7 | import { useRootStore } from 'src/store/root'; 8 | 9 | export default function Bridge() { 10 | const trackEvent = useRootStore((store) => store.trackEvent); 11 | 12 | useEffect(() => { 13 | trackEvent('Page Viewed', { 14 | 'Page Name': 'Bridge Transactions', 15 | }); 16 | }, [trackEvent]); 17 | return ( 18 | <> 19 | 20 | 21 | 22 | 23 | 24 | ); 25 | } 26 | 27 | Bridge.getLayout = function getLayout(page: React.ReactElement) { 28 | return {page}; 29 | }; 30 | -------------------------------------------------------------------------------- /pages/history.page.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import { useEffect } from 'react'; 3 | import { ContentContainer } from 'src/components/ContentContainer'; 4 | import { MainLayout } from 'src/layouts/MainLayout'; 5 | import { HistoryTopPanel } from 'src/modules/history/HistoryTopPanel'; 6 | import { HistoryWrapper } from 'src/modules/history/HistoryWrapper'; 7 | import { useRootStore } from 'src/store/root'; 8 | 9 | export default function History() { 10 | const trackEvent = useRootStore((store) => store.trackEvent); 11 | 12 | useEffect(() => { 13 | trackEvent('Page Viewed', { 14 | 'Page Name': 'History', 15 | }); 16 | }, [trackEvent]); 17 | return ( 18 | <> 19 | 20 | 21 | 22 | 23 | 24 | ); 25 | } 26 | 27 | History.getLayout = function getLayout(page: React.ReactElement) { 28 | return {page}; 29 | }; 30 | -------------------------------------------------------------------------------- /src/modules/reserve-overview/graphs/GraphLegend.tsx: -------------------------------------------------------------------------------- 1 | import { Box, Typography } from '@mui/material'; 2 | 3 | interface GraphLegendProps { 4 | labels: { text: string; color: string }[]; 5 | } 6 | 7 | export function GraphLegend({ 8 | labels = [ 9 | { text: 'test', color: '#000' }, 10 | { text: 'bla', color: '#ff0' }, 11 | ], 12 | }: GraphLegendProps) { 13 | return ( 14 | 15 | {labels.map((label) => ( 16 | 17 | 26 | 27 | {label.text} 28 | 29 | 30 | ))} 31 | 32 | ); 33 | } 34 | -------------------------------------------------------------------------------- /public/icons/tokens/gno.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/icons/tokens/seth.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.github/actions/fork-result-comment/action.yml: -------------------------------------------------------------------------------- 1 | name: Comment on CI results 2 | description: Comment on CI results 3 | inputs: 4 | PULL_REQUEST_NUMBER: 5 | description: Pull request id 6 | required: false 7 | default: '0' 8 | COMMENT_BODY: 9 | description: Text of the comment 10 | required: true 11 | runs: 12 | using: 'composite' 13 | steps: 14 | - name: Find Comment 15 | uses: peter-evans/find-comment@1769778a0c5bd330272d749d12c036d65e70d39d # v2.0.0 16 | id: fc 17 | with: 18 | issue-number: '${{ inputs.PULL_REQUEST_NUMBER }}' 19 | body-includes: 'runs/${{ github.run_id }}' 20 | 21 | - name: Update Comment 22 | uses: peter-evans/create-or-update-comment@c9fcb64660bc90ec1cc535646af190c992007c32 # v2.0.0 23 | with: 24 | issue-number: '${{ inputs.PULL_REQUEST_NUMBER }}' 25 | body: '${{ inputs.COMMENT_BODY }}' 26 | comment-id: ${{ steps.fc.outputs.comment-id }} 27 | edit-mode: replace 28 | -------------------------------------------------------------------------------- /src/store/utils/queryParams.ts: -------------------------------------------------------------------------------- 1 | import Router from 'next/router'; 2 | 3 | export const setQueryParameter = (key: string, value: string) => { 4 | if (typeof window !== 'undefined') { 5 | Router.push({ query: { ...getAllQueryParameters(), [key]: value } }, undefined, { 6 | shallow: true, 7 | }); 8 | } 9 | }; 10 | 11 | export const getQueryParameter = (key: string) => { 12 | if (typeof window !== 'undefined' && 'URLSearchParams' in window) { 13 | const proxy = new Proxy(new URLSearchParams(window.location.search), { 14 | get: (searchParams, prop) => searchParams.get(prop as string), 15 | }); 16 | return (proxy as unknown as { [key: string]: string })[key]; 17 | } 18 | }; 19 | 20 | export const getAllQueryParameters = () => { 21 | if (typeof window !== 'undefined' && 'URLSearchParams' in window) { 22 | const urlSearchParams = new URLSearchParams(window.location.search); 23 | return Object.fromEntries(urlSearchParams.entries()); 24 | } 25 | }; 26 | -------------------------------------------------------------------------------- /src/components/SecondsToString.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | 3 | function secondsToDHMS(seconds: number) { 4 | const d = Math.floor(seconds / (3600 * 24)); 5 | const h = Math.floor((seconds % (3600 * 24)) / 3600); 6 | const m = Math.floor((seconds % 3600) / 60); 7 | const s = Math.floor(seconds % 60); 8 | return { d, h, m, s }; 9 | } 10 | 11 | export function SecondsToString({ seconds }: { seconds: number }) { 12 | const { d, h, m, s } = secondsToDHMS(seconds); 13 | return ( 14 | <> 15 | {d !== 0 && ( 16 | 17 | {d}d 18 | 19 | )} 20 | {h !== 0 && ( 21 | 22 | {h}h 23 | 24 | )} 25 | {m !== 0 && ( 26 | 27 | {m}m 28 | 29 | )} 30 | {s !== 0 && ( 31 | 32 | {s}s 33 | 34 | )} 35 | 36 | ); 37 | } 38 | -------------------------------------------------------------------------------- /src/components/infoTooltips/AvailableTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | 3 | import { CapType } from '../caps/helper'; 4 | import { TextWithTooltip, TextWithTooltipProps } from '../TextWithTooltip'; 5 | 6 | interface AvailableTooltipProps extends TextWithTooltipProps { 7 | capType: CapType; 8 | } 9 | 10 | export const AvailableTooltip = ({ capType, ...rest }: AvailableTooltipProps) => { 11 | const description = 12 | capType === CapType.supplyCap ? ( 13 | 14 | This is the total amount that you are able to supply to in this reserve. You are able to 15 | supply your wallet balance up until the supply cap is reached. 16 | 17 | ) : ( 18 | 19 | This is the total amount available for you to borrow. You can borrow based on your 20 | collateral and until the borrow cap is reached. 21 | 22 | ); 23 | 24 | return {description}; 25 | }; 26 | -------------------------------------------------------------------------------- /src/components/infoTooltips/PausedTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { ExclamationIcon } from '@heroicons/react/outline'; 2 | import { Trans } from '@lingui/macro'; 3 | import { Stack, SvgIcon, Tooltip } from '@mui/material'; 4 | 5 | import { PopperComponent } from '../ContentWithTooltip'; 6 | 7 | export const PausedTooltipText = () => { 8 | return ( 9 | 10 | This asset has been paused due to a community decision. Supply, withdraw, borrows and repays 11 | are impacted. 12 | 13 | ); 14 | }; 15 | 16 | export const PausedTooltip = () => { 17 | return ( 18 | 24 | 25 | 26 | } 27 | > 28 | 29 | 30 | 31 | 32 | ); 33 | }; 34 | -------------------------------------------------------------------------------- /public/icons/bridge/avalanche.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/components/incentives/SonicIncentivesTooltipContent.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import { Box } from '@mui/material'; 3 | 4 | import { Link } from '../primitives/Link'; 5 | 6 | export const SonicAirdropTooltipContent = ({ points }: { points: number }) => { 7 | return ( 8 | 9 | {`This asset is eligible for ${({points}x)} Sonic Rewards.\n`} 10 |
11 | {'Learn more about Sonic Rewards program'}{' '} 12 | 18 | {'here'} 19 | 20 | {'.'} 21 |
22 |
23 | 24 | {`Aave Labs does not 25 | guarantee the program and accepts no liability.\n`} 26 | 27 |
28 | ); 29 | }; 30 | -------------------------------------------------------------------------------- /src/components/transactions/SavingsGho/SavingsGhoWithdrawModal.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import { BasicModal } from 'src/components/primitives/BasicModal'; 3 | import { ModalContextType, ModalType, useModalContext } from 'src/hooks/useModal'; 4 | 5 | import { ModalWrapper } from '../FlowCommons/ModalWrapper'; 6 | import { SavingsGhoModalWithdrawContent } from './SavingsGhoWithdrawModalContent'; 7 | 8 | export const SavingsGhoWithdrawModal = () => { 9 | const { type, close, args } = useModalContext() as ModalContextType<{ 10 | underlyingAsset: string; 11 | }>; 12 | 13 | return ( 14 | 15 | Withdraw GHO} 17 | underlyingAsset={args.underlyingAsset} 18 | hideTitleSymbol 19 | > 20 | {(params) => } 21 | 22 | 23 | ); 24 | }; 25 | -------------------------------------------------------------------------------- /public/icons/tokens/kncl.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.github/workflows/crowdin-upload.yml: -------------------------------------------------------------------------------- 1 | name: Upload Crowdin files 2 | 3 | # on any push to main, we upload the translations to be translated 4 | on: 5 | push: 6 | branches: 7 | - main 8 | 9 | jobs: 10 | upload-to-crowdin: 11 | name: Upload sources to Crowdin 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - name: Checkout 16 | uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 17 | 18 | - uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # v3.4.1 19 | with: 20 | node-version-file: '.nvmrc' 21 | cache: 'yarn' 22 | 23 | - name: Synchronize 24 | uses: crowdin/github-action@97aa99cbebfe99b964e3521e6421c1518146d4b9 # v1.4.12 25 | with: 26 | upload_sources: true 27 | download_translations: false 28 | config: 'crowdin.yml' 29 | env: 30 | GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }} 31 | CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_TOKEN }} 32 | -------------------------------------------------------------------------------- /public/icons/tokens/ausd.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/icons/tokens/wsteth.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/components/incentives/EtherfiIncentivesTooltipContent.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import { Box } from '@mui/material'; 3 | 4 | import { Link } from '../primitives/Link'; 5 | 6 | export const EtherFiAirdropTooltipContent = ({ multiplier }: { multiplier: number }) => { 7 | return ( 8 | 9 | 10 | {`This asset is eligible for the Ether.fi Loyalty program with a `} 11 | x{multiplier} multiplier 12 | {`.`} 13 | 14 |
15 | Learn more about the Ether.fi program{' '} 16 | 22 | here 23 | 24 | . 25 |
26 |
27 | Aave Labs does not guarantee the program and accepts no liability. 28 |
29 | ); 30 | }; 31 | -------------------------------------------------------------------------------- /src/components/transactions/GasStation/GasButton.tsx: -------------------------------------------------------------------------------- 1 | import { Skeleton, ToggleButton, ToggleButtonProps, Typography } from '@mui/material'; 2 | import { formatUnits } from 'ethers/lib/utils'; 3 | import React from 'react'; 4 | 5 | import { GasOption } from './GasStationProvider'; 6 | 7 | export interface GasButtonProps extends ToggleButtonProps { 8 | value: GasOption; 9 | gwei?: string | undefined; 10 | } 11 | 12 | export const GasButton: React.FC = ({ value, gwei, ...props }) => { 13 | return ( 14 | 15 | {gwei ? ( 16 | 17 | {parseFloat(formatUnits(gwei, 'gwei')).toLocaleString(undefined, { 18 | maximumFractionDigits: 2, 19 | })} 20 | 21 | ) : ( 22 | 23 | )} 24 | 25 | ); 26 | }; 27 | -------------------------------------------------------------------------------- /public/icons/tokens/usdc.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/icons/tokens/vbill.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/components/transactions/Switch/common.ts: -------------------------------------------------------------------------------- 1 | import { BaseNetworkConfig } from 'src/ui-config/networksConfig'; 2 | import { 3 | getSupportedChainIds, 4 | marketsData, 5 | networkConfigs, 6 | } from 'src/utils/marketsAndNetworksConfig'; 7 | 8 | export interface SupportedNetworkWithChainId extends BaseNetworkConfig { 9 | chainId: number; 10 | } 11 | 12 | export const supportedNetworksConfig: SupportedNetworkWithChainId[] = getSupportedChainIds().map( 13 | (chainId) => ({ 14 | ...networkConfigs[chainId], 15 | chainId, 16 | }) 17 | ); 18 | export const supportedNetworksWithEnabledMarket = supportedNetworksConfig.filter((elem) => 19 | Object.values(marketsData).find( 20 | (market) => market.chainId === elem.chainId && market.enabledFeatures?.switch 21 | ) 22 | ); 23 | 24 | export const supportedNetworksWithEnabledMarketLimit = supportedNetworksConfig.filter((elem) => 25 | Object.values(marketsData).find( 26 | (market) => market.chainId === elem.chainId && market.enabledFeatures?.limit 27 | ) 28 | ); 29 | -------------------------------------------------------------------------------- /src/hooks/stake/apyCalculator.ts: -------------------------------------------------------------------------------- 1 | import { BigNumber } from 'bignumber.js'; 2 | 3 | const SECONDS_PER_YEAR = 31536000; 4 | 5 | export const calculateApy = ( 6 | emissionsPerSecond: string, 7 | stakeTokenTotalAssets: string, 8 | stakeTokenPrice: string, 9 | stakeTokenDecimals: number, 10 | rewardTokenPrice: string, 11 | rewardTokenDecimals: number 12 | ) => { 13 | const emissionsScaled = new BigNumber(emissionsPerSecond).multipliedBy( 14 | new BigNumber(10).exponentiatedBy(rewardTokenDecimals) 15 | ); 16 | const yearlyRewards = emissionsScaled.multipliedBy(SECONDS_PER_YEAR); 17 | const yearlyRewardsUsd = yearlyRewards.multipliedBy(rewardTokenPrice); 18 | 19 | const stakeTokenTotalAssetsScaled = new BigNumber(stakeTokenTotalAssets).multipliedBy( 20 | new BigNumber(10).exponentiatedBy(stakeTokenDecimals) 21 | ); 22 | 23 | const stakeTokenTotalAssetsScaledUsd = stakeTokenTotalAssetsScaled.multipliedBy(stakeTokenPrice); 24 | 25 | return yearlyRewardsUsd.dividedBy(stakeTokenTotalAssetsScaledUsd); 26 | }; 27 | --------------------------------------------------------------------------------