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

feat: add flash mint leverage extended contract #48

Merged
merged 60 commits into from
May 14, 2024

Conversation

janndriessen
Copy link
Collaborator

@janndriessen janndriessen commented Apr 23, 2024

Description

TODOs

  •  check FIXME and TODOs commented on this PR
  • check to get correct issuance quotes w/ new function parameter
  • add tests for all new Arbitrum tokens in tests. Copy from eth2x tests and make sure to use the arbitrum localhost provider and zero ex api (mentioned in PR comments).

Copy link
Collaborator

@0xonramp 0xonramp left a comment

Choose a reason for hiding this comment

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

changes LGTM, few smol questions

src/utils/contracts.ts Outdated Show resolved Hide resolved
import { LeveragedExtendedQuoteProvider } from './provider'

const provider = LocalhostProvider
const zeroExApi = ZeroExApiArbitrumSwapQuote
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In tests make sure to use this zeroExApi setup for Arbitrum

.env.default Outdated Show resolved Hide resolved
Comment on lines +158 to +159
test('returns a tx for minting ETH2X (ETH)', async () => {
const buildRequest = createBuildRequest(true, eth, 'ETH')
Copy link
Collaborator

Choose a reason for hiding this comment

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

should this be the 2x token? (similar to L200)

Copy link
Collaborator Author

@janndriessen janndriessen May 13, 2024

Choose a reason for hiding this comment

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

Since this is minting, outputToken is ETH2X which is the default: https://github.com/IndexCoop/flash-mint-sdk/pull/48/files#diff-63922e4c38d75ebb21208c533ae7d4a5bb2b0fd0c1bba0f80bb9ecc1a3d37a45R226. I was lazy with the request function 😅

symbol: IndexCoopBitcoin3xIndex.symbol,
}

describe.skip('BTC3X (Arbitrum)', () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

looking to keep this test suite skipped?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes for now. As mentioned might have to skip the whole arbitrum tests suite to release the SDK due to the bug causing failed tx's.

@@ -50,7 +50,7 @@ describe('ZeroExApi', () => {
const chainId = 137
const query = new URLSearchParams({
buyAmount: ONE,
buyToken: DPI,
buyToken: '0x1494CA1F11D487c2bBe4543E90080AeBa4BA3C2b',
Copy link
Collaborator

Choose a reason for hiding this comment

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

just curious - why remove constant for the raw literal here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Once again being lazy. I first deleted to replace everything with USDC, until I noticed I don't need USDC in every test. Readded.

@janndriessen janndriessen marked this pull request as ready for review May 13, 2024 13:02
@janndriessen janndriessen merged commit 5eb480e into main May 14, 2024
1 check passed
@janndriessen janndriessen deleted the feat/add-leverage-extended branch May 14, 2024 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants