hifi-finance / hifi

Monorepo implementing the Hifi fixed-rate, fixed-term lending protocol
https://app.hifi.finance
Other
105 stars 15 forks source link

[flash-swap] Merge the "CollateralFlashUniswapV2" and "UnderlyingFlashUniswapV2" contracts #67

Closed PaulRBerg closed 2 years ago

PaulRBerg commented 2 years ago

Thanks to https://github.com/hifi-finance/hifi/commit/32dd173ef1a57d9bef316d01f687049c98534865 and https://github.com/hifi-finance/hifi/commit/7f042ab59d6d51a92f1a583120a2778c831fe749, the CollateralFlashUniswapV2 and UnderlyingFlashUniswapV2 have become very much alike.

By passing an additional variable to the flash swap ABI-encoded data, say "repayToken", we could potentially merge the contracts. That will remove a big chunk of technical debt.

PaulRBerg commented 2 years ago

I started working on this in the refactor/flash-swap branch.

PaulRBerg commented 2 years ago

Closing now.

I should have closed this issue on Nov 16, when I merged PR https://github.com/hifi-finance/hifi/pull/69 into the main branch.