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

chore: disable swap minting #1740

Merged
merged 27 commits into from
Jan 23, 2025
Merged

chore: disable swap minting #1740

merged 27 commits into from
Jan 23, 2025

Conversation

janndriessen
Copy link
Collaborator

Summary of Changes

Test Data or Screenshots

By submitting this pull request, you are confirming the following to be true:
  • I have reviewed the Contribution Guidelines.
  • I have performed a self-review of my own code.
  • I have updated my repository to match the master at IndexCoop/index-app.
  • I have included test data or screenshots that prove my fix is effective or that my feature works.

Copy link

vercel bot commented Jan 17, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
index-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 22, 2025 2:06pm

@janndriessen janndriessen marked this pull request as ready for review January 21, 2025 15:54
image: string
chainId?: number
logoURI?: string
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Adding a new type to decouple from Token type from constants/token. Will follow up with a PR to refactor quite a bit around Token.

@@ -4,6 +4,8 @@ export const buildEarnTradePath = (
network: number | string = 1,
) => `/earn?buy=${buySymbol}&sell=${sellSymbol}&network=${network}`

export const buildLegacyPath = () => `/legacy`
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No routing available, so we just link to legacy.

expect(resolvedPath.outputToken.symbol).toBe(indicesTokenList[0].symbol)
expect(resolvedPath.isMinting).toBe(false)
expect(resolvedPath.inputToken.symbol).toBe(indicesTokenList[0].symbol)
expect(resolvedPath.outputToken.symbol).toBe('ETH')
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

A lot of these tests had to be changed to make sure that those pairs are now only redeemable.

@@ -26,6 +26,9 @@ import {
Matic2xFlexibleLeverageIndexPolygon,
} from './polygon'

const GitcoinStakedETHIndex = getTokenByChainAndSymbol(1, 'gtcETH')
const ic21 = getTokenByChainAndSymbol(1, 'ic21')
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Adding directly from tokenlists. Removing lots of obsolete references/assets throughout the app.

onClick={props.onClickBuy}
>
Buy
</div>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No longer needed here. So removed othe relevant code as well.

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.

few smol questions, LGTM though 👍

Comment on lines +27 to +29
const DebtIssuanceModuleAddress = '0x39F024d621367C044BacE2bf0Fb15Fb3612eCB92'
const DebtIssuanceModuleV2PolygonAddress =
'0xf2dC2f456b98Af9A6bEEa072AF152a7b0EaA40C9'
Copy link
Collaborator

Choose a reason for hiding this comment

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

curious- why define these here as opposed to flash mint sdk? if we need to define them in this codebase, thoughts on putting them in some sort of config?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

They are removed in the SDK as we actually don't really use them any longer - expect for deprecated products. So I would say here it's fine? and then we can completely remove once those products are removed from legacy?

Copy link
Collaborator

Choose a reason for hiding this comment

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

sounds good to me , thanks for the context 👍

Comment on lines +91 to +96
if (outputTokenIsIndex) {
return {
isMinting: false,
inputToken: outputToken,
outputToken: this.getCurrency(outputToken, inputToken),
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

i'm not very familiar with this code- why specify the outputToken as the inputToken here on line 94?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This will be just INDEX in that case could have used that directly too. Basically all this is rewritten a bit just to satisfy the requirement of not all tokens being mintable any longer.

Copy link
Collaborator

@tokdaniel tokdaniel left a comment

Choose a reason for hiding this comment

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

lgtm. I wish we could somehow do all these token defs in the list somehow, but maybe its not worth it, or is that what the followup is about?

@janndriessen
Copy link
Collaborator Author

lgtm. I wish we could somehow do all these token defs in the list somehow, but maybe its not worth it, or is that what the followup is about?

yes sir - at least parts of it: https://github.com/IndexCoop/index-app/pull/1743/files#diff-bf292afa3363dfdc97bd117db8d3a9af6c8686a1e49e9812cbcd3c36345248abL3

* remove bed index token constant

* refactor legacy config

* remove obsolete issuance quote fetch

* refactor icreth use

* remove obsolete assets

* refactor get address for token
@janndriessen janndriessen merged commit ed88205 into master Jan 23, 2025
3 checks passed
@janndriessen janndriessen deleted the task/disable-swap-minting branch January 23, 2025 17:17
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