Giter Club home page Giter Club logo

earn-protocol's Issues

Include MKR token edge case in `_getBestAPR` in APROracle.sol

  • _getBestAPR is handling the edge for WETH token as of now. However, if using getTokenConfigBySymbol(symbol) of Compound, then MKR token's edge case can be added as MKR contract returns MKR's symbol's hash and not "MKR" as string.
  • This has to be explored bit more as well as if MKR is possible scenario or not.
  • Also, Maybe we can use getTokenConfigByUnderlying(token) with an exception for MKR. However, this function also returns error right now for MKR token address and therefore needs more exploration.

Withdraw/Deposit For

Two new functions:

  1. withdrawFor
  2. depositFor

The purpose of these functions is to permit a contract to perform a withdraw or deposit function on behalf of a user - in particular it is useful for tracking deposits/withdrawals made by LimitOrder contract suite on behalf of users (order.maker).

DForce adapter test cases

There is uncertainty of protocols distributing rewards. This should be handle dynamically by making web3 calls when test cases are executed.

This refactoring to dynamically determine the status of reward distribution can be applied across other protocol adapters as well.

This is with respect to this PR.

Refactor config contracts

  • Remove returns(bool) from setter functions
  • Repetitive checks and do code re-use
  • No need to check address(0) if isContract() check is done.

Vault and StrategyManager

  • Handle strategy manager when OPTYTokenDistributor and ODEFIVaultBooster are zero addresses
  • Document with clarity for _emergencyBrake() inVault.sol
  • Document getPricePerFullShare and getPricePerFullShareWrite in Vault.sol stating the edge case scenario when last step step is curve
  • In RegistryProxy.sol, remove initialization of setOPTYDistributor(msg.sender) from constructor
  • In ModifierController.sol, check that _OPTYDistributor is not an EOA.
  • Write unit test to verify all the changes.
  • Vault exceeds 24kb

APR Oracle

  • The strategy hash compose is incorrect.
  • Perform keccak256 hash of tokensHash and strategy step

Verify that deposit and withdraw to/from strategy occurred in vault

Problem

  • Whenever Vault deposit to the strategy through series of function call using MultiCall contract, it does not consider return values if any protocol returns on deposit.
  • Whenever Vault withdraws from the strategy through series of function call using MultiCall contract, it does not consider return values if any protocol returns during withdraw.

Possible Solution

  • Deposit : Check the difference of vault balance in underlying token before and after deposit. Some protocols may limit the investment so consider that via calls made to the adapter.Revert if the difference is not as expected
  • Withdraw : Check the difference of vault balance in underlying token before and after withdraw. Revert if the difference is not as expected.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.