Skip to content

Commit

Permalink
chore: force fmt on PRs and update aave-core lib (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
fredwes committed Feb 21, 2024
1 parent 77eb259 commit f480d90
Show file tree
Hide file tree
Showing 12 changed files with 75 additions and 68 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

- name: Run Forge Format
run: |
forge fmt
forge fmt --check
id: format

- name: Run Forge build
Expand Down
2 changes: 1 addition & 1 deletion lib/aave-v3-core
Submodule aave-v3-core updated 87 files
+1 −1 .github/workflows/release.yml
+7 −0 CHANGELOG.md
+1 −1 contracts/dependencies/gnosis/contracts/GPv2SafeERC20.sol
+1 −1 contracts/dependencies/openzeppelin/contracts/AccessControl.sol
+1 −1 contracts/dependencies/openzeppelin/contracts/Context.sol
+1 −1 contracts/dependencies/openzeppelin/contracts/ERC165.sol
+1 −1 contracts/dependencies/openzeppelin/contracts/ERC20.sol
+1 −1 contracts/dependencies/openzeppelin/contracts/IAccessControl.sol
+1 −1 contracts/dependencies/openzeppelin/contracts/IERC165.sol
+1 −1 contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol
+1 −1 contracts/dependencies/openzeppelin/contracts/Ownable.sol
+1 −1 contracts/dependencies/openzeppelin/contracts/SafeCast.sol
+1 −1 contracts/dependencies/openzeppelin/contracts/SafeMath.sol
+1 −1 contracts/dependencies/openzeppelin/contracts/Strings.sol
+1 −1 contracts/dependencies/openzeppelin/upgradeability/AdminUpgradeabilityProxy.sol
+1 −1 contracts/dependencies/openzeppelin/upgradeability/BaseAdminUpgradeabilityProxy.sol
+1 −1 contracts/dependencies/openzeppelin/upgradeability/BaseUpgradeabilityProxy.sol
+1 −1 contracts/dependencies/openzeppelin/upgradeability/Initializable.sol
+1 −1 contracts/dependencies/openzeppelin/upgradeability/InitializableAdminUpgradeabilityProxy.sol
+1 −1 contracts/dependencies/openzeppelin/upgradeability/InitializableUpgradeabilityProxy.sol
+1 −1 contracts/dependencies/openzeppelin/upgradeability/Proxy.sol
+1 −1 contracts/dependencies/openzeppelin/upgradeability/UpgradeabilityProxy.sol
+1 −1 contracts/dependencies/weth/WETH9.sol
+1 −1 contracts/deployments/ReservesSetupHelper.sol
+1 −1 contracts/flashloan/base/FlashLoanReceiverBase.sol
+1 −1 contracts/flashloan/base/FlashLoanSimpleReceiverBase.sol
+1 −1 contracts/misc/AaveOracle.sol
+1 −1 contracts/misc/AaveProtocolDataProvider.sol
+1 −1 contracts/misc/L2Encoder.sol
+1 −1 contracts/misc/ZeroReserveInterestRateStrategy.sol
+1 −1 contracts/mocks/flashloan/MockFlashLoanReceiver.sol
+1 −1 contracts/mocks/flashloan/MockSimpleFlashLoanReceiver.sol
+1 −1 contracts/mocks/helpers/MockIncentivesController.sol
+1 −1 contracts/mocks/helpers/MockL2Pool.sol
+1 −1 contracts/mocks/helpers/MockPeripheryContract.sol
+1 −1 contracts/mocks/helpers/MockPool.sol
+1 −1 contracts/mocks/helpers/MockReserveConfiguration.sol
+1 −1 contracts/mocks/helpers/SelfDestructTransfer.sol
+1 −1 contracts/mocks/oracle/CLAggregators/MockAggregator.sol
+1 −1 contracts/mocks/oracle/PriceOracle.sol
+1 −1 contracts/mocks/oracle/SequencerOracle.sol
+1 −1 contracts/mocks/tests/FlashloanAttacker.sol
+1 −1 contracts/mocks/tests/MockReserveInterestRateStrategy.sol
+1 −1 contracts/mocks/tests/WadRayMathWrapper.sol
+1 −1 contracts/mocks/tokens/MintableDelegationERC20.sol
+1 −1 contracts/mocks/tokens/MintableERC20.sol
+1 −1 contracts/mocks/tokens/MockATokenRepayment.sol
+1 −1 contracts/mocks/tokens/WETH9Mocked.sol
+1 −1 contracts/mocks/upgradeability/MockAToken.sol
+1 −1 contracts/mocks/upgradeability/MockInitializableImplementation.sol
+1 −1 contracts/mocks/upgradeability/MockStableDebtToken.sol
+1 −1 contracts/mocks/upgradeability/MockVariableDebtToken.sol
+1 −1 contracts/protocol/configuration/ACLManager.sol
+1 −1 contracts/protocol/configuration/PoolAddressesProvider.sol
+1 −1 contracts/protocol/configuration/PoolAddressesProviderRegistry.sol
+1 −1 contracts/protocol/configuration/PriceOracleSentinel.sol
+1 −1 contracts/protocol/libraries/aave-upgradeability/BaseImmutableAdminUpgradeabilityProxy.sol
+1 −1 contracts/protocol/libraries/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol
+1 −1 contracts/protocol/libraries/aave-upgradeability/VersionedInitializable.sol
+1 −1 contracts/protocol/libraries/logic/BorrowLogic.sol
+1 −1 contracts/protocol/libraries/logic/BridgeLogic.sol
+1 −1 contracts/protocol/libraries/logic/CalldataLogic.sol
+1 −1 contracts/protocol/libraries/logic/ConfiguratorLogic.sol
+1 −1 contracts/protocol/libraries/logic/EModeLogic.sol
+1 −1 contracts/protocol/libraries/logic/FlashLoanLogic.sol
+1 −1 contracts/protocol/libraries/logic/GenericLogic.sol
+1 −1 contracts/protocol/libraries/logic/IsolationModeLogic.sol
+1 −1 contracts/protocol/libraries/logic/LiquidationLogic.sol
+1 −1 contracts/protocol/libraries/logic/PoolLogic.sol
+1 −1 contracts/protocol/libraries/logic/ReserveLogic.sol
+1 −1 contracts/protocol/libraries/logic/SupplyLogic.sol
+1 −1 contracts/protocol/libraries/logic/ValidationLogic.sol
+1 −1 contracts/protocol/pool/DefaultReserveInterestRateStrategy.sol
+1 −1 contracts/protocol/pool/Pool.sol
+1 −1 contracts/protocol/pool/PoolConfigurator.sol
+1 −1 contracts/protocol/pool/PoolStorage.sol
+1 −1 contracts/protocol/tokenization/AToken.sol
+1 −1 contracts/protocol/tokenization/DelegationAwareAToken.sol
+1 −1 contracts/protocol/tokenization/StableDebtToken.sol
+1 −1 contracts/protocol/tokenization/VariableDebtToken.sol
+1 −1 contracts/protocol/tokenization/base/DebtTokenBase.sol
+1 −1 contracts/protocol/tokenization/base/EIP712Base.sol
+1 −1 contracts/protocol/tokenization/base/IncentivizedERC20.sol
+1 −1 contracts/protocol/tokenization/base/MintableIncentivizedERC20.sol
+1 −1 contracts/protocol/tokenization/base/ScaledBalanceTokenBase.sol
+2 −2 package-lock.json
+1 −1 package.json
61 changes: 31 additions & 30 deletions script/deploy/DeployHelper.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ contract DeployHelper is BaseMainnetConstants {
IERC20 underlyingToken
) internal returns (WrappedERC20PermissionedDeposit wrappedToken) {
wrappedToken = new WrappedERC20PermissionedDeposit(
wrappedTokenERC20Config.name,
wrappedTokenERC20Config.symbol,
underlyingToken,
initialAdmin
);
wrappedTokenERC20Config.name,
wrappedTokenERC20Config.symbol,
underlyingToken,
initialAdmin
);

_logAddress("WrappedToken", address(wrappedToken));
}
Expand Down Expand Up @@ -140,14 +140,14 @@ contract DeployHelper is BaseMainnetConstants {
) internal returns (Swapper swapper) {
Swapper swapperImplementation = new Swapper();
ERC1967Proxy swapperProxy = new ERC1967Proxy(
address(swapperImplementation),
abi.encodeWithSelector(
Swapper.Swapper_init.selector,
initialAdmin,
IPriceOracleGetter(poolAddressesProvider.getPriceOracle()),
swapperOffsetDeviation
)
);
address(swapperImplementation),
abi.encodeWithSelector(
Swapper.Swapper_init.selector,
initialAdmin,
IPriceOracleGetter(poolAddressesProvider.getPriceOracle()),
swapperOffsetDeviation
)
);

swapper = Swapper(address(swapperProxy));

Expand Down Expand Up @@ -187,8 +187,9 @@ contract DeployHelper is BaseMainnetConstants {
);

// UnderlyingToken <-> WETH Aerodrome Adapter
aerodromeAdapter =
new AerodromeAdapter(initialAdmin, AERODROME_ROUTER, AERODROME_FACTORY, address(swapper));
aerodromeAdapter = new AerodromeAdapter(
initialAdmin, AERODROME_ROUTER, AERODROME_FACTORY, address(swapper)
);

IRouter.Route[] memory routesUnderlyingtoWETH = new IRouter.Route[](1);
routesUnderlyingtoWETH[0] = IRouter.Route({
Expand Down Expand Up @@ -290,21 +291,21 @@ contract DeployHelper is BaseMainnetConstants {
LoopStrategy strategyImplementation = new LoopStrategy();

ERC1967Proxy strategyProxy = new ERC1967Proxy(
address(strategyImplementation),
abi.encodeWithSelector(
LoopStrategy.LoopStrategy_init.selector,
config.strategyERC20Config.name,
config.strategyERC20Config.symbol,
initialAdmin,
strategyAssets,
config.collateralRatioConfig.collateralRatioTargets,
poolAddressesProvider,
IPriceOracleGetter(poolAddressesProvider.getPriceOracle()),
swapper,
config.collateralRatioConfig.ratioMargin,
config.collateralRatioConfig.maxIterations
)
);
address(strategyImplementation),
abi.encodeWithSelector(
LoopStrategy.LoopStrategy_init.selector,
config.strategyERC20Config.name,
config.strategyERC20Config.symbol,
initialAdmin,
strategyAssets,
config.collateralRatioConfig.collateralRatioTargets,
poolAddressesProvider,
IPriceOracleGetter(poolAddressesProvider.getPriceOracle()),
swapper,
config.collateralRatioConfig.ratioMargin,
config.collateralRatioConfig.maxIterations
)
);
strategy = LoopStrategy(address(strategyProxy));

strategy.grantRole(strategy.PAUSER_ROLE(), initialAdmin);
Expand Down
1 change: 0 additions & 1 deletion src/interfaces/IPriceOracleGetter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ pragma solidity ^0.8.21;
* @author Aave
* @notice Interface for the Aave price oracle.
*/

interface IPriceOracleGetter {
/**
* @notice Returns the base currency address
Expand Down
21 changes: 10 additions & 11 deletions test/integration/IntegrationBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,17 @@ contract IntegrationBase is Test, DeployHelper, DeployForkConfigs {
function _changeBorrowInterestRate(uint256 borrowRate) internal {
vm.startPrank(testDeployer.addr);

DefaultReserveInterestRateStrategy interestRateStrategy =
new DefaultReserveInterestRateStrategy(
DefaultReserveInterestRateStrategy interestRateStrategy = new DefaultReserveInterestRateStrategy(
poolAddressesProvider,
0.5 * 1e27,
borrowRate,
0.0000001 * 1e27,
0.0000001 * 1e27,
0.0000001 * 1e27,
0.0000001 * 1e27,
0.0000001 * 1e27,
0.0000001 * 1e27,
0.0000001 * 1e27
0.5 * 1e27,
borrowRate,
0.0000001 * 1e27,
0.0000001 * 1e27,
0.0000001 * 1e27,
0.0000001 * 1e27,
0.0000001 * 1e27,
0.0000001 * 1e27,
0.0000001 * 1e27
);

IPoolConfigurator(poolAddressesProvider.getPoolConfigurator())
Expand Down
20 changes: 10 additions & 10 deletions test/integration/SimulationTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ contract SimulationTest is IntegrationBase {
_deployLoopStrategyWithMockSwapper();

handler = new SimulationHandler(
strategy,
NUM_USERS,
START_AMOUNT_PER_USER,
MIN_DEPOSIT,
MAX_DEPOSIT,
JSON_PATH
strategy,
NUM_USERS,
START_AMOUNT_PER_USER,
MIN_DEPOSIT,
MAX_DEPOSIT,
JSON_PATH
);

uint256 currWethPrice = IPriceOracleGetter(
Expand Down Expand Up @@ -162,10 +162,10 @@ contract SimulationTest is IntegrationBase {
function _deployLoopStrategyWithMockSwapper() internal {
vm.startPrank(testDeployer.addr);
SwapperMock swapperMock = new SwapperMock(
address(wrappedToken),
address(WETH),
poolAddressesProvider.getPriceOracle()
);
address(wrappedToken),
address(WETH),
poolAddressesProvider.getPriceOracle()
);
swapperMock.setOffsets(DEX_FEE, DEX_FEE);
swapperMock.setRealOffsets(DEX_FEE, DEX_FEE);
swapperMock.setWrapped(IERC20(wrappedToken), true);
Expand Down
9 changes: 6 additions & 3 deletions test/lib/RebalanceLogicContext.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,11 @@ abstract contract RebalanceLogicContext is BaseForkTest {
CbETH_price = $.oracle.getAssetPrice(address(CbETH));

// deploy mock swapper instance
$.swapper =
new SwapperMock(address($.assets.collateral), address($.assets.debt), address($.oracle));
$.swapper = new SwapperMock(
address($.assets.collateral),
address($.assets.debt),
address($.oracle)
);

assert(
address(SwapperMock(address($.swapper)).borrowAsset())
Expand Down Expand Up @@ -125,7 +128,7 @@ abstract contract RebalanceLogicContext is BaseForkTest {
ERC1967Proxy swapperProxy = new ERC1967Proxy(
address(swapperImplementation),
abi.encodeWithSelector(
Swapper.Swapper_init.selector,
Swapper.Swapper_init.selector,
address(this),
$.oracle,
OFFSET_DEVIATION_USD
Expand Down
5 changes: 3 additions & 2 deletions test/unit/AerodromeAdapter.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ contract AerodromeAdapterTest is BaseForkTest {
AerodromeAdapter adapter;

function setUp() public {
adapter =
new AerodromeAdapter(OWNER, AERODROME_ROUTER, AERODROME_FACTORY, alice);
adapter = new AerodromeAdapter(
OWNER, AERODROME_ROUTER, AERODROME_FACTORY, alice
);

deal(address(WETH), address(alice), 100 ether);
}
Expand Down
10 changes: 6 additions & 4 deletions test/unit/LoopStrategy.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,13 @@ contract LoopStrategyTest is BaseForkTest {
_changePrice(CbETH, COLLATERAL_PRICE);
_changePrice(WETH, COLLATERAL_PRICE * 80 / 100);

wrappedToken =
new WrappedERC20PermissionedDeposit("wCbETH", "wCbETH", CbETH, address(this));
wrappedToken = new WrappedERC20PermissionedDeposit(
"wCbETH", "wCbETH", CbETH, address(this)
);

swapper =
new SwapperMock(address(CbETH), address(USDbC), address(priceOracle));
swapper = new SwapperMock(
address(CbETH), address(USDbC), address(priceOracle)
);
strategyAssets = StrategyAssets({
underlying: CbETH,
collateral: CbETH,
Expand Down
2 changes: 1 addition & 1 deletion test/unit/Swapper.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ contract SwapperTest is BaseForkTest {
ERC1967Proxy swapperProxy = new ERC1967Proxy(
address(swapperImplementation),
abi.encodeWithSelector(
Swapper.Swapper_init.selector,
Swapper.Swapper_init.selector,
OWNER,
IPriceOracleGetter(poolAddressProvider.getPriceOracle()),
1
Expand Down
5 changes: 3 additions & 2 deletions test/unit/WrappedERC20PermissionedDeposit.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ contract WrappedERC20PermissionedDepositTest is Test {

function setUp() public {
mockERC20 = new MockERC20("Mock", "M");
wrappedToken =
new WrappedERC20PermissionedDeposit("WrappedMock", "WM", IERC20(mockERC20), address(this));
wrappedToken = new WrappedERC20PermissionedDeposit(
"WrappedMock", "WM", IERC20(mockERC20), address(this)
);

deal(address(mockERC20), address(alice), 100 ether);
}
Expand Down
5 changes: 3 additions & 2 deletions test/unit/WrappedTokenAdapter.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ contract WrappedTokenAdapterTest is BaseForkTest {
adapter = new WrappedTokenAdapter(OWNER, alice);

mockERC20 = new MockERC20("Mock", "M");
wrappedToken =
new WrappedERC20PermissionedDeposit("WrappedMock", "WM", IERC20(mockERC20), OWNER);
wrappedToken = new WrappedERC20PermissionedDeposit(
"WrappedMock", "WM", IERC20(mockERC20), OWNER
);

deal(address(mockERC20), address(alice), 100 ether);

Expand Down

0 comments on commit f480d90

Please sign in to comment.