Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* initial separate into d3m target and d3m join contracts * initial update of tests and file reorg/rename * add approval for the join to allow the target to move gems and update the target withdraw to pull the adai first * update interfaces and require successful transferFrom" * update tests and fix reward claimer * allow filing a new target * minor clean up * remove unneeded interface * update interface and add validTarget helper * add missing arg * initial Test Target contract * update test forge path to accept new match arguments * add new line * update Target to not need wat parameter * add test gem for Join testing * allow for bar = 0 case in tests * add give allowance to test token and transfers to target * update Join to fix target cage bug * we don't need internal balance tracking for the test target * add a test rewards contract * add join specific tests for covering the interactions with the Vat * make targets joins and have them hold balance Co-authored-by: Julien <[email protected]> * update testing and d3m Join so that the Target holds the balances in ERC and Vat * rename Join to Hub * rename Target to Join * make Hub compatible with multiple d3m joins: * add balance check to join * update test for hub+joins model * update helper for Hub approach * update copyrights * update tests and require d3m be live for admin actions * use ilks instead * organize files and change Join->Pool * switch to pool internally on hub * update test to use Pool naming * initial update for separation of Plans from Pools * minor test updates * initial breakdown of pool into base * add Plan base * clean up * Update to Eip 4626 (#34) * initial update of tests and file reorg/rename * update tests and fix reward claimer * organize files and change Join->Pool * switch to pool internally on hub * initial update for separation of Plans from Pools * update language for EIP-4626 * fix tests after rename * maxWithdraw and asset balances - PR comments from @hexonaut * fix share transfer amounts * fix tests * remove helper function * remove helper function tests * fix unwind balance * fix asset balance in test pool * move bar to plan * use plan base * Fix tests * Modularize upd 325 (#37) * Clean up vars and add Cage event * Upd revert names * Upd revert names in Pool Base * emit Hope and Nope events on Pool Base * Add Quit event * Add emit for clarity * Add Exit event * uint => uint256 * rm math * wards ocd * start updating aave to use base * shorten names * remove chainlog from d3m hub * remove dai daiJoin from hub * make common interfaces to use in tests * remove ds-value submodule * update aave tests for no ds-value * add todos * do daiJoin work in hub @gbalabasquer * PR comments to clean up hub * clean up add TODO * join directly to vow * PR feedback @talbaneth and @gbalabasquer * Apply suggestions from code review Co-authored-by: talbaneth <[email protected]> * remove collect and move plan to Hub from pool * abstract bar to individual plan implementations * read and assign end on when necessary * don't read the plan * adjust unwind daiJoin interaction to match wind * fix aave tests - WIP * Apply suggestions from code review Co-authored-by: talbaneth <[email protected]> * PR clean up comments * add recover tokens function to pool * remove convertToAssets from base * PR comments: remove bar and pool from bases and gas efficiency * change aave assetBalance calc * fix mom bar filing * update test for Aave share balance transfer in exit * revert convert to shares in exit since we should already be dealing with shares in wad * fix permissionless repay aave test * fix remaining aave test * reorganize interfaces into tests * move constant * remove unused interface functions * remove maxBar from base * remove events * Apply suggestions from code review Co-authored-by: talbaneth <[email protected]> * fix silly variable setting Co-authored-by: talbaneth <[email protected]> * move plans to separate folder * PR comments - update auths * move share to pools out of base * initial switch to returning target assets * WIP change to return targetAsset * accrued if needed before getting balance * integrate @hexonaut 's Aave calc fix * Delete empty file * plan base unit tests * add pool base tests * re-order accrueIfNeeded and maxWithdraw Co-authored-by: talbaneth <[email protected]> * remove unneeded math Co-authored-by: talbaneth <[email protected]> * consistent filing for ilks * better documentations of Ilk in Hub Co-authored-by: talbaneth <[email protected]> * remove unneeded safe math * don't store culled * unused return variable Co-authored-by: talbaneth <[email protected]> * update getTargetAssets * pr feedback * update share balance for aave to be scaled * Mom can disable plans * make files external * initial AaveDai plan tests * more AaveDaiPlan unit tests * add disable to plan base * fix missing override * check dai balance in wind * denominate shares in hub in dai/gems and add transferAllShares function * add approxEq for checking dai depositing * AaveDaiPool tests * move deposit check to pool * clean up remaining hub tests * add Mom tests * update base and share calculations * update aaave deposit checking * remove named return Co-authored-by: talbaneth <[email protected]> * remove debugging * update comments and errors * fix rounding error * fix possible bug with debt > debt ceiling * pr comments and clean up * add file events * pr comments on events and requires * add missing auth and test coverage * consolidate debt usage to totalDebt instead of adding it multiple times * update unwind comment Co-authored-by: talbaneth <[email protected]> * fix adai pool comment Co-authored-by: talbaneth <[email protected]> * update comment * D3MCompoundDaiPlan - initial implementation, untested * Neat * Add initial version of D3MCompoundDaiPool, missing logic and tests * More ppol work, actually add D3MCompoundDaiPool.sol * Test supply for current rate * D3MCompoundDaiPlan testing * Add test for calculating supplies * Align to latest modularize branch * Add accrueIfNeeded to compound pool * D3MCompoundDai.t.sol - WIP * Align to latest modularize changes * Remove auth modifier from compound's collect() * Support also 0 jump multiplier * Neat * Unify return values * Neat - fix indentation * Add plan test from hub * During test cleanup * Align to modularize latest changes * Support explicit disable() from mom * Make disable overriding on Compound Plan * Align to transferShares changes in hub * Align to modularize - validaion in deposit * Add underlying() validation also in plan ctr * Remove unused function in pool and add overrride * Align to modularize pool changes * Add Compound plan events * Add Compound pool auth and events * Align to compound-cd-audit fixes, commit fa793a3 This is the commit with the response to CS audit for Plan. The base plan and compound plan code are now identical to there. * Align to v2, wip * Align to v2, tests pass * Port test from cs-audit-fixes * Fix merge mistake with filing rate model * Finish porting all new plan tests * Add D3MCompoundDaiPool.t.sol * Align Compound plan test to run base plan tests * Cleare comparisons in D3MCompoundDai.t.sol * Simplify to use just _setRelBorrowTarget in D3MCompoundDai.t.sol * Align to use Like suffix for interfaces * Linter run - break require, remove test comment * Add clarification for Compound APY * Slightly improve plan comment + small neats * Add comp amount comparison to test * Refactors based on AAVE comments -Move administration parts to the top so wards will be in first slot. -Move internal functions to after external related ones. * Add amt to Compund's Collect() event * Fix merge of D3MAaveDaiPool.t.sol * Use compSupplySpeeds in comp claiming tests * Align line break style to rest of the file * Use internal constant, Add TODOs * add 2021 Nov Aave D3M Audit (#52) * fix end address Co-authored-by: Nazzareno Massari <[email protected]> * update end in aave tests Co-authored-by: Nazzareno Massari <[email protected]> * Update End address in D3MCompoundDai.t.sol * Fix typo * Tighten underlying dai comparisons, check deposit cdai * Add nope to compound pool, support hope/nope base tests * align to use >= in solidity pragma * Group storage together for Compound pool and plan * Flip expected and ectual in assertEqAbsolute * Align to V2 branch * Align layout of events/ctr/auth/math/admin to aave * Revert if getAccountSnapshot returns an error * Add TODOs * Add Compound links and explanation for using exchangeRateStored * Algin to V2 changes * Renamings and avoiding unused warning on hooks * Add SPDX-FileCopyrightText to Compound files * Align to V2 * deactivate if cdai implementation changes * Add boundary for barb * Make comp immutable, get dai from cdai * Support collect without claim. Since COMP can be claimed to the pool directly through Compound by a 3rd party make sure it can be recovered later even if comptroller would revert for some reason. * Improve interface links * align to v2 - wip * Finish aliging to asserRevert change * Align to V2 * Add Compound to README * Update to permanent links * Fix failures due to rounding * Validate delegate is not address(0) * Use address instead of token in cDai etherscan link Co-authored-by: Nazzareno Massari <[email protected]> * Move tau to general place in the Readme * Move _calculateTargetSupply up * Add comment about normal rate * Use _hub in pool ctr * Reorder cdai assignment and Avoid casting in plan * Support utilization > 100% * Comment why multiplierPerBlock != 0 and can de divided by * dapp upgrade dss-test (reverting un-intentional downgrade) * _assertEqApprox => assertEq Co-authored-by: Gonzalo Balabasquer <[email protected]> * Remove safe math in tests * Fix copyrights Co-authored-by: Nazzareno Massari <[email protected]> * Handle several review comments in tests * Fix copyrights also in Compound tests * Substract before addition * Neat - better spacings Co-authored-by: Chris Smith <[email protected]> Co-authored-by: Julien <[email protected]> Co-authored-by: Brian McMichael <[email protected]> Co-authored-by: Nazzareno Massari <[email protected]> Co-authored-by: Gonzalo Balabasquer <[email protected]>
- Loading branch information