Skip to content

Filda 2.0 update#2

Open
songsjun wants to merge 58 commits into
filda_1.0from
filda_2.0
Open

Filda 2.0 update#2
songsjun wants to merge 58 commits into
filda_1.0from
filda_2.0

Conversation

@songsjun

@songsjun songsjun commented Sep 5, 2021

Copy link
Copy Markdown
  1. Add V2 price oracle, support chainlink price sources
  2. Support borrow cap limit
  3. Add risk parameters supplyCap, borrowCap, borrowFactor
  4. Support flash loan
  5. Support non-collateral lending by introducing credit line
  6. Support to set LiquidationIncentive per asset
  7. Support more interest model
  8. Support deposit and loan mining ratio configurable
  9. Support Polygon and BSC chain
  10. Fix the bug of ERC777 assets
  11. Support LP assets and LP oracle seed

* commit 'da1165d6766fc23f6f5ec7dcc6ebcfc58903b1ad':
  override seizeInternal in LPDelegate
* commit '9280fe2bc85639c1901378cb4c3af91ee401062c':
  sqrt price decimals

# Conflicts:
#	contracts/QsMdxLPOracle.sol
* filda_1.1:
  update flat files
  add lp deploy scripts

# Conflicts:
#	flats/QsConfig.sol
#	flats/Qstroller.sol
AshtonChen and others added 15 commits September 24, 2021 09:51
Add new oracle impl and borrow cap support
1. PVE-002:Inaccurate Logic Behind Comp Distribution
2. PVE-003:Improved Sanity Checks For System Parameters
3. PVE-004:Redundant State/Code Removal
2. Fix flash loan related issues
Fix issues reported by security audit
[N1] [Suggestion] Native token receiving issue
[N2] [Suggestion] Missing event record
[N5] [Suggestion] Potential calculation flaws in flashloan fees

2. Remove unused CDaiDelegate.sol
3. Update deploy scripts according to contract codes change
4. Update matic test network config
Fix security related issues
ariaInKitchen and others added 21 commits November 5, 2021 14:10
* add quick dual lp delegate

* add setRewardFtoken

* add FTokenStorage

* add QsQuickLPDelegate and deploy script

* check rewardsTokens array length in init function

Co-authored-by: zuohuahua <zuohuahua@elastos.org>
remove unused state in quick lp

Co-authored-by: zuohuahua <zuohuahua@elastos.org>
…l of permission control, plan to enable timelock+multisig to admin and enable muting for safetyGuardian

2. Add transferGovernance to allow transfer governance to multisig account
3. Remove nonReentrant modifier from overridden borrowInternal function to avoid double reentrant issue
4. Add empty _addReserves to lp fToken impl to reduce contract size, such function is useless for lp fToken
5. Use exchangeRateStored instead exchangeRateCurrent in Qstroller.mintAllowed function to avoid double reentrant issue
6. Change to use safetyGuardian as permission controller for _setReserveFactorFresh, _reduceReservesFresh and _setInterestRateModelFresh
7. Check keccak256("ERC3156FlashBorrower.onFlashLoan") in flashloan function to comply with EIP-3156
8. Add BitWise as one tool for bit operation
Co-authored-by: zuohuahua <zuohuahua@elastos.org>
* CompoundLens add lp apy function

* fix seconds a year

Co-authored-by: zuohuahua <zuohuahua@elastos.org>
* quick lp calculate apy in 24 hours

* add comments

Co-authored-by: zuohuahua <zuohuahua@elastos.org>
Co-authored-by: zuohuahua <zuohuahua@elastos.org>
Co-authored-by: zuohuahua <zuohuahua@elastos.org>
Co-authored-by: zuohuahua <zuohuahua@elastos.org>
Co-authored-by: zuohuahua <zuohuahua@elastos.org>
Co-authored-by: zuohuahua <zuohuahua@elastos.org>
* Update to temporarily allow admin transfer

* 1. remove admin transfer function
2. fix flashloan issue for ERC677/ERC777 token
3. support whitelist for flashloan
4. support to block blacklist accounts
5. allow to reduce reserves to security guardian

* fix address not payable issue

* fix contract size too big issue

Co-authored-by: Ashton Chen <cdljsj@gmail.com>
Co-authored-by: zuohuahua <zuohuahua@elastos.org>
* Fix the exchange rate vulnerability

- Use internal cash to record the supply balance

- Add gulp function to absorb the excess cash into reserves

* Reduce contract code size

- Some CToken, SToken, Comptroller and Qstroller functions will now revert instead of returning Failures

- Refactor several math/error operations to use reverts

- Added mul_ScalarTruncate , mul_ScalarTruncateAddUint , div_ScalarByExp and div_ScalarByExpTruncate to Exponential library
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants