-
Notifications
You must be signed in to change notification settings - Fork 106
Commit f6db6ad
authored
ALM internal audit fixes (#122)
* Fix: CollateralAssetsUpdated and BorrowAssetsUpdated events
* Fix: AavReserveUpdated event
* Emit struct elements separately for greater clarity
* Add corresponding test
* Add test for LendingPoolUpdated event
* Fix: Line 214 & 182 comments
* Fix: Initialize function
* Add header for external functions
* Add _addCollateralAssets and _addBorrowAssets internal functions
* Note: New internal functions are a straight copy of the previous external function implementations. Specific changes to _addCollateralAssets and _addBorrowAssets would be done later.
* Fix: lever javadocs
* Improve javadocs for lever() and delever()
* Fix: deleverToZeroBorrowBalance() function
* Improve javadocs
* Revert if borrow balance is zero
* Add corresponding test
* Fix: Improve sync() javadocs
* Fix: sync(), store borrowAssets[i] in local variable
* Fix: addCollateralAssets() function
* Made the function external
* Removed call to _updateUnderlyingToReserveTokens() from the associated internal
function
* Added note to javadoc
* Fix: addBorrowAssets() function
* Made the function external
* Removed call to _updateUnderlyingToReserveTokens() from the associated internal function
* Added note to javadoc
* Removed tests associated with confirming underlyingToReserveTokens mappings update
* Add Note in caps about adding only required collateral assets
* Fix: componentIssueHook(), use preciseMul
* Remove call to sync() from removeModule(), removeCollateralAssets() and removeBorrowAssets() functions
* Fix: updateAllowedSetToken function()
* Fix javadocs
* Add check to validate passed address is valid SetToken
* Add corresponding tests
* Fix: updateUnderlyingToReserveTokensMapping
* Fix javadocs
* Move emitting events to internal function
* Add check for valid aave reserve
* Rename event AaveReserveUpdated to more suitable ReserveTokensUpddated
* Add test for invalid reserve in updateUnderlyingToReserveTokensMapping
* Fix: Add reference to AaveV2 library in internal function javadocs
* Fix: _createAndValidateActionInfoNotional()
* Pass setTotalSupply as an argument
* Fix: _updateLeverPositions()
* Put underlyingToReserveTokens[actionInfo.collateralAsset].aToken into local variable to avoid fetching from storage twice
* Fix: _getBorrowPosition() math
* Update preciseDiv to preciseDivCeil
* Fix: _updateUseReserveAsCollateral()
* Fix javadocs: Add impossible case
* Fix: _validateCommon()
Improve revert message
* Fix: _validateNewCollateralAssets() and _validatNewBorrowAsset()
* Check latest reserve token addresses are saved in underlyingToReserveTokens mapping before adding a new collateral/borrow asset
* Add tests for introduced changes
* Refactor updateUnderlyingToReserveTokensMapping
* Add check to revert if mapping already exists.
* Rename to _addUnderlyingToReserveTokensMapping
* Add tests for changes
* Remove updateLendingPool function and corresponding event
* Since we fetch and store lendingPool proxy address in the constructor which would never change.
* Aave would only update the lendingPool implementation.
* Remove corresponding tests
* Reorder functions to match CLM
* Easier to review the diff.
* Add suggested changes
* Rename parameters to reflect position units1 parent 60ec0b4 commit f6db6adCopy full SHA for f6db6ad
File tree
Expand file treeCollapse file tree
2 files changed
+524
-435
lines changedFilter options
- contracts/protocol/modules
- test/protocol/modules
Expand file treeCollapse file tree
2 files changed
+524
-435
lines changed
0 commit comments