Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(PerpV2BasisTradingModule): External audit fixes for low-risk findings and Internal audit fixes #232

Merged
merged 16 commits into from
Apr 13, 2022

Conversation

0xSachinK
Copy link
Contributor

@0xSachinK 0xSachinK commented Mar 25, 2022

External Audit Report

Fixes

Low Risk

  • Base functions are not overridden (Decreased bytecode size in 0d70785, Fix in c857a3f)
  • Subtraction underflow when calling deposit
    • Todo: Gain more clarity
    • Proposed solution below, added in 910fb59
  • Fix update external position unit
    • _updateWithdrawFundingState should also update the external position unit

Informational

Explained: Subtraction underflow when calling deposit

I was not able to recreate the bug even after depositing the entire withdrawn amount for >500 times consecutively. But as bernard pointed out in our chat, he was able to recreate the issue without any withdrawing and just depositing airdropped tokens.

In this script that bernard shared, he

  • creates a SetToken with 100 USDC as a position unit.
  • Issues 10 such Sets.
  • Then airdrops 100 USDC to the Set.
  • Then calls deposit with (balance/totalSupply = 1100/10 = 110) units.
    • In the deposit function, we calculate depositNotional = 110 * totalsupply = 100 * 10 = 1100, and then invoke deposit on PerpV2, which pulls 1100 USDC from the Set.
    • But, here the deposit function should have reverted because we are trying to deposit more than what we are tracking as position units (that is we are also depositing the airdropped amount).
    • But since we don't catch that here, we end up with a subtraction overflow when we are trying to edit the default position unit. The calculateDefaultEditPositionUnit is designed to not pick up airdropped amounts in its calculations.
    • In this particular example, calculateDefaultEditPositionUnit is passed the following parameters,
      • _setTokenSupply: 10e18
      • _preTotalNotional: 1100e6
      • _postTotalNotional: 0
      • _prePositionUnit: 100e6
      • And error occurs because, airdroppedAmount (1100 - 100 * 10)e6 = 100e6 is greater than _postTotalNotional (0).

Proposed Solution

Rather than modifying the PositionV2#calculateDefaultEditPositionUnit, we fix the PerpV2LeverageModuleV2#deposit unit to check that the deposit position units is <= current position unit.

Internal Audit Report

All changes added in 90b0276 and 56bfe82.

PerpV2LeverageModuleV2

  • L393: Manager Only comment should be SetToken Only.

PerpV2BasisTradingModule

Imports

  • (nit): Separate IERC20 (imported from Zeppelin) from other imports and place at top of file

constructor

  • (nit): dev comment could contextualize logic.

initialize(setToken, feeState)

  • (nit/docs): _settings param is not documented

