Skip to content

Commit

Permalink
Merge branch 'main' into feat/wallet-framework-update
Browse files Browse the repository at this point in the history
  • Loading branch information
grothem committed Dec 13, 2024
2 parents e985004 + f73b2cd commit 551da1f
Show file tree
Hide file tree
Showing 19 changed files with 111 additions and 55 deletions.
29 changes: 3 additions & 26 deletions .github/workflows/update-prod-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,7 @@ jobs:
strategy:
matrix:
environment:
[
{ name: 'Production', domain: 'app.aave.com', artifact: 'out', build_path: 'out' },
{
name: 'Staging',
domain: 'staging.aave.com',
artifact: 'out_staging',
build_path: 'out_staging',
},
]
[{ name: 'Production', domain: 'app.aave.com', artifact: 'out', build_path: 'out' }]
environment:
name: ${{ matrix.environment.name }}
url: https://${{ matrix.environment.domain }}
Expand All @@ -35,18 +27,6 @@ jobs:
name: ${{ matrix.environment.artifact }}
path: ${{ matrix.environment.build_path }}

# Only for staging environment
- name: pinata
id: pinata
if: matrix.environment.name == 'Staging'
uses: aave/pinata-action@35662944e92cf082457973f10aa42e48df179b47
with:
PINATA_API_KEY: '${{ secrets.PINATA_API_KEY }}'
PINATA_SECRET_KEY: '${{ secrets.PINATA_SECRET_KEY }}'
PIN_ALIAS: 'app-aave-staging'
BUILD_LOCATION: './out_staging'
CID_VERSION: 1

- name: Pin to primary IPFS server
id: ipfs-primary
uses: ./.github/actions/ipfs-pin
Expand All @@ -56,25 +36,22 @@ jobs:
IPFS_SERVER: '${{ secrets.IPFS_PRIMARY_SERVER }}'
IPFS_SERVER_KEY: '${{ secrets.IPFS_PRIMARY_SERVER_KEY }}'
BUILD_PATH: ${{ matrix.environment.build_path }}
PINATA_HASH: ${{ matrix.environment.name == 'Production' && inputs.PINATA_HASH || steps.pinata.outputs.hash }}
PINATA_HASH: ${{ inputs.PINATA_HASH }}

- uses: aave/cloudflare-update-action@0f2084730a068fab162853c4e7cc40537233d34a
with:
CF_API_TOKEN: '${{ secrets.CF_API_TOKEN }}'
CF_ZONE_ID: '${{ secrets.CF_ZONE_ID }}'
HASH: ${{ matrix.environment.name == 'Production' && inputs.PINATA_HASH || steps.pinata.outputs.hash }}
HASH: ${{ inputs.PINATA_HASH }}
CF_DEPLOYMENT_DOMAIN: ${{ matrix.environment.domain }}

# Only for production environment
- name: prepare release
if: matrix.environment.name == 'Production'
run: |
cp .github/release-template.md ./release-notes.md
sed -i 's|<ipfs-hash>|${{ inputs.PINATA_HASH }}|g' ./release-notes.md
echo "TAG=release-$(date '+%Y-%m-%d_%H-%M')" >> ${GITHUB_ENV}
- name: Create GH release
if: matrix.environment.name == 'Production'
uses: ncipollo/release-action@4c75f0f2e4ae5f3c807cf0904605408e319dcaac # v1.10.0
with:
name: Production release
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,13 @@ There's a github action commenting the appropriate IPFS hash embedded in the Clo

For ease of use:

- the DNS of [https://staging.aave.com](https://staging.aave.com) will always point to the latest main IPFS hash with all networks enabled
- the DNS of [https://app.aave.com](https://app.aave.com) will always point to the latest main IPFS hash with disabled test networks
- the DNS of [https://app.aave.com](https://app.aave.com) will always point to the latest main IPFS hash.

### Testnet Networks Access
The interface now includes a feature toggle for testnet networks. Users can enable test networks by:
1. Opening the Settings menu
2. Toggling the "Testnet mode" switch
3. Once enabled, testnet networks (like Sepolia, Mumbai, etc.) will become available in the network selection menu

### Links known to work at some point:

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,5 +151,6 @@
"budget": null,
"budgetPercentIncreaseRed": 20,
"showDetails": true
}
},
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
2 changes: 1 addition & 1 deletion public/icons/other/spark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions src/components/incentives/IncentivesTooltipContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ const IncentivesSymbolMap: {
symbol: 'aUSDT',
aToken: true,
},
aEthPYUSD: {
tokenIconSymbol: 'PYUSD',
symbol: 'aPYUSD',
aToken: true,
},
aAvaSAVAX: {
tokenIconSymbol: 'sAVAX',
symbol: 'asAVAX',
aToken: true,
},
};

