Skip to content

Commit

Permalink
refactor: supply
Browse files Browse the repository at this point in the history
  • Loading branch information
brotherlymite committed Oct 30, 2023
1 parent b5141e0 commit 1b2a1bf
Showing 1 changed file with 13 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
pragma solidity ^0.8.0;

import {AaveV3Gnosis} from 'aave-address-book/AaveV3Gnosis.sol';
import {IPool} from 'aave-address-book/AaveV3.sol';
import {AaveV3PayloadGnosis} from 'aave-helpers/v3-config-engine/AaveV3PayloadGnosis.sol';
import {EngineFlags} from 'aave-helpers/v3-config-engine/EngineFlags.sol';
import {IAaveV3ConfigEngine} from 'aave-helpers/v3-config-engine/IAaveV3ConfigEngine.sol';
Expand Down Expand Up @@ -34,26 +35,13 @@ contract AaveV3Gnosis_AaveV3GnosisActivation_20231026 is AaveV3PayloadGnosis {
AaveV3Gnosis.ACL_MANAGER.addRiskAdmin(FREEZING_STEWARD);
AaveV3Gnosis.ACL_MANAGER.addRiskAdmin(AaveV3Gnosis.CAPS_PLUS_RISK_STEWARD);

IERC20(WETH).forceApprove(address(AaveV3Gnosis.POOL), 0.01 * 1e18);
AaveV3Gnosis.POOL.supply(WETH, 0.01 * 1e18, address(AaveV3Gnosis.COLLECTOR), 0);

IERC20(wstETH).forceApprove(address(AaveV3Gnosis.POOL), 0.01 * 1e18);
AaveV3Gnosis.POOL.supply(wstETH, 0.01 * 1e18, address(AaveV3Gnosis.COLLECTOR), 0);

IERC20(GNO).forceApprove(address(AaveV3Gnosis.POOL), 0.1 * 1e18);
AaveV3Gnosis.POOL.supply(GNO, 0.1 * 1e18, address(AaveV3Gnosis.COLLECTOR), 0);

IERC20(USDC).forceApprove(address(AaveV3Gnosis.POOL), 10 * 1e6);
AaveV3Gnosis.POOL.supply(USDC, 10 * 1e6, address(AaveV3Gnosis.COLLECTOR), 0);

IERC20(WXDAI).forceApprove(address(AaveV3Gnosis.POOL), 10 * 1e18);
AaveV3Gnosis.POOL.supply(WXDAI, 10 * 1e18, address(AaveV3Gnosis.COLLECTOR), 0);

IERC20(EURe).forceApprove(address(AaveV3Gnosis.POOL), 10 * 1e18);
AaveV3Gnosis.POOL.supply(EURe, 10 * 1e18, address(AaveV3Gnosis.COLLECTOR), 0);

IERC20(sDAI).forceApprove(address(AaveV3Gnosis.POOL), 10 * 1e18);
AaveV3Gnosis.POOL.supply(sDAI, 10 * 1e18, address(AaveV3Gnosis.COLLECTOR), 0);
_supply(AaveV3Gnosis.POOL, WETH, 0.01 * 1e18, address(AaveV3Gnosis.COLLECTOR));
_supply(AaveV3Gnosis.POOL, wstETH, 0.01 * 1e18, address(AaveV3Gnosis.COLLECTOR));
_supply(AaveV3Gnosis.POOL, GNO, 0.1 * 1e18, address(AaveV3Gnosis.COLLECTOR));
_supply(AaveV3Gnosis.POOL, USDC, 10 * 1e6, address(AaveV3Gnosis.COLLECTOR));
_supply(AaveV3Gnosis.POOL, WXDAI, 10 * 1e18, address(AaveV3Gnosis.COLLECTOR));
_supply(AaveV3Gnosis.POOL, EURe, 10 * 1e18, address(AaveV3Gnosis.COLLECTOR));
_supply(AaveV3Gnosis.POOL, sDAI, 10 * 1e18, address(AaveV3Gnosis.COLLECTOR));
}

function eModeCategoriesUpdates()
Expand Down Expand Up @@ -299,4 +287,9 @@ contract AaveV3Gnosis_AaveV3GnosisActivation_20231026 is AaveV3PayloadGnosis {

return listings;
}

function _supply(IPool pool, address asset, uint256 amount, address onBehalfOf) internal {
IERC20(asset).forceApprove(address(pool), amount);
pool.supply(asset, amount, onBehalfOf, 0);
}
}

0 comments on commit 1b2a1bf

Please sign in to comment.