tradeAndTrackFunding

  • Naming consistency
    • BasisTradingModule tracks settled funding. So the function name is correct.
  • onlyManagerAndValidSet checks are duplicated by call to PerpV2LeverageModule.trade. (For some methods this contract falls back on base modifiers, in others it doesn’t)
    • Whenever we call an internal function that uses a passed in parameter (eg. _updateSetlledFunding(_setToken) utilizes _setToken) we first ensure the parameter is valid (e.g. validate _setToken via onlyManagerAndValidSet modifier). But if we are calling the base function (PerpV2LeverageModule.###) at the very top in the function, example in removeModule then we don't duplicate the modifiers.

withdrawFundingAndAccrueFees

  • javadocs: Added note
  • method _withdraw is called without using PerpV2LeverageModuleV2 predicate.
    • All internal functions are called without using PerpV2LeverageModuleV2 predicate

moduleRedeemHook

  • Could newExternalPositionUnit on L319 ever end up being negative?
    • Added check and set to zero when negative

updatePerformanceFee

  • describe procedure for settling funding to zero before updating fee
  • inconsistent require condition

getRedemptionAdjustments

  • can this position unit ever go negative (Fixed)
  • Could logic be refactored so that this method and moduleRedeemHook share the core settledFunding → trade → newPositionUnit flow?

_handleFees

  • (naming): _amount_notionalFundingAmount for clarity

@0xSachinK 0xSachinK requested a review from cgewecke March 25, 2022 12:25
@0xSachinK 0xSachinK changed the title fix(PerpV2BasisTradingModule): External audit fixes fix(PerpV2BasisTradingModule): External audit fixes for low-risk findings Mar 25, 2022
* equal to the amount of collateralToken returned per SetToken upon redemption. Approximate value works because
* as noted above, the external position unit is only updated on an as-needed basis during issuance, redemption,
* deposit and withdraw. It does not reflect the current value of the Set's perpetual position. The current value
* can be calculated from getPositionNotionalInfo.
*
* @param _setToken Instance of SetToken
* @return int256 External position unit
*/
function _calculateExternalPositionUnit(ISetToken _setToken) internal view returns (int256) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only call this as part of the external deposit and withdraw flows. If we change it to be an approximation of the position unit (b/c the accountValue is a function of the oracle price, rather than AMM state) and recommend that people calculate "the current value ... from getPositionNotionalInfo" (e.g off-chain?) maybe we should just stop editing the positionUnit on deposit and withdraw altogether. What use case does it serve?

Would this have any implications for the strategy extensions going forward? (It looks like the LeverageStrategy contract doesn't read the position unit anywhere.)

Copy link
Contributor Author

@0xSachinK 0xSachinK Mar 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you take a look at the PositionV2#editExternalPosition function, it does the following

  1. It adds/removes the component to SetToken's components list.
  2. It adds/removes the associated module to SetToken's external modules list.
  3. It updates the external position unit.

1, and 2 are required for the rest of the stack. Something like below would also acheive 1 and 2.

  _setToken.editExternalPositionUnit(
      address(collateralToken),
      address(this),
      1 if account value unit in PerpV2 > 0 else 0  // pseudocode
  );

The fact is that, there is no THE correct value that we can set here. Each value is merely a placeholder, which helps to achieve 1 and 2. The actual value is determined only during issuance/redemption. But it's fairly simple to fetch the account value from Perp and is very close to the values we were calculating earlier. Hence fetching the account value seems to be a sweet spot to me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I wonder if your suggestion to toggle based on the vault balance might be the right thing to do - it seems closer to what's intended than either of the account valuation strategies.

Copy link
Contributor Author

@0xSachinK 0xSachinK Apr 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update: Instead of toggling we are setting the unit to collateralValueUnit. As we want the module to remain added to the SetToken as long as there is collateral in PerpV2 vault for the Set's account. In contrast, account value doesn't provide the same guarantee because it can flip negative (even when collateral balance > 0) after liquidations.

    function _updateExternalPositionUnit(ISetToken _setToken) internal {
        int256 collateralValueUnit = perpVault.getBalance(address(_setToken))
            .toPreciseUnitsFromDecimals(collateralDecimals)
            .preciseDiv(_setToken.totalSupply().toInt256())
            .fromPreciseUnitToDecimals(collateralDecimals);

        _setToken.editExternalPosition(
            address(collateralToken),
            address(this),
            collateralValueUnit,
            ""
        );
    }

@0xSachinK 0xSachinK force-pushed the sachin/btm-external-audit-fixes-2 branch from 910fb59 to b7ca3b8 Compare April 12, 2022 05:32
@0xSachinK
Copy link
Contributor Author

Rebase to master to pull in the latest integration tests merged to master.

Copy link
Contributor

@cgewecke cgewecke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this all looks good! Solution to airdrop problem really nice, makes sense.

Should _updateWithdrawFundingState also update the external position unit?

Idk if that question is still open but seems fine to me.

Have added some small fixes for the things we discussed April 12 in #243. If those look ok to you then merging them into this branch should resolve the remaining CI blockers here and this is done.

(Am tentatively approving on the assumption you'll pull those in or do something equivalent)

cgewecke and others added 2 commits April 13, 2022 12:37
* Add fix for _updateExternalPositionUnit

* Add test for negative balance check in _calculateNetFeesPositionUnit

* Fix externalPositionUnit test in perpV2LeverageV2SlippageIssuance tests

* Use `tradeAndTrackFunding` everywhere in BasisTrading integration tests
@0xSachinK 0xSachinK changed the title fix(PerpV2BasisTradingModule): External audit fixes for low-risk findings fix(PerpV2BasisTradingModule): External audit fixes for low-risk findings and Internal audit fixes Apr 13, 2022
@0xSachinK 0xSachinK merged commit d7d37da into master Apr 13, 2022
@0xSachinK 0xSachinK deleted the sachin/btm-external-audit-fixes-2 branch April 13, 2022 07:39
@cgewecke
Copy link
Contributor

🎉 This PR is included in version 0.9.2-hhat.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

cgewecke pushed a commit that referenced this pull request Apr 13, 2022
## [0.9.2](v0.9.1...v0.9.2) (2022-04-13)

### Bug Fixes

* **PerpV2BasisTradingModule:** External audit fixes for low-risk findings and Internal audit fixes ([#232](#232)) ([d7d37da](d7d37da)), closes [#243](#243)
ckoopmann pushed a commit to IndexCoop/index-protocol that referenced this pull request Oct 4, 2022
# 1.0.0 (2022-10-04)

### Bug Fixes

* **adapter:** Support Curve stableswap pools ([SetProtocol#253](https://github.com/IndexCoop/index-protocol/issues/253)) ([777ed94](777ed94))
* add proper tests, require statements for sellTokenForToken ([5c84995](5c84995))
* address review feedback ([5c6fcfc](5c6fcfc))
* **build:** Upgrade eslint-plugin-jsdoc to latest ([SetProtocol#228](https://github.com/IndexCoop/index-protocol/issues/228)) ([f5758d2](f5758d2))
* **interfaces:** add IAirdropModule, IClaimModule, and IWrapModuleV2 ([SetProtocol#252](https://github.com/IndexCoop/index-protocol/issues/252)) ([6999e84](6999e84))
* **interfaces:** Add protocol interfaces for set-v2-strategies [SIM-124] ([SetProtocol#226](https://github.com/IndexCoop/index-protocol/issues/226)) ([0bd5ca4](0bd5ca4))
* **IPerpV2BasisTradingModule:** Improve javadocs [SetProtocol#246](https://github.com/IndexCoop/index-protocol/issues/246) ([3129b37](3129b37))
* **NotionalTradeModule:** audit adjustments ([de39ee1](de39ee1))
* **PerpV2BasisTradingModule:** bytecode size limit bug ([SetProtocol#200](https://github.com/IndexCoop/index-protocol/issues/200)) ([ddfab38](ddfab38))
* **PerpV2BasisTradingModule:** Expose getter to fetch updated settled funding ([SetProtocol#244](https://github.com/IndexCoop/index-protocol/issues/244)) ([f215147](f215147))
* **PerpV2BasisTradingModule:** External audit fixes for low-risk findings and Internal audit fixes ([SetProtocol#232](https://github.com/IndexCoop/index-protocol/issues/232)) ([d7d37da](d7d37da)), closes [SetProtocol#243](https://github.com/IndexCoop/index-protocol/issues/243)
* **PerpV2LeverageModuleV2:** Round up during withdraw ([SetProtocol#249](https://github.com/IndexCoop/index-protocol/issues/249)) ([7780963](7780963))
* remove incorrect require check for sellEthForTokenToUniswapV3 ([7f8048d](7f8048d))
* sellEthForTokenToUniswapV3 impl and address review comments ([73ea7b3](73ea7b3))
* **SlippageIssuanceModule:** Fix issuance & redemption flows to not update position units ([SetProtocol#254](https://github.com/IndexCoop/index-protocol/issues/254)) ([9be3d1b](9be3d1b))
* **tests:** Add Hardhat deployment subgraph test scripts  ([SetProtocol#242](https://github.com/IndexCoop/index-protocol/issues/242)) ([0aa0d14](0aa0d14))
* **utils:** Port StringArrayUtils from set-v2-strategies [SIM-124] ([SetProtocol#227](https://github.com/IndexCoop/index-protocol/issues/227)) ([dbf6c04](dbf6c04))

### Features

* **adapter:** Add Curve trade adapter [SIM-173] ([SetProtocol#238](https://github.com/IndexCoop/index-protocol/issues/238)) ([f697783](f697783))
* **adapter:** Add RGT to Tribe migration adapter [SIM-52] ([SetProtocol#188](https://github.com/IndexCoop/index-protocol/issues/188)) ([ca5c2ab](ca5c2ab))
* add direct RFQT fill suport to ZeroExApiAdapter [SIM-230] ([SetProtocol#241](https://github.com/IndexCoop/index-protocol/issues/241)) ([f4b976e](f4b976e))
* **BytesArrayUtils:** Add BytesArrayUtils library ([SetProtocol#248](https://github.com/IndexCoop/index-protocol/issues/248)) ([7b35392](7b35392))
* **deprecation:** Consolidate or remove deprecated contracts [SIM-124] ([SetProtocol#225](https://github.com/IndexCoop/index-protocol/issues/225)) ([579852a](579852a))
* implement sellTokenForEthToUniswapV3 and sellEthForTokenToUniswapV3 ([2296f6e](2296f6e))
* initial stab at Uniswap V3 adaptor ([c25665b](c25665b))
* **Intefaces:** Add basis trading module interfaces ([SetProtocol#237](https://github.com/IndexCoop/index-protocol/issues/237)) ([c7af322](c7af322))
* **module:** Notional Trade Module ([SetProtocol#251](https://github.com/IndexCoop/index-protocol/issues/251)) ([49bdf46](49bdf46))
* **publishing:** Auto publish repository to npm in CI [SIM-123] ([SetProtocol#203](https://github.com/IndexCoop/index-protocol/issues/203)) ([8ddbbf1](8ddbbf1))
* **reorg:** Re-org modules into v1 and v2 directories ([SetProtocol#230](https://github.com/IndexCoop/index-protocol/issues/230)) ([d43df0c](d43df0c))
* **UniswapV3ExchangeAdapterV2:** Add UniswapV3ExchangeAdapterV2 exchange adapter ([SetProtocol#240](https://github.com/IndexCoop/index-protocol/issues/240)) ([b4d95ca](b4d95ca))
* verify path for multiple hops ([06ca9b6](06ca9b6))
* verify uniswap path for single hops WIP ([7905d73](7905d73))
ckoopmann pushed a commit to IndexCoop/index-protocol that referenced this pull request Oct 4, 2022
# 1.0.0 (2022-10-04)

### Bug Fixes

* **adapter:** Support Curve stableswap pools ([SetProtocol#253](https://github.com/IndexCoop/index-protocol/issues/253)) ([777ed94](777ed94))
* add proper tests, require statements for sellTokenForToken ([5c84995](5c84995))
* address review feedback ([5c6fcfc](5c6fcfc))
* **build:** Upgrade eslint-plugin-jsdoc to latest ([SetProtocol#228](https://github.com/IndexCoop/index-protocol/issues/228)) ([f5758d2](f5758d2))
* **interfaces:** add IAirdropModule, IClaimModule, and IWrapModuleV2 ([SetProtocol#252](https://github.com/IndexCoop/index-protocol/issues/252)) ([6999e84](6999e84))
* **interfaces:** Add protocol interfaces for set-v2-strategies [SIM-124] ([SetProtocol#226](https://github.com/IndexCoop/index-protocol/issues/226)) ([0bd5ca4](0bd5ca4))
* **IPerpV2BasisTradingModule:** Improve javadocs [SetProtocol#246](https://github.com/IndexCoop/index-protocol/issues/246) ([3129b37](3129b37))
* **NotionalTradeModule:** audit adjustments ([de39ee1](de39ee1))
* **PerpV2BasisTradingModule:** bytecode size limit bug ([SetProtocol#200](https://github.com/IndexCoop/index-protocol/issues/200)) ([ddfab38](ddfab38))
* **PerpV2BasisTradingModule:** Expose getter to fetch updated settled funding ([SetProtocol#244](https://github.com/IndexCoop/index-protocol/issues/244)) ([f215147](f215147))
* **PerpV2BasisTradingModule:** External audit fixes for low-risk findings and Internal audit fixes ([SetProtocol#232](https://github.com/IndexCoop/index-protocol/issues/232)) ([d7d37da](d7d37da)), closes [SetProtocol#243](https://github.com/IndexCoop/index-protocol/issues/243)
* **PerpV2LeverageModuleV2:** Round up during withdraw ([SetProtocol#249](https://github.com/IndexCoop/index-protocol/issues/249)) ([7780963](7780963))
* remove incorrect require check for sellEthForTokenToUniswapV3 ([7f8048d](7f8048d))
* sellEthForTokenToUniswapV3 impl and address review comments ([73ea7b3](73ea7b3))
* **SlippageIssuanceModule:** Fix issuance & redemption flows to not update position units ([SetProtocol#254](https://github.com/IndexCoop/index-protocol/issues/254)) ([9be3d1b](9be3d1b))
* **tests:** Add Hardhat deployment subgraph test scripts  ([SetProtocol#242](https://github.com/IndexCoop/index-protocol/issues/242)) ([0aa0d14](0aa0d14))
* **utils:** Port StringArrayUtils from set-v2-strategies [SIM-124] ([SetProtocol#227](https://github.com/IndexCoop/index-protocol/issues/227)) ([dbf6c04](dbf6c04))

### Features

* **adapter:** Add Curve trade adapter [SIM-173] ([SetProtocol#238](https://github.com/IndexCoop/index-protocol/issues/238)) ([f697783](f697783))
* **adapter:** Add RGT to Tribe migration adapter [SIM-52] ([SetProtocol#188](https://github.com/IndexCoop/index-protocol/issues/188)) ([ca5c2ab](ca5c2ab))
* add direct RFQT fill suport to ZeroExApiAdapter [SIM-230] ([SetProtocol#241](https://github.com/IndexCoop/index-protocol/issues/241)) ([f4b976e](f4b976e))
* **BytesArrayUtils:** Add BytesArrayUtils library ([SetProtocol#248](https://github.com/IndexCoop/index-protocol/issues/248)) ([7b35392](7b35392))
* **deprecation:** Consolidate or remove deprecated contracts [SIM-124] ([SetProtocol#225](https://github.com/IndexCoop/index-protocol/issues/225)) ([579852a](579852a))
* implement sellTokenForEthToUniswapV3 and sellEthForTokenToUniswapV3 ([2296f6e](2296f6e))
* initial stab at Uniswap V3 adaptor ([c25665b](c25665b))
* **Intefaces:** Add basis trading module interfaces ([SetProtocol#237](https://github.com/IndexCoop/index-protocol/issues/237)) ([c7af322](c7af322))
* **module:** Notional Trade Module ([SetProtocol#251](https://github.com/IndexCoop/index-protocol/issues/251)) ([49bdf46](49bdf46))
* **publishing:** Auto publish repository to npm in CI [SIM-123] ([SetProtocol#203](https://github.com/IndexCoop/index-protocol/issues/203)) ([8ddbbf1](8ddbbf1))
* **reorg:** Re-org modules into v1 and v2 directories ([SetProtocol#230](https://github.com/IndexCoop/index-protocol/issues/230)) ([d43df0c](d43df0c))
* **UniswapV3ExchangeAdapterV2:** Add UniswapV3ExchangeAdapterV2 exchange adapter ([SetProtocol#240](https://github.com/IndexCoop/index-protocol/issues/240)) ([b4d95ca](b4d95ca))
* verify path for multiple hops ([06ca9b6](06ca9b6))
* verify uniswap path for single hops WIP ([7905d73](7905d73))
ckoopmann pushed a commit to IndexCoop/index-protocol that referenced this pull request Oct 5, 2022
# 1.0.0 (2022-10-05)

### Bug Fixes

* **adapter:** Support Curve stableswap pools ([SetProtocol#253](https://github.com/IndexCoop/index-protocol/issues/253)) ([777ed94](777ed94))
* add proper tests, require statements for sellTokenForToken ([5c84995](5c84995))
* address review feedback ([5c6fcfc](5c6fcfc))
* **build:** Upgrade eslint-plugin-jsdoc to latest ([SetProtocol#228](https://github.com/IndexCoop/index-protocol/issues/228)) ([f5758d2](f5758d2))
* **interfaces:** add IAirdropModule, IClaimModule, and IWrapModuleV2 ([SetProtocol#252](https://github.com/IndexCoop/index-protocol/issues/252)) ([6999e84](6999e84))
* **interfaces:** Add protocol interfaces for set-v2-strategies [SIM-124] ([SetProtocol#226](https://github.com/IndexCoop/index-protocol/issues/226)) ([0bd5ca4](0bd5ca4))
* **IPerpV2BasisTradingModule:** Improve javadocs [SetProtocol#246](https://github.com/IndexCoop/index-protocol/issues/246) ([3129b37](3129b37))
* **NotionalTradeModule:** audit adjustments ([de39ee1](de39ee1))
* **PerpV2BasisTradingModule:** bytecode size limit bug ([SetProtocol#200](https://github.com/IndexCoop/index-protocol/issues/200)) ([ddfab38](ddfab38))
* **PerpV2BasisTradingModule:** Expose getter to fetch updated settled funding ([SetProtocol#244](https://github.com/IndexCoop/index-protocol/issues/244)) ([f215147](f215147))
* **PerpV2BasisTradingModule:** External audit fixes for low-risk findings and Internal audit fixes ([SetProtocol#232](https://github.com/IndexCoop/index-protocol/issues/232)) ([d7d37da](d7d37da)), closes [SetProtocol#243](https://github.com/IndexCoop/index-protocol/issues/243)
* **PerpV2LeverageModuleV2:** Round up during withdraw ([SetProtocol#249](https://github.com/IndexCoop/index-protocol/issues/249)) ([7780963](7780963))
* remove incorrect require check for sellEthForTokenToUniswapV3 ([7f8048d](7f8048d))
* sellEthForTokenToUniswapV3 impl and address review comments ([73ea7b3](73ea7b3))
* **SlippageIssuanceModule:** Fix issuance & redemption flows to not update position units ([SetProtocol#254](https://github.com/IndexCoop/index-protocol/issues/254)) ([9be3d1b](9be3d1b))
* **tests:** Add Hardhat deployment subgraph test scripts  ([SetProtocol#242](https://github.com/IndexCoop/index-protocol/issues/242)) ([0aa0d14](0aa0d14))
* **utils:** Port StringArrayUtils from set-v2-strategies [SIM-124] ([SetProtocol#227](https://github.com/IndexCoop/index-protocol/issues/227)) ([dbf6c04](dbf6c04))

### Features

* **adapter:** Add Curve trade adapter [SIM-173] ([SetProtocol#238](https://github.com/IndexCoop/index-protocol/issues/238)) ([f697783](f697783))
* **adapter:** Add RGT to Tribe migration adapter [SIM-52] ([SetProtocol#188](https://github.com/IndexCoop/index-protocol/issues/188)) ([ca5c2ab](ca5c2ab))
* add direct RFQT fill suport to ZeroExApiAdapter [SIM-230] ([SetProtocol#241](https://github.com/IndexCoop/index-protocol/issues/241)) ([f4b976e](f4b976e))
* **BytesArrayUtils:** Add BytesArrayUtils library ([SetProtocol#248](https://github.com/IndexCoop/index-protocol/issues/248)) ([7b35392](7b35392))
* **deprecation:** Consolidate or remove deprecated contracts [SIM-124] ([SetProtocol#225](https://github.com/IndexCoop/index-protocol/issues/225)) ([579852a](579852a))
* implement sellTokenForEthToUniswapV3 and sellEthForTokenToUniswapV3 ([2296f6e](2296f6e))
* initial stab at Uniswap V3 adaptor ([c25665b](c25665b))
* **Intefaces:** Add basis trading module interfaces ([SetProtocol#237](https://github.com/IndexCoop/index-protocol/issues/237)) ([c7af322](c7af322))
* **module:** Notional Trade Module ([SetProtocol#251](https://github.com/IndexCoop/index-protocol/issues/251)) ([49bdf46](49bdf46))
* **publishing:** Auto publish repository to npm in CI [SIM-123] ([SetProtocol#203](https://github.com/IndexCoop/index-protocol/issues/203)) ([8ddbbf1](8ddbbf1))
* **reorg:** Re-org modules into v1 and v2 directories ([SetProtocol#230](https://github.com/IndexCoop/index-protocol/issues/230)) ([d43df0c](d43df0c))
* **UniswapV3ExchangeAdapterV2:** Add UniswapV3ExchangeAdapterV2 exchange adapter ([SetProtocol#240](https://github.com/IndexCoop/index-protocol/issues/240)) ([b4d95ca](b4d95ca))
* verify path for multiple hops ([06ca9b6](06ca9b6))
* verify uniswap path for single hops WIP ([7905d73](7905d73))
ckoopmann pushed a commit to IndexCoop/index-protocol that referenced this pull request Oct 5, 2022
# 1.0.0 (2022-10-05)

### Bug Fixes

* **adapter:** Support Curve stableswap pools ([SetProtocol#253](https://github.com/IndexCoop/index-protocol/issues/253)) ([777ed94](777ed94))
* add proper tests, require statements for sellTokenForToken ([5c84995](5c84995))
* address review feedback ([5c6fcfc](5c6fcfc))
* **build:** Upgrade eslint-plugin-jsdoc to latest ([SetProtocol#228](https://github.com/IndexCoop/index-protocol/issues/228)) ([f5758d2](f5758d2))
* **interfaces:** add IAirdropModule, IClaimModule, and IWrapModuleV2 ([SetProtocol#252](https://github.com/IndexCoop/index-protocol/issues/252)) ([6999e84](6999e84))
* **interfaces:** Add protocol interfaces for set-v2-strategies [SIM-124] ([SetProtocol#226](https://github.com/IndexCoop/index-protocol/issues/226)) ([0bd5ca4](0bd5ca4))
* **IPerpV2BasisTradingModule:** Improve javadocs [SetProtocol#246](https://github.com/IndexCoop/index-protocol/issues/246) ([3129b37](3129b37))
* **NotionalTradeModule:** audit adjustments ([de39ee1](de39ee1))
* **PerpV2BasisTradingModule:** bytecode size limit bug ([SetProtocol#200](https://github.com/IndexCoop/index-protocol/issues/200)) ([ddfab38](ddfab38))
* **PerpV2BasisTradingModule:** Expose getter to fetch updated settled funding ([SetProtocol#244](https://github.com/IndexCoop/index-protocol/issues/244)) ([f215147](f215147))
* **PerpV2BasisTradingModule:** External audit fixes for low-risk findings and Internal audit fixes ([SetProtocol#232](https://github.com/IndexCoop/index-protocol/issues/232)) ([d7d37da](d7d37da)), closes [SetProtocol#243](https://github.com/IndexCoop/index-protocol/issues/243)
* **PerpV2LeverageModuleV2:** Round up during withdraw ([SetProtocol#249](https://github.com/IndexCoop/index-protocol/issues/249)) ([7780963](7780963))
* remove incorrect require check for sellEthForTokenToUniswapV3 ([7f8048d](7f8048d))
* sellEthForTokenToUniswapV3 impl and address review comments ([73ea7b3](73ea7b3))
* **SlippageIssuanceModule:** Fix issuance & redemption flows to not update position units ([SetProtocol#254](https://github.com/IndexCoop/index-protocol/issues/254)) ([9be3d1b](9be3d1b))
* **tests:** Add Hardhat deployment subgraph test scripts  ([SetProtocol#242](https://github.com/IndexCoop/index-protocol/issues/242)) ([0aa0d14](0aa0d14))
* **utils:** Port StringArrayUtils from set-v2-strategies [SIM-124] ([SetProtocol#227](https://github.com/IndexCoop/index-protocol/issues/227)) ([dbf6c04](dbf6c04))

### Features

* **adapter:** Add Curve trade adapter [SIM-173] ([SetProtocol#238](https://github.com/IndexCoop/index-protocol/issues/238)) ([f697783](f697783))
* **adapter:** Add RGT to Tribe migration adapter [SIM-52] ([SetProtocol#188](https://github.com/IndexCoop/index-protocol/issues/188)) ([ca5c2ab](ca5c2ab))
* add direct RFQT fill suport to ZeroExApiAdapter [SIM-230] ([SetProtocol#241](https://github.com/IndexCoop/index-protocol/issues/241)) ([f4b976e](f4b976e))
* **BytesArrayUtils:** Add BytesArrayUtils library ([SetProtocol#248](https://github.com/IndexCoop/index-protocol/issues/248)) ([7b35392](7b35392))
* **deprecation:** Consolidate or remove deprecated contracts [SIM-124] ([SetProtocol#225](https://github.com/IndexCoop/index-protocol/issues/225)) ([579852a](579852a))
* implement sellTokenForEthToUniswapV3 and sellEthForTokenToUniswapV3 ([2296f6e](2296f6e))
* initial stab at Uniswap V3 adaptor ([c25665b](c25665b))
* **Intefaces:** Add basis trading module interfaces ([SetProtocol#237](https://github.com/IndexCoop/index-protocol/issues/237)) ([c7af322](c7af322))
* **module:** Notional Trade Module ([SetProtocol#251](https://github.com/IndexCoop/index-protocol/issues/251)) ([49bdf46](49bdf46))
* **publishing:** Auto publish repository to npm in CI [SIM-123] ([SetProtocol#203](https://github.com/IndexCoop/index-protocol/issues/203)) ([8ddbbf1](8ddbbf1))
* **reorg:** Re-org modules into v1 and v2 directories ([SetProtocol#230](https://github.com/IndexCoop/index-protocol/issues/230)) ([d43df0c](d43df0c))
* **UniswapV3ExchangeAdapterV2:** Add UniswapV3ExchangeAdapterV2 exchange adapter ([SetProtocol#240](https://github.com/IndexCoop/index-protocol/issues/240)) ([b4d95ca](b4d95ca))
* verify path for multiple hops ([06ca9b6](06ca9b6))
* verify uniswap path for single hops WIP ([7905d73](7905d73))
ckoopmann pushed a commit to IndexCoop/index-protocol that referenced this pull request Oct 5, 2022
# 1.0.0 (2022-10-05)

### Bug Fixes

* **adapter:** Support Curve stableswap pools ([SetProtocol#253](https://github.com/IndexCoop/index-protocol/issues/253)) ([777ed94](777ed94))
* add proper tests, require statements for sellTokenForToken ([5c84995](5c84995))
* address review feedback ([5c6fcfc](5c6fcfc))
* **build:** Upgrade eslint-plugin-jsdoc to latest ([SetProtocol#228](https://github.com/IndexCoop/index-protocol/issues/228)) ([f5758d2](f5758d2))
* **interfaces:** add IAirdropModule, IClaimModule, and IWrapModuleV2 ([SetProtocol#252](https://github.com/IndexCoop/index-protocol/issues/252)) ([6999e84](6999e84))
* **interfaces:** Add protocol interfaces for set-v2-strategies [SIM-124] ([SetProtocol#226](https://github.com/IndexCoop/index-protocol/issues/226)) ([0bd5ca4](0bd5ca4))
* **IPerpV2BasisTradingModule:** Improve javadocs [SetProtocol#246](https://github.com/IndexCoop/index-protocol/issues/246) ([3129b37](3129b37))
* **NotionalTradeModule:** audit adjustments ([de39ee1](de39ee1))
* **PerpV2BasisTradingModule:** bytecode size limit bug ([SetProtocol#200](https://github.com/IndexCoop/index-protocol/issues/200)) ([ddfab38](ddfab38))
* **PerpV2BasisTradingModule:** Expose getter to fetch updated settled funding ([SetProtocol#244](https://github.com/IndexCoop/index-protocol/issues/244)) ([f215147](f215147))
* **PerpV2BasisTradingModule:** External audit fixes for low-risk findings and Internal audit fixes ([SetProtocol#232](https://github.com/IndexCoop/index-protocol/issues/232)) ([d7d37da](d7d37da)), closes [SetProtocol#243](https://github.com/IndexCoop/index-protocol/issues/243)
* **PerpV2LeverageModuleV2:** Round up during withdraw ([SetProtocol#249](https://github.com/IndexCoop/index-protocol/issues/249)) ([7780963](7780963))
* remove incorrect require check for sellEthForTokenToUniswapV3 ([7f8048d](7f8048d))
* sellEthForTokenToUniswapV3 impl and address review comments ([73ea7b3](73ea7b3))
* **SlippageIssuanceModule:** Fix issuance & redemption flows to not update position units ([SetProtocol#254](https://github.com/IndexCoop/index-protocol/issues/254)) ([9be3d1b](9be3d1b))
* **tests:** Add Hardhat deployment subgraph test scripts  ([SetProtocol#242](https://github.com/IndexCoop/index-protocol/issues/242)) ([0aa0d14](0aa0d14))
* **utils:** Port StringArrayUtils from set-v2-strategies [SIM-124] ([SetProtocol#227](https://github.com/IndexCoop/index-protocol/issues/227)) ([dbf6c04](dbf6c04))

### Features

* **adapter:** Add Curve trade adapter [SIM-173] ([SetProtocol#238](https://github.com/IndexCoop/index-protocol/issues/238)) ([f697783](f697783))
* **adapter:** Add RGT to Tribe migration adapter [SIM-52] ([SetProtocol#188](https://github.com/IndexCoop/index-protocol/issues/188)) ([ca5c2ab](ca5c2ab))
* add direct RFQT fill suport to ZeroExApiAdapter [SIM-230] ([SetProtocol#241](https://github.com/IndexCoop/index-protocol/issues/241)) ([f4b976e](f4b976e))
* **BytesArrayUtils:** Add BytesArrayUtils library ([SetProtocol#248](https://github.com/IndexCoop/index-protocol/issues/248)) ([7b35392](7b35392))
* **deprecation:** Consolidate or remove deprecated contracts [SIM-124] ([SetProtocol#225](https://github.com/IndexCoop/index-protocol/issues/225)) ([579852a](579852a))
* implement sellTokenForEthToUniswapV3 and sellEthForTokenToUniswapV3 ([2296f6e](2296f6e))
* initial stab at Uniswap V3 adaptor ([c25665b](c25665b))
* **Intefaces:** Add basis trading module interfaces ([SetProtocol#237](https://github.com/IndexCoop/index-protocol/issues/237)) ([c7af322](c7af322))
* **module:** Notional Trade Module ([SetProtocol#251](https://github.com/IndexCoop/index-protocol/issues/251)) ([49bdf46](49bdf46))
* **publishing:** Auto publish repository to npm in CI [SIM-123] ([SetProtocol#203](https://github.com/IndexCoop/index-protocol/issues/203)) ([8ddbbf1](8ddbbf1))
* **reorg:** Re-org modules into v1 and v2 directories ([SetProtocol#230](https://github.com/IndexCoop/index-protocol/issues/230)) ([d43df0c](d43df0c))
* **UniswapV3ExchangeAdapterV2:** Add UniswapV3ExchangeAdapterV2 exchange adapter ([SetProtocol#240](https://github.com/IndexCoop/index-protocol/issues/240)) ([b4d95ca](b4d95ca))
* verify path for multiple hops ([06ca9b6](06ca9b6))
* verify uniswap path for single hops WIP ([7905d73](7905d73))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants