-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* basic utility pool structure * sdCollateral intergration with utilityPool * Rename SDx.sol to SDX.sol * terminology change * SD Incentive Controller (#210) * Initial code * Change terminologies * IncentiveController->SDIncentiveController * Run prettier * Use block number and read from staderConfig * utilize flow * dwlwgator withdraw flow * seperate function in node registry to utilze SD * view function to get latest data * Liquidation (#211) * User struct * mapping * calculation * liquidationCall initial * Add riskconfig * Add back comments * include pause functionality * repay flow changes and comments * Operator reward integration (#213) * init * Introduce owedAmount * Update OperatorRewardsCollector.sol * Add PoolUtils * claimLiquidation * Fix compile * Fix claimFor * Add liquidator data * review fixes * deposit SD reward as collateral changes * Fix compilation * Change function orders * Fix review * Add exit operator * deposit SD reward as collateral flow changes * Fix review * Use operatorUtilizedSDBalance * custom error message * deploy script for utility pool * Updates on incentiveController * Add docs and checkers * fix claim function time cool down logic * Add withdrawable * rename function and variables * Add non-existent liquidation check * fix sdCollateral withdraw function * Fix claim logic * refactor slash SD * whenNotPaused modifier * Claim rewards during requestWithdraw * review fixes * change in request withdraw logic * Review fix * Introduce weth * introducing withdrawOnBehalf in SDCollateral * Transfer back utilized SD * add getter in interface * incentiveController and addValidatorKey fix * test case for utilze and delegate flow * referral Id for adding validator keys * sdCollateral test cases * SD token decimal adjust * Multiply by DECIMAL * Liquidation test * Only manager role for certain functions * test fix * Fix weth issue * Small fix and unit test * Minimum reward amount * Claim available amount * Lint test * Add start incentive later test * SDP-06 fix * SDP-11 fix * Fix SDP-03 * SDP-02 fix * push back SDP-03 fix * SDP-07 fix * SDP-17 fix * Take initial _delegate into consideration * whenNotPaused test cases * comment fix * Expand liquidation call tests * Update SDIncentiveController.t.sol * Separate claim and claimLiquidation * Add test * Quick fix * Remove claimFor * Fix test * Lint and add tests * small change claim * Add emit tests * Refactor test * add emit test * claim after liquidation * change initial delegate amount to 1 SD * Initialise risk config at initialize * Internal function prefix with _ * renaming change * Collateral in ETH and expose liquidationIndexByOperator * rounding up interest in ETH * reward collector test fixed * foundry deploy script * minimum withdraw and delegate limits * rounding up cTokenShare in requestWithdrawWithSD call * fix utilityPool with min delegate amount * add clearUtilizedPosition function * add totalUtilizedSD getter in interface * clearing utilized position using withdrawOnBehalf * optimize _transferBackUtilizedSD * handling of edge cases when nonTerminalKeys are 0 * update interface * add utilityPool deploy script * introduce claimWithAmount function in rewardCollector * fix: only call withdraw if balance of nodeELVault greater than 0 * updating operatorRewardsCollector Interface * adding third party license file * fix formatting of README * add title in License file * formatting the title of License file --------- Co-authored-by: Sanjay Yadav <[email protected]> Co-authored-by: Dulguun <[email protected]>
- Loading branch information
1 parent
34ba126
commit 1939e6c
Showing
39 changed files
with
4,062 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ lcov.info | |
# Foundry | ||
cache_forge/ | ||
out/ | ||
broadcast | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
THIRD PARTY LICENSES | ||
|
||
Compound Code (BSD-3-Clause License) | ||
|
||
This project incorporates portions of code originally developed by Compound Labs, Inc. and | ||
licensed under the BSD-3-Clause License ("BSD-3-Clause"). The full text of the BSD-3-Clause | ||
License is included below for your reference: | ||
|
||
Copyright (c) 2020 Compound Labs, Inc. | ||
|
||
Redistribution and use in source and binary forms, with or without modification, are permitted | ||
provided that the following conditions are met: | ||
|
||
- Redistributions of source code must retain the above copyright notice, this list of | ||
conditions and the following disclaimer. | ||
|
||
- Redistributions in binary form must reproduce the above copyright notice, this list of | ||
conditions and the following disclaimer in the documentation and/or other materials | ||
provided with the distribution. | ||
|
||
- Neither the name of the copyright holder nor the names of its contributors may be used | ||
to endorse or promote products derived from this software without specific prior written | ||
permission. | ||
|
||
|
||
DISCLAIMER: | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | ||
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A | ||
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED | ||
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
||
The following sections of this project codebase are derived from the Compound code: | ||
|
||
contracts/SDUtilityPool.sol - accrueFee(), utilizerBalanceCurrent(address account), | ||
utilizerBalanceStored(address account), _utilizerBalanceStoredInternal(address account), | ||
exchangeRateCurrent(),exchangeRateStored(), _exchangeRateStored(). | ||
|
||
These are the logic to compute the rewards, compute utilizer balance and | ||
exchangeRate computation for C-token based model. | ||
|
||
Curvefi Code (MIT License) | ||
|
||
This project incorporates portions of code originally developed by Ben Hauser and licensed | ||
under the MIT License. The full text of the MIT License is included below for your reference: | ||
|
||
MIT License | ||
|
||
Copyright (c) 2020 Ben Hauser | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software | ||
and associated documentation files (the "Software"), to deal in the Software without restriction, | ||
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to | ||
do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or | ||
substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT | ||
OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE | ||
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
Specific Code Attribution: | ||
|
||
The following sections of this project codebase are derived from the Curvefi code: | ||
|
||
contracts/SDIncentiveController.sol - updateRewardForAccount(address account), | ||
rewardPerToken() and earned(address account). | ||
|
||
These are mainly the logic for storing and computing user incentivize rewards. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.