Skip to content

Commit b7bf8cc

Browse files
authored
Resolve all warnings and prettified (#278)
1 parent e716f32 commit b7bf8cc

12 files changed

Lines changed: 35 additions & 33 deletions

scripts/AaveV3ConfigEngine.s.sol

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ library DeployEngineBnbLib {
322322
}
323323

324324
library DeployEngineScrollLib {
325-
function deploy() internal returns (address) {
325+
function deploy() internal returns (address) {
326326
IEngine.EngineLibraries memory engineLibraries = IEngine.EngineLibraries({
327327
listingEngine: Create2Utils.create2Deploy('v1', type(ListingEngine).creationCode),
328328
eModeEngine: Create2Utils.create2Deploy('v1', type(EModeEngine).creationCode),
@@ -354,7 +354,6 @@ library DeployEngineScrollLib {
354354
}
355355
}
356356

357-
358357
library DeployEngineZkEvmLib {
359358
function deploy() internal returns (address) {
360359
IEngine.EngineLibraries memory engineLibraries = IEngine.EngineLibraries({

src/ChainIds.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ library ChainHelpers {
4747
newFork = vm.createSelectFork(vm.rpcUrl('base'));
4848
} else if (chainId == ChainIds.GNOSIS) {
4949
newFork = vm.createSelectFork(vm.rpcUrl('gnosis'));
50-
} else if (chainId == ChainIds.SCROLL) {
50+
} else if (chainId == ChainIds.SCROLL) {
5151
newFork = vm.createSelectFork(vm.rpcUrl('scroll'));
5252
} else if (chainId == ChainIds.ARBITRUM) {
5353
newFork = vm.createSelectFork(vm.rpcUrl('arbitrum'));

src/GovV3Helpers.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ library GovV3StorageHelpers {
866866
function injectProposal(
867867
Vm vm,
868868
PayloadsControllerUtils.Payload[] memory payloads,
869-
address votingPortal
869+
address // supposed to be votingPortal, kept to not introduce breaking change, but mute compilation warning
870870
) internal returns (uint256) {
871871
uint256 count = GovernanceV3Ethereum.GOVERNANCE.getProposalsCount();
872872
uint256 proposalBaseSlot = StorageHelpers.getStorageSlotUintMapping(PROPOSALS_SLOT, count);

src/bridges/AavePolEthERC20Bridge.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ contract AavePolEthERC20Bridge is Ownable, Rescuable, IAavePolEthERC20Bridge {
100100
receive() external payable {
101101
if (block.chainid != ChainIds.MAINNET) revert InvalidChain();
102102

103-
(bool success, ) = address(AaveV3Ethereum.COLLECTOR).call{value: address(this).balance}("");
103+
(bool success, ) = address(AaveV3Ethereum.COLLECTOR).call{value: address(this).balance}('');
104104
if (!success) {
105105
emit FailedToSendETH();
106106
}

src/dependencies/DefaultReserveInterestRateStrategy.sol

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,21 @@ contract DefaultReserveInterestRateStrategy is IReserveInterestRateStrategy {
5656

5757
constructor(
5858
ILendingPoolAddressesProvider provider,
59-
uint256 optimalUtilizationRate,
60-
uint256 baseVariableBorrowRate,
61-
uint256 variableRateSlope1,
62-
uint256 variableRateSlope2,
63-
uint256 stableRateSlope1,
64-
uint256 stableRateSlope2
65-
) public {
66-
OPTIMAL_UTILIZATION_RATE = optimalUtilizationRate;
67-
EXCESS_UTILIZATION_RATE = WadRayMath.ray().sub(optimalUtilizationRate);
59+
uint256 optimalUtilizationRate_,
60+
uint256 baseVariableBorrowRate_,
61+
uint256 variableRateSlope1_,
62+
uint256 variableRateSlope2_,
63+
uint256 stableRateSlope1_,
64+
uint256 stableRateSlope2_
65+
) {
66+
OPTIMAL_UTILIZATION_RATE = optimalUtilizationRate_;
67+
EXCESS_UTILIZATION_RATE = WadRayMath.ray().sub(optimalUtilizationRate_);
6868
addressesProvider = provider;
69-
_baseVariableBorrowRate = baseVariableBorrowRate;
70-
_variableRateSlope1 = variableRateSlope1;
71-
_variableRateSlope2 = variableRateSlope2;
72-
_stableRateSlope1 = stableRateSlope1;
73-
_stableRateSlope2 = stableRateSlope2;
69+
_baseVariableBorrowRate = baseVariableBorrowRate_;
70+
_variableRateSlope1 = variableRateSlope1_;
71+
_variableRateSlope2 = variableRateSlope2_;
72+
_stableRateSlope1 = stableRateSlope1_;
73+
_stableRateSlope2 = stableRateSlope2_;
7474
}
7575

7676
function variableRateSlope1() external view returns (uint256) {

src/v2-config-engine/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ If you want to change interest rates strategy, you only need to define the rates
2323
The `Base Aave v2 Payload` defines `_preExecute()` and `_postExecute()` hook functions, that you can redefine on your payload and will the execute before and after all changes you define.
2424

2525
## Links to examples
26+
2627
- [Simple rates updates (changing some, keeping current values on others) on Aave v2 Ethereum](../test/mocks/AaveV2EthereumRatesUpdate.sol)

src/v3-config-engine/AaveV3PayloadPolygonZkEvm.sol

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ import './AaveV3Payload.sol';
88
* @dev Base smart contract for an Aave v3.0.1 (compatible with 3.0.0) listing on v3 Polygon ZkEvm.
99
* @author BGD Labs
1010
*/
11-
abstract contract AaveV3PayloadPolygonZkEvm is AaveV3Payload(IEngine(AaveV3PolygonZkEvm.CONFIG_ENGINE)) {
11+
abstract contract AaveV3PayloadPolygonZkEvm is
12+
AaveV3Payload(IEngine(AaveV3PolygonZkEvm.CONFIG_ENGINE))
13+
{
1214
function getPoolContext() public pure override returns (IEngine.PoolContext memory) {
1315
return IEngine.PoolContext({networkName: 'PolygonZkEvm', networkAbbreviation: 'PolZkEvm'});
1416
}

src/v3-config-engine/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Change eMode category of a particular asset? Same as previous, just define the u
3333
### Internal aspects to consider
3434

3535
- Frequently, at the same time that you want to do an update of parameters or listing, you also want to do something extra before or after.
36-
The `Base Aave v3 Payload` defines `_preExecute()` and `_postExecute()` hook functions, that you can redefine on your payload and will the execute before and after all configs changes/listings you define.
36+
The `Base Aave v3 Payload` defines `_preExecute()` and `_postExecute()` hook functions, that you can redefine on your payload and will the execute before and after all configs changes/listings you define.
3737

3838
- The payload also allow you to group changes of parameters and listings, just by defining at the same time the aforementioned `newListings()`, `capsUpdate()` and/or `collateralsUpdates()` and so on. For reference, the execution ordering is the following:
3939
1. `_preExecute()`
@@ -49,6 +49,7 @@ The `Base Aave v3 Payload` defines `_preExecute()` and `_postExecute()` hook fun
4949
11. `_postExecute()`
5050

5151
## Links to examples
52+
5253
- [Simple mock listing on Aave v3 Polygon](../test/mocks/AaveV3PolygonMockListing.sol)
5354
- [Simple custom mock listing on Aave V3 Ethereum with custom token impl](../test/mocks/AaveV3EthereumMockCustomListing.sol)
5455
- [Mock e-mode category update on Aave V3 Polygon](../test/mocks/AaveV3PolygonEModeCategoryUpdate.sol)

tests/CommonTestBase.t.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ contract CommonTestBaseTest is CommonTestBase {
1010
vm.createSelectFork('mainnet', 18572478);
1111
}
1212

13-
function call() external returns (address) {
13+
function call() external view returns (address) {
1414
return msg.sender;
1515
}
1616

tests/PreviewLink.t.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import 'forge-std/Test.sol';
55
import {GovV3Helpers, PayloadsControllerUtils} from '../src/GovV3Helpers.sol';
66

77
contract PreviewLink is Test {
8-
function testPreviewLink() public {
8+
function testPreviewLink() public pure {
99
PayloadsControllerUtils.Payload[] memory payloads = new PayloadsControllerUtils.Payload[](2);
1010
payloads[0].payloadId = 1;
1111
payloads[0].accessLevel = PayloadsControllerUtils.AccessControl.Level_1;

0 commit comments

Comments
 (0)