diff --git a/.github/workflows/build-test-deploy-dev.yml b/.github/workflows/build-test-deploy-dev.yml
index 3bca92f3be..caf6591aee 100644
--- a/.github/workflows/build-test-deploy-dev.yml
+++ b/.github/workflows/build-test-deploy-dev.yml
@@ -71,6 +71,7 @@ jobs:
- ethereum
- base
- gho
+ - gnosis
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
diff --git a/.github/workflows/build-test-deploy.yml b/.github/workflows/build-test-deploy.yml
index ed1fcc86b6..8b57f08cdf 100644
--- a/.github/workflows/build-test-deploy.yml
+++ b/.github/workflows/build-test-deploy.yml
@@ -92,6 +92,7 @@ jobs:
- ethereum
- gho
- base
+ - gnosis
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
diff --git a/.github/workflows/test-deploy-fork.yml b/.github/workflows/test-deploy-fork.yml
index 0ff6999660..7b074c2703 100644
--- a/.github/workflows/test-deploy-fork.yml
+++ b/.github/workflows/test-deploy-fork.yml
@@ -91,6 +91,7 @@ jobs:
- ethereum
- base
- gho
+ - gnosis
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
diff --git a/cypress/configs/v3-markets/gnosis-v3-smoke.config.ts b/cypress/configs/v3-markets/gnosis-v3-smoke.config.ts
new file mode 100644
index 0000000000..51ee235719
--- /dev/null
+++ b/cypress/configs/v3-markets/gnosis-v3-smoke.config.ts
@@ -0,0 +1,15 @@
+import { defineConfig } from 'cypress';
+
+import { defaultConfig } from '../base.cypress';
+
+const folder = `./cypress/e2e/1-v3-markets/7-gnosis-v3-market/`;
+
+export default defineConfig({
+ ...defaultConfig,
+ e2e: {
+ specPattern: [
+ folder + '0-assets/usdc.gnosis-v3.cy.ts',
+ folder + '0-assets/sdai.gnosis-v3.cy.ts',
+ ],
+ },
+});
diff --git a/cypress/e2e/1-v3-markets/7-gnosis-v3-market/0-assets/usdc.gnosis-v3.cy.ts b/cypress/e2e/1-v3-markets/7-gnosis-v3-market/0-assets/usdc.gnosis-v3.cy.ts
new file mode 100644
index 0000000000..506fed479f
--- /dev/null
+++ b/cypress/e2e/1-v3-markets/7-gnosis-v3-market/0-assets/usdc.gnosis-v3.cy.ts
@@ -0,0 +1,85 @@
+import assets from '../../../../fixtures/assets.json';
+import constants from '../../../../fixtures/constans.json';
+import { skipState } from '../../../../support/steps/common';
+import { configEnvWithTenderlyGnosisFork } from '../../../../support/steps/configuration.steps';
+import { borrow, repay, supply, withdraw } from '../../../../support/steps/main.steps';
+import { dashboardAssetValuesVerification } from '../../../../support/steps/verification.steps';
+
+const testData = {
+ depositBaseAmount: {
+ asset: assets.gnosisV3Market.xDAI,
+ amount: 9000,
+ hasApproval: true,
+ },
+ testCases: {
+ borrow: [
+ {
+ asset: assets.gnosisV3Market.USDC,
+ amount: 50,
+ apyType: constants.borrowAPYType.default,
+ hasApproval: true,
+ },
+ ],
+ deposit: {
+ asset: assets.gnosisV3Market.USDC,
+ amount: 10.1,
+ hasApproval: false,
+ },
+ repay: [
+ {
+ asset: assets.gnosisV3Market.USDC,
+ apyType: constants.apyType.variable,
+ amount: 2,
+ hasApproval: true,
+ repayOption: constants.repayType.default,
+ },
+ {
+ asset: assets.gnosisV3Market.USDC,
+ apyType: constants.apyType.variable,
+ repayableAsset: assets.gnosisV3Market.aUSDC,
+ amount: 2,
+ hasApproval: true,
+ repayOption: constants.repayType.default,
+ },
+ ],
+ withdraw: {
+ asset: assets.gnosisV3Market.USDC,
+ isCollateral: true,
+ amount: 1,
+ hasApproval: true,
+ },
+ },
+ verifications: {
+ finalDashboard: [
+ {
+ type: constants.dashboardTypes.deposit,
+ assetName: assets.gnosisV3Market.USDC.shortName,
+ amount: 7.0,
+ collateralType: constants.collateralType.isCollateral,
+ isCollateral: true,
+ },
+ {
+ type: constants.dashboardTypes.borrow,
+ assetName: assets.gnosisV3Market.USDC.shortName,
+ amount: 46.0,
+ apyType: constants.borrowAPYType.variable,
+ },
+ ],
+ },
+};
+
+describe('USDC INTEGRATION SPEC, GNOSIS V3 MARKET', () => {
+ const skipTestState = skipState(false);
+ configEnvWithTenderlyGnosisFork({ v3: true });
+
+ supply(testData.depositBaseAmount, skipTestState, true);
+ testData.testCases.borrow.forEach((borrowCase) => {
+ borrow(borrowCase, skipTestState, true);
+ });
+ supply(testData.testCases.deposit, skipTestState, true);
+ testData.testCases.repay.forEach((repayCase) => {
+ repay(repayCase, skipTestState, false);
+ });
+ withdraw(testData.testCases.withdraw, skipTestState, false);
+ dashboardAssetValuesVerification(testData.verifications.finalDashboard, skipTestState);
+});
diff --git a/cypress/e2e/1-v3-markets/7-gnosis-v3-market/0-assets/xdai.gnosis-v3.cy.ts b/cypress/e2e/1-v3-markets/7-gnosis-v3-market/0-assets/xdai.gnosis-v3.cy.ts
new file mode 100644
index 0000000000..9b8404f69c
--- /dev/null
+++ b/cypress/e2e/1-v3-markets/7-gnosis-v3-market/0-assets/xdai.gnosis-v3.cy.ts
@@ -0,0 +1,115 @@
+import assets from '../../../../fixtures/assets.json';
+import constants from '../../../../fixtures/constans.json';
+import { skipState } from '../../../../support/steps/common';
+import { configEnvWithTenderlyGnosisFork } from '../../../../support/steps/configuration.steps';
+import {
+ borrow,
+ changeCollateral,
+ changeCollateralNegative,
+ repay,
+ supply,
+ withdraw,
+} from '../../../../support/steps/main.steps';
+import {
+ borrowsUnavailable,
+ dashboardAssetValuesVerification,
+} from '../../../../support/steps/verification.steps';
+
+const testData = {
+ testCases: {
+ deposit: {
+ asset: assets.gnosisV3Market.xDAI,
+ amount: 500,
+ hasApproval: true,
+ },
+ collateral: {
+ switchOff: {
+ asset: assets.gnosisV3Market.xDAI,
+ isCollateralType: true,
+ hasApproval: true,
+ },
+ switchOn: {
+ asset: assets.gnosisV3Market.xDAI,
+ isCollateralType: false,
+ hasApproval: true,
+ },
+ switchNegative: {
+ asset: assets.gnosisV3Market.xDAI,
+ isCollateralType: true,
+ },
+ },
+ borrow: [
+ {
+ asset: assets.gnosisV3Market.xDAI,
+ amount: 100,
+ apyType: constants.borrowAPYType.default,
+ hasApproval: false,
+ },
+ ],
+ withdraw: [
+ {
+ asset: assets.gnosisV3Market.xDAI,
+ isCollateral: true,
+ amount: 50,
+ hasApproval: false,
+ },
+ ],
+ repay: [
+ {
+ asset: assets.gnosisV3Market.xDAI,
+ apyType: constants.apyType.variable,
+ amount: 10,
+ hasApproval: true,
+ repayOption: constants.repayType.default,
+ },
+ {
+ asset: assets.gnosisV3Market.xDAI,
+ apyType: constants.apyType.variable,
+ repayableAsset: assets.gnosisV3Market.aWXDAI,
+ amount: 10,
+ hasApproval: false,
+ repayOption: constants.repayType.default,
+ },
+ ],
+ },
+ verifications: {
+ finalDashboard: [
+ {
+ type: constants.dashboardTypes.deposit,
+ assetName: assets.gnosisV3Market.xDAI.shortName,
+ amount: 450,
+ collateralType: constants.collateralType.isCollateral,
+ isCollateral: true,
+ },
+ {
+ type: constants.dashboardTypes.borrow,
+ assetName: assets.gnosisV3Market.xDAI.shortName,
+ amount: 90,
+ apyType: constants.borrowAPYType.variable,
+ },
+ ],
+ },
+};
+
+describe('xDAI INTEGRATION SPEC, GNOSIS V3 MARKET', () => {
+ const skipTestState = skipState(false);
+ configEnvWithTenderlyGnosisFork({ v3: true });
+
+ supply(testData.testCases.deposit, skipTestState, true);
+ describe('Check Collateral switching', () => {
+ changeCollateral(testData.testCases.collateral.switchOff, skipTestState, false);
+ borrowsUnavailable(skipTestState);
+ changeCollateral(testData.testCases.collateral.switchOn, skipTestState, false);
+ });
+ testData.testCases.borrow.forEach((borrowCase) => {
+ borrow(borrowCase, skipTestState, true);
+ });
+ changeCollateralNegative(testData.testCases.collateral.switchNegative, skipTestState, false);
+ testData.testCases.withdraw.forEach((withdrawCase) => {
+ withdraw(withdrawCase, skipTestState, false);
+ });
+ testData.testCases.repay.forEach((repayCase) => {
+ repay(repayCase, skipTestState, false);
+ });
+ dashboardAssetValuesVerification(testData.verifications.finalDashboard, skipTestState);
+});
diff --git a/cypress/e2e/2-settings/stake-abpt.cy.ts b/cypress/e2e/2-settings/stake-abpt.cy.ts
deleted file mode 100644
index 93bca59832..0000000000
--- a/cypress/e2e/2-settings/stake-abpt.cy.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { configEnvWithTenderlyMainnetFork } from '../../support/steps/configuration.steps';
-
-describe('Checking ABPT token modal on Staking page', () => {
- describe('CASE1:Open Stake page', () => {
- configEnvWithTenderlyMainnetFork({});
- it('Open Stake page', () => {
- cy.wait(2000);
- cy.get('[data-cy="menuStake"]').click();
- });
- it('Get ABP Token', () => {
- cy.contains('Stake ABPT').click();
- cy.get('[data-cy="getAbp-token"]').first().click();
- });
- it('Verify does Get ABP Token modal is opened', () => {
- cy.contains('Go to Balancer Pool').should(
- 'have.attr',
- 'href',
- 'https://pools.balancer.exchange/#/pool/0xc697051d1c6296c24ae3bcef39aca743861d9a81/'
- );
- });
- });
-});
diff --git a/cypress/e2e/3-stake-governance/stake.cy.ts b/cypress/e2e/3-stake-governance/stake.cy.ts
index a721c049ea..dc1dbe4677 100644
--- a/cypress/e2e/3-stake-governance/stake.cy.ts
+++ b/cypress/e2e/3-stake-governance/stake.cy.ts
@@ -3,10 +3,10 @@ import { skipState } from '../../support/steps/common';
import { configEnvWithTenderlyMainnetFork } from '../../support/steps/configuration.steps';
import {
activateCooldown,
- stake,
- reCallCooldown,
claimReward,
+ reCallCooldown,
reStake,
+ stake,
} from '../../support/steps/stake.steps';
const testCases = [
@@ -18,14 +18,14 @@ const testCases = [
tabValue: 'aave',
changeApproval: true,
},
- {
- asset: assets.staking.ABPT,
- amount: 5,
- checkAmount: '5.00',
- checkAmountFinal: '10.00',
- tabValue: 'bpt',
- changeApproval: false,
- },
+ // {
+ // asset: assets.staking.ABPT,
+ // amount: 5,
+ // checkAmount: '5.00',
+ // checkAmountFinal: '10.00',
+ // tabValue: 'bpt',
+ // changeApproval: false,
+ // },
];
testCases.forEach(
diff --git a/cypress/e2e/4-gho-ethereum/fixtures/gho.json b/cypress/e2e/4-gho-ethereum/fixtures/gho.json
index ad7afde19e..0983ceee08 100644
--- a/cypress/e2e/4-gho-ethereum/fixtures/gho.json
+++ b/cypress/e2e/4-gho-ethereum/fixtures/gho.json
@@ -4,7 +4,7 @@
"collateral": false,
"wrapped": false,
"apy": {
- "min": 2.13,
- "max": 3.05
+ "min": 3.38,
+ "max": 4.83
}
}
diff --git a/cypress/e2e/5-widgets/switch-tool.cy.ts b/cypress/e2e/5-widgets/switch-tool.cy.ts
index f5cb4ed181..5e47c78e63 100644
--- a/cypress/e2e/5-widgets/switch-tool.cy.ts
+++ b/cypress/e2e/5-widgets/switch-tool.cy.ts
@@ -47,11 +47,13 @@ const switchByTool = ({
}).should('be.visible', { timeout: 10000 });
});
it(`Set amount`, () => {
+ cy.wait(2000); //there is no way to know when real max amount will upload by UI
if (isMaxAmount) {
- cy.wait(2000); //there is no way to know when real max amount will upload by UI
cy.get('[data-cy=Modal]').find('button:contains("Max")').click();
} else {
- cy.get('[data-cy=Modal] input[aria-label="amount input"]').first().type(amount.toString());
+ cy.get('[data-cy=Modal] input[aria-label="amount input"]')
+ .first()
+ .type(amount.toString(), { force: true });
}
cy.get('[data-cy=Modal]').as('Modal');
cy.get('@Modal').find(`#switch-slippage-selector-button`).click();
diff --git a/cypress/fixtures/assets.json b/cypress/fixtures/assets.json
index 7b1182c3df..5dbbb740df 100644
--- a/cypress/fixtures/assets.json
+++ b/cypress/fixtures/assets.json
@@ -1055,5 +1055,31 @@
"collateral": true,
"wrapped": false
}
+ },
+ "gnosisV3Market": {
+ "xDAI": {
+ "fullName": "xDAI",
+ "shortName": "xDAI",
+ "collateral": true,
+ "wrapped": false
+ },
+ "aWXDAI": {
+ "fullName": "aWXDAI",
+ "shortName": "aWXDAI",
+ "collateral": true,
+ "wrapped": false
+ },
+ "USDC": {
+ "fullName": "USDC",
+ "shortName": "USDC",
+ "collateral": true,
+ "wrapped": false
+ },
+ "aUSDC": {
+ "fullName": "aUSDC",
+ "shortName": "aUSDC",
+ "collateral": true,
+ "wrapped": false
+ }
}
}
diff --git a/cypress/support/steps/configuration.steps.ts b/cypress/support/steps/configuration.steps.ts
index 83d5d59def..98e7b821aa 100644
--- a/cypress/support/steps/configuration.steps.ts
+++ b/cypress/support/steps/configuration.steps.ts
@@ -144,6 +144,10 @@ export const configEnvWithTenderlyAEthereumV3Fork = createConfigWithTenderlyFork
ChainId.mainnet,
'fork_proto_mainnet_v3'
);
+export const configEnvWithTenderlyGnosisFork = createConfigWithTenderlyFork(
+ ChainId.xdai,
+ 'fork_proto_gnosis_v3'
+);
export const configEnvWithTenderlyGoerliGhoFork = createConfigWithTenderlyFork(
ChainId.goerli,
'fork_proto_goerli_gho_v3'
diff --git a/package.json b/package.json
index 7dc43a794e..205f1bdadb 100644
--- a/package.json
+++ b/package.json
@@ -32,8 +32,8 @@
"test:coverage": "jest --coverage"
},
"dependencies": {
- "@aave/contract-helpers": "1.21.0",
- "@aave/math-utils": "^1.21.0",
+ "@aave/contract-helpers": "1.21.1",
+ "@aave/math-utils": "1.21.1",
"@bgd-labs/aave-address-book": "^2.10.0",
"@emotion/cache": "11.10.3",
"@emotion/react": "11.10.4",
@@ -81,7 +81,7 @@
"react-cookie-consent": "^8.0.1",
"react-dom": "latest",
"react-infinite-scroller": "^1.2.6",
- "react-markdown": "^8.0.3",
+ "react-markdown": "^8.0.7",
"react-number-format": "^4.9.1",
"reflect-metadata": "^0.1.13",
"remark-gfm": "^3.0.1",
diff --git a/public/icons/tokens/fxs.svg b/public/icons/tokens/fxs.svg
new file mode 100755
index 0000000000..b8d6d39067
--- /dev/null
+++ b/public/icons/tokens/fxs.svg
@@ -0,0 +1 @@
+
diff --git a/scripts/populate-cache.js b/scripts/populate-cache.js
index 365d103238..5d9eb1c5ec 100644
--- a/scripts/populate-cache.js
+++ b/scripts/populate-cache.js
@@ -33722,6 +33722,8 @@ var require_types2 = __commonJS({
ProtocolAction2["liquidationCall"] = "liquidationCall";
ProtocolAction2["liquidationFlash"] = "liquidationFlash";
ProtocolAction2["repay"] = "repay";
+ ProtocolAction2["repayETH"] = "repayETH";
+ ProtocolAction2["repayWithATokens"] = "repayWithATokens";
ProtocolAction2["swapCollateral"] = "swapCollateral";
ProtocolAction2["repayCollateral"] = "repayCollateral";
ProtocolAction2["withdrawETH"] = "withdrawETH";
@@ -35341,6 +35343,10 @@ var require_utils6 = __commonJS({
limit: "300000",
recommended: "300000"
},
+ [types_1.ProtocolAction.repayETH]: {
+ limit: "350000",
+ recommended: "300000"
+ },
[types_1.ProtocolAction.borrowETH]: {
limit: "450000",
recommended: "450000"
@@ -35369,6 +35375,10 @@ var require_utils6 = __commonJS({
limit: "350000",
recommended: "350000"
},
+ [types_1.ProtocolAction.stake]: {
+ limit: "350000",
+ recommended: "350000"
+ },
[types_1.ProtocolAction.stakeWithPermit]: {
limit: "400000",
recommended: "400000"
@@ -35377,10 +35387,6 @@ var require_utils6 = __commonJS({
limit: "125000",
recommended: "125000"
},
- [types_1.ProtocolAction.stake]: {
- limit: "395000",
- recommended: "395000"
- },
[types_1.ProtocolAction.claimRewards]: {
limit: "275000",
recommended: "275000"
@@ -35389,6 +35395,10 @@ var require_utils6 = __commonJS({
limit: "138000",
recommended: "138000"
},
+ [types_1.ProtocolAction.repayWithATokens]: {
+ limit: "300000",
+ recommended: "300000"
+ },
[types_1.ProtocolAction.withdrawAndSwitch]: {
limit: "1000000",
recommended: "1000000"
@@ -42422,6 +42432,23 @@ var require_wethgateway_contract = __commonJS({
};
return actionTx;
};
+ this.generateRepayEthTxData = ({ interestRateMode, lendingPool, amount, user, onBehalfOf }) => {
+ const numericRateMode = interestRateMode === types_1.InterestRate.Variable ? 2 : 1;
+ const txData = this.wethGatewayInstance.encodeFunctionData("repayETH", [
+ lendingPool,
+ amount,
+ numericRateMode,
+ onBehalfOf !== null && onBehalfOf !== void 0 ? onBehalfOf : user
+ ]);
+ const actionTx = {
+ data: txData,
+ to: this.wethGatewayAddress,
+ from: user,
+ value: ethers_1.BigNumber.from(amount),
+ gasLimit: ethers_1.BigNumber.from(utils_1.gasLimitRecommendations[types_1.ProtocolAction.repayETH].limit)
+ };
+ return actionTx;
+ };
}
depositETH({ lendingPool, user, amount, onBehalfOf, referralCode }) {
const convertedAmount = (0, utils_1.valueToWei)(amount, 18);
@@ -43658,6 +43685,32 @@ var require_lendingPool_contract_bundle = __commonJS({
return actionTx;
}
};
+ this.repayTxBuilder = {
+ generateTxData: ({ user, reserve, onBehalfOf, interestRateMode, amount }) => {
+ const actionTx = {};
+ if (reserve.toLowerCase() === utils_1.API_ETH_MOCK_ADDRESS.toLowerCase()) {
+ return this.wethGatewayService.generateRepayEthTxData({
+ lendingPool: this.lendingPoolAddress,
+ user,
+ amount,
+ interestRateMode,
+ onBehalfOf
+ });
+ }
+ const numericRateMode = interestRateMode === types_1.InterestRate.Variable ? 2 : 1;
+ const txData = this.contractInterface.encodeFunctionData("repay", [
+ reserve,
+ amount === "-1" ? ethers_1.constants.MaxUint256.toString() : amount,
+ numericRateMode,
+ onBehalfOf !== null && onBehalfOf !== void 0 ? onBehalfOf : user
+ ]);
+ actionTx.to = this.lendingPoolAddress;
+ actionTx.from = user;
+ actionTx.data = txData;
+ actionTx.gasLimit = ethers_1.BigNumber.from(utils_1.gasLimitRecommendations[types_1.ProtocolAction.repay].recommended);
+ return actionTx;
+ }
+ };
}
};
exports2.LendingPoolBundle = LendingPoolBundle;
@@ -49635,6 +49688,36 @@ var require_v3_pool_rollups = __commonJS({
actionTx.gasLimit = ethers_1.BigNumber.from(utils_2.gasLimitRecommendations[types_1.ProtocolAction.supplyWithPermit].limit);
return actionTx;
};
+ this.generateEncodedRepayTxData = ({ encodedTxData, user }) => {
+ const actionTx = {};
+ const txData = this.l2PoolContractInstance.encodeFunctionData("repay", [
+ encodedTxData
+ ]);
+ actionTx.to = this.l2PoolAddress;
+ actionTx.data = txData;
+ actionTx.from = user;
+ actionTx.gasLimit = ethers_1.BigNumber.from(utils_2.gasLimitRecommendations[types_1.ProtocolAction.repay].limit);
+ return actionTx;
+ };
+ this.generateEncodedRepayWithPermitTxData = ({ encodedTxData, user, signature }) => {
+ const actionTx = {};
+ const decomposedSignature = (0, utils_1.splitSignature)(signature);
+ const txData = this.l2PoolContractInstance.encodeFunctionData("repayWithPermit", [encodedTxData, decomposedSignature.r, decomposedSignature.s]);
+ actionTx.to = this.l2PoolAddress;
+ actionTx.data = txData;
+ actionTx.from = user;
+ actionTx.gasLimit = ethers_1.BigNumber.from(utils_2.gasLimitRecommendations[types_1.ProtocolAction.repayWithPermit].limit);
+ return actionTx;
+ };
+ this.generateEncodedRepayWithATokensTxData = ({ encodedTxData, user }) => {
+ const actionTx = {};
+ const txData = this.l2PoolContractInstance.encodeFunctionData("repayWithATokens", [encodedTxData]);
+ actionTx.to = this.l2PoolAddress;
+ actionTx.data = txData;
+ actionTx.from = user;
+ actionTx.gasLimit = ethers_1.BigNumber.from(utils_2.gasLimitRecommendations[types_1.ProtocolAction.repayWithATokens].limit);
+ return actionTx;
+ };
}
supply(_0, _1) {
return __async(this, arguments, function* ({ user, reserve, amount, referralCode }, txs) {
@@ -50974,6 +51057,12 @@ var require_v3_pool_contract_bundle = __commonJS({
return Object.assign(Object.assign({}, props), { spender, amount: amount.toString() });
}),
generateTxData: ({ user, reserve, amount, onBehalfOf, referralCode, useOptimizedPath, encodedTxData }) => {
+ if (useOptimizedPath && encodedTxData) {
+ return this.l2PoolService.generateEncodedSupplyTxData({
+ encodedTxData,
+ user
+ });
+ }
let actionTx = {};
const onBehalfOfParam = onBehalfOf !== null && onBehalfOf !== void 0 ? onBehalfOf : user;
const referralCodeParam = referralCode !== null && referralCode !== void 0 ? referralCode : "0";
@@ -50985,22 +51074,6 @@ var require_v3_pool_contract_bundle = __commonJS({
onBehalfOf: onBehalfOfParam,
referralCode: referralCodeParam
});
- } else if (useOptimizedPath) {
- if (encodedTxData) {
- actionTx = this.l2PoolService.generateEncodedSupplyTxData({
- encodedTxData,
- user
- });
- } else {
- const args = {
- user,
- reserve,
- amount,
- onBehalfOf: onBehalfOfParam,
- referralCode: referralCodeParam
- };
- actionTx = this.l2PoolService.generateSupplyTxData(args);
- }
} else {
const txData = this.contractInterface.encodeFunctionData("supply", [
reserve,
@@ -51016,52 +51089,49 @@ var require_v3_pool_contract_bundle = __commonJS({
return actionTx;
},
generateSignedTxData: ({ user, reserve, amount, onBehalfOf, referralCode, useOptimizedPath, signature, deadline, encodedTxData }) => {
+ if (useOptimizedPath && encodedTxData) {
+ return this.l2PoolService.generateEncodedSupplyWithPermitTxData({
+ encodedTxData,
+ user,
+ signature
+ });
+ }
const decomposedSignature = (0, bytes_1.splitSignature)(signature);
- let populatedTx = {};
+ const populatedTx = {};
const onBehalfOfParam = onBehalfOf !== null && onBehalfOf !== void 0 ? onBehalfOf : user;
const referralCodeParam = referralCode !== null && referralCode !== void 0 ? referralCode : "0";
- if (useOptimizedPath) {
- if (encodedTxData) {
- populatedTx = this.l2PoolService.generateEncodedSupplyWithPermitTxData({
- encodedTxData,
- user,
- signature
- });
- } else {
- const args = {
- user,
- reserve,
- amount,
- referralCode: referralCodeParam,
- onBehalfOf: onBehalfOfParam,
- permitR: decomposedSignature.r,
- permitS: decomposedSignature.s,
- permitV: decomposedSignature.v,
- deadline: Number(deadline)
- };
- populatedTx = this.l2PoolService.generateSupplyWithPermitTxData(args);
- }
- } else {
- const txData = this.contractInterface.encodeFunctionData("supplyWithPermit", [
- reserve,
- amount,
- onBehalfOfParam,
- referralCodeParam,
- deadline,
- decomposedSignature.v,
- decomposedSignature.r,
- decomposedSignature.s
- ]);
- populatedTx.to = this.poolAddress;
- populatedTx.from = user;
- populatedTx.data = txData;
- populatedTx.gasLimit = ethers_1.BigNumber.from(utils_1.gasLimitRecommendations[types_1.ProtocolAction.supplyWithPermit].recommended);
- }
+ const txData = this.contractInterface.encodeFunctionData("supplyWithPermit", [
+ reserve,
+ amount,
+ onBehalfOfParam,
+ referralCodeParam,
+ deadline,
+ decomposedSignature.v,
+ decomposedSignature.r,
+ decomposedSignature.s
+ ]);
+ populatedTx.to = this.poolAddress;
+ populatedTx.from = user;
+ populatedTx.data = txData;
+ populatedTx.gasLimit = ethers_1.BigNumber.from(utils_1.gasLimitRecommendations[types_1.ProtocolAction.supplyWithPermit].recommended);
return populatedTx;
- }
+ },
+ encodeSupplyParams: (_0) => __async(this, [_0], function* ({ reserve, amount, referralCode }) {
+ return this.l2PoolService.getEncoder().encodeSupplyParams(reserve, amount, referralCode !== null && referralCode !== void 0 ? referralCode : "0");
+ }),
+ encodeSupplyWithPermitParams: (_0) => __async(this, [_0], function* ({ reserve, amount, signature, deadline, referralCode }) {
+ const decomposedSignature = (0, bytes_1.splitSignature)(signature);
+ return this.l2PoolService.getEncoder().encodeSupplyWithPermitParams(reserve, amount, referralCode !== null && referralCode !== void 0 ? referralCode : "0", deadline, decomposedSignature.v, decomposedSignature.r, decomposedSignature.s);
+ })
};
this.borrowTxBuilder = {
generateTxData: ({ user, reserve, amount, interestRateMode, debtTokenAddress, onBehalfOf, referralCode, useOptimizedPath, encodedTxData }) => {
+ if (useOptimizedPath && encodedTxData) {
+ return this.l2PoolService.generateEncodedBorrowTxData({
+ encodedTxData,
+ user
+ });
+ }
let actionTx = {};
const referralCodeParam = referralCode !== null && referralCode !== void 0 ? referralCode : "0";
const onBehalfOfParam = onBehalfOf !== null && onBehalfOf !== void 0 ? onBehalfOf : user;
@@ -51078,23 +51148,6 @@ var require_v3_pool_contract_bundle = __commonJS({
interestRateMode,
referralCode: referralCodeParam
});
- } else if (useOptimizedPath) {
- if (encodedTxData) {
- actionTx = this.l2PoolService.generateEncodedBorrowTxData({
- encodedTxData,
- user
- });
- } else {
- const args = {
- user,
- reserve,
- amount,
- onBehalfOf: onBehalfOfParam,
- referralCode: referralCodeParam,
- numericRateMode
- };
- actionTx = this.l2PoolService.generateBorrowTxData(args);
- }
} else {
const txData = this.contractInterface.encodeFunctionData("borrow", [
reserve,
@@ -51109,7 +51162,113 @@ var require_v3_pool_contract_bundle = __commonJS({
actionTx.gasLimit = ethers_1.BigNumber.from(utils_1.gasLimitRecommendations[types_1.ProtocolAction.borrow].recommended);
}
return actionTx;
- }
+ },
+ encodeBorrowParams: (_0) => __async(this, [_0], function* ({ reserve, amount, interestRateMode, referralCode }) {
+ const numericRateMode = interestRateMode === types_1.InterestRate.Variable ? 2 : 1;
+ return this.l2PoolService.getEncoder().encodeBorrowParams(reserve, amount, numericRateMode, referralCode !== null && referralCode !== void 0 ? referralCode : "0");
+ })
+ };
+ this.repayTxBuilder = {
+ generateTxData: ({ user, reserve, amount, interestRateMode, onBehalfOf, useOptimizedPath, encodedTxData }) => {
+ const numericRateMode = interestRateMode === types_1.InterestRate.Variable ? 2 : 1;
+ const onBehalfOfParam = onBehalfOf !== null && onBehalfOf !== void 0 ? onBehalfOf : user;
+ if (reserve.toLowerCase() === utils_1.API_ETH_MOCK_ADDRESS.toLowerCase()) {
+ return this.wethGatewayService.generateRepayEthTxData({
+ lendingPool: this.poolAddress,
+ user,
+ amount,
+ interestRateMode,
+ onBehalfOf: onBehalfOfParam
+ });
+ }
+ if (useOptimizedPath && encodedTxData) {
+ return this.l2PoolService.generateEncodedRepayTxData({
+ encodedTxData,
+ user
+ });
+ }
+ const actionTx = {};
+ const txData = this.contractInterface.encodeFunctionData("repay", [
+ reserve,
+ amount === "-1" ? ethers_1.constants.MaxUint256.toString() : amount,
+ numericRateMode,
+ onBehalfOfParam
+ ]);
+ actionTx.to = this.poolAddress;
+ actionTx.from = user;
+ actionTx.data = txData;
+ actionTx.gasLimit = ethers_1.BigNumber.from(utils_1.gasLimitRecommendations[types_1.ProtocolAction.repay].recommended);
+ return actionTx;
+ },
+ generateSignedTxData: ({ onBehalfOf, signature, deadline, user, reserve, amount, interestRateMode, useOptimizedPath, encodedTxData }) => {
+ const decomposedSignature = (0, bytes_1.splitSignature)(signature);
+ const populatedTx = {};
+ const numericRateMode = interestRateMode === types_1.InterestRate.Variable ? 2 : 1;
+ const onBehalfOfParam = onBehalfOf !== null && onBehalfOf !== void 0 ? onBehalfOf : user;
+ if (useOptimizedPath && encodedTxData) {
+ return this.l2PoolService.generateEncodedRepayWithPermitTxData({
+ encodedTxData,
+ user,
+ signature
+ });
+ }
+ const txData = this.contractInterface.encodeFunctionData("repayWithPermit", [
+ reserve,
+ amount === "-1" ? ethers_1.constants.MaxUint256.toString() : amount,
+ numericRateMode,
+ onBehalfOfParam,
+ deadline,
+ decomposedSignature.v,
+ decomposedSignature.r,
+ decomposedSignature.s
+ ]);
+ populatedTx.to = this.poolAddress;
+ populatedTx.from = user;
+ populatedTx.data = txData;
+ populatedTx.gasLimit = ethers_1.BigNumber.from(utils_1.gasLimitRecommendations[types_1.ProtocolAction.repayWithPermit].recommended);
+ return populatedTx;
+ },
+ encodeRepayParams: (_0) => __async(this, [_0], function* ({ reserve, amount, interestRateMode }) {
+ const numericRateMode = interestRateMode === types_1.InterestRate.Variable ? 2 : 1;
+ const repayAmount = amount === "-1" ? ethers_1.constants.MaxUint256.toString() : amount;
+ return this.l2PoolService.getEncoder().encodeRepayParams(reserve, repayAmount, numericRateMode);
+ }),
+ encodeRepayWithPermitParams: (_0) => __async(this, [_0], function* ({ reserve, amount, interestRateMode, signature, deadline }) {
+ const decomposedSignature = (0, bytes_1.splitSignature)(signature);
+ const numericRateMode = interestRateMode === types_1.InterestRate.Variable ? 2 : 1;
+ const repayAmount = amount === "-1" ? ethers_1.constants.MaxUint256.toString() : amount;
+ return this.l2PoolService.getEncoder().encodeRepayWithPermitParams(reserve, repayAmount, numericRateMode, deadline, decomposedSignature.v, decomposedSignature.r, decomposedSignature.s);
+ })
+ };
+ this.repayWithATokensTxBuilder = {
+ generateTxData: ({ rateMode, user, amount, reserve, useOptimizedPath, encodedTxData }) => {
+ const actionTx = {};
+ const numericRateMode = rateMode === types_1.InterestRate.Variable ? 2 : 1;
+ if (reserve.toLowerCase() === utils_1.API_ETH_MOCK_ADDRESS.toLowerCase()) {
+ throw new Error("Can not repay with aTokens with eth. Should be WETH instead");
+ }
+ if (useOptimizedPath && encodedTxData) {
+ return this.l2PoolService.generateEncodedRepayWithATokensTxData({
+ encodedTxData,
+ user
+ });
+ }
+ const txData = this.contractInterface.encodeFunctionData("repayWithATokens", [
+ reserve,
+ amount === "-1" ? ethers_1.constants.MaxUint256.toString() : amount,
+ numericRateMode
+ ]);
+ actionTx.to = this.poolAddress;
+ actionTx.from = user;
+ actionTx.data = txData;
+ actionTx.gasLimit = ethers_1.BigNumber.from(utils_1.gasLimitRecommendations[types_1.ProtocolAction.repayWithATokens].recommended);
+ return actionTx;
+ },
+ encodeRepayWithATokensParams: (_0) => __async(this, [_0], function* ({ reserve, amount, rateMode }) {
+ const numericRateMode = rateMode === types_1.InterestRate.Variable ? 2 : 1;
+ const repayAmount = amount === "-1" ? ethers_1.constants.MaxUint256.toString() : amount;
+ return this.l2PoolService.getEncoder().encodeRepayWithATokensParams(reserve, repayAmount, numericRateMode);
+ })
};
}
};
diff --git a/src/components/transactions/Repay/RepayActions.tsx b/src/components/transactions/Repay/RepayActions.tsx
index 8e278e92d6..612824cd4f 100644
--- a/src/components/transactions/Repay/RepayActions.tsx
+++ b/src/components/transactions/Repay/RepayActions.tsx
@@ -1,11 +1,23 @@
-import { InterestRate, ProtocolAction } from '@aave/contract-helpers';
+import { gasLimitRecommendations, InterestRate, ProtocolAction } from '@aave/contract-helpers';
+import { TransactionResponse } from '@ethersproject/providers';
import { Trans } from '@lingui/macro';
import { BoxProps } from '@mui/material';
-import { useTransactionHandler } from 'src/helpers/useTransactionHandler';
+import { parseUnits } from 'ethers/lib/utils';
+import { queryClient } from 'pages/_app.page';
+import { useEffect, useState } from 'react';
+import { useBackgroundDataProvider } from 'src/hooks/app-data-provider/BackgroundDataProvider';
import { ComputedReserveData } from 'src/hooks/app-data-provider/useAppDataProvider';
+import { SignedParams, useApprovalTx } from 'src/hooks/useApprovalTx';
+import { usePoolApprovedAmount } from 'src/hooks/useApprovedAmount';
+import { useModalContext } from 'src/hooks/useModal';
+import { useWeb3Context } from 'src/libs/hooks/useWeb3Context';
import { useRootStore } from 'src/store/root';
+import { ApprovalMethod } from 'src/store/walletSlice';
+import { getErrorTextFromError, TxAction } from 'src/ui-config/errorMapping';
+import { queryKeysFactory } from 'src/ui-config/queries';
import { TxActionsWrapper } from '../TxActionsWrapper';
+import { APPROVAL_GAS_LIMIT, checkRequiresApproval } from '../utils';
export interface RepayActionProps extends BoxProps {
amountToRepay: string;
@@ -17,6 +29,7 @@ export interface RepayActionProps extends BoxProps {
debtType: InterestRate;
repayWithATokens: boolean;
blocked?: boolean;
+ maxApproveNeeded: string;
}
export const RepayActions = ({
@@ -29,56 +42,196 @@ export const RepayActions = ({
debtType,
repayWithATokens,
blocked,
+ maxApproveNeeded,
...props
}: RepayActionProps) => {
- const { repay, repayWithPermit, tryPermit } = useRootStore();
+ const [
+ repay,
+ repayWithPermit,
+ encodeRepayParams,
+ encodeRepayWithPermit,
+ tryPermit,
+ walletApprovalMethodPreference,
+ estimateGasLimit,
+ addTransaction,
+ optimizedPath,
+ currentMarketData,
+ ] = useRootStore((store) => [
+ store.repay,
+ store.repayWithPermit,
+ store.encodeRepayParams,
+ store.encodeRepayWithPermitParams,
+ store.tryPermit,
+ store.walletApprovalMethodPreference,
+ store.estimateGasLimit,
+ store.addTransaction,
+ store.useOptimizedPath,
+ store.currentMarketData,
+ ]);
+ const { sendTx } = useWeb3Context();
+ const { refetchGhoData, refetchIncentiveData, refetchPoolData } = useBackgroundDataProvider();
+ const [signatureParams, setSignatureParams] = useState();
+ const {
+ approvalTxState,
+ mainTxState,
+ loadingTxns,
+ setMainTxState,
+ setTxError,
+ setGasLimit,
+ setLoadingTxns,
+ setApprovalTxState,
+ } = useModalContext();
- const usingPermit = tryPermit({
+ const {
+ data: approvedAmount,
+ refetch: fetchApprovedAmount,
+ isFetching: fetchingApprovedAmount,
+ isFetchedAfterMount,
+ } = usePoolApprovedAmount(currentMarketData, poolAddress);
+
+ const permitAvailable = tryPermit({
reserveAddress: poolAddress,
isWrappedBaseAsset: poolReserve.isWrappedBaseAsset,
});
- const { approval, action, requiresApproval, loadingTxns, approvalTxState, mainTxState } =
- useTransactionHandler({
- tryPermit: usingPermit,
- permitAction: ProtocolAction.repayWithPermit,
- protocolAction: ProtocolAction.repay,
- eventTxInfo: {
- amount: amountToRepay,
- assetName: poolReserve.name,
- asset: poolReserve.underlyingAsset,
- },
- handleGetTxns: async () => {
- return repay({
- amountToRepay,
- poolAddress,
- repayWithATokens,
- debtType,
- poolReserve,
- isWrongNetwork,
- symbol,
+ const usePermit = permitAvailable && walletApprovalMethodPreference === ApprovalMethod.PERMIT;
+
+ setLoadingTxns(fetchingApprovedAmount);
+
+ const requiresApproval =
+ !repayWithATokens &&
+ Number(amountToRepay) !== 0 &&
+ checkRequiresApproval({
+ approvedAmount: approvedAmount?.amount || '0',
+ amount: Number(amountToRepay) === -1 ? maxApproveNeeded : amountToRepay,
+ signedAmount: signatureParams ? signatureParams.amount : '0',
+ });
+
+ if (requiresApproval && approvalTxState?.success) {
+ // There was a successful approval tx, but the approval amount is not enough.
+ // Clear the state to prompt for another approval.
+ setApprovalTxState({});
+ }
+
+ const { approval } = useApprovalTx({
+ usePermit,
+ approvedAmount,
+ requiresApproval,
+ assetAddress: poolAddress,
+ symbol,
+ decimals: poolReserve.decimals,
+ signatureAmount: amountToRepay,
+ onApprovalTxConfirmed: fetchApprovedAmount,
+ onSignTxCompleted: (signedParams) => setSignatureParams(signedParams),
+ });
+
+ useEffect(() => {
+ if (!isFetchedAfterMount && !repayWithATokens) {
+ fetchApprovedAmount();
+ }
+ }, [fetchApprovedAmount, isFetchedAfterMount, repayWithATokens]);
+
+ const action = async () => {
+ try {
+ setMainTxState({ ...mainTxState, loading: true });
+
+ let response: TransactionResponse;
+ let action = ProtocolAction.default;
+
+ if (usePermit && signatureParams) {
+ const repayWithPermitParams = {
+ amount:
+ amountToRepay === '-1'
+ ? amountToRepay
+ : parseUnits(amountToRepay, poolReserve.decimals).toString(),
+ reserve: poolAddress,
+ interestRateMode: debtType,
+ signature: signatureParams.signature,
+ deadline: signatureParams.deadline,
+ };
+
+ let encodedParams: [string, string, string] | undefined;
+ if (optimizedPath()) {
+ encodedParams = await encodeRepayWithPermit(repayWithPermitParams);
+ }
+
+ action = ProtocolAction.repayWithPermit;
+ let signedRepayWithPermitTxData = repayWithPermit({
+ ...repayWithPermitParams,
+ encodedTxData: encodedParams ? encodedParams[0] : undefined,
});
- },
- handleGetPermitTxns: async (signatures, deadline) => {
- return repayWithPermit({
- amountToRepay,
- poolReserve,
- isWrongNetwork,
+
+ signedRepayWithPermitTxData = await estimateGasLimit(signedRepayWithPermitTxData);
+ response = await sendTx(signedRepayWithPermitTxData);
+ await response.wait(1);
+ } else {
+ const repayParams = {
+ amountToRepay:
+ amountToRepay === '-1'
+ ? amountToRepay
+ : parseUnits(amountToRepay, poolReserve.decimals).toString(),
poolAddress,
- symbol,
- debtType,
repayWithATokens,
- signature: signatures[0],
- deadline,
+ debtType,
+ };
+
+ let encodedParams: string | undefined;
+ if (optimizedPath()) {
+ encodedParams = await encodeRepayParams(repayParams);
+ }
+
+ action = ProtocolAction.repay;
+ let repayTxData = repay({
+ ...repayParams,
+ encodedTxData: encodedParams,
});
- },
- skip: !amountToRepay || parseFloat(amountToRepay) === 0 || blocked,
- deps: [amountToRepay, poolAddress, repayWithATokens],
- });
+ repayTxData = await estimateGasLimit(repayTxData);
+ response = await sendTx(repayTxData);
+ await response.wait(1);
+ }
+ setMainTxState({
+ txHash: response.hash,
+ loading: false,
+ success: true,
+ });
+ addTransaction(response.hash, {
+ action,
+ txState: 'success',
+ asset: poolAddress,
+ amount: amountToRepay,
+ assetName: symbol,
+ });
+
+ queryClient.invalidateQueries({ queryKey: queryKeysFactory.pool });
+ refetchPoolData && refetchPoolData();
+ refetchIncentiveData && refetchIncentiveData();
+ refetchGhoData && refetchGhoData();
+ } catch (error) {
+ const parsedError = getErrorTextFromError(error, TxAction.GAS_ESTIMATION, false);
+ setTxError(parsedError);
+ setMainTxState({
+ txHash: undefined,
+ loading: false,
+ });
+ }
+ };
+
+ useEffect(() => {
+ let supplyGasLimit = 0;
+ if (usePermit) {
+ supplyGasLimit = Number(gasLimitRecommendations[ProtocolAction.supplyWithPermit].recommended);
+ } else {
+ supplyGasLimit = Number(gasLimitRecommendations[ProtocolAction.supply].recommended);
+ if (requiresApproval && !approvalTxState.success) {
+ supplyGasLimit += Number(APPROVAL_GAS_LIMIT);
+ }
+ }
+ setGasLimit(supplyGasLimit.toString());
+ }, [requiresApproval, approvalTxState, usePermit, setGasLimit]);
return (
approval([{ amount: amountToRepay, underlyingAsset: poolAddress }])}
+ handleApproval={approval}
actionText={Repay {symbol}}
actionInProgressText={Repaying {symbol}}
- tryPermit={usingPermit}
+ tryPermit={permitAvailable}
/>
);
};
diff --git a/src/components/transactions/Repay/RepayModalContent.tsx b/src/components/transactions/Repay/RepayModalContent.tsx
index a80d089030..81f942b0c9 100644
--- a/src/components/transactions/Repay/RepayModalContent.tsx
+++ b/src/components/transactions/Repay/RepayModalContent.tsx
@@ -79,7 +79,9 @@ export const RepayModalContent = ({
.multipliedBy(marketReferencePriceInUsd)
.shiftedBy(-USD_DECIMALS);
- const safeAmountToRepayAll = valueToBigNumber(debt).multipliedBy('1.0025');
+ const safeAmountToRepayAll = valueToBigNumber(debt)
+ .multipliedBy('1.0025')
+ .decimalPlaces(poolReserve.decimals, BigNumber.ROUND_UP);
// calculate max amount abailable to repay
let maxAmountToRepay: BigNumber;
@@ -223,7 +225,7 @@ export const RepayModalContent = ({
repaid}
amount={amountRef.current}
- symbol={tokenToRepayWith.symbol}
+ symbol={repayWithATokens ? poolReserve.symbol : tokenToRepayWith.symbol}
/>
);
@@ -274,6 +276,7 @@ export const RepayModalContent = ({
{txError && }
[
state.tryPermit,
state.supply,
state.supplyWithPermit,
- state.getApprovedAmount,
- state.generateSignatureRequest,
- state.generateApproval,
state.walletApprovalMethodPreference,
state.estimateGasLimit,
state.addTransaction,
+ state.currentMarketData,
]);
const {
approvalTxState,
@@ -84,51 +69,56 @@ export const SupplyActions = React.memo(
setTxError,
} = useModalContext();
const { refetchPoolData, refetchIncentiveData, refetchGhoData } = useBackgroundDataProvider();
- const permitAvailable = tryPermit({ reserveAddress: poolAddress, isWrappedBaseAsset });
- const { signTxData, sendTx } = useWeb3Context();
+ const permitAvailable = tryPermit({
+ reserveAddress: poolAddress,
+ isWrappedBaseAsset: isWrappedBaseAsset,
+ });
+ const { sendTx } = useWeb3Context();
- const [usePermit, setUsePermit] = useState(false);
- const [approvedAmount, setApprovedAmount] = useState();
- const [requiresApproval, setRequiresApproval] = useState(false);
const [signatureParams, setSignatureParams] = useState();
- // callback to fetch approved amount and determine execution path on dependency updates
- const fetchApprovedAmount = useCallback(
- async (forceApprovalCheck?: boolean) => {
- // Check approved amount on-chain on first load or if an action triggers a re-check such as an approval being confirmed
- if (!approvedAmount || forceApprovalCheck) {
- setLoadingTxns(true);
- const approvedAmount = await getApprovedAmount({ token: poolAddress });
- setApprovedAmount(approvedAmount);
- }
-
- if (approvedAmount) {
- const fetchedRequiresApproval = checkRequiresApproval({
- approvedAmount: approvedAmount.amount,
- amount: amountToSupply,
- signedAmount: signatureParams ? signatureParams.amount : '0',
- });
- setRequiresApproval(fetchedRequiresApproval);
- if (fetchedRequiresApproval) setApprovalTxState({});
- }
-
- setLoadingTxns(false);
- },
- [
- approvedAmount,
- setLoadingTxns,
- getApprovedAmount,
- poolAddress,
- amountToSupply,
- signatureParams,
- setApprovalTxState,
- ]
- );
+ const {
+ data: approvedAmount,
+ refetch: fetchApprovedAmount,
+ isRefetching: fetchingApprovedAmount,
+ isFetchedAfterMount,
+ } = usePoolApprovedAmount(currentMarketData, poolAddress);
+
+ setLoadingTxns(fetchingApprovedAmount);
+
+ const requiresApproval =
+ Number(amountToSupply) !== 0 &&
+ checkRequiresApproval({
+ approvedAmount: approvedAmount?.amount || '0',
+ amount: amountToSupply,
+ signedAmount: signatureParams ? signatureParams.amount : '0',
+ });
+
+ if (requiresApproval && approvalTxState?.success) {
+ // There was a successful approval tx, but the approval amount is not enough.
+ // Clear the state to prompt for another approval.
+ setApprovalTxState({});
+ }
+
+ const usePermit = permitAvailable && walletApprovalMethodPreference === ApprovalMethod.PERMIT;
+
+ const { approval } = useApprovalTx({
+ usePermit,
+ approvedAmount,
+ requiresApproval,
+ assetAddress: poolAddress,
+ symbol,
+ decimals,
+ signatureAmount: amountToSupply,
+ onApprovalTxConfirmed: fetchApprovedAmount,
+ onSignTxCompleted: (signedParams) => setSignatureParams(signedParams),
+ });
- // Run on first load to decide execution path
useEffect(() => {
- fetchApprovedAmount();
- }, [fetchApprovedAmount]);
+ if (!isFetchedAfterMount) {
+ fetchApprovedAmount();
+ }
+ }, [fetchApprovedAmount, isFetchedAfterMount]);
// Update gas estimation
useEffect(() => {
@@ -146,61 +136,6 @@ export const SupplyActions = React.memo(
setGasLimit(supplyGasLimit.toString());
}, [requiresApproval, approvalTxState, usePermit, setGasLimit]);
- useEffect(() => {
- const preferPermit =
- permitAvailable && walletApprovalMethodPreference === ApprovalMethod.PERMIT;
- setUsePermit(preferPermit);
- }, [permitAvailable, walletApprovalMethodPreference]);
-
- const approval = async () => {
- try {
- if (requiresApproval && approvedAmount) {
- if (usePermit) {
- const deadline = Math.floor(Date.now() / 1000 + 3600).toString();
- const signatureRequest = await generateSignatureRequest({
- ...approvedAmount,
- deadline,
- amount: parseUnits(amountToSupply, decimals).toString(),
- });
-
- const response = await signTxData(signatureRequest);
- setSignatureParams({ signature: response, deadline, amount: amountToSupply });
- setApprovalTxState({
- txHash: MOCK_SIGNED_HASH,
- loading: false,
- success: true,
- });
- } else {
- let approveTxData = generateApproval(approvedAmount);
- setApprovalTxState({ ...approvalTxState, loading: true });
- approveTxData = await estimateGasLimit(approveTxData);
- const response = await sendTx(approveTxData);
- await response.wait(1);
- setApprovalTxState({
- txHash: response.hash,
- loading: false,
- success: true,
- });
- addTransaction(response.hash, {
- action: ProtocolAction.approval,
- txState: 'success',
- asset: poolAddress,
- amount: MAX_UINT_AMOUNT,
- assetName: symbol,
- });
- fetchApprovedAmount(true);
- }
- }
- } catch (error) {
- const parsedError = getErrorTextFromError(error, TxAction.GAS_ESTIMATION, false);
- setTxError(parsedError);
- setApprovalTxState({
- txHash: undefined,
- loading: false,
- });
- }
- };
-
const action = async () => {
try {
setMainTxState({ ...mainTxState, loading: true });
@@ -272,10 +207,10 @@ export const SupplyActions = React.memo(
requiresAmount
amount={amountToSupply}
symbol={symbol}
- preparingTransactions={loadingTxns}
+ preparingTransactions={loadingTxns || !approvedAmount}
actionText={Supply {symbol}}
actionInProgressText={Supplying {symbol}}
- handleApproval={() => approval()}
+ handleApproval={approval}
handleAction={action}
requiresApproval={requiresApproval}
tryPermit={permitAvailable}
diff --git a/src/components/transactions/TxActionsWrapper.tsx b/src/components/transactions/TxActionsWrapper.tsx
index 587a554aad..af16ded1bd 100644
--- a/src/components/transactions/TxActionsWrapper.tsx
+++ b/src/components/transactions/TxActionsWrapper.tsx
@@ -127,7 +127,7 @@ export const TxActionsWrapper = ({
const approvalParams = getApprovalParams();
return (
- {requiresApproval && !readOnlyModeAddress && (
+ {approvalParams && !readOnlyModeAddress && (
diff --git a/src/components/transactions/utils.ts b/src/components/transactions/utils.ts
index c0273206fd..e7a3ea70d4 100644
--- a/src/components/transactions/utils.ts
+++ b/src/components/transactions/utils.ts
@@ -34,6 +34,7 @@ export const checkRequiresApproval = ({
// Returns false if the user has a max approval, an approval > amountToSupply, or a valid signature for amountToSupply
if (
approvedAmount === '-1' ||
+ signedAmount === '-1' ||
(approvedAmount !== '0' && Number(approvedAmount) >= Number(amount)) ||
Number(signedAmount) >= Number(amount)
) {
diff --git a/src/hooks/useApprovalTx.tsx b/src/hooks/useApprovalTx.tsx
new file mode 100644
index 0000000000..40d172a11a
--- /dev/null
+++ b/src/hooks/useApprovalTx.tsx
@@ -0,0 +1,113 @@
+import { ApproveType, MAX_UINT_AMOUNT, ProtocolAction } from '@aave/contract-helpers';
+import { SignatureLike } from '@ethersproject/bytes';
+import { constants } from 'ethers';
+import { parseUnits } from 'ethers/lib/utils';
+import { MOCK_SIGNED_HASH } from 'src/helpers/useTransactionHandler';
+import { useWeb3Context } from 'src/libs/hooks/useWeb3Context';
+import { useRootStore } from 'src/store/root';
+import { getErrorTextFromError, TxAction } from 'src/ui-config/errorMapping';
+
+import { useModalContext } from './useModal';
+
+export interface SignedParams {
+ signature: SignatureLike;
+ deadline: string;
+ amount: string;
+}
+
+export const useApprovalTx = ({
+ usePermit,
+ approvedAmount,
+ requiresApproval,
+ assetAddress,
+ symbol,
+ decimals,
+ signatureAmount,
+ onApprovalTxConfirmed,
+ onSignTxCompleted,
+}: {
+ usePermit: boolean;
+ approvedAmount: ApproveType | undefined;
+ requiresApproval: boolean;
+ assetAddress: string;
+ symbol: string;
+ decimals: number;
+ signatureAmount: string;
+ onApprovalTxConfirmed?: () => void;
+ onSignTxCompleted?: (signedParams: SignedParams) => void;
+}) => {
+ const [generateApproval, generateSignatureRequest, estimateGasLimit, addTransaction] =
+ useRootStore((store) => [
+ store.generateApproval,
+ store.generateSignatureRequest,
+ store.estimateGasLimit,
+ store.addTransaction,
+ ]);
+
+ const { signTxData, sendTx } = useWeb3Context();
+
+ const { approvalTxState, setApprovalTxState, setTxError } = useModalContext();
+
+ const approval = async () => {
+ try {
+ if (requiresApproval && approvedAmount) {
+ if (usePermit) {
+ setApprovalTxState({ ...approvalTxState, loading: true });
+ const deadline = Math.floor(Date.now() / 1000 + 3600).toString();
+ const signatureRequest = await generateSignatureRequest({
+ ...approvedAmount,
+ deadline,
+ amount:
+ signatureAmount === '-1'
+ ? constants.MaxUint256.toString()
+ : parseUnits(signatureAmount, decimals).toString(),
+ });
+
+ const response = await signTxData(signatureRequest);
+ if (onSignTxCompleted) {
+ onSignTxCompleted({ signature: response, deadline, amount: signatureAmount });
+ }
+ setTxError(undefined);
+ setApprovalTxState({
+ txHash: MOCK_SIGNED_HASH,
+ loading: false,
+ success: true,
+ });
+ } else {
+ let approveTxData = generateApproval(approvedAmount);
+ setApprovalTxState({ ...approvalTxState, loading: true });
+ approveTxData = await estimateGasLimit(approveTxData);
+ const response = await sendTx(approveTxData);
+ await response.wait(1);
+ setApprovalTxState({
+ txHash: response.hash,
+ loading: false,
+ success: true,
+ });
+ setTxError(undefined);
+ addTransaction(response.hash, {
+ action: ProtocolAction.approval,
+ txState: 'success',
+ asset: assetAddress,
+ amount: MAX_UINT_AMOUNT,
+ assetName: symbol,
+ });
+ if (onApprovalTxConfirmed) {
+ onApprovalTxConfirmed();
+ }
+ }
+ }
+ } catch (error) {
+ const parsedError = getErrorTextFromError(error, TxAction.GAS_ESTIMATION, false);
+ setTxError(parsedError);
+ setApprovalTxState({
+ txHash: undefined,
+ loading: false,
+ });
+ }
+ };
+
+ return {
+ approval,
+ };
+};
diff --git a/src/hooks/useApprovedAmount.tsx b/src/hooks/useApprovedAmount.tsx
new file mode 100644
index 0000000000..c004eff21c
--- /dev/null
+++ b/src/hooks/useApprovedAmount.tsx
@@ -0,0 +1,40 @@
+import { useQuery } from '@tanstack/react-query';
+import { useRootStore } from 'src/store/root';
+import { MarketDataType } from 'src/ui-config/marketsConfig';
+import { queryKeysFactory } from 'src/ui-config/queries';
+import { useSharedDependencies } from 'src/ui-config/SharedDependenciesProvider';
+
+export const useApprovedAmount = ({
+ marketData,
+ token,
+ spender,
+}: {
+ marketData: MarketDataType;
+ user: string;
+ token: string;
+ spender: string;
+}) => {
+ const { approvedAmountService } = useSharedDependencies();
+ const user = useRootStore((store) => store.account);
+ return useQuery({
+ queryFn: () => approvedAmountService.getApprovedAmount(marketData, user, token, spender),
+ queryKey: queryKeysFactory.approvedAmount(user, token, spender, marketData),
+ enabled: !!user,
+ refetchOnMount: false,
+ refetchOnWindowFocus: false,
+ refetchOnReconnect: false,
+ });
+};
+
+export const usePoolApprovedAmount = (marketData: MarketDataType, token: string) => {
+ const { approvedAmountService } = useSharedDependencies();
+ const user = useRootStore((store) => store.account);
+ return useQuery({
+ queryFn: () => approvedAmountService.getPoolApprovedAmount(marketData, user, token),
+ queryKey: queryKeysFactory.poolApprovedAmount(user, token, marketData),
+ enabled: !!user,
+ refetchOnMount: false,
+ refetchOnWindowFocus: false,
+ refetchOnReconnect: false,
+ });
+};
diff --git a/src/layouts/MainLayout.tsx b/src/layouts/MainLayout.tsx
index d2ae5d98ff..85ac93d1a7 100644
--- a/src/layouts/MainLayout.tsx
+++ b/src/layouts/MainLayout.tsx
@@ -1,34 +1,14 @@
import { Box } from '@mui/material';
import React, { ReactNode } from 'react';
import AnalyticsConsent from 'src/components/Analytics/AnalyticsConsent';
-import { useProtocolDataContext } from 'src/hooks/useProtocolDataContext';
-import TopBarNotify from 'src/layouts/TopBarNotify';
import { FORK_ENABLED } from 'src/utils/marketsAndNetworksConfig';
import { AppFooter } from './AppFooter';
import { AppHeader } from './AppHeader';
export function MainLayout({ children }: { children: ReactNode }) {
- const { currentMarket } = useProtocolDataContext();
-
- const notifyText =
- 'An issue in a certain feature of the Aave Protocol was identified. Some markets or assets are temporarily paused. No funds are at risk.';
-
- const unPauseText =
- 'Implementation of the approved governance proposal is underway for V2 markets. Your funds are secure.';
-
return (
<>
- {currentMarket === 'proto_mainnet' ||
- currentMarket === 'proto_avalanche_v3' ||
- currentMarket === 'proto_polygon_v3' ||
- currentMarket === 'proto_optimism_v3' ? (
-
- ) : null}
-
{children}
diff --git a/src/modules/dashboard/lists/BorrowAssetsList/GhoBorrowAssetsListItem.tsx b/src/modules/dashboard/lists/BorrowAssetsList/GhoBorrowAssetsListItem.tsx
index 62bc7d564d..4c3a15c553 100644
--- a/src/modules/dashboard/lists/BorrowAssetsList/GhoBorrowAssetsListItem.tsx
+++ b/src/modules/dashboard/lists/BorrowAssetsList/GhoBorrowAssetsListItem.tsx
@@ -162,7 +162,7 @@ const GhoBorrowAssetsListItemDesktop = ({
/>
-
+
APY, borrow rate}
variant="subheader2"
diff --git a/src/services/ApprovedAmountService.ts b/src/services/ApprovedAmountService.ts
new file mode 100644
index 0000000000..34b3fd5840
--- /dev/null
+++ b/src/services/ApprovedAmountService.ts
@@ -0,0 +1,60 @@
+import { ApproveType, ERC20Service, LendingPoolBundle, PoolBundle } from '@aave/contract-helpers';
+import { Provider } from '@ethersproject/providers';
+import { MarketDataType } from 'src/ui-config/marketsConfig';
+
+export class ApprovedAmountService {
+ constructor(private readonly getProvider: (chainId: number) => Provider) {}
+
+ private async getERC20Service(marketData: MarketDataType) {
+ const provider = this.getProvider(marketData.chainId);
+ return new ERC20Service(provider);
+ }
+
+ private async getPoolService(marketData: MarketDataType) {
+ const provider = this.getProvider(marketData.chainId);
+ return new PoolBundle(provider, {
+ POOL: marketData.addresses.LENDING_POOL,
+ WETH_GATEWAY: marketData.addresses.WETH_GATEWAY,
+ L2_ENCODER: marketData.addresses.L2_ENCODER,
+ });
+ }
+
+ private async getLendingPoolService(marketData: MarketDataType) {
+ const provider = this.getProvider(marketData.chainId);
+ return new LendingPoolBundle(provider, {
+ LENDING_POOL: marketData.addresses.LENDING_POOL,
+ WETH_GATEWAY: marketData.addresses.WETH_GATEWAY,
+ });
+ }
+
+ async getPoolApprovedAmount(
+ marketData: MarketDataType,
+ user: string,
+ token: string
+ ): Promise {
+ if (marketData.v3) {
+ const pool = await this.getPoolService(marketData);
+ return pool.supplyTxBuilder.getApprovedAmount({
+ user,
+ token,
+ });
+ } else {
+ const lendingPool = await this.getLendingPoolService(marketData);
+ return lendingPool.depositTxBuilder.getApprovedAmount({ user, token });
+ }
+ }
+
+ async getApprovedAmount(
+ marketData: MarketDataType,
+ user: string,
+ token: string,
+ spender: string
+ ): Promise {
+ const service = await this.getERC20Service(marketData);
+ return service.approvedAmount({
+ user,
+ token,
+ spender,
+ });
+ }
+}
diff --git a/src/static-build/ipfsFiles.json b/src/static-build/ipfsFiles.json
index df99f0db5b..2f05a676a6 100644
--- a/src/static-build/ipfsFiles.json
+++ b/src/static-build/ipfsFiles.json
@@ -4601,6 +4601,114 @@
"description": "\n## Simple Summary\n\nThis AIP will convert all but 100 aEthWETH held in the DAO’s Ethereum Treasury to rETH.\n\n## Motivation\n\nThis AIP proposes consolidating the DAO's ETH-nominated assets into Aave v3 on the Ethereum network and subsequently acquiring rETH. The rETH yield, currently at 3.07%, surpasses the ETH deposit yield on Aave v3.\n\nThis action will yield two significant advantages for the DAO. First, it will enable the DAO to earn a higher return on its ETH assets, thus improving the value of its holdings. Second, by promoting greater diversity in the nodes supporting the network, this move contributes to the overall health and sustainability of the Ethereum network.\n\nA balance of 100 aEthWETH tokens will be retained in the Treasury. These tokens will serve as a reserve for covering ongoing DAO expenses, including initiatives like the [Quarterly Gas Rebate](https://governance.aave.com/t/arfc-quarterly-gas-rebate-distribution-august-2023/14680), and any other potential expenses that may arise in the future.\n\n## Specification\n\nThis AIP will perform the following:\n\n- Withdraw all awETH to wETH\n- Withdraw all but 100 aEthWETH to wETH\n- Swap all wETH into RocketPool’s rETH\n\n## References\n\n- Implementation: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/f9c4f1f97f88982fb5dbf895fa6762503b1bf7fa/src/20231103_AaveV3Ethereum_TreasuryManagementAddToRETHHolding/AaveV3Ethereum_TreasuryManagementAddToRETHHolding_20231103.sol)\n- Tests: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/f9c4f1f97f88982fb5dbf895fa6762503b1bf7fa/src/20231103_AaveV3Ethereum_TreasuryManagementAddToRETHHolding/AaveV3Ethereum_TreasuryManagementAddToRETHHolding_20231103.t.sol)\n- [Snapshot](https://snapshot.org/#/aave.eth/proposal/0x80493cdca3b1893e198802cd245e6e3c00f5fcd0b37c09aa41765b17419a71fe)\n- [Discussion](https://governance.aave.com/t/arfc-treasury-management-add-to-reth-holding/15123)\n\n## Copyright\n\nCopyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).\n",
"originalHash": "0x2187a22d1c0a9eba2d112f38b51ad1716a49842ecd2d8efcb146876c20bfb848",
"id": 374
+ },
+ {
+ "title": "Increase Stablecoin Optimal Borrow Rates",
+ "author": "monet-supply + Gauntlet (impl: Alice Rozengarden (@Rozengarden - Aave-chan initiative))",
+ "discussions": "https://governance.aave.com/t/arfc-increase-optimal-borrow-rates-for-ethereum-stablecoin-markets/15096/3",
+ "ipfsHash": "QmUmVYs6sqDuYnxJWhTz62mXc4xTzGYnMZnuGRgVtAfpGT",
+ "description": "\n## Simple Summary\n\nThis AIP propose to modify the parameters of stablecoins across all the Aave pools. Mainly by setting the slope1 to 5%, as well as changing the RF to 25% and Uopt to 90% of some of them.\n\n## Motivation\n\nAccording to [research](https://governance.aave.com/t/arfc-increase-optimal-borrow-rates-for-ethereum-stablecoin-markets/15096/3) by @monet-supply, the borrowing parameters of the stablecoins on Aave have diverged from the broader market leading to potentials inefficiencies and bad user experience.\n\nThose proposed changes have been approved by both risk providers, with additional suggestion by @Gauntlet.\n\nStablecoin across all the V2 and V3 markets are concerned by those change. Namely USDC, USDT, LUSD, FRAX, sUSD, DAI, MAI, GUSD, USDP on ethereum (V2 and V3), polygon (V2 and V2), Arbitrum, Gnosis, Optimism, Avalanche (v2 and V3) and Metis. However the changes of RF and Uopt would be more limited, with the Uopt changes being limited to USDC, USDT, DAI and FRAX across all V3s and the RF ones to USDC, USDT and LUSD only for Ethereum V2.\n\n## Specification\n\nThe following stablecoins would see changes to their parameters:\n(Blank means no changes)\n\n| Market | Asset | slope1 | Uopt | RF |\n| ------- | ------ | ------ | ---- | --- |\n| Ethv2 | USDC | 5% | | 25% |\n| Ethv2 | USDT | 5% | | 25% |\n| Ethv2 | FRAX | 5% | | |\n| Ethv2 | sUSD | 5% | | |\n| Ethv2 | GUSD | 5% | | |\n| Ethv2 | LUSD | 5% | | 25% |\n| Ethv2 | USDP | 5% | | |\n| --- | --- | --- | --- | --- |\n| Ethv3 | USDC | 5% | 90% | |\n| Ethv3 | USDT | 5% | 90% | |\n| Ethv3 | FRAX | 5% | 90% | |\n| Ethv3 | LUSD | 5% | | |\n| --- | --- | --- | --- | --- |\n| AvaxV2 | USDC | 5% | | |\n| AvaxV2 | USDT | 5% | | |\n| AvaxV2 | DAI | 5% | | |\n| --- | --- | --- | --- | --- |\n| AvaxV3 | USDC | 5% | 90% | |\n| AvaxV3 | USDT | 5% | 90% | |\n| AvaxV3 | DAI | 5% | 90% | |\n| AvaxV3 | MAI | 5% | | |\n| AvaxV3 | FRAX | 5% | 90% | |\n| --- | --- | --- | --- | --- |\n| PolV2 | USDC | 5% | | |\n| PolV2 | USDT | 5% | | |\n| PolV2 | DAI | 5% | | |\n| --- | --- | --- | --- | --- |\n| PolV3 | USDC | 5% | 90% | |\n| PolV3 | USDT | 5% | 90% | |\n| PolV3 | DAI | 5% | 90% | |\n| PolV3 | MAI | 5% | | |\n| --- | --- | --- | --- | --- |\n| OpV3 | USDC | 5% | 90% | |\n| OpV3 | USDT | 5% | 90% | |\n| OpV3 | DAI | 5% | 90% | |\n| OpV3 | sUSD | 5% | | |\n| OpV3 | LUSD | 5% | | |\n| OpV3 | MAI | 5% | | |\n| --- | --- | --- | --- | --- |\n| ArbV3 | USDC | 5% | 90% | |\n| ArbV3 | USDC.e | 5% | | |\n| ArbV3 | USDT | 5% | 90% | |\n| ArbV3 | DAI | 5% | 90% | |\n| ArbV3 | LUSD | 5% | | |\n| ArbV3 | FRAX | 5% | 90% | |\n| ArbV3 | MAI | 5% | | |\n| --- | --- | --- | --- | --- |\n| BaseV3 | USDC | 5% | 90% | |\n| --- | --- | --- | --- | --- |\n| MetisV3 | USDC | 5% | 90% | |\n| MetisV3 | USDT | 5% | 90% | |\n| --- | --- | --- | --- | --- |\n\n## References\n\n- Implementation: [AaveV2Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/8cf09317c749ddf7bed46b5f260c0f399897e11a/src/20231113_Multi_IncreaseStablecoinOptimalBorrowRates/AaveV2Ethereum_IncreaseStablecoinOptimalBorrowRates_20231113.sol), [AaveV2Polygon](https://github.com/bgd-labs/aave-proposals-v3/blob/8cf09317c749ddf7bed46b5f260c0f399897e11a/src/20231113_Multi_IncreaseStablecoinOptimalBorrowRates/AaveV2Polygon_IncreaseStablecoinOptimalBorrowRates_20231113.sol), [AaveV2Avalanche](https://github.com/bgd-labs/aave-proposals-v3/blob/8cf09317c749ddf7bed46b5f260c0f399897e11a/src/20231113_Multi_IncreaseStablecoinOptimalBorrowRates/AaveV2Avalanche_IncreaseStablecoinOptimalBorrowRates_20231113.sol), [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/8cf09317c749ddf7bed46b5f260c0f399897e11a/src/20231113_Multi_IncreaseStablecoinOptimalBorrowRates/AaveV3Ethereum_IncreaseStablecoinOptimalBorrowRates_20231113.sol), [AaveV3Polygon](https://github.com/bgd-labs/aave-proposals-v3/blob/8cf09317c749ddf7bed46b5f260c0f399897e11a/src/20231113_Multi_IncreaseStablecoinOptimalBorrowRates/AaveV3Polygon_IncreaseStablecoinOptimalBorrowRates_20231113.sol), [AaveV3Avalanche](https://github.com/bgd-labs/aave-proposals-v3/blob/8cf09317c749ddf7bed46b5f260c0f399897e11a/src/20231113_Multi_IncreaseStablecoinOptimalBorrowRates/AaveV3Avalanche_IncreaseStablecoinOptimalBorrowRates_20231113.sol), [AaveV3Optimism](https://github.com/bgd-labs/aave-proposals-v3/blob/8cf09317c749ddf7bed46b5f260c0f399897e11a/src/20231113_Multi_IncreaseStablecoinOptimalBorrowRates/AaveV3Optimism_IncreaseStablecoinOptimalBorrowRates_20231113.sol), [AaveV3Arbitrum](https://github.com/bgd-labs/aave-proposals-v3/blob/8cf09317c749ddf7bed46b5f260c0f399897e11a/src/20231113_Multi_IncreaseStablecoinOptimalBorrowRates/AaveV3Arbitrum_IncreaseStablecoinOptimalBorrowRates_20231113.sol), [AaveV3Metis](https://github.com/bgd-labs/aave-proposals-v3/blob/8cf09317c749ddf7bed46b5f260c0f399897e11a/src/20231113_Multi_IncreaseStablecoinOptimalBorrowRates/AaveV3Metis_IncreaseStablecoinOptimalBorrowRates_20231113.sol), [AaveV3Base](https://github.com/bgd-labs/aave-proposals-v3/blob/8cf09317c749ddf7bed46b5f260c0f399897e11a/src/20231113_Multi_IncreaseStablecoinOptimalBorrowRates/AaveV3Base_IncreaseStablecoinOptimalBorrowRates_20231113.sol)\n- Tests: [AaveV2Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/8cf09317c749ddf7bed46b5f260c0f399897e11a/src/20231113_Multi_IncreaseStablecoinOptimalBorrowRates/AaveV2Ethereum_IncreaseStablecoinOptimalBorrowRates_20231113.t.sol), [AaveV2Polygon](https://github.com/bgd-labs/aave-proposals-v3/blob/8cf09317c749ddf7bed46b5f260c0f399897e11a/src/20231113_Multi_IncreaseStablecoinOptimalBorrowRates/AaveV2Polygon_IncreaseStablecoinOptimalBorrowRates_20231113.t.sol), [AaveV2Avalanche](https://github.com/bgd-labs/aave-proposals-v3/blob/8cf09317c749ddf7bed46b5f260c0f399897e11a/src/20231113_Multi_IncreaseStablecoinOptimalBorrowRates/AaveV2Avalanche_IncreaseStablecoinOptimalBorrowRates_20231113.t.sol), [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/8cf09317c749ddf7bed46b5f260c0f399897e11a/src/20231113_Multi_IncreaseStablecoinOptimalBorrowRates/AaveV3Ethereum_IncreaseStablecoinOptimalBorrowRates_20231113.t.sol), [AaveV3Polygon](https://github.com/bgd-labs/aave-proposals-v3/blob/8cf09317c749ddf7bed46b5f260c0f399897e11a/src/20231113_Multi_IncreaseStablecoinOptimalBorrowRates/AaveV3Polygon_IncreaseStablecoinOptimalBorrowRates_20231113.t.sol), [AaveV3Avalanche](https://github.com/bgd-labs/aave-proposals-v3/blob/8cf09317c749ddf7bed46b5f260c0f399897e11a/src/20231113_Multi_IncreaseStablecoinOptimalBorrowRates/AaveV3Avalanche_IncreaseStablecoinOptimalBorrowRates_20231113.t.sol), [AaveV3Optimism](https://github.com/bgd-labs/aave-proposals-v3/blob/8cf09317c749ddf7bed46b5f260c0f399897e11a/src/20231113_Multi_IncreaseStablecoinOptimalBorrowRates/AaveV3Optimism_IncreaseStablecoinOptimalBorrowRates_20231113.t.sol), [AaveV3Arbitrum](https://github.com/bgd-labs/aave-proposals-v3/blob/8cf09317c749ddf7bed46b5f260c0f399897e11a/src/20231113_Multi_IncreaseStablecoinOptimalBorrowRates/AaveV3Arbitrum_IncreaseStablecoinOptimalBorrowRates_20231113.t.sol), [AaveV3Metis](https://github.com/bgd-labs/aave-proposals-v3/blob/8cf09317c749ddf7bed46b5f260c0f399897e11a/src/20231113_Multi_IncreaseStablecoinOptimalBorrowRates/AaveV3Metis_IncreaseStablecoinOptimalBorrowRates_20231113.t.sol), [AaveV3Base](https://github.com/bgd-labs/aave-proposals-v3/blob/8cf09317c749ddf7bed46b5f260c0f399897e11a/src/20231113_Multi_IncreaseStablecoinOptimalBorrowRates/AaveV3Base_IncreaseStablecoinOptimalBorrowRates_20231113.t.sol)\n- Snapshot: [Slope1](https://snapshot.org/#/aave.eth/proposal/0x914862039828294f4277ad63087ffae295b7693ba365c9036326cca802bfc7af), [Uopt & RF](https://snapshot.org/#/aave.eth/proposal/0xb9b28f57f7633dd6b987de9abcede23da62fe4fab6b002f189b8b25a7c02ea93)\n- [Discussion](https://governance.aave.com/t/arfc-increase-optimal-borrow-rates-for-ethereum-stablecoin-markets/15096/3)\n\n## Copyright\n\nCopyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).\n",
+ "originalHash": "0x5f8349082690bd85372f956b70ef80d8ab98f9eb6f4b8b1e1d849afadb7b51fc",
+ "id": 375
+ },
+ {
+ "title": "MAI/MIMATIC deprecation, 2023.10.31",
+ "author": "Gauntlet",
+ "discussions": "https://governance.aave.com/t/arfc-gauntlet-recommendation-for-mai-mimatic-deprecation/15119",
+ "ipfsHash": "QmaPLn5er1FvCUgvMCbgMBo2JHc7rZSZdR64AAn2VqvqzD",
+ "description": "\n## Summary\n\nGiven MAI/MIMATIC price drop to ~$0.72 and its inability to regain peg for the past few months, Gauntlet recommends to begin deprecation of MAI/MIMATIC. We aim to do so by changing LT and increasing borrow rates to incentivize repayment. Additionally, Gauntlet recommends freezing MAI/MIMATIC and setting MAI/MIMATIC LTV -> 0 on Avalanche, which was not executed in [this previous AIP](https://app.aave.com/governance/proposal/318/).\n\n## Specification\n\n#### LT reductions\n\n| Chain | Asset | Current LT | Recommended LT |\n| ------------ | ----------- | ---------- | -------------- |\n| avalanche v3 | MAI/MIMATIC | 0.8 | 0.01 |\n| arbitrum v3 | MAI/MIMATIC | 0.8 | 0.01 |\n| polygon v3 | MAI/MIMATIC | 0.8 | 0.01 |\n| optimism v3 | MAI/MIMATIC | 0.8 | 0.65 |\n\n#### IR recommendations\n\nAdjust Uopt to 0.45, Slope 2 to 300%, RF to 95%\n\n| Chain | Asset | Current Uopt | Current Slope2 | Current RF | Recommended Uopt | Recommended Slope2 | Recommended RF |\n| ------------ | ------- | ------------ | -------------- | ---------- | ---------------- | ------------------ | -------------- |\n| arbitrum v3 | MAI | 0.8 | 0.75 | 0.2 | 0.45 | 3 | 0.95 |\n| avalanche v3 | MAI | 0.8 | 0.75 | 0.2 | 0.45 | 3 | 0.95 |\n| optimism v3 | MAI | 0.8 | 0.75 | 0.2 | 0.45 | 3 | 0.95 |\n| polygon v3 | miMATIC | 0.8 | 0.75 | 0.2 | 0.45 | 3 | 0.95 |\n\n#### Freeze MAI and set LTV -> 0 on Avalanche\n\n| Chain | Asset | Action |\n| ------------ | ----------- | ---------------------------- |\n| avalanche v3 | MAI/MIMATIC | Freeze Reserve, set LTV -> 0 |\n\n## References\n\n- Implementation: [AaveV3Polygon](https://github.com/bgd-labs/aave-proposals-v3/blob/66b52de254b64062a4654440fae7d9a07b32f0e5/src/20231031_Multi_MAIMIMATICDeprecation20231031/AaveV3Polygon_MAIMIMATICDeprecation20231031_20231031.sol), [AaveV3Avalanche](https://github.com/bgd-labs/aave-proposals-v3/blob/66b52de254b64062a4654440fae7d9a07b32f0e5/src/20231031_Multi_MAIMIMATICDeprecation20231031/AaveV3Avalanche_MAIMIMATICDeprecation20231031_20231031.sol), [AaveV3Optimism](https://github.com/bgd-labs/aave-proposals-v3/blob/66b52de254b64062a4654440fae7d9a07b32f0e5/src/20231031_Multi_MAIMIMATICDeprecation20231031/AaveV3Optimism_MAIMIMATICDeprecation20231031_20231031.sol), [AaveV3Arbitrum](https://github.com/bgd-labs/aave-proposals-v3/blob/66b52de254b64062a4654440fae7d9a07b32f0e5/src/20231031_Multi_MAIMIMATICDeprecation20231031/AaveV3Arbitrum_MAIMIMATICDeprecation20231031_20231031.sol)\n- Tests: [AaveV3Polygon](https://github.com/bgd-labs/aave-proposals-v3/blob/66b52de254b64062a4654440fae7d9a07b32f0e5/src/20231031_Multi_MAIMIMATICDeprecation20231031/AaveV3Polygon_MAIMIMATICDeprecation20231031_20231031.t.sol), [AaveV3Avalanche](https://github.com/bgd-labs/aave-proposals-v3/blob/66b52de254b64062a4654440fae7d9a07b32f0e5/src/20231031_Multi_MAIMIMATICDeprecation20231031/AaveV3Avalanche_MAIMIMATICDeprecation20231031_20231031.t.sol), [AaveV3Optimism](https://github.com/bgd-labs/aave-proposals-v3/blob/66b52de254b64062a4654440fae7d9a07b32f0e5/src/20231031_Multi_MAIMIMATICDeprecation20231031/AaveV3Optimism_MAIMIMATICDeprecation20231031_20231031.t.sol), [AaveV3Arbitrum](https://github.com/bgd-labs/aave-proposals-v3/blob/66b52de254b64062a4654440fae7d9a07b32f0e5/src/20231031_Multi_MAIMIMATICDeprecation20231031/AaveV3Arbitrum_MAIMIMATICDeprecation20231031_20231031.t.sol)\n- [Snapshot](https://snapshot.org/#/aave.eth/proposal/0x9b7173e3f91ba3cab15dbe2d6d241de2e58b027612c690f00609d6e4fb422748)\n- [Discussion](https://governance.aave.com/t/arfc-gauntlet-recommendation-for-mai-mimatic-deprecation/15119)\n\n## Disclaimer\n\nGauntlet has not received any compensation from any third-party in exchange for recommending any of the actions contained in this proposal.\n\nBy approving this proposal, you agree that any services provided by Gauntlet shall be governed by the terms of service available at gauntlet.network/tos.\n\n## Copyright\n\nCopyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).\n\n_By approving this proposal, you agree that any services provided by Gauntlet shall be governed by the terms of service available at gauntlet.network/tos._\n",
+ "originalHash": "0xb2fcb5da149a326de38268779244b13e824e7b5e3426d37f76865e9e41dde43e",
+ "id": 376
+ },
+ {
+ "title": "Gauntlet recommendation to lower stMATIC, MaticX non-emode LT, pt 2",
+ "author": "Gauntlet",
+ "discussions": "https://governance.aave.com/t/arfc-gauntlet-recommendation-to-lower-stmatic-maticx-non-emode-lt-pt-2/15314",
+ "ipfsHash": "QmTHheeuSzN25RdWE8KHFUmicCEtk7CtvmJxR6o4ontk5a",
+ "description": "\n## Summary\n\nGauntlet recommends follow-ups to our previous recommendations on lowering stMATIC / MaticX non-emode LT. These recommendations are geared towards the following:\n\n- Reducing risks associated with increased stablecoin borrowing against LST collateral, amidst lower MATIC LST liquidity\n- Lower risks of reduced WMATIC supply in the future, which may cause long-term growth risk for Polygon v3\n- Encourage WMATIC borrowing against MATIC LST collateral\n\n## Specification\n\n| Asset | Parameter | Current Value | Recommended Value |\n| ------- | -------------------- | ------------- | ----------------- |\n| stMATIC | LiquidationThreshold | 60% | 56% |\n| MaticX | LiquidationThreshold | 62% | 58% |\n\n## References\n\n- Implementation: [AaveV3Polygon](https://github.com/bgd-labs/aave-proposals-v3/blob/0b832342a79ecd704e399fad3567e2dd146bfd9a/src/20231117_AaveV3Polygon_GauntletRecommendationToLowerStMATICMaticXNonEmodeLTPt2/AaveV3Polygon_GauntletRecommendationToLowerStMATICMaticXNonEmodeLTPt2_20231117.sol)\n- Tests: [AaveV3Polygon](https://github.com/bgd-labs/aave-proposals-v3/blob/0b832342a79ecd704e399fad3567e2dd146bfd9a/src/20231117_AaveV3Polygon_GauntletRecommendationToLowerStMATICMaticXNonEmodeLTPt2/AaveV3Polygon_GauntletRecommendationToLowerStMATICMaticXNonEmodeLTPt2_20231117.t.sol)\n- [Snapshot](https://snapshot.org/#/aave.eth/proposal/0xc59f0e1bd1463285d1fca9c3771d92dc227915615e475b84e6e4033f281ff079)\n- [Discussion](https://governance.aave.com/t/arfc-gauntlet-recommendation-to-lower-stmatic-maticx-non-emode-lt-pt-2/15314)\n\n## Disclaimer\n\nGauntlet has not received any compensation from any third-party in exchange for recommending any of the actions contained in this proposal.\n\n_By approving this proposal, you agree that any services provided by Gauntlet shall be governed by the terms of service available at gauntlet.network/tos._\n\n## Copyright\n\nCopyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).\n",
+ "originalHash": "0x4989045af890034b671390e0bd573cf61bba6d3f20bfbb784abe1c420f7ec95d",
+ "id": 377
+ },
+ {
+ "title": "CRVUSD onboarding on Aave V3 Ethereum",
+ "author": "@Marczeller - Aave-chan Initiative",
+ "discussions": "https://governance.aave.com/t/arfc-crvusd-onboarding-on-aave-v3-ethereum-pool/15161",
+ "ipfsHash": "QmS1FC9Ciy3a5R88GCUHhp8Wae1m8CsNMxmN9CLNG54iUA",
+ "description": "\n## Simple Summary\n\nThis AIP proposes the onboarding of the CRVUSD stablecoin, minted by the Curve Protocol, into the Aave V3 Ethereum pool.\n\n## Motivation\n\nCrvUSD is a USD-peg stablecoin minted by the Curve Protocol. While it's relatively young, it has grown to a circulating supply of over $130M with strong peg resilience. Onboarding this asset into Aave will:\n\n- Reinforce synergies between Aave and Curve.\n- Offer Aave users an additional decentralized stablecoin option matching the ACI diversity support ethos.\n- Strengthen the relationship between the CRVUSD & the GHO stablecoins.\n\nAs the primary usecase for stablecoins is to be deposited by users looking for a passive yield and used as a borrowable asset and not as much as a collateral asset, the ACI proposes a CRVUSD onboarding outside isolation mode but without collateral properties.\n\nFollowing CrvUSD maturity, the Aave governance can propose a collateral activation for crvUSD at a later stage.\n\n## Specification\n\nTicker: crvUSD \nContract address: [0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E](https://etherscan.io/token/0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E) \nPrice Feed: [0xEEf0C605546958c1f899b6fB336C20671f9cD49F](https://etherscan.io/address/0xEEf0C605546958c1f899b6fB336C20671f9cD49F)\n\nWe propose the following parameters for a crvUSD onboarding:\n\n| Parameter | Value |\n| ---------------------------------- | -------- |\n| Isolation Mode | No |\n| Borrowable | Yes |\n| Collateral Enabled | No |\n| Supply Cap (CRVUSD) | 60M |\n| Borrow Cap (CRVUSD) | 50M |\n| Debt Ceiling | N/A |\n| LTV | N/A |\n| LT | N/A |\n| Liquidation Bonus | N/A |\n| Liquidation Protocol Fee | 10.00% |\n| Variable Base | 0.00% |\n| Variable Slope1 | 5.00% |\n| Variable Slope2 | 80.00% |\n| Uoptimal | 80.00% |\n| Reserve Factor | 10.00% |\n| Stable Borrowing | Disabled |\n| Stable Slope1 | 13.00% |\n| Stable Slope2 | 300.00% |\n| Base Stable Rate Offset | 3.00% |\n| Stable Rate Excess Offset | 8.00% |\n| Optimal Stable To Total Debt Ratio | 20.00% |\n| Flashloanable | Yes |\n| Siloed Borrowing | No |\n| Borrowed in Isolation | No |\n\n## References\n\n- Implementation: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/1e5d9e78ec397ee3280c75d87e0880104c6df9dd/src/20231116_AaveV3Ethereum_CRVUSDOnboardingOnAaveV3Ethereum/AaveV3Ethereum_CRVUSDOnboardingOnAaveV3Ethereum_20231116.sol)\n- Tests: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/1e5d9e78ec397ee3280c75d87e0880104c6df9dd/src/20231116_AaveV3Ethereum_CRVUSDOnboardingOnAaveV3Ethereum/AaveV3Ethereum_CRVUSDOnboardingOnAaveV3Ethereum_20231116.t.sol)\n- [Snapshot](https://snapshot.org/#/aave.eth/proposal/0xbc10b43fccd3954f02c9df774ba6f8335268727b999660738ae37a1b9d5b969e)\n- [Discussion](https://governance.aave.com/t/arfc-crvusd-onboarding-on-aave-v3-ethereum-pool/15161)\n\n## Copyright\n\nCopyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).\n",
+ "originalHash": "0x36761f3b362b7462b1697600f0003795e4dea7a5daeb2080f00980542401f1c3",
+ "id": 378
+ },
+ {
+ "title": "Chaos Labs Risk Parameter Updates - Increase MKR Debt Ceiling on V3 Ethereum",
+ "author": "Chaos Labs (@yonikesel, @ori-chaoslabs)",
+ "discussions": "https://governance.aave.com/t/arfc-chaos-labs-risk-parameter-updates-increase-mkr-debt-ceiling-on-v3-ethereum-11-07-2023/15406",
+ "ipfsHash": "QmQbCYLYHB6BEc6XS5vAoasgYDniD7oubRb5vcK1agq5C8",
+ "description": "\n## Simple Summary\n\nA proposal to increase the debt ceiling of MKR on V3 Ethereum\n\n## Motivation\n\nThe current debt ceiling for MKR on V3 Ethereum, set at $6M, has reached 100% utilization.\n\nGiven current market conditions and improved liquidity for MKR on Ethereum over the past months, our [Isolation Mode Methodology](https://governance.aave.com/t/chaos-labs-isolation-mode-methodology/12440) supports increasing the debt ceiling for MKR to $8.5M.\n\nIt is important to note that the majority of MKR debt positions are concentrated within two accounts, accounting for over 80% of the total debt, as outlined below. While this concentration does not affect the current recommendation, it is something to continue monitoring and will be considered in future MKR recommendations and in cases of significant market changes.\n\n### V2 → V3 Migration\n\nThere are still nearly 3,400 MKR supplied on V2 Ethereum, with nearly $750K in stablecoins borrowed against MKR collateral. The current supply caps and proposed debt ceiling should allow for the migration of these positions.\n\n### Positions Analysis\n\nThere are currently two major users utilizing MKR as collateral on V3 Ethereum:\n\n1. [0xa9dee54892713f43c221509cfedbd717d16791a0](https://community-staging.chaoslabs.xyz/aave/risk/wallets/0xa9dee54892713f43c221509cfedbd717d16791a0) - borrowing $3.11M DAI against his 5,914 MKR collateral, accounting for nearly 52% of the debt ceiling. The user's current health score is 1.77.\n2. [0x8af700ba841f30e0a3fcb0ee4c4a9d223e1efa05](https://community-staging.chaoslabs.xyz/aave/risk/wallets/0x8af700ba841f30e0a3fcb0ee4c4a9d223e1efa05) - borrowing $1.84M USDC against his 4,077 MKR collateral, accounting for nearly 31% of the debt ceiling. The user's current health score is 2.06.\n\n## Specification\n\n| Asset | Parameter | Current | Recommended |\n| ----- | ------------ | --------- | ----------- |\n| MKR | Debt Ceiling | 6,000,000 | 8,500,000 |\n\n## References\n\n- Implementation: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/b2c837e7494896a29d73d2bcc3de8d6c995674c6/src/20231116_AaveV3Ethereum_ChaosLabsRiskParameterUpdatesIncreaseMKRDebtCeilingOnV3Ethereum/AaveV3Ethereum_ChaosLabsRiskParameterUpdatesIncreaseMKRDebtCeilingOnV3Ethereum_20231116.sol)\n- Tests: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/b2c837e7494896a29d73d2bcc3de8d6c995674c6/src/20231116_AaveV3Ethereum_ChaosLabsRiskParameterUpdatesIncreaseMKRDebtCeilingOnV3Ethereum/AaveV3Ethereum_ChaosLabsRiskParameterUpdatesIncreaseMKRDebtCeilingOnV3Ethereum_20231116.t.sol)\n- [Snapshot](https://snapshot.org/#/aave.eth/proposal/0xb3163709f822b662241395c1fde5ecaa8b39d52b1bc81722136c6084a4b3959c)\n- [Discussion](https://governance.aave.com/t/arfc-chaos-labs-risk-parameter-updates-increase-mkr-debt-ceiling-on-v3-ethereum-11-07-2023/15406)\n\n## Disclaimer\n\nChaos Labs has not been compensated by any third party for publishing this ARFC.\n\n## Copyright\n\nCopyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).\n",
+ "originalHash": "0x21717f4bd284ed1e6c9f93ddd02f113d821e448b1f0d7c1e4d8d52d4f0bd47a5",
+ "id": 379
+ },
+ {
+ "title": "Gauntlet Cap Recommendations for Polygon v3",
+ "author": "Gauntlet",
+ "discussions": "https://governance.aave.com/t/arfc-gauntlet-cap-recommendations-for-polygon-v3-2023-11-03/15327",
+ "ipfsHash": "QmTNWiWBr7Ucxbnuu29iH25VdPfWQNcSNZb8g7RABwGYwY",
+ "description": "\n## Summary\n\nGauntlet recommends parameter changes on Polygon Aave v3 market. For more details, see the full forum post [here](https://governance.aave.com/t/arfc-gauntlet-cap-recommendations-for-polygon-v3-2023-11-03/15327).\n\n## Motivation\n\nPer Gauntlet’s supply and borrow cap methodology, we recommend setting supply and borrow caps for agEUR and jEUR. Currently agEUR borrowing is disabled and cannot be used as collateral. jEUR is frozen. Despite this, all assets should have supply and borrow caps.\n\n## Specification\n\n| Chain | Asset | Cap | Current | Recommended |\n| ------- | ----- | ------ | ------- | ----------- |\n| Polygon | agEUR | Supply | - | 300k |\n| Polygon | agEUR | Borrow | - | 250k |\n| Polygon | jEUR | Supply | - | 120k |\n| Polygon | jEUR | Borrow | - | 100k |\n\n## References\n\n- Implementation: [AaveV3Polygon](https://github.com/bgd-labs/aave-proposals-v3/blob/3933f440d8878ae9b21bc53e0afacdc2862882c3/src/20231120_AaveV3Polygon_GauntletCapRecommendationsForPolygonV3/AaveV3Polygon_GauntletCapRecommendationsForPolygonV3_20231120.sol)\n- Tests: [AaveV3Polygon](https://github.com/bgd-labs/aave-proposals-v3/blob/3933f440d8878ae9b21bc53e0afacdc2862882c3/src/20231120_AaveV3Polygon_GauntletCapRecommendationsForPolygonV3/AaveV3Polygon_GauntletCapRecommendationsForPolygonV3_20231120.t.sol)\n- [Snapshot](https://snapshot.org/#/aave.eth/proposal/0xcab97d0cf0f484f3604f790234ca26b559b6c38c0b33ed1f7821b3d3340c9354)\n- [Discussion](https://governance.aave.com/t/arfc-gauntlet-cap-recommendations-for-polygon-v3-2023-11-03/15327)\n\n## Disclaimer\n\nGauntlet has not received any compensation from any third-party in exchange for recommending any of the actions contained in this proposal.\n\n## Copyright\n\nCopyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).\n\n_By approving this proposal, you agree that any services provided by Gauntlet shall be governed by the terms of service available at gauntlet.network/tos._\n",
+ "originalHash": "0x4ac48ef13a739822e2ca321f731b123bfa6f25bb825a7fd88a48a54ad5fc41ef",
+ "id": 380
+ },
+ {
+ "title": "Increase GHO Borrow Rate",
+ "author": "@Marczeller - Aave-Chan Initiative",
+ "discussions": "https://governance.aave.com/t/arfc-increase-gho-borrow-rate-to-5-22-on-aave-v3/15632",
+ "ipfsHash": "QmTHSXwiKnCZFPKbGXNw1aAMis1nNST3EHBP2XYr5Xjrpk",
+ "description": "\n## Simple Summary\n\nThis AIP proposes to increase the GHO borrow rate from 4.72% APR to 5.22% APR.\nThis aims to support the GHO peg and align borrowing costs closer to industry market rates.\n\n## Motivation\n\nFollowing [AIP-349](https://app.aave.com/governance/proposal/349/), which allowed for 50 bps increments in the GHO borrow rate, the peg remains off-target at ~0.965 avg price. This increase is part of the direct-to-AIP process to incentivize repayment and help restore the peg.\n\n## Specification\n\n- **Current Borrow Rate:** 4.72% APR - ~4.83% APY\n- **Proposed Borrow Rate:** 5.22% - ~5.35% APY\n- **New Discounted Borrow Rate:** ~3.7% - 3.75% APY\n\n**The proposal also authorizes ACI to continue with up to 100 bps incremental increases every 7 days if required up to 9.5% APR if the monthly avg price of GHO stays outside a 0,995<>1,005 price range**.\n\nComparative analysis with other stablecoins on Aave V3 shows that GHO's current borrow rate is lower, which may contribute to its underpeg. The following table illustrates average borrow rates:\n\n| Stablecoin | Average Borrow Rate |\n| ---------- | ------------------- |\n| USDC | 6.39% |\n| USDT | 7.29% |\n| DAI | 6% |\n| GHO | 4.83% (APY) |\n\nGiven this discrepancy, it is unlikely that the current rate is sufficient to restore GHO's peg.\n\n## References\n\n- Implementation: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/bbe74d703bf794fa98295322e626a0b2b9262c54/src/20231121_AaveV3Ethereum_IncreaseGHOBorrowRate/AaveV3Ethereum_IncreaseGHOBorrowRate_20231121.sol)\n- Tests: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/bbe74d703bf794fa98295322e626a0b2b9262c54/src/20231121_AaveV3Ethereum_IncreaseGHOBorrowRate/AaveV3Ethereum_IncreaseGHOBorrowRate_20231121.t.sol)\n- [Snapshot](Direct-to-AIP)\n- [Discussion](https://governance.aave.com/t/arfc-increase-gho-borrow-rate-to-5-22-on-aave-v3/15632)\n\n## Copyright\n\nCopyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).\n",
+ "originalHash": "0x4977ecf7075c1e4d30973c4e1d34c1d2d3a1c989ae5da116a6ad951d974c4f65",
+ "id": 381
+ },
+ {
+ "title": "Onboard Native USDC to Aave V3 Optimism",
+ "author": "@marczeller - Aave Chan Initiative",
+ "discussions": "https://governance.aave.com/t/arfc-onboard-native-usdc-to-aave-v3-optimism-market/15463",
+ "ipfsHash": "QmQ7oC4kDx5Lte3H5uHxwmyfXHjoqUhQWms9QnCRikcJtG",
+ "description": "\n## Simple Summary\n\nThis ARFC proposes integrating native USDC into the Aave V3 pool on Optimism, positioning it as the primary stablecoin version over the bridged USDC.e.\n\n## Motivation\n\nWith the evolution of L2 networks, adopting native USDC versions becomes vital for efficiency. This proposal seeks a balanced transition from USDC.e to native USDC on Optimism, drawing from similar successful integrations on other networks.\n\n## Specification\n\n### Token Information\n\n- **Token Symbol:** USDC\n- **Token Address:** [0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85](https://optimistic.etherscan.io/address/0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85)\n\n### Parameters\n\n- **Supply Cap:**\n - USDC: 25M\n - USDC.e: 25M\n- **Borrow Cap:**\n - USDC: 20M\n - USDC.e: 20M\n- **Reserve Factor (RF):**\n - USDC.e: Increase to 20% to incentivize native USDC usage.\n\nAll other risk parameters for native USDC will mirror those of USDC.e.\n\n## References\n\n- Implementation: [AaveV3Optimism](https://github.com/bgd-labs/aave-proposals-v3/blob/84cee62f8de8e53c7459e7f30297e06c70f8b7d6/src/20231122_AaveV3Optimism_OnboardNativeUSDCToAaveV3Optimism/AaveV3Optimism_OnboardNativeUSDCToAaveV3Optimism_20231122.sol)\n- Tests: [AaveV3Optimism](https://github.com/bgd-labs/aave-proposals-v3/blob/84cee62f8de8e53c7459e7f30297e06c70f8b7d6/src/20231122_AaveV3Optimism_OnboardNativeUSDCToAaveV3Optimism/AaveV3Optimism_OnboardNativeUSDCToAaveV3Optimism_20231122.t.sol)\n- [Snapshot](https://snapshot.org/#/aave.eth/proposal/0xf04fdb85e27849310557716d09fb2ed7f84b1a8c4f493088899ad91a2d834fb0)\n- [Discussion](https://governance.aave.com/t/arfc-onboard-native-usdc-to-aave-v3-optimism-market/15463)\n\n## Copyright\n\nCopyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).\n",
+ "originalHash": "0x1a6c69fcf8d44afae186c84ef32a80cd702a75951a60f9069e2b9adb311d8349",
+ "id": 382
+ },
+ {
+ "title": "V2 Deprecation Plan, 2023.11.20",
+ "author": "Gauntlet, Chaos Labs",
+ "discussions": "https://governance.aave.com/t/arfc-v2-ethereum-deprecation-11-20-2023/15628",
+ "ipfsHash": "QmTLonEXtKXL1DfcEnXPKqMoSifwbk61MLpMzzCijz91GA",
+ "description": "\n## Simple Summary\n\nA proposal to reduce Liquidation Thresholds (LT) on Aave V2 Ethereum.\n\n## Motivation\n\nIn accordance with the [v2 deprecation framework](https://governance.aave.com/t/arfc-aave-v2-markets-deprecation-plan/14870), Gauntlet and Chaos Labs advise implementing the subsequent parameter changes to the frozen assets on Aave v2 Ethereum.\n\n## Specification\n\nThe recommendations below suggest an LT configuration that optimizes reductions without significantly increasing the number of accounts eligible for liquidation. The proposed values are set at a margin of at least ~4% from the closest LT figure, which would trigger more substantial liquidations.\nThis will affect 33 accounts, leading to a cumulative of $5,460 in value liquidated.\n\n| Asset | Current LT | New LT |\n| ----- | ---------- | ------ |\n| BAL | 21% | 1% |\n| CRV | 38% | 30% |\n| CVX | 30% | 24% |\n| DPI | 14% | 5% |\n| ENJ | 50% | 44% |\n| ENS | 47% | 38% |\n| LINK | 81% | 80% |\n| MANA | 37% | 29% |\n| MKR | 30% | 28% |\n| REN | 25% | 18% |\n| SNX | 41% | 30% |\n| UNI | 64% | 55% |\n| YFI | 43% | 32% |\n| ZRX | 34% | 24% |\n\nAs Liquidation Threshold reductions may lead to user accounts being eligible for liquidations upon their approval, we want to clarify the full implications to the community at each step. Chaos and Gauntlet will publicly communicate the planned amendments and list of affected accounts leading to the on-chain execution.\n\n## References\n\n- Implementation: [AaveV2Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/e571baf835c669d317a9dfc656f3f4d7159c9972/src/20231121_AaveV2Ethereum_V2DeprecationPlan20231120/AaveV2Ethereum_V2DeprecationPlan20231120_20231121.sol)\n- Tests: [AaveV2Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/e571baf835c669d317a9dfc656f3f4d7159c9972/src/20231121_AaveV2Ethereum_V2DeprecationPlan20231120/AaveV2Ethereum_V2DeprecationPlan20231120_20231121.t.sol)\n- [Discussion](https://governance.aave.com/t/arfc-v2-ethereum-deprecation-11-20-2023/15628)\n\n## Disclaimer\n\nGauntlet and Chaos Labs have not been compensated by any third party for publishing this ARFC.\n\n## Copyright\n\nCopyright and related rights waived via CC0.\n\n_By approving this proposal, you agree that any services provided by Gauntlet shall be governed by the terms of service available at gauntlet.network/tos._\n",
+ "originalHash": "0x4a54b101821f12b78ac4215ac84658d9ef6278a814267264728f2c57e998f83f",
+ "id": 383
+ },
+ {
+ "title": "Increase GHO Borrow Rate",
+ "author": "@Marczeller - Aave-Chan Initiative",
+ "discussions": "https://governance.aave.com/t/arfc-increase-gho-borrow-rate-to-5-22-on-aave-v3/15632",
+ "ipfsHash": "QmTHSXwiKnCZFPKbGXNw1aAMis1nNST3EHBP2XYr5Xjrpk",
+ "description": "\n## Simple Summary\n\nThis AIP proposes to increase the GHO borrow rate from 4.72% APR to 5.22% APR.\nThis aims to support the GHO peg and align borrowing costs closer to industry market rates.\n\n## Motivation\n\nFollowing [AIP-349](https://app.aave.com/governance/proposal/349/), which allowed for 50 bps increments in the GHO borrow rate, the peg remains off-target at ~0.965 avg price. This increase is part of the direct-to-AIP process to incentivize repayment and help restore the peg.\n\n## Specification\n\n- **Current Borrow Rate:** 4.72% APR - ~4.83% APY\n- **Proposed Borrow Rate:** 5.22% - ~5.35% APY\n- **New Discounted Borrow Rate:** ~3.7% - 3.75% APY\n\n**The proposal also authorizes ACI to continue with up to 100 bps incremental increases every 7 days if required up to 9.5% APR if the monthly avg price of GHO stays outside a 0,995<>1,005 price range**.\n\nComparative analysis with other stablecoins on Aave V3 shows that GHO's current borrow rate is lower, which may contribute to its underpeg. The following table illustrates average borrow rates:\n\n| Stablecoin | Average Borrow Rate |\n| ---------- | ------------------- |\n| USDC | 6.39% |\n| USDT | 7.29% |\n| DAI | 6% |\n| GHO | 4.83% (APY) |\n\nGiven this discrepancy, it is unlikely that the current rate is sufficient to restore GHO's peg.\n\n## References\n\n- Implementation: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/bbe74d703bf794fa98295322e626a0b2b9262c54/src/20231121_AaveV3Ethereum_IncreaseGHOBorrowRate/AaveV3Ethereum_IncreaseGHOBorrowRate_20231121.sol)\n- Tests: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/bbe74d703bf794fa98295322e626a0b2b9262c54/src/20231121_AaveV3Ethereum_IncreaseGHOBorrowRate/AaveV3Ethereum_IncreaseGHOBorrowRate_20231121.t.sol)\n- [Snapshot](Direct-to-AIP)\n- [Discussion](https://governance.aave.com/t/arfc-increase-gho-borrow-rate-to-5-22-on-aave-v3/15632)\n\n## Copyright\n\nCopyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).\n",
+ "originalHash": "0x4977ecf7075c1e4d30973c4e1d34c1d2d3a1c989ae5da116a6ad951d974c4f65",
+ "id": 384
+ },
+ {
+ "title": "AmendSafetyModuleAAVEEmissions",
+ "author": "JosepBove (0xbove - Aave-Chan Initiative)",
+ "discussions": "https://governance.aave.com/t/arfc-treasury-management-amend-safety-module-aave-emissions/14936",
+ "ipfsHash": "QmeUUSNDhm11tE5cQX6KM6QkaipTuECSiCMr9vJPv9kWyP",
+ "description": "\n## Simple Summary\n\nThis publication proposes reducing AAVE (Safety Incentives) distributions to the Safety Module (SM) by 30% and introducing a 90-day SM emission cycle.\n\n##\n\nThe SM serves as the Aave Protocol’s self-protection smart contract. The Aave Protocol distributes 1,100 AAVE daily, split evenly across AAVE and B-80AAVE-20wETH deposits.\n\nFuture proposals shall discuss the composition and aim to improve the overall capital efficiency of the SM. However, this publication intends to reduce AAVE emissions in the immediate future, saving the DAO valuable AAVE emissions while the broader SM upgrade is being advanced. It is widely accepted within the community that Aave DAO is overpaying for AAVE and B-80BAL-20wETH deposits.\n\nThis publication proposes reducing AAVE emissions by ~30%. The revised AAVE emission is to be reduced from 1,100 AAVE/day to 770 AAVE/day. This represents a 330 AAVE/day reduction. The APR for stkAAVE holders is expected to reduce from 6.87% to 4.81%. Similarly, for the B-80BAL-20wETH deposits, yield is expected to fall from 14.35% to 10.05%.\n\nPlease note that the 80AAVE/20wETH Balancer v1 pool is to be migrated to Balancer v2 in the future. This will present the community with an opportunity to further revise the AAVE emissions. It may also occur at a time when the DAO has vlAURA and/or veBAL at its disposal.\n\nFor context, the Llama Part IV SM Upgrade suggests reducing the AAVE emission to stkAAVE holders by 75%. This is because slashing for stkAAVE is to be reduced, additional assets are to be added to the SM, and the emissions are to be redirected to those newly added assets. Since this proposal was published, stkAAVE has also gained the utility of discounted GHO borrowing rates.\n\nSimilarly, Xenophon Labs recommended doubling the slashing percentage from 30% to 60% on the stkAAVE pool and lowering emissions by 80 AAVE/day, from 550 to 470. While this publication does not propose amending the slashing rate, the reduction in AAVE emissions is about double.\n\n## Specification\n\nThe implementation for this proposal will be prepared by ACI. The table below shows the current and proposed daily AAVE Emissions.\n\n| Collateral | Current Emissions | Proposed Emissions |\n| --------------- | ----------------- | ------------------ |\n| AAVE | 550 | 385 |\n| B-80AAVE-20wETH | 550 | 385 |\n\nTransition to a 90-day period SM Emission schedule.\n\nA comparison between Xenophon Labs’ proposal and this proposal for stkAAVE holders is shown below:\n\n| TVL | Slashing Rate | Protection | AAVE/day | AAVE Price | Annual Spend | Annual Cost per $ of Coverage | Deposit Yield |\n| ------- | ------------- | ---------- | -------- | ---------- | ------------ | ----------------------------- | ------------- |\n| $175.0M | 30% | 52.5M | 550 | $60.00 | $12.045M | $0.23 | 6.88% |\n| $175.0M | 60% | 105.0M | 470 | $60.00 | $10.293M | $0.10 | 5.88% |\n| $175.0M | 30% | 52.5M | 385 | $60.00 | $8.431M | $0.16 | 4.82% |\n\n## References\n\n- Implementation: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/8b055b83920aed59071aeff65481715d1dd4cc17/src/20231104_AaveV3Ethereum_AmendSafetyModuleAAVEEmissions/AaveV3Ethereum_AmendSafetyModuleAAVEEmissions_20231104.sol)\n- Tests: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/8b055b83920aed59071aeff65481715d1dd4cc17/src/20231104_AaveV3Ethereum_AmendSafetyModuleAAVEEmissions/AaveV3Ethereum_AmendSafetyModuleAAVEEmissions_20231104.t.sol)\n- [Snapshot](https://snapshot.org/#/aave.eth/proposal/0xb0124fb0206676ee743e8d6221b7b3c317cb26a657551f11cb5fa23544772a73)\n- [Discussion](https://governance.aave.com/t/arfc-treasury-management-amend-safety-module-aave-emissions/14936)\n\n## Copyright\n\nCopyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).\n",
+ "originalHash": "0xefbc05fe227f66c90738f7ea59a2139abffd659ab6ad5d580aac94152b3d6632",
+ "id": 385
+ },
+ {
+ "title": "Allow Emergency Admin to freeze on Aave V2",
+ "author": "BGD Labs (@bgdlabs)",
+ "discussions": "https://governance.aave.com/t/aave-v2-v3-security-incident-04-11-2023/15335",
+ "ipfsHash": "QmeDaarTxJQoQ28jUtjthn2cfvmqr4JKosUNDHEcJYvWGz",
+ "description": "\n## Simple Summary\n\nProposal to allow the emergencyAdmin role to freeze reserves on Aave V2 pools - including Aave V2 AMM, Aave V2 Ethereum, Polygon, and Avalanche; same behavior as on Aave v3.\nAdditionally, Liquidations Grace Sentinel is activated for Aave V2 AMM, following the same approach as [AIP 361](https://app.aave.com/governance/proposal/361/)\n\n## Motivation\n\nTo be consistent with the approved Aave v3 approach of Freezing Stewards ([AIP 319](https://app.aave.com/governance/proposal/319/)), and maintain security across all Aave V2 deployments, the protocol needs to have up-to-date preventative functionality.\n\nFreezing is a less invasive mechanism compared with pause, which can already be done by the emergencyAdmin on v2.\n\n## Specification\n\nThe proposal payloads will update the `freezeReserve()` / `unfreezeReserve()` functions on the pool configurator contract to use the new `onlyPoolOrEmergencyAdmin` modifier, which allows both the emergency admin (Aave Guardian) and pool admin (governance Executor contract) to freeze and unfreeze reserves.\n\nOn AaveV2Ethereum, AaveV2EthereumAMM, AaveV2Polygon and AaveV2Avalanche the proposal will call:\n\n- `POOL_ADDRESSES_PROVIDER.setLendingPoolConfiguratorImpl(NEW_POOL_CONFIGURATOR);`\n\nTo update the pool configurator with the new implementation.\n\nIn addition `LendingPoolCollateralManager` for Aave V2 AMM is updated analog to [AIP 361](https://app.aave.com/governance/proposal/361/).\n\n## References\n\n- Implementation: [Payload](https://github.com/bgd-labs/stable-rate-patch/blob/main/src/payloads/ConfiguratorUpdatePayload.sol),\n- Tests: [PoolConfiguratorTest](https://github.com/bgd-labs/stable-rate-patch/blob/main/tests/V2PoolConfigurator.t.sol), [PoolConfiguratorTestBase](https://github.com/bgd-labs/stable-rate-patch/blob/main/tests/V2PoolConfiguratorTestBase.t.sol)\n- [Discussion](https://governance.aave.com/t/aave-v2-v3-security-incident-04-11-2023/15335)\n\n## Copyright\n\nCopyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).\n",
+ "originalHash": "0xebeb42cd75c157a4c381216989b4f7000fdab49d85feba360690bc34338006cb",
+ "id": 386
}
]
}
\ No newline at end of file
diff --git a/src/static-build/proposals.json b/src/static-build/proposals.json
index 5401e09197..801794f2f5 100644
--- a/src/static-build/proposals.json
+++ b/src/static-build/proposals.json
@@ -14310,22 +14310,22 @@
],
"startBlock": 18592893,
"endBlock": 18612093,
- "executionTime": 0,
+ "executionTime": 1700558771,
"forVotes": "499500025714649178601506",
"againstVotes": "0",
- "executed": false,
+ "executed": true,
"canceled": false,
"strategy": "0xb7e383ef9B1E9189Fc0F71fb30af8aa14377429e",
- "state": "Active",
+ "state": "Executed",
"minimumQuorum": "200",
"minimumDiff": "50",
- "executionTimeWithGracePeriod": 0,
+ "executionTimeWithGracePeriod": 1700990771,
"proposalCreated": 18585693,
"totalVotingSupply": "16000000000000000000000000",
"ipfsHash": "0xaf9ee1c1965d3483c0570f4d8a3e70744d08bc452e135331118169101af298c0",
"startTimestamp": 1700239775,
"creationTimestamp": 1700152715,
- "expirationTimestamp": 1700472335
+ "expirationTimestamp": 1700470175
},
{
"id": 373,
@@ -14345,22 +14345,22 @@
],
"startBlock": 18593657,
"endBlock": 18612857,
- "executionTime": 0,
+ "executionTime": 1700568011,
"forVotes": "455811817950727417868976",
"againstVotes": "0",
- "executed": false,
+ "executed": true,
"canceled": false,
"strategy": "0xb7e383ef9B1E9189Fc0F71fb30af8aa14377429e",
- "state": "Active",
+ "state": "Executed",
"minimumQuorum": "200",
"minimumDiff": "50",
- "executionTimeWithGracePeriod": 0,
+ "executionTimeWithGracePeriod": 1701000011,
"proposalCreated": 18586457,
"totalVotingSupply": "16000000000000000000000000",
"ipfsHash": "0x663996e76ce01bdb35abd53ee9f03d15fee8d5fa9ccb4b5733a0e9eeb2549b83",
"startTimestamp": 1700248991,
"creationTimestamp": 1700161907,
- "expirationTimestamp": 1700481503
+ "expirationTimestamp": 1700479391
},
{
"id": 374,
@@ -14380,22 +14380,494 @@
],
"startBlock": 18593667,
"endBlock": 18612867,
- "executionTime": 0,
- "forVotes": "495892952762747896201294",
+ "executionTime": 1700568143,
+ "forVotes": "499477712762747896201294",
"againstVotes": "0",
- "executed": false,
+ "executed": true,
"canceled": false,
"strategy": "0xb7e383ef9B1E9189Fc0F71fb30af8aa14377429e",
- "state": "Active",
+ "state": "Executed",
"minimumQuorum": "200",
"minimumDiff": "50",
- "executionTimeWithGracePeriod": 0,
+ "executionTimeWithGracePeriod": 1701000143,
"proposalCreated": 18586467,
"totalVotingSupply": "16000000000000000000000000",
"ipfsHash": "0x2187a22d1c0a9eba2d112f38b51ad1716a49842ecd2d8efcb146876c20bfb848",
"startTimestamp": 1700249111,
"creationTimestamp": 1700162027,
- "expirationTimestamp": 1700481623
+ "expirationTimestamp": 1700479511
+ },
+ {
+ "id": 375,
+ "creator": "0x329c54289Ff5D6B7b7daE13592C6B1EDA1543eD4",
+ "executor": "0xEE56e2B3D491590B5b31738cC34d5232F378a8D5",
+ "targets": [
+ "0x9AEE0B04504CeF83A65AC3f0e838D0593BCb2BC7",
+ "0x9AEE0B04504CeF83A65AC3f0e838D0593BCb2BC7",
+ "0x9AEE0B04504CeF83A65AC3f0e838D0593BCb2BC7",
+ "0x9AEE0B04504CeF83A65AC3f0e838D0593BCb2BC7",
+ "0x9AEE0B04504CeF83A65AC3f0e838D0593BCb2BC7",
+ "0x9AEE0B04504CeF83A65AC3f0e838D0593BCb2BC7",
+ "0x9AEE0B04504CeF83A65AC3f0e838D0593BCb2BC7"
+ ],
+ "signatures": [
+ "forwardPayloadForExecution((uint256,uint8,address,uint40))",
+ "forwardPayloadForExecution((uint256,uint8,address,uint40))",
+ "forwardPayloadForExecution((uint256,uint8,address,uint40))",
+ "forwardPayloadForExecution((uint256,uint8,address,uint40))",
+ "forwardPayloadForExecution((uint256,uint8,address,uint40))",
+ "forwardPayloadForExecution((uint256,uint8,address,uint40))",
+ "forwardPayloadForExecution((uint256,uint8,address,uint40))"
+ ],
+ "calldatas": [
+ "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000dabad81af85554e9ae636395611c58f7ec1aaec50000000000000000000000000000000000000000000000000000000000000014",
+ "0x00000000000000000000000000000000000000000000000000000000000000890000000000000000000000000000000000000000000000000000000000000001000000000000000000000000401b5d0294e23637c18fcc38b1bca814cda2637c000000000000000000000000000000000000000000000000000000000000000a",
+ "0x000000000000000000000000000000000000000000000000000000000000a86a00000000000000000000000000000000000000000000000000000000000000010000000000000000000000001140cb7cafacc745771c2ea31e7b5c653c5d0b800000000000000000000000000000000000000000000000000000000000000007",
+ "0x000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000e1a3af1f9cc76a62ed31ededca291e63632e7c40000000000000000000000000000000000000000000000000000000000000004",
+ "0x000000000000000000000000000000000000000000000000000000000000a4b1000000000000000000000000000000000000000000000000000000000000000100000000000000000000000089644ca1bb8064760312ae4f03ea41b05da3637c0000000000000000000000000000000000000000000000000000000000000004",
+ "0x000000000000000000000000000000000000000000000000000000000000044000000000000000000000000000000000000000000000000000000000000000010000000000000000000000002233f8a66a728fba6e1dc95570b25360d07d55240000000000000000000000000000000000000000000000000000000000000002",
+ "0x000000000000000000000000000000000000000000000000000000000000210500000000000000000000000000000000000000000000000000000000000000010000000000000000000000002dc219e716793fb4b21548c0f009ba3af753ab010000000000000000000000000000000000000000000000000000000000000001"
+ ],
+ "withDelegatecalls": [
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false
+ ],
+ "startBlock": 18621879,
+ "endBlock": 18641079,
+ "executionTime": 1700909459,
+ "forVotes": "498993927626374313878584",
+ "againstVotes": "0",
+ "executed": true,
+ "canceled": false,
+ "strategy": "0xb7e383ef9B1E9189Fc0F71fb30af8aa14377429e",
+ "state": "Executed",
+ "minimumQuorum": "200",
+ "minimumDiff": "50",
+ "executionTimeWithGracePeriod": 1701341459,
+ "proposalCreated": 18614679,
+ "totalVotingSupply": "16000000000000000000000000",
+ "ipfsHash": "0x5f8349082690bd85372f956b70ef80d8ab98f9eb6f4b8b1e1d849afadb7b51fc",
+ "startTimestamp": 1700590763,
+ "creationTimestamp": 1700503643,
+ "expirationTimestamp": 1700821163
+ },
+ {
+ "id": 376,
+ "creator": "0x683a4F9915D6216f73d6Df50151725036bD26C02",
+ "executor": "0xEE56e2B3D491590B5b31738cC34d5232F378a8D5",
+ "targets": [
+ "0x9AEE0B04504CeF83A65AC3f0e838D0593BCb2BC7",
+ "0x9AEE0B04504CeF83A65AC3f0e838D0593BCb2BC7",
+ "0x9AEE0B04504CeF83A65AC3f0e838D0593BCb2BC7",
+ "0x9AEE0B04504CeF83A65AC3f0e838D0593BCb2BC7"
+ ],
+ "signatures": [
+ "forwardPayloadForExecution((uint256,uint8,address,uint40))",
+ "forwardPayloadForExecution((uint256,uint8,address,uint40))",
+ "forwardPayloadForExecution((uint256,uint8,address,uint40))",
+ "forwardPayloadForExecution((uint256,uint8,address,uint40))"
+ ],
+ "calldatas": [
+ "0x00000000000000000000000000000000000000000000000000000000000000890000000000000000000000000000000000000000000000000000000000000001000000000000000000000000401b5d0294e23637c18fcc38b1bca814cda2637c0000000000000000000000000000000000000000000000000000000000000009",
+ "0x000000000000000000000000000000000000000000000000000000000000a86a00000000000000000000000000000000000000000000000000000000000000010000000000000000000000001140cb7cafacc745771c2ea31e7b5c653c5d0b800000000000000000000000000000000000000000000000000000000000000006",
+ "0x000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000e1a3af1f9cc76a62ed31ededca291e63632e7c40000000000000000000000000000000000000000000000000000000000000003",
+ "0x000000000000000000000000000000000000000000000000000000000000a4b1000000000000000000000000000000000000000000000000000000000000000100000000000000000000000089644ca1bb8064760312ae4f03ea41b05da3637c0000000000000000000000000000000000000000000000000000000000000003"
+ ],
+ "withDelegatecalls": [
+ false,
+ false,
+ false,
+ false
+ ],
+ "startBlock": 18622155,
+ "endBlock": 18641355,
+ "executionTime": 1700912807,
+ "forVotes": "587300527426219461460782",
+ "againstVotes": "0",
+ "executed": true,
+ "canceled": false,
+ "strategy": "0xb7e383ef9B1E9189Fc0F71fb30af8aa14377429e",
+ "state": "Executed",
+ "minimumQuorum": "200",
+ "minimumDiff": "50",
+ "executionTimeWithGracePeriod": 1701344807,
+ "proposalCreated": 18614955,
+ "totalVotingSupply": "16000000000000000000000000",
+ "ipfsHash": "0xb2fcb5da149a326de38268779244b13e824e7b5e3426d37f76865e9e41dde43e",
+ "startTimestamp": 1700594087,
+ "creationTimestamp": 1700506979,
+ "expirationTimestamp": 1700824487
+ },
+ {
+ "id": 377,
+ "creator": "0x683a4F9915D6216f73d6Df50151725036bD26C02",
+ "executor": "0xEE56e2B3D491590B5b31738cC34d5232F378a8D5",
+ "targets": [
+ "0x9AEE0B04504CeF83A65AC3f0e838D0593BCb2BC7"
+ ],
+ "signatures": [
+ "forwardPayloadForExecution((uint256,uint8,address,uint40))"
+ ],
+ "calldatas": [
+ "0x00000000000000000000000000000000000000000000000000000000000000890000000000000000000000000000000000000000000000000000000000000001000000000000000000000000401b5d0294e23637c18fcc38b1bca814cda2637c000000000000000000000000000000000000000000000000000000000000000b"
+ ],
+ "withDelegatecalls": [
+ false
+ ],
+ "startBlock": 18623092,
+ "endBlock": 18642292,
+ "executionTime": 1700924147,
+ "forVotes": "492568165069295232595604",
+ "againstVotes": "181510620082044331911006",
+ "executed": true,
+ "canceled": false,
+ "strategy": "0xb7e383ef9B1E9189Fc0F71fb30af8aa14377429e",
+ "state": "Executed",
+ "minimumQuorum": "200",
+ "minimumDiff": "50",
+ "executionTimeWithGracePeriod": 1701356147,
+ "proposalCreated": 18615892,
+ "totalVotingSupply": "16000000000000000000000000",
+ "ipfsHash": "0x4989045af890034b671390e0bd573cf61bba6d3f20bfbb784abe1c420f7ec95d",
+ "startTimestamp": 1700605367,
+ "creationTimestamp": 1700518319,
+ "expirationTimestamp": 1700835767
+ },
+ {
+ "id": 378,
+ "creator": "0x329c54289Ff5D6B7b7daE13592C6B1EDA1543eD4",
+ "executor": "0xEE56e2B3D491590B5b31738cC34d5232F378a8D5",
+ "targets": [
+ "0x9AEE0B04504CeF83A65AC3f0e838D0593BCb2BC7"
+ ],
+ "signatures": [
+ "forwardPayloadForExecution((uint256,uint8,address,uint40))"
+ ],
+ "calldatas": [
+ "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000dabad81af85554e9ae636395611c58f7ec1aaec50000000000000000000000000000000000000000000000000000000000000013"
+ ],
+ "withDelegatecalls": [
+ false
+ ],
+ "startBlock": 18630124,
+ "endBlock": 18649324,
+ "executionTime": 1701009143,
+ "forVotes": "559215373670323512879690",
+ "againstVotes": "0",
+ "executed": true,
+ "canceled": false,
+ "strategy": "0xb7e383ef9B1E9189Fc0F71fb30af8aa14377429e",
+ "state": "Executed",
+ "minimumQuorum": "200",
+ "minimumDiff": "50",
+ "executionTimeWithGracePeriod": 1701441143,
+ "proposalCreated": 18622924,
+ "totalVotingSupply": "16000000000000000000000000",
+ "ipfsHash": "0x36761f3b362b7462b1697600f0003795e4dea7a5daeb2080f00980542401f1c3",
+ "startTimestamp": 1700690471,
+ "creationTimestamp": 1700603351,
+ "expirationTimestamp": 1700920871
+ },
+ {
+ "id": 379,
+ "creator": "0x329c54289Ff5D6B7b7daE13592C6B1EDA1543eD4",
+ "executor": "0xEE56e2B3D491590B5b31738cC34d5232F378a8D5",
+ "targets": [
+ "0x9AEE0B04504CeF83A65AC3f0e838D0593BCb2BC7"
+ ],
+ "signatures": [
+ "forwardPayloadForExecution((uint256,uint8,address,uint40))"
+ ],
+ "calldatas": [
+ "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000dabad81af85554e9ae636395611c58f7ec1aaec50000000000000000000000000000000000000000000000000000000000000015"
+ ],
+ "withDelegatecalls": [
+ false
+ ],
+ "startBlock": 18630137,
+ "endBlock": 18649337,
+ "executionTime": 1701009299,
+ "forVotes": "499192426262526047284900",
+ "againstVotes": "0",
+ "executed": true,
+ "canceled": false,
+ "strategy": "0xb7e383ef9B1E9189Fc0F71fb30af8aa14377429e",
+ "state": "Executed",
+ "minimumQuorum": "200",
+ "minimumDiff": "50",
+ "executionTimeWithGracePeriod": 1701441299,
+ "proposalCreated": 18622937,
+ "totalVotingSupply": "16000000000000000000000000",
+ "ipfsHash": "0x21717f4bd284ed1e6c9f93ddd02f113d821e448b1f0d7c1e4d8d52d4f0bd47a5",
+ "startTimestamp": 1700690627,
+ "creationTimestamp": 1700603507,
+ "expirationTimestamp": 1700921027
+ },
+ {
+ "id": 380,
+ "creator": "0x683a4F9915D6216f73d6Df50151725036bD26C02",
+ "executor": "0xEE56e2B3D491590B5b31738cC34d5232F378a8D5",
+ "targets": [
+ "0x9AEE0B04504CeF83A65AC3f0e838D0593BCb2BC7"
+ ],
+ "signatures": [
+ "forwardPayloadForExecution((uint256,uint8,address,uint40))"
+ ],
+ "calldatas": [
+ "0x00000000000000000000000000000000000000000000000000000000000000890000000000000000000000000000000000000000000000000000000000000001000000000000000000000000401b5d0294e23637c18fcc38b1bca814cda2637c000000000000000000000000000000000000000000000000000000000000000c"
+ ],
+ "withDelegatecalls": [
+ false
+ ],
+ "startBlock": 18633026,
+ "endBlock": 18652226,
+ "executionTime": 1701044267,
+ "forVotes": "516807211511465879970843",
+ "againstVotes": "0",
+ "executed": true,
+ "canceled": false,
+ "strategy": "0xb7e383ef9B1E9189Fc0F71fb30af8aa14377429e",
+ "state": "Executed",
+ "minimumQuorum": "200",
+ "minimumDiff": "50",
+ "executionTimeWithGracePeriod": 1701476267,
+ "proposalCreated": 18625826,
+ "totalVotingSupply": "16000000000000000000000000",
+ "ipfsHash": "0x4ac48ef13a739822e2ca321f731b123bfa6f25bb825a7fd88a48a54ad5fc41ef",
+ "startTimestamp": 1700725559,
+ "creationTimestamp": 1700638499,
+ "expirationTimestamp": 1700955959
+ },
+ {
+ "id": 381,
+ "creator": "0x329c54289Ff5D6B7b7daE13592C6B1EDA1543eD4",
+ "executor": "0xEE56e2B3D491590B5b31738cC34d5232F378a8D5",
+ "targets": [
+ "0x9AEE0B04504CeF83A65AC3f0e838D0593BCb2BC7"
+ ],
+ "signatures": [
+ "forwardPayloadForExecution((uint256,uint8,address,uint40))"
+ ],
+ "calldatas": [
+ "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000dabad81af85554e9ae636395611c58f7ec1aaec50000000000000000000000000000000000000000000000000000000000000016"
+ ],
+ "withDelegatecalls": [
+ false
+ ],
+ "startBlock": 18636650,
+ "endBlock": 18655850,
+ "executionTime": 1701088139,
+ "forVotes": "388350316541174548220035",
+ "againstVotes": "0",
+ "executed": true,
+ "canceled": false,
+ "strategy": "0xb7e383ef9B1E9189Fc0F71fb30af8aa14377429e",
+ "state": "Executed",
+ "minimumQuorum": "200",
+ "minimumDiff": "50",
+ "executionTimeWithGracePeriod": 1701520139,
+ "proposalCreated": 18629450,
+ "totalVotingSupply": "16000000000000000000000000",
+ "ipfsHash": "0x4977ecf7075c1e4d30973c4e1d34c1d2d3a1c989ae5da116a6ad951d974c4f65",
+ "startTimestamp": 1700769311,
+ "creationTimestamp": 1700682347,
+ "expirationTimestamp": 1700999711
+ },
+ {
+ "id": 382,
+ "creator": "0x329c54289Ff5D6B7b7daE13592C6B1EDA1543eD4",
+ "executor": "0xEE56e2B3D491590B5b31738cC34d5232F378a8D5",
+ "targets": [
+ "0x9AEE0B04504CeF83A65AC3f0e838D0593BCb2BC7"
+ ],
+ "signatures": [
+ "forwardPayloadForExecution((uint256,uint8,address,uint40))"
+ ],
+ "calldatas": [
+ "0x000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000e1a3af1f9cc76a62ed31ededca291e63632e7c40000000000000000000000000000000000000000000000000000000000000005"
+ ],
+ "withDelegatecalls": [
+ false
+ ],
+ "startBlock": 18636679,
+ "endBlock": 18655879,
+ "executionTime": 1701088499,
+ "forVotes": "388353032772049329897172",
+ "againstVotes": "0",
+ "executed": true,
+ "canceled": false,
+ "strategy": "0xb7e383ef9B1E9189Fc0F71fb30af8aa14377429e",
+ "state": "Executed",
+ "minimumQuorum": "200",
+ "minimumDiff": "50",
+ "executionTimeWithGracePeriod": 1701520499,
+ "proposalCreated": 18629479,
+ "totalVotingSupply": "16000000000000000000000000",
+ "ipfsHash": "0x1a6c69fcf8d44afae186c84ef32a80cd702a75951a60f9069e2b9adb311d8349",
+ "startTimestamp": 1700769659,
+ "creationTimestamp": 1700682695,
+ "expirationTimestamp": 1701000059
+ },
+ {
+ "id": 383,
+ "creator": "0x683a4F9915D6216f73d6Df50151725036bD26C02",
+ "executor": "0xEE56e2B3D491590B5b31738cC34d5232F378a8D5",
+ "targets": [
+ "0x9AEE0B04504CeF83A65AC3f0e838D0593BCb2BC7"
+ ],
+ "signatures": [
+ "forwardPayloadForExecution((uint256,uint8,address,uint40))"
+ ],
+ "calldatas": [
+ "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000dabad81af85554e9ae636395611c58f7ec1aaec50000000000000000000000000000000000000000000000000000000000000017"
+ ],
+ "withDelegatecalls": [
+ false
+ ],
+ "startBlock": 18637784,
+ "endBlock": 18656984,
+ "executionTime": 1701101927,
+ "forVotes": "536681669731008990198268",
+ "againstVotes": "0",
+ "executed": false,
+ "canceled": false,
+ "strategy": "0xb7e383ef9B1E9189Fc0F71fb30af8aa14377429e",
+ "state": "Queued",
+ "minimumQuorum": "200",
+ "minimumDiff": "50",
+ "executionTimeWithGracePeriod": 1701533927,
+ "proposalCreated": 18630584,
+ "totalVotingSupply": "16000000000000000000000000",
+ "ipfsHash": "0x4a54b101821f12b78ac4215ac84658d9ef6278a814267264728f2c57e998f83f",
+ "startTimestamp": 1700783087,
+ "creationTimestamp": 1700696027,
+ "expirationTimestamp": 1701013487
+ },
+ {
+ "id": 384,
+ "creator": "0x329c54289Ff5D6B7b7daE13592C6B1EDA1543eD4",
+ "executor": "0xEE56e2B3D491590B5b31738cC34d5232F378a8D5",
+ "targets": [
+ "0x9AEE0B04504CeF83A65AC3f0e838D0593BCb2BC7"
+ ],
+ "signatures": [
+ "forwardPayloadForExecution((uint256,uint8,address,uint40))"
+ ],
+ "calldatas": [
+ "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000dabad81af85554e9ae636395611c58f7ec1aaec50000000000000000000000000000000000000000000000000000000000000016"
+ ],
+ "withDelegatecalls": [
+ false
+ ],
+ "startBlock": 18641214,
+ "endBlock": 18660414,
+ "executionTime": 0,
+ "forVotes": "0",
+ "againstVotes": "490738663234554400193937",
+ "executed": false,
+ "canceled": false,
+ "strategy": "0xb7e383ef9B1E9189Fc0F71fb30af8aa14377429e",
+ "state": "Failed",
+ "minimumQuorum": "200",
+ "minimumDiff": "50",
+ "executionTimeWithGracePeriod": 0,
+ "proposalCreated": 18634014,
+ "totalVotingSupply": "16000000000000000000000000",
+ "ipfsHash": "0x4977ecf7075c1e4d30973c4e1d34c1d2d3a1c989ae5da116a6ad951d974c4f65",
+ "startTimestamp": 1700824655,
+ "creationTimestamp": 1700737463,
+ "expirationTimestamp": 1701055055
+ },
+ {
+ "id": 385,
+ "creator": "0x329c54289Ff5D6B7b7daE13592C6B1EDA1543eD4",
+ "executor": "0xEE56e2B3D491590B5b31738cC34d5232F378a8D5",
+ "targets": [
+ "0x8eF5088F33056c4232B8cB4Cb4720D7e58a44Caf"
+ ],
+ "signatures": [
+ "execute()"
+ ],
+ "calldatas": [
+ "0x"
+ ],
+ "withDelegatecalls": [
+ true
+ ],
+ "startBlock": 18642396,
+ "endBlock": 18661596,
+ "executionTime": 1701157775,
+ "forVotes": "403961702053153237554482",
+ "againstVotes": "0",
+ "executed": false,
+ "canceled": false,
+ "strategy": "0xb7e383ef9B1E9189Fc0F71fb30af8aa14377429e",
+ "state": "Queued",
+ "minimumQuorum": "200",
+ "minimumDiff": "50",
+ "executionTimeWithGracePeriod": 1701589775,
+ "proposalCreated": 18635196,
+ "totalVotingSupply": "16000000000000000000000000",
+ "ipfsHash": "0xefbc05fe227f66c90738f7ea59a2139abffd659ab6ad5d580aac94152b3d6632",
+ "startTimestamp": 1700838947,
+ "creationTimestamp": 1700751719,
+ "expirationTimestamp": 1701069347
+ },
+ {
+ "id": 386,
+ "creator": "0xf71fc92e2949ccF6A5Fd369a0b402ba80Bc61E02",
+ "executor": "0xEE56e2B3D491590B5b31738cC34d5232F378a8D5",
+ "targets": [
+ "0x9AEE0B04504CeF83A65AC3f0e838D0593BCb2BC7",
+ "0x9AEE0B04504CeF83A65AC3f0e838D0593BCb2BC7",
+ "0x9AEE0B04504CeF83A65AC3f0e838D0593BCb2BC7",
+ "0x9AEE0B04504CeF83A65AC3f0e838D0593BCb2BC7",
+ "0x9AEE0B04504CeF83A65AC3f0e838D0593BCb2BC7"
+ ],
+ "signatures": [
+ "forwardPayloadForExecution((uint256,uint8,address,uint40))",
+ "forwardPayloadForExecution((uint256,uint8,address,uint40))",
+ "forwardPayloadForExecution((uint256,uint8,address,uint40))",
+ "forwardPayloadForExecution((uint256,uint8,address,uint40))",
+ "forwardPayloadForExecution((uint256,uint8,address,uint40))"
+ ],
+ "calldatas": [
+ "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000dabad81af85554e9ae636395611c58f7ec1aaec50000000000000000000000000000000000000000000000000000000000000010",
+ "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000dabad81af85554e9ae636395611c58f7ec1aaec5000000000000000000000000000000000000000000000000000000000000000d",
+ "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000dabad81af85554e9ae636395611c58f7ec1aaec5000000000000000000000000000000000000000000000000000000000000000e",
+ "0x00000000000000000000000000000000000000000000000000000000000000890000000000000000000000000000000000000000000000000000000000000001000000000000000000000000401b5d0294e23637c18fcc38b1bca814cda2637c0000000000000000000000000000000000000000000000000000000000000008",
+ "0x000000000000000000000000000000000000000000000000000000000000a86a00000000000000000000000000000000000000000000000000000000000000010000000000000000000000001140cb7cafacc745771c2ea31e7b5c653c5d0b800000000000000000000000000000000000000000000000000000000000000005"
+ ],
+ "withDelegatecalls": [
+ false,
+ false,
+ false,
+ false,
+ false
+ ],
+ "startBlock": 18670744,
+ "endBlock": 18689944,
+ "executionTime": 0,
+ "forVotes": "0",
+ "againstVotes": "0",
+ "executed": false,
+ "canceled": false,
+ "strategy": "0xb7e383ef9B1E9189Fc0F71fb30af8aa14377429e",
+ "state": "Pending",
+ "minimumQuorum": "200",
+ "minimumDiff": "50",
+ "executionTimeWithGracePeriod": 0,
+ "proposalCreated": 18663544,
+ "totalVotingSupply": "16000000000000000000000000",
+ "ipfsHash": "0xebeb42cd75c157a4c381216989b4f7000fdab49d85feba360690bc34338006cb",
+ "creationTimestamp": 1701094931,
+ "startTimestamp": 1701181355,
+ "expirationTimestamp": 1701411755
}
]
}
\ No newline at end of file
diff --git a/src/store/poolSlice.ts b/src/store/poolSlice.ts
index 20fc10db15..67c31e4316 100644
--- a/src/store/poolSlice.ts
+++ b/src/store/poolSlice.ts
@@ -14,11 +14,13 @@ import {
InterestRate,
LendingPool,
LendingPoolBundle,
+ LendingPoolBundleInterface,
MAX_UINT_AMOUNT,
PermitSignature,
Pool,
PoolBaseCurrencyHumanized,
PoolBundle,
+ PoolBundleInterface,
ReserveDataHumanized,
ReservesIncentiveDataHumanized,
UiIncentiveDataProvider,
@@ -34,11 +36,11 @@ import {
LPWithdrawParamsType,
} from '@aave/contract-helpers/dist/esm/lendingPool-contract/lendingPoolTypes';
import {
+ LPRepayWithPermitParamsType,
LPSignERC20ApprovalType,
LPSupplyParamsType,
LPSupplyWithPermitType,
} from '@aave/contract-helpers/dist/esm/v3-pool-contract/lendingPoolTypes';
-import { SignatureLike } from '@ethersproject/bytes';
import dayjs from 'dayjs';
import { BigNumber, PopulatedTransaction, Signature, utils } from 'ethers';
import { splitSignature } from 'ethers/lib/utils';
@@ -46,7 +48,6 @@ import { produce } from 'immer';
import { ClaimRewardsActionsProps } from 'src/components/transactions/ClaimRewards/ClaimRewardsActions';
import { DebtSwitchActionProps } from 'src/components/transactions/DebtSwitch/DebtSwitchActions';
import { CollateralRepayActionProps } from 'src/components/transactions/Repay/CollateralRepayActions';
-import { RepayActionProps } from 'src/components/transactions/Repay/RepayActions';
import { SwapActionProps } from 'src/components/transactions/Swap/SwapActions';
import { WithdrawAndSwitchActionProps } from 'src/components/transactions/Withdraw/WithdrawAndSwitchActions';
import { Approval } from 'src/helpers/useTransactionHandler';
@@ -66,6 +67,14 @@ export type PoolReserve = {
userReserves?: UserReserveDataHumanized[];
};
+type RepayArgs = {
+ amountToRepay: string;
+ poolAddress: string;
+ debtType: InterestRate;
+ repayWithATokens: boolean;
+ encodedTxData?: string;
+};
+
type GenerateApprovalOpts = {
chainId?: number;
};
@@ -101,13 +110,12 @@ export interface PoolSlice {
// TODO: optimize types to use only neccessary properties
swapCollateral: (args: SwapActionProps) => Promise;
withdrawAndSwitch: (args: WithdrawAndSwitchActionProps) => PopulatedTransaction;
- repay: (args: RepayActionProps) => Promise;
- repayWithPermit: (
- args: RepayActionProps & {
- signature: SignatureLike;
- deadline: string;
- }
- ) => Promise;
+ repay: (args: RepayArgs) => PopulatedTransaction;
+ encodeRepayParams: (args: RepayArgs) => Promise;
+ repayWithPermit: (args: Omit) => PopulatedTransaction;
+ encodeRepayWithPermitParams: (
+ args: Omit
+ ) => Promise<[string, string, string]>;
poolComputed: {
minRemainingBaseTokenBalance: string;
};
@@ -124,7 +132,6 @@ export interface PoolSlice {
generateApproval: (args: ApproveType, opts?: GenerateApprovalOpts) => PopulatedTransaction;
supply: (args: Omit) => PopulatedTransaction;
supplyWithPermit: (args: Omit) => PopulatedTransaction;
- getApprovedAmount: (args: { token: string }) => Promise;
borrow: (args: Omit) => PopulatedTransaction;
getCreditDelegationApprovedAmount: (
args: Omit
@@ -136,6 +143,7 @@ export interface PoolSlice {
}
) => Promise;
generateApproveDelegation: (args: Omit) => PopulatedTransaction;
+ getCorrectPoolBundle: () => PoolBundleInterface | LendingPoolBundleInterface;
estimateGasLimit: (tx: PopulatedTransaction, chainId?: number) => Promise;
}
@@ -165,24 +173,24 @@ export const createPoolSlice: StateCreator<
});
}
}
- function getCorrectPoolBundle() {
- const currentMarketData = get().currentMarketData;
- const provider = get().jsonRpcProvider();
- if (currentMarketData.v3) {
- return new PoolBundle(provider, {
- POOL: currentMarketData.addresses.LENDING_POOL,
- WETH_GATEWAY: currentMarketData.addresses.WETH_GATEWAY,
- L2_ENCODER: currentMarketData.addresses.L2_ENCODER,
- });
- } else {
- return new LendingPoolBundle(provider, {
- LENDING_POOL: currentMarketData.addresses.LENDING_POOL,
- WETH_GATEWAY: currentMarketData.addresses.WETH_GATEWAY,
- });
- }
- }
return {
data: new Map(),
+ getCorrectPoolBundle() {
+ const currentMarketData = get().currentMarketData;
+ const provider = get().jsonRpcProvider();
+ if (currentMarketData.v3) {
+ return new PoolBundle(provider, {
+ POOL: currentMarketData.addresses.LENDING_POOL,
+ WETH_GATEWAY: currentMarketData.addresses.WETH_GATEWAY,
+ L2_ENCODER: currentMarketData.addresses.L2_ENCODER,
+ });
+ } else {
+ return new LendingPoolBundle(provider, {
+ LENDING_POOL: currentMarketData.addresses.LENDING_POOL,
+ WETH_GATEWAY: currentMarketData.addresses.WETH_GATEWAY,
+ });
+ }
+ },
refreshPoolData: async (marketData?: MarketDataType) => {
const account = get().account;
const currentChainId = get().currentChainId;
@@ -296,7 +304,7 @@ export const createPoolSlice: StateCreator<
return tokenERC20Service.approveTxData({ ...args, amount: MAX_UINT_AMOUNT });
},
supply: (args: Omit) => {
- const poolBundle = getCorrectPoolBundle();
+ const poolBundle = get().getCorrectPoolBundle();
const currentAccount = get().account;
if (poolBundle instanceof PoolBundle) {
return poolBundle.supplyTxBuilder.generateTxData({
@@ -315,7 +323,7 @@ export const createPoolSlice: StateCreator<
}
},
supplyWithPermit: (args: Omit) => {
- const poolBundle = getCorrectPoolBundle() as PoolBundle;
+ const poolBundle = get().getCorrectPoolBundle() as PoolBundle;
const user = get().account;
const signature = utils.joinSignature(args.signature);
return poolBundle.supplyTxBuilder.generateSignedTxData({
@@ -327,17 +335,8 @@ export const createPoolSlice: StateCreator<
signature,
});
},
- getApprovedAmount: async (args: { token: string }) => {
- const poolBundle = getCorrectPoolBundle();
- const user = get().account;
- if (poolBundle instanceof PoolBundle) {
- return poolBundle.supplyTxBuilder.getApprovedAmount({ user, token: args.token });
- } else {
- return poolBundle.depositTxBuilder.getApprovedAmount({ user, token: args.token });
- }
- },
borrow: (args: Omit) => {
- const poolBundle = getCorrectPoolBundle();
+ const poolBundle = get().getCorrectPoolBundle();
const currentAccount = get().account;
if (poolBundle instanceof PoolBundle) {
return poolBundle.borrowTxBuilder.generateTxData({
@@ -571,41 +570,88 @@ export const createPoolSlice: StateCreator<
},
});
},
- repay: ({ repayWithATokens, amountToRepay, poolAddress, debtType }) => {
- const pool = getCorrectPool();
+ repay: ({ repayWithATokens, amountToRepay, poolAddress, debtType, encodedTxData }) => {
+ const poolBundle = get().getCorrectPoolBundle();
const currentAccount = get().account;
- if (pool instanceof Pool && repayWithATokens) {
- return pool.repayWithATokens({
- user: currentAccount,
- reserve: poolAddress,
- amount: amountToRepay,
- rateMode: debtType as InterestRate,
- useOptimizedPath: get().useOptimizedPath(),
- });
+ if (poolBundle instanceof PoolBundle) {
+ if (repayWithATokens) {
+ return poolBundle.repayWithATokensTxBuilder.generateTxData({
+ user: currentAccount,
+ reserve: poolAddress,
+ amount: amountToRepay,
+ useOptimizedPath: get().useOptimizedPath(),
+ rateMode: debtType,
+ encodedTxData,
+ });
+ } else {
+ return poolBundle.repayTxBuilder.generateTxData({
+ user: currentAccount,
+ reserve: poolAddress,
+ amount: amountToRepay,
+ useOptimizedPath: get().useOptimizedPath(),
+ interestRateMode: debtType,
+ encodedTxData,
+ });
+ }
} else {
- return pool.repay({
+ const lendingPool = poolBundle as LendingPoolBundle;
+ return lendingPool.repayTxBuilder.generateTxData({
user: currentAccount,
reserve: poolAddress,
amount: amountToRepay,
interestRateMode: debtType,
- useOptimizedPath: get().useOptimizedPath(),
});
}
},
- repayWithPermit: ({ poolAddress, amountToRepay, debtType, deadline, signature }) => {
- // Better to get rid of direct assert
- const pool = getCorrectPool() as Pool;
+ repayWithPermit: ({
+ reserve,
+ amount,
+ interestRateMode,
+ deadline,
+ signature,
+ encodedTxData,
+ }) => {
+ const poolBundle = get().getCorrectPoolBundle() as PoolBundle;
const currentAccount = get().account;
- return pool.repayWithPermit({
+ const stringSignature = utils.joinSignature(signature);
+ return poolBundle.repayTxBuilder.generateSignedTxData({
user: currentAccount,
- reserve: poolAddress,
- amount: amountToRepay, // amountToRepay.toString(),
- interestRateMode: debtType,
- signature,
+ reserve,
+ amount,
useOptimizedPath: get().useOptimizedPath(),
+ interestRateMode,
+ deadline,
+ signature: stringSignature,
+ encodedTxData,
+ });
+ },
+ encodeRepayWithPermitParams: ({ reserve, amount, interestRateMode, deadline, signature }) => {
+ const poolBundle = get().getCorrectPoolBundle() as PoolBundle;
+ const stringSignature = utils.joinSignature(signature);
+ return poolBundle.repayTxBuilder.encodeRepayWithPermitParams({
+ reserve,
+ amount,
+ interestRateMode,
deadline,
+ signature: stringSignature,
});
},
+ encodeRepayParams: ({ amountToRepay, poolAddress, debtType, repayWithATokens }) => {
+ const poolBundle = get().getCorrectPoolBundle() as PoolBundle;
+ if (repayWithATokens) {
+ return poolBundle.repayWithATokensTxBuilder.encodeRepayWithATokensParams({
+ reserve: poolAddress,
+ amount: amountToRepay,
+ rateMode: debtType,
+ });
+ } else {
+ return poolBundle.repayTxBuilder.encodeRepayParams({
+ reserve: poolAddress,
+ amount: amountToRepay,
+ interestRateMode: debtType,
+ });
+ }
+ },
swapCollateral: async ({
poolReserve,
targetReserve,
diff --git a/src/ui-config/SharedDependenciesProvider.tsx b/src/ui-config/SharedDependenciesProvider.tsx
index 7621a4104b..522d287984 100644
--- a/src/ui-config/SharedDependenciesProvider.tsx
+++ b/src/ui-config/SharedDependenciesProvider.tsx
@@ -1,4 +1,5 @@
import { createContext, useContext } from 'react';
+import { ApprovedAmountService } from 'src/services/ApprovedAmountService';
import { GovernanceService } from 'src/services/GovernanceService';
import { UiIncentivesService } from 'src/services/UIIncentivesService';
import { UiPoolService } from 'src/services/UIPoolService';
@@ -15,6 +16,7 @@ interface SharedDependenciesContext {
governanceWalletBalanceService: WalletBalanceService;
poolTokensBalanceService: WalletBalanceService;
uiStakeDataService: UiStakeDataService;
+ approvedAmountService: ApprovedAmountService;
uiIncentivesService: UiIncentivesService;
uiPoolService: UiPoolService;
}
@@ -41,6 +43,7 @@ export const SharedDependenciesProvider: React.FC = ({ children }) => {
const governanceWalletBalanceService = new WalletBalanceService(getGovernanceProvider);
const poolTokensBalanceService = new WalletBalanceService(getProvider);
const uiStakeDataService = new UiStakeDataService(getStakeProvider);
+ const approvedAmountService = new ApprovedAmountService(getProvider);
const uiPoolService = new UiPoolService(getProvider);
const uiIncentivesService = new UiIncentivesService(getProvider);
@@ -52,6 +55,7 @@ export const SharedDependenciesProvider: React.FC = ({ children }) => {
governanceWalletBalanceService,
poolTokensBalanceService,
uiStakeDataService,
+ approvedAmountService,
uiPoolService,
uiIncentivesService,
}}
diff --git a/src/ui-config/queries.ts b/src/ui-config/queries.ts
index ee6045f55e..0864baef1c 100644
--- a/src/ui-config/queries.ts
+++ b/src/ui-config/queries.ts
@@ -79,6 +79,20 @@ export const queryKeysFactory = {
user: string
) => [...queryKeysFactory.user(user), chainId, amount, srcToken, destToken, 'paraswapRates'],
gasPrices: (chainId: number) => [chainId, 'gasPrices'],
+ poolApprovedAmount: (user: string, token: string, marketData: MarketDataType) => [
+ ...queryKeysFactory.pool,
+ ...queryKeysFactory.user(user),
+ ...queryKeysFactory.market(marketData),
+ token,
+ 'poolApprovedAmount',
+ ],
+ approvedAmount: (user: string, token: string, spender: string, marketData: MarketDataType) => [
+ ...queryKeysFactory.user(user),
+ ...queryKeysFactory.market(marketData),
+ token,
+ spender,
+ 'approvedAmount',
+ ],
};
export const POLLING_INTERVAL = 60000;
diff --git a/yarn.lock b/yarn.lock
index 4d4fce3494..90d5b9d150 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2,17 +2,17 @@
# yarn lockfile v1
-"@aave/contract-helpers@1.21.0":
- version "1.21.0"
- resolved "https://registry.yarnpkg.com/@aave/contract-helpers/-/contract-helpers-1.21.0.tgz#9081a7aab4bc84818584494c344e99ef3e1dffec"
- integrity sha512-vlTZyX5yDHli4u4zXNcI74JRcWToPSL3ARdax80Kauu+9L8SxjWNcbIfPrCvvQ7j0HY8tYDg4O4FYRjwu62N3Q==
+"@aave/contract-helpers@1.21.1":
+ version "1.21.1"
+ resolved "https://registry.yarnpkg.com/@aave/contract-helpers/-/contract-helpers-1.21.1.tgz#7157ec7e7fe83f3fb5be1a5f4a1dfbfdfaa592a1"
+ integrity sha512-sp5m0KZ0lInlBfTfZnbR7yh0jG1Q+5wvM42H7JBMOdjxb1jWKWkAWg0DFQJzXlDsBo+bk6BS/sBHa4Eql0IA8A==
dependencies:
isomorphic-unfetch "^3.1.0"
-"@aave/math-utils@^1.21.0":
- version "1.21.0"
- resolved "https://registry.yarnpkg.com/@aave/math-utils/-/math-utils-1.21.0.tgz#420e36de179c27637be1c544afaf2f7b6c92b4d1"
- integrity sha512-phO9BogmnpMPaK0/rl2QxdiTfHLHb+YmTCwvLC3e/IhDyRcc4QKLb/NFaPfC65aRZBjEEsS4QI1crPz3WKHHXA==
+"@aave/math-utils@1.21.1":
+ version "1.21.1"
+ resolved "https://registry.yarnpkg.com/@aave/math-utils/-/math-utils-1.21.1.tgz#b72b85e0ef6d98ac28121cac383c985122b08bd4"
+ integrity sha512-oFZafJ5MeNtiqgJBEsmvvGlFtdFauWX0wI9B+wikqT//LVc0PYS0IX49UItv6yoTcd0I7IDq3Zv8V47e3lhBOw==
"@adobe/css-tools@^4.0.1":
version "4.0.1"
@@ -9196,13 +9196,14 @@ mdast-util-definitions@^5.0.0:
unist-util-visit "^3.0.0"
mdast-util-find-and-replace@^2.0.0:
- version "2.1.0"
- resolved "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-2.1.0.tgz"
- integrity sha512-1w1jbqAd13oU78QPBf5223+xB+37ecNtQ1JElq2feWols5oEYAl+SgNDnOZipe7NfLemoEt362yUS15/wip4mw==
+ version "2.2.2"
+ resolved "https://registry.yarnpkg.com/mdast-util-find-and-replace/-/mdast-util-find-and-replace-2.2.2.tgz#cc2b774f7f3630da4bd592f61966fecade8b99b1"
+ integrity sha512-MTtdFRz/eMDHXzeK6W3dO7mXUlF82Gom4y0oOgvHhh/HXZAGvIQDUvQ0SuUx+j2tv44b8xTHOm8K/9OoRFnXKw==
dependencies:
+ "@types/mdast" "^3.0.0"
escape-string-regexp "^5.0.0"
unist-util-is "^5.0.0"
- unist-util-visit-parents "^4.0.0"
+ unist-util-visit-parents "^5.0.0"
mdast-util-from-markdown@^1.0.0:
version "1.2.0"
@@ -9223,9 +9224,9 @@ mdast-util-from-markdown@^1.0.0:
uvu "^0.5.0"
mdast-util-gfm-autolink-literal@^1.0.0:
- version "1.0.2"
- resolved "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-1.0.2.tgz"
- integrity sha512-FzopkOd4xTTBeGXhXSBU0OCDDh5lUj2rd+HQqG92Ld+jL4lpUfgX2AT2OHAVP9aEeDKp7G92fuooSZcYJA3cRg==
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-1.0.3.tgz#67a13abe813d7eba350453a5333ae1bc0ec05c06"
+ integrity sha512-My8KJ57FYEy2W2LyNom4n3E7hKTuQk/0SES0u16tjA9Z3oFkF4RrC/hPAPgjlSpezsOvI8ObcXcElo92wn5IGA==
dependencies:
"@types/mdast" "^3.0.0"
ccount "^2.0.0"
@@ -9233,48 +9234,60 @@ mdast-util-gfm-autolink-literal@^1.0.0:
micromark-util-character "^1.0.0"
mdast-util-gfm-footnote@^1.0.0:
- version "1.0.1"
- resolved "https://registry.npmjs.org/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-1.0.1.tgz"
- integrity sha512-p+PrYlkw9DeCRkTVw1duWqPRHX6Ywh2BNKJQcZbCwAuP/59B0Lk9kakuAd7KbQprVO4GzdW8eS5++A9PUSqIyw==
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-1.0.2.tgz#ce5e49b639c44de68d5bf5399877a14d5020424e"
+ integrity sha512-56D19KOGbE00uKVj3sgIykpwKL179QsVFwx/DCW0u/0+URsryacI4MAdNJl0dh+u2PSsD9FtxPFbHCzJ78qJFQ==
dependencies:
"@types/mdast" "^3.0.0"
mdast-util-to-markdown "^1.3.0"
micromark-util-normalize-identifier "^1.0.0"
mdast-util-gfm-strikethrough@^1.0.0:
- version "1.0.1"
- resolved "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-1.0.1.tgz"
- integrity sha512-zKJbEPe+JP6EUv0mZ0tQUyLQOC+FADt0bARldONot/nefuISkaZFlmVK4tU6JgfyZGrky02m/I6PmehgAgZgqg==
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-1.0.3.tgz#5470eb105b483f7746b8805b9b989342085795b7"
+ integrity sha512-DAPhYzTYrRcXdMjUtUjKvW9z/FNAMTdU0ORyMcbmkwYNbKocDpdk+PX1L1dQgOID/+vVs1uBQ7ElrBQfZ0cuiQ==
dependencies:
"@types/mdast" "^3.0.0"
mdast-util-to-markdown "^1.3.0"
mdast-util-gfm-table@^1.0.0:
- version "1.0.3"
- resolved "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-1.0.3.tgz"
- integrity sha512-B/tgpJjND1qIZM2WZst+NYnb0notPE6m0J+YOe3NOHXyEmvK38ytxaOsgz4BvrRPQQcNbRrTzSHMPnBkj1fCjg==
+ version "1.0.7"
+ resolved "https://registry.yarnpkg.com/mdast-util-gfm-table/-/mdast-util-gfm-table-1.0.7.tgz#3552153a146379f0f9c4c1101b071d70bbed1a46"
+ integrity sha512-jjcpmNnQvrmN5Vx7y7lEc2iIOEytYv7rTvu+MeyAsSHTASGCCRA79Igg2uKssgOs1i1po8s3plW0sTu1wkkLGg==
dependencies:
+ "@types/mdast" "^3.0.0"
markdown-table "^3.0.0"
+ mdast-util-from-markdown "^1.0.0"
mdast-util-to-markdown "^1.3.0"
mdast-util-gfm-task-list-item@^1.0.0:
- version "1.0.1"
- resolved "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-1.0.1.tgz"
- integrity sha512-KZ4KLmPdABXOsfnM6JHUIjxEvcx2ulk656Z/4Balw071/5qgnhz+H1uGtf2zIGnrnvDC8xR4Fj9uKbjAFGNIeA==
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-1.0.2.tgz#b280fcf3b7be6fd0cc012bbe67a59831eb34097b"
+ integrity sha512-PFTA1gzfp1B1UaiJVyhJZA1rm0+Tzn690frc/L8vNX1Jop4STZgOE6bxUhnzdVSB+vm2GU1tIsuQcA9bxTQpMQ==
dependencies:
"@types/mdast" "^3.0.0"
mdast-util-to-markdown "^1.3.0"
mdast-util-gfm@^2.0.0:
- version "2.0.0"
- resolved "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-2.0.0.tgz"
- integrity sha512-wMwejlTN3EQADPFuvxe8lmGsay3+f6gSJKdAHR6KBJzpcxvsjJSILB9K6u6G7eQLC7iOTyVIHYGui9uBc9r1Tg==
+ version "2.0.2"
+ resolved "https://registry.yarnpkg.com/mdast-util-gfm/-/mdast-util-gfm-2.0.2.tgz#e92f4d8717d74bdba6de57ed21cc8b9552e2d0b6"
+ integrity sha512-qvZ608nBppZ4icQlhQQIAdc6S3Ffj9RGmzwUKUWuEICFnd1LVkN3EktF7ZHAgfcEdvZB5owU9tQgt99e2TlLjg==
dependencies:
+ mdast-util-from-markdown "^1.0.0"
mdast-util-gfm-autolink-literal "^1.0.0"
mdast-util-gfm-footnote "^1.0.0"
mdast-util-gfm-strikethrough "^1.0.0"
mdast-util-gfm-table "^1.0.0"
mdast-util-gfm-task-list-item "^1.0.0"
+ mdast-util-to-markdown "^1.0.0"
+
+mdast-util-phrasing@^3.0.0:
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/mdast-util-phrasing/-/mdast-util-phrasing-3.0.1.tgz#c7c21d0d435d7fb90956038f02e8702781f95463"
+ integrity sha512-WmI1gTXUBJo4/ZmSk79Wcb2HcjPJBzM1nlI/OUWA8yk2X9ik3ffNbBGsU+09BFmXaL1IBb9fiuvq6/KMiNycSg==
+ dependencies:
+ "@types/mdast" "^3.0.0"
+ unist-util-is "^5.0.0"
mdast-util-to-hast@^12.1.0:
version "12.1.1"
@@ -9292,20 +9305,28 @@ mdast-util-to-hast@^12.1.0:
unist-util-position "^4.0.0"
unist-util-visit "^4.0.0"
-mdast-util-to-markdown@^1.3.0:
- version "1.3.0"
- resolved "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-1.3.0.tgz"
- integrity sha512-6tUSs4r+KK4JGTTiQ7FfHmVOaDrLQJPmpjD6wPMlHGUVXoG9Vjc3jIeP+uyBWRf8clwB2blM+W7+KrlMYQnftA==
+mdast-util-to-markdown@^1.0.0, mdast-util-to-markdown@^1.3.0:
+ version "1.5.0"
+ resolved "https://registry.yarnpkg.com/mdast-util-to-markdown/-/mdast-util-to-markdown-1.5.0.tgz#c13343cb3fc98621911d33b5cd42e7d0731171c6"
+ integrity sha512-bbv7TPv/WC49thZPg3jXuqzuvI45IL2EVAr/KxF0BSdHsU0ceFHOmwQn6evxAh1GaoK/6GQ1wp4R4oW2+LFL/A==
dependencies:
"@types/mdast" "^3.0.0"
"@types/unist" "^2.0.0"
longest-streak "^3.0.0"
+ mdast-util-phrasing "^3.0.0"
mdast-util-to-string "^3.0.0"
micromark-util-decode-string "^1.0.0"
unist-util-visit "^4.0.0"
zwitch "^2.0.0"
-mdast-util-to-string@^3.0.0, mdast-util-to-string@^3.1.0:
+mdast-util-to-string@^3.0.0:
+ version "3.2.0"
+ resolved "https://registry.yarnpkg.com/mdast-util-to-string/-/mdast-util-to-string-3.2.0.tgz#66f7bb6324756741c5f47a53557f0cbf16b6f789"
+ integrity sha512-V4Zn/ncyN1QNSqSBxTrMOLpjr+IKdHl2v3KVLoWmDPscP4r9GcCi71gjgvUV1SFSKh92AjAG4peFuBl2/YgCJg==
+ dependencies:
+ "@types/mdast" "^3.0.0"
+
+mdast-util-to-string@^3.1.0:
version "3.1.0"
resolved "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-3.1.0.tgz"
integrity sha512-n4Vypz/DZgwo0iMHLQL49dJzlp7YtAJP+N07MZHpjPf/5XJuHUWstviF4Mn2jEiR/GNmtnRRqnwsXExk3igfFA==
@@ -9352,7 +9373,29 @@ messageformat-parser@^4.1.3:
resolved "https://registry.npmjs.org/messageformat-parser/-/messageformat-parser-4.1.3.tgz"
integrity sha512-2fU3XDCanRqeOCkn7R5zW5VQHWf+T3hH65SzuqRvjatBK7r4uyFa5mEX+k6F9Bd04LVM5G4/BHBTUJsOdW7uyg==
-micromark-core-commonmark@^1.0.0, micromark-core-commonmark@^1.0.1:
+micromark-core-commonmark@^1.0.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/micromark-core-commonmark/-/micromark-core-commonmark-1.1.0.tgz#1386628df59946b2d39fb2edfd10f3e8e0a75bb8"
+ integrity sha512-BgHO1aRbolh2hcrzL2d1La37V0Aoz73ymF8rAcKnohLy93titmv62E0gP8Hrx9PKcKrqCZ1BbLGbP3bEhoXYlw==
+ dependencies:
+ decode-named-character-reference "^1.0.0"
+ micromark-factory-destination "^1.0.0"
+ micromark-factory-label "^1.0.0"
+ micromark-factory-space "^1.0.0"
+ micromark-factory-title "^1.0.0"
+ micromark-factory-whitespace "^1.0.0"
+ micromark-util-character "^1.0.0"
+ micromark-util-chunked "^1.0.0"
+ micromark-util-classify-character "^1.0.0"
+ micromark-util-html-tag-name "^1.0.0"
+ micromark-util-normalize-identifier "^1.0.0"
+ micromark-util-resolve-all "^1.0.0"
+ micromark-util-subtokenize "^1.0.0"
+ micromark-util-symbol "^1.0.0"
+ micromark-util-types "^1.0.1"
+ uvu "^0.5.0"
+
+micromark-core-commonmark@^1.0.1:
version "1.0.6"
resolved "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-1.0.6.tgz"
integrity sha512-K+PkJTxqjFfSNkfAhp4GB+cZPfQd6dxtTXnf+RjZOV7T4EEXnvgzOcnp+eSTmpGk9d1S9sL6/lqrgSNn/s0HZA==
@@ -9375,20 +9418,19 @@ micromark-core-commonmark@^1.0.0, micromark-core-commonmark@^1.0.1:
uvu "^0.5.0"
micromark-extension-gfm-autolink-literal@^1.0.0:
- version "1.0.3"
- resolved "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-1.0.3.tgz"
- integrity sha512-i3dmvU0htawfWED8aHMMAzAVp/F0Z+0bPh3YrbTPPL1v4YAlCZpy5rBO5p0LPYiZo0zFVkoYh7vDU7yQSiCMjg==
+ version "1.0.5"
+ resolved "https://registry.yarnpkg.com/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-1.0.5.tgz#5853f0e579bbd8ef9e39a7c0f0f27c5a063a66e7"
+ integrity sha512-z3wJSLrDf8kRDOh2qBtoTRD53vJ+CWIyo7uyZuxf/JAbNJjiHsOpG1y5wxk8drtv3ETAHutCu6N3thkOOgueWg==
dependencies:
micromark-util-character "^1.0.0"
micromark-util-sanitize-uri "^1.0.0"
micromark-util-symbol "^1.0.0"
micromark-util-types "^1.0.0"
- uvu "^0.5.0"
micromark-extension-gfm-footnote@^1.0.0:
- version "1.0.3"
- resolved "https://registry.npmjs.org/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-1.0.3.tgz"
- integrity sha512-bn62pC5y39rIo2g1RqZk1NhF7T7cJLuJlbevunQz41U0iPVCdVOFASe5/L1kke+DFKSgfCRhv24+o42cZ1+ADw==
+ version "1.1.2"
+ resolved "https://registry.yarnpkg.com/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-1.1.2.tgz#05e13034d68f95ca53c99679040bc88a6f92fe2e"
+ integrity sha512-Yxn7z7SxgyGWRNa4wzf8AhYYWNrwl5q1Z8ii+CSTTIqVkmGZF1CElX2JI8g5yGoM3GAman9/PVCUFUSJ0kB/8Q==
dependencies:
micromark-core-commonmark "^1.0.0"
micromark-factory-space "^1.0.0"
@@ -9396,12 +9438,13 @@ micromark-extension-gfm-footnote@^1.0.0:
micromark-util-normalize-identifier "^1.0.0"
micromark-util-sanitize-uri "^1.0.0"
micromark-util-symbol "^1.0.0"
+ micromark-util-types "^1.0.0"
uvu "^0.5.0"
micromark-extension-gfm-strikethrough@^1.0.0:
- version "1.0.4"
- resolved "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-1.0.4.tgz"
- integrity sha512-/vjHU/lalmjZCT5xt7CcHVJGq8sYRm80z24qAKXzaHzem/xsDYb2yLL+NNVbYvmpLx3O7SYPuGL5pzusL9CLIQ==
+ version "1.0.7"
+ resolved "https://registry.yarnpkg.com/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-1.0.7.tgz#c8212c9a616fa3bf47cb5c711da77f4fdc2f80af"
+ integrity sha512-sX0FawVE1o3abGk3vRjOH50L5TTLr3b5XMqnP9YDRb34M0v5OoZhG+OHFz1OffZ9dlwgpTBKaT4XW/AsUVnSDw==
dependencies:
micromark-util-chunked "^1.0.0"
micromark-util-classify-character "^1.0.0"
@@ -9411,9 +9454,9 @@ micromark-extension-gfm-strikethrough@^1.0.0:
uvu "^0.5.0"
micromark-extension-gfm-table@^1.0.0:
- version "1.0.5"
- resolved "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-1.0.5.tgz"
- integrity sha512-xAZ8J1X9W9K3JTJTUL7G6wSKhp2ZYHrFk5qJgY/4B33scJzE2kpfRL6oiw/veJTbt7jiM/1rngLlOKPWr1G+vg==
+ version "1.0.7"
+ resolved "https://registry.yarnpkg.com/micromark-extension-gfm-table/-/micromark-extension-gfm-table-1.0.7.tgz#dcb46074b0c6254c3fc9cc1f6f5002c162968008"
+ integrity sha512-3ZORTHtcSnMQEKtAOsBQ9/oHp9096pI/UvdPtN7ehKvrmZZ2+bbWhi0ln+I9drmwXMt5boocn6OlwQzNXeVeqw==
dependencies:
micromark-factory-space "^1.0.0"
micromark-util-character "^1.0.0"
@@ -9422,16 +9465,16 @@ micromark-extension-gfm-table@^1.0.0:
uvu "^0.5.0"
micromark-extension-gfm-tagfilter@^1.0.0:
- version "1.0.1"
- resolved "https://registry.npmjs.org/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-1.0.1.tgz"
- integrity sha512-Ty6psLAcAjboRa/UKUbbUcwjVAv5plxmpUTy2XC/3nJFL37eHej8jrHrRzkqcpipJliuBH30DTs7+3wqNcQUVA==
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-1.0.2.tgz#aa7c4dd92dabbcb80f313ebaaa8eb3dac05f13a7"
+ integrity sha512-5XWB9GbAUSHTn8VPU8/1DBXMuKYT5uOgEjJb8gN3mW0PNW5OPHpSdojoqf+iq1xo7vWzw/P8bAHY0n6ijpXF7g==
dependencies:
micromark-util-types "^1.0.0"
micromark-extension-gfm-task-list-item@^1.0.0:
- version "1.0.3"
- resolved "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-1.0.3.tgz"
- integrity sha512-PpysK2S1Q/5VXi72IIapbi/jliaiOFzv7THH4amwXeYXLq3l1uo8/2Be0Ac1rEwK20MQEsGH2ltAZLNY2KI/0Q==
+ version "1.0.5"
+ resolved "https://registry.yarnpkg.com/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-1.0.5.tgz#b52ce498dc4c69b6a9975abafc18f275b9dde9f4"
+ integrity sha512-RMFXl2uQ0pNQy6Lun2YBYT9g9INXtWJULgbt01D/x8/6yJ2qpKyzdZD3pi6UIkzF++Da49xAelVKUeUMqd5eIQ==
dependencies:
micromark-factory-space "^1.0.0"
micromark-util-character "^1.0.0"
@@ -9440,9 +9483,9 @@ micromark-extension-gfm-task-list-item@^1.0.0:
uvu "^0.5.0"
micromark-extension-gfm@^2.0.0:
- version "2.0.1"
- resolved "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-2.0.1.tgz"
- integrity sha512-p2sGjajLa0iYiGQdT0oelahRYtMWvLjy8J9LOCxzIQsllMCGLbsLW+Nc+N4vi02jcRJvedVJ68cjelKIO6bpDA==
+ version "2.0.3"
+ resolved "https://registry.yarnpkg.com/micromark-extension-gfm/-/micromark-extension-gfm-2.0.3.tgz#e517e8579949a5024a493e49204e884aa74f5acf"
+ integrity sha512-vb9OoHqrhCmbRidQv/2+Bc6pkP0FrtlhurxZofvOEy5o8RtuuvTq+RQ1Vw5ZDNrVraQZu3HixESqbG+0iKk/MQ==
dependencies:
micromark-extension-gfm-autolink-literal "^1.0.0"
micromark-extension-gfm-footnote "^1.0.0"
@@ -10611,10 +10654,10 @@ react-is@^18.0.0, react-is@^18.2.0:
resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b"
integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==
-react-markdown@^8.0.3:
- version "8.0.3"
- resolved "https://registry.yarnpkg.com/react-markdown/-/react-markdown-8.0.3.tgz#e8aba0d2f5a1b2124d476ee1fff9448a2f57e4b3"
- integrity sha512-We36SfqaKoVNpN1QqsZwWSv/OZt5J15LNgTLWynwAN5b265hrQrsjMtlRNwUvS+YyR3yDM8HpTNc4pK9H/Gc0A==
+react-markdown@^8.0.7:
+ version "8.0.7"
+ resolved "https://registry.yarnpkg.com/react-markdown/-/react-markdown-8.0.7.tgz#c8dbd1b9ba5f1c5e7e5f2a44de465a3caafdf89b"
+ integrity sha512-bvWbzG4MtOU62XqBx3Xx+zB2raaFFsq4mYiAzfjXJMEz2sixgeAfraA3tvzULF02ZdOMUOKTBFFaZJDDrq+BJQ==
dependencies:
"@types/hast" "^2.0.0"
"@types/prop-types" "^15.0.0"
@@ -10627,7 +10670,7 @@ react-markdown@^8.0.3:
remark-parse "^10.0.0"
remark-rehype "^10.0.0"
space-separated-tokens "^2.0.0"
- style-to-object "^0.3.0"
+ style-to-object "^0.4.0"
unified "^10.0.0"
unist-util-visit "^4.0.0"
vfile "^5.0.0"
@@ -10851,7 +10894,7 @@ relateurl@^0.2.7:
remark-gfm@^3.0.1:
version "3.0.1"
- resolved "https://registry.npmjs.org/remark-gfm/-/remark-gfm-3.0.1.tgz"
+ resolved "https://registry.yarnpkg.com/remark-gfm/-/remark-gfm-3.0.1.tgz#0b180f095e3036545e9dddac0e8df3fa5cfee54f"
integrity sha512-lEFDoi2PICJyNrACFOfDD3JlLkuSbOa5Wd8EPt06HUdptv8Gn0bxYTdbU/XXQ3swAPkEaGxxPN9cbnMHvVu1Ig==
dependencies:
"@types/mdast" "^3.0.0"
@@ -11589,10 +11632,10 @@ strip-json-comments@^3.1.0, strip-json-comments@^3.1.1:
resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz"
integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==
-style-to-object@^0.3.0:
- version "0.3.0"
- resolved "https://registry.npmjs.org/style-to-object/-/style-to-object-0.3.0.tgz"
- integrity sha512-CzFnRRXhzWIdItT3OmF8SQfWyahHhjq3HwcMNCNLn+N7klOOqPjMeG/4JSu77D7ypZdGvSzvkrbyeTMizz2VrA==
+style-to-object@^0.4.0:
+ version "0.4.4"
+ resolved "https://registry.yarnpkg.com/style-to-object/-/style-to-object-0.4.4.tgz#266e3dfd56391a7eefb7770423612d043c3f33ec"
+ integrity sha512-HYNoHZa2GorYNyqiCaBgsxvcJIn7OHq6inEga+E6Ke3m5JkoqpQbnFssk4jwe+K7AhGa2fcha4wSOf1Kn01dMg==
dependencies:
inline-style-parser "0.1.1"