interface IncentivesTooltipContentProps {
Expand Down
8 changes: 6 additions & 2 deletions src/components/incentives/MeritIncentivesTooltipContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const MeritIncentivesTooltipContent = ({
}}
>
<Typography variant="caption" color="text.primary" mb={3}>
<Trans>Eligible for the merit program.</Trans>
<Trans>Eligible for the Merit program.</Trans>
</Typography>

<Typography variant="caption" color="text.secondary" mb={3}>
Expand All @@ -36,7 +36,11 @@ export const MeritIncentivesTooltipContent = ({
does not guarantee the program and accepts no liability.
</Trans>{' '}
<Link
href="https://governance.aave.com/t/arfc-merit-a-new-aave-alignment-user-reward-system/16646"
href={
meritIncentives.customForumLink
? meritIncentives.customForumLink
: 'https://governance.aave.com/t/arfc-merit-a-new-aave-alignment-user-reward-system/16646'
}
sx={{ textDecoration: 'underline' }}
variant="caption"
color="text.secondary"
Expand Down
62 changes: 60 additions & 2 deletions src/hooks/useMeritIncentives.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,33 @@
import { ProtocolAction } from '@aave/contract-helpers';
import { ReserveIncentiveResponse } from '@aave/math-utils/dist/esm/formatters/incentive/calculate-reserve-incentives';
import { AaveV3Base, AaveV3Ethereum } from '@bgd-labs/aave-address-book';
import { AaveV3Avalanche, AaveV3Base, AaveV3Ethereum } from '@bgd-labs/aave-address-book';
import { useQuery } from '@tanstack/react-query';
import { CustomMarket } from 'src/ui-config/marketsConfig';

export enum MeritAction {
ETHEREUM_STKGHO = 'ethereum-stkgho',
ETHEREUM_SUPPLY_PYUSD = 'ethereum-supply-pyusd',
SUPPLY_CBBTC_BORROW_USDC = 'ethereum-supply-cbbtc-borrow-usdc',
SUPPLY_WBTC_BORROW_USDT = 'ethereum-supply-wbtc-borrow-usdt',
BASE_SUPPLY_CBBTC = 'base-supply-cbbtc',
BASE_SUPPLY_USDC = 'base-supply-usdc',
BASE_BORROW_USDC = 'base-borrow-usdc',
AVALANCHE_SUPPLY_BTCB = 'avalanche-supply-btcb',
AVALANCHE_SUPPLY_USDC = 'avalanche-supply-usdc',
AVALANCHE_SUPPLY_USDT = 'avalanche-supply-usdt',
AVALANCHE_SUPPLY_SAVAX = 'avalanche-supply-savax',
}

type MeritIncentives = {
totalAPR: number;
actionsAPR: {
[key in MeritAction]: number;
[key in MeritAction]: number | null | undefined;
};
};

export type ExtendedReserveIncentiveResponse = ReserveIncentiveResponse & {
customMessage: string;
customForumLink: string;
};

const url = 'https://apps.aavechan.com/api/merit/aprs';
Expand All @@ -30,6 +36,7 @@ export type MeritReserveIncentiveData = Omit<ReserveIncentiveResponse, 'incentiv
action: MeritAction;
protocolAction?: ProtocolAction;
customMessage?: string;
customForumLink?: string;
};

const getMeritData = (market: string, symbol: string): MeritReserveIncentiveData[] | undefined =>
Expand Down Expand Up @@ -80,6 +87,18 @@ const MERIT_DATA_MAP: Record<string, Record<string, MeritReserveIncentiveData[]>
customMessage: 'You must supply wBTC and borrow USDT in order to receive merit rewards.',
},
],
PYUSD: [
{
action: MeritAction.ETHEREUM_SUPPLY_PYUSD,
rewardTokenAddress: AaveV3Ethereum.ASSETS.PYUSD.A_TOKEN,
rewardTokenSymbol: 'aEthPYUSD',
protocolAction: ProtocolAction.supply,
customForumLink:
'https://governance.aave.com/t/arfc-pyusd-reserve-configuration-update-incentive-campaign/19573',
customMessage:
'Borrowing of some assets may impact the amount of rewards you are eligible for. Please check the forum post for the full eligibility criteria.',
},
],
},
[CustomMarket.proto_base_v3]: {
cbBTC: [
Expand All @@ -105,6 +124,40 @@ const MERIT_DATA_MAP: Record<string, Record<string, MeritReserveIncentiveData[]>
},
],
},
[CustomMarket.proto_avalanche_v3]: {
['BTC.b']: [
{
action: MeritAction.AVALANCHE_SUPPLY_BTCB,
rewardTokenAddress: AaveV3Avalanche.ASSETS.BTCb.A_TOKEN,
rewardTokenSymbol: 'aAvaSAVAX',
protocolAction: ProtocolAction.supply,
},
],
USDC: [
{
action: MeritAction.AVALANCHE_SUPPLY_USDC,
rewardTokenAddress: AaveV3Avalanche.ASSETS.USDC.A_TOKEN,
rewardTokenSymbol: 'aAvaSAVAX',
protocolAction: ProtocolAction.supply,
},
],
USDt: [
{
action: MeritAction.AVALANCHE_SUPPLY_USDT,
rewardTokenAddress: AaveV3Avalanche.ASSETS.USDt.A_TOKEN,
rewardTokenSymbol: 'aAvaSAVAX',
protocolAction: ProtocolAction.supply,
},
],
sAVAX: [
{
action: MeritAction.AVALANCHE_SUPPLY_SAVAX,
rewardTokenAddress: AaveV3Avalanche.ASSETS.sAVAX.A_TOKEN,
rewardTokenSymbol: 'aAvaSAVAX',
protocolAction: ProtocolAction.supply,
},
],
},
};

