-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Flash Mint Leveraged Compound Integration * compound integration * compound leverage module * fix compile version * fix lint error * test * Change test script * use const instead of let for ethAddress * use const for ethAddress * fix issues * Change test script * remove unused variables * Fixed coverage issue * Rmove CEther * remove comment * Fix smart contract issues * Complete Test Interation Script * Fixed lint error in compIntegration script * Improve Coverage Score * Update lint issue * Test ERC20 * Fixed Lint Errors * Fixed Lint Error * add AaveLendingPoolMock * add ExchangeIssuanceLeveragedCompMock.sol * Completed Coverage 100% * Remove console.log * Final update * Final update (remove comment) * refactor: ExhangeIssuance to FlashMint. Refactors Natspec and File names only. Formatted flashMintLeveragedForCompound with prettier. * Ref: ExchangeIssuance to FlashMint migration in unit test. * ref(compound): pass cEther in through constructor. * ref: reduce number of arguements to constructor. fixes coverage failure, stack too deep compilation error. * ref: remove unused variables. Co-authored-by: Naoki Murano <[email protected]>
- Loading branch information
1 parent
19d09e9
commit 905e8b8
Showing
19 changed files
with
5,995 additions
and
4 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Apache License | ||
Apache License | ||
Version 2.0, January 2004 | ||
http://www.apache.org/licenses/ | ||
|
||
|
1,299 changes: 1,299 additions & 0 deletions
1,299
contracts/exchangeIssuance/FlashMintLeveragedForCompound.sol
Large diffs are not rendered by default.
Oops, something went wrong.
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,24 @@ | ||
/* | ||
Copyright 2022 Index Cooperative | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
SPDX-License-Identifier: Apache License, Version 2.0 | ||
*/ | ||
pragma solidity 0.6.10; | ||
pragma experimental ABIEncoderV2; | ||
|
||
contract CErc20Storage { | ||
/** | ||
* @notice Underlying asset for this CToken | ||
*/ | ||
address public underlying; | ||
} |
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,22 @@ | ||
/* | ||
Copyright 2022 Index Cooperative | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
SPDX-License-Identifier: Apache License, Version 2.0 | ||
*/ | ||
pragma solidity 0.6.10; | ||
pragma experimental ABIEncoderV2; | ||
|
||
contract CompoundLeverageModuleStorage { | ||
// Mapping of underlying to CToken. If ETH, then map WETH to cETH | ||
mapping(address => address) public underlyingToCToken; | ||
} |
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,69 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity 0.6.10; | ||
pragma experimental ABIEncoderV2; | ||
|
||
interface ICErc20Delegator { | ||
function _acceptAdmin() external returns(uint256); | ||
function _addReserves(uint256 addAmount) external returns(uint256); | ||
function _reduceReserves(uint256 reduceAmount) external returns(uint256); | ||
function _renounceAdminRights() external returns(uint256); | ||
function _renounceFuseAdminRights() external returns(uint256); | ||
function _resignImplementation() external; | ||
function _setAdminFee(uint256 newAdminFeeMantissa) external returns(uint256); | ||
function _setComptroller(address newComptroller) external returns(uint256); | ||
function _setFuseFee() external returns(uint256); | ||
function _setInterestRateModel(address newInterestRateModel) external returns(uint256); | ||
function _setPendingAdmin(address newPendingAdmin) external returns(uint256); | ||
function _setReserveFactor(uint256 newReserveFactorMantissa) external returns(uint256); | ||
function _withdrawAdminFees(uint256 withdrawAmount) external returns(uint256); | ||
function _withdrawFuseFees(uint256 withdrawAmount) external returns(uint256); | ||
function accrualBlockNumber() external view returns(uint256); | ||
function accrueInterest() external returns(uint256); | ||
function admin() external view returns(address); | ||
function adminFeeMantissa() external view returns(uint256); | ||
function adminHasRights() external view returns(bool); | ||
function allowance(address owner, address spender) external view returns(uint256); | ||
function approve(address spender, uint256 amount) external returns(bool); | ||
function balanceOf(address owner) external view returns(uint256); | ||
function balanceOfUnderlying(address owner) external returns(uint256); | ||
function borrow(uint256 borrowAmount) external returns(uint256); | ||
function borrowBalanceCurrent(address account) external returns(uint256); | ||
function borrowBalanceStored(address account) external view returns(uint256); | ||
function borrowIndex() external view returns(uint256); | ||
function borrowRatePerBlock() external view returns(uint256); | ||
function comptroller() external view returns(address); | ||
function decimals() external view returns(uint8); | ||
function exchangeRateCurrent() external returns(uint256); | ||
function exchangeRateStored() external view returns(uint256); | ||
function fuseAdminHasRights() external view returns(bool); | ||
function fuseFeeMantissa() external view returns(uint256); | ||
function getAccountSnapshot(address account) external view returns(uint256, uint256, uint256, uint256); | ||
function getCash() external view returns(uint256); | ||
function implementation() external view returns(address); | ||
function initialize(address comptroller_, address interestRateModel_, uint256 initialExchangeRateMantissa_, string memory name_, string memory symbol_, uint8 decimals_, uint256 reserveFactorMantissa_, uint256 adminFeeMantissa_) external; | ||
function initialize(address underlying_, address comptroller_, address interestRateModel_, uint256 initialExchangeRateMantissa_, string memory name_, string memory symbol_, uint8 decimals_, uint256 reserveFactorMantissa_, uint256 adminFeeMantissa_) external; | ||
function interestRateModel() external view returns(address); | ||
function isCEther() external view returns(bool); | ||
function isCToken() external view returns(bool); | ||
function liquidateBorrow(address borrower, uint256 repayAmount, address cTokenCollateral) external returns(uint256); | ||
function mint(uint256 mintAmount) external returns(uint256); | ||
function name() external view returns(string memory); | ||
function pendingAdmin() external view returns(address); | ||
function redeem(uint256 redeemTokens) external returns(uint256); | ||
function redeemUnderlying(uint256 redeemAmount) external returns(uint256); | ||
function repayBorrow(uint256 repayAmount) external returns(uint256); | ||
function repayBorrowBehalf(address borrower, uint256 repayAmount) external returns(uint256); | ||
function reserveFactorMantissa() external view returns(uint256); | ||
function seize(address liquidator, address borrower, uint256 seizeTokens) external returns(uint256); | ||
function supplyRatePerBlock() external view returns(uint256); | ||
function symbol() external view returns(string memory); | ||
function totalAdminFees() external view returns(uint256); | ||
function totalBorrows() external view returns(uint256); | ||
function totalBorrowsCurrent() external returns(uint256); | ||
function totalFuseFees() external view returns(uint256); | ||
function totalReserves() external view returns(uint256); | ||
function totalSupply() external view returns(uint256); | ||
function transfer(address dst, uint256 amount) external returns(bool); | ||
function transferFrom(address src, address dst, uint256 amount) external returns(bool); | ||
function underlying() external view returns(address); | ||
} |
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,16 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity 0.6.10; | ||
pragma experimental ABIEncoderV2; | ||
|
||
interface ICEther { | ||
function mint() external payable; | ||
function redeem(uint redeemTokens) external returns (uint); | ||
function redeemUnderlying(uint redeemAmount) external returns (uint); | ||
function borrow(uint borrowAmount) external returns (uint); | ||
function getCash() external view returns (uint); | ||
function exchangeRateStored() external view returns (uint); | ||
function exchangeRateCurrent() external returns (uint); | ||
function allowance(address owner, address spender) external view returns (uint256); | ||
function approve(address spender, uint256 amount) external returns (bool); | ||
receive() external payable; | ||
} |
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,23 @@ | ||
/* | ||
Copyright 2021 Set Labs Inc. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
SPDX-License-Identifier: Apache License, Version 2.0 | ||
*/ | ||
pragma solidity 0.6.10; | ||
import { ISetToken } from "./ISetToken.sol"; | ||
|
||
interface ICompoundLeverageModule { | ||
function sync(ISetToken _setToken, bool _shouldAccrueInterest) external virtual; | ||
} |
Oops, something went wrong.