export const useMeritIncentives = ({
Expand Down Expand Up @@ -141,11 +194,16 @@ export const useMeritIncentives = ({

const APR = data.actionsAPR[incentive.action];

if (!APR) {
return null;
}

return {
incentiveAPR: (APR / 100).toString(),
rewardTokenAddress: incentive.rewardTokenAddress,
rewardTokenSymbol: incentive.rewardTokenSymbol,
customMessage: incentive.customMessage,
customForumLink: incentive.customForumLink,
} as ExtendedReserveIncentiveResponse;
},
});
Expand Down
7 changes: 4 additions & 3 deletions src/layouts/MainLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ import { AppHeader } from './AppHeader';
import TopBarNotify from './TopBarNotify';

export function MainLayout({ children }: { children: ReactNode }) {
const APP_BANNER_VERSION = '4.0.0';
const APP_BANNER_VERSION = '5.0.0';

return (
<>
<TopBarNotify
learnMoreLink="/markets/?marketName=proto_base_v3"
notifyText="Merit incentives are available for users who both supply cbBTC and borrow USDC."
learnMoreLink="https://oh7vm38ynd2.typeform.com/to/Fnw3rMyw"
notifyText="Looking to provide product feedback? We'd love to hear from you! 👉"
bannerVersion={APP_BANNER_VERSION}
buttonText="Share feedback"
/>
<AppHeader />
<Box component="main" sx={{ display: 'flex', flexDirection: 'column', flex: 1 }}>
Expand Down
4 changes: 2 additions & 2 deletions src/locales/de/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Language: de\n"
"Project-Id-Version: aave-interface\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-11-27 18:06\n"
"PO-Revision-Date: 2024-12-11 18:06\n"
"Last-Translator: \n"
"Language-Team: German\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
Expand Down Expand Up @@ -1006,7 +1006,7 @@ msgid "Efficiency mode (E-Mode)"
msgstr "Effizienz-Modus (E-Modus)"

#: src/components/incentives/MeritIncentivesTooltipContent.tsx
msgid "Eligible for the merit program."
msgid "Eligible for the Merit program."
msgstr ""

#: src/layouts/FeedbackDialog.tsx
Expand Down
2 changes: 1 addition & 1 deletion src/locales/el/messages.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/locales/el/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Language: el\n"
"Project-Id-Version: aave-interface\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-11-27 18:06\n"
"PO-Revision-Date: 2024-12-11 18:06\n"
"Last-Translator: \n"
"Language-Team: Greek\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
Expand Down Expand Up @@ -1006,7 +1006,7 @@ msgid "Efficiency mode (E-Mode)"
msgstr "Λειτουργία αποδοτικότητας (E-Mode)"

#: src/components/incentives/MeritIncentivesTooltipContent.tsx
msgid "Eligible for the merit program."
msgid "Eligible for the Merit program."
msgstr ""

#: src/layouts/FeedbackDialog.tsx
Expand Down
2 changes: 1 addition & 1 deletion src/locales/en/messages.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/locales/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -992,8 +992,8 @@ msgid "Efficiency mode (E-Mode)"
msgstr "Efficiency mode (E-Mode)"

#: src/components/incentives/MeritIncentivesTooltipContent.tsx
msgid "Eligible for the merit program."
msgstr "Eligible for the merit program."
msgid "Eligible for the Merit program."
msgstr "Eligible for the Merit program."

#: src/layouts/FeedbackDialog.tsx
msgid "Email"
Expand Down
2 changes: 1 addition & 1 deletion src/locales/es/messages.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/locales/es/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Language: es\n"
"Project-Id-Version: aave-interface\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-11-27 18:06\n"
"PO-Revision-Date: 2024-12-11 18:07\n"
"Last-Translator: \n"
"Language-Team: Spanish\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
Expand Down Expand Up @@ -1006,7 +1006,7 @@ msgid "Efficiency mode (E-Mode)"
msgstr "Modo de eficiencia (E-Mode)"

#: src/components/incentives/MeritIncentivesTooltipContent.tsx
msgid "Eligible for the merit program."
msgid "Eligible for the Merit program."
msgstr ""

#: src/layouts/FeedbackDialog.tsx
Expand Down
2 changes: 1 addition & 1 deletion src/locales/fr/messages.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/locales/fr/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Language: fr\n"
"Project-Id-Version: aave-interface\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-11-27 18:06\n"
"PO-Revision-Date: 2024-12-11 18:06\n"
"Last-Translator: \n"
"Language-Team: French\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
Expand Down Expand Up @@ -1006,7 +1006,7 @@ msgid "Efficiency mode (E-Mode)"
msgstr "Mode efficacité (E-Mode)"

#: src/components/incentives/MeritIncentivesTooltipContent.tsx
msgid "Eligible for the merit program."
msgid "Eligible for the Merit program."
msgstr ""

#: src/layouts/FeedbackDialog.tsx
Expand Down
4 changes: 2 additions & 2 deletions src/locales/ru/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Language: ru\n"
"Project-Id-Version: aave-interface\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-11-27 18:06\n"
"PO-Revision-Date: 2024-12-11 18:06\n"
"Last-Translator: \n"
"Language-Team: Russian\n"
"Plural-Forms: nplurals=4; plural=((n%10==1 && n%100!=11) ? 0 : ((n%10 >= 2 && n%10 <=4 && (n%100 < 12 || n%100 > 14)) ? 1 : ((n%10 == 0 || (n%10 >= 5 && n%10 <=9)) || (n%100 >= 11 && n%100 <= 14)) ? 2 : 3));\n"
Expand Down Expand Up @@ -1006,7 +1006,7 @@ msgid "Efficiency mode (E-Mode)"
msgstr "Режим эффективности (E-Mode)"

#: src/components/incentives/MeritIncentivesTooltipContent.tsx
msgid "Eligible for the merit program."
msgid "Eligible for the Merit program."
msgstr ""

#: src/layouts/FeedbackDialog.tsx
Expand Down
4 changes: 2 additions & 2 deletions src/locales/zh/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Language: zh\n"
"Project-Id-Version: aave-interface\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-11-27 18:06\n"
"PO-Revision-Date: 2024-12-11 18:06\n"
"Last-Translator: \n"
"Language-Team: Chinese Simplified\n"
"Plural-Forms: nplurals=1; plural=0;\n"
Expand Down Expand Up @@ -1006,7 +1006,7 @@ msgid "Efficiency mode (E-Mode)"
msgstr "效率模式(E-Mode)"

#: src/components/incentives/MeritIncentivesTooltipContent.tsx
msgid "Eligible for the merit program."
msgid "Eligible for the Merit program."
msgstr ""

#: src/layouts/FeedbackDialog.tsx
Expand Down

0 comments on commit 551da1f

Please sign in to comment.