Skip to content

Commit

Permalink
refactor: remove icreth
Browse files Browse the repository at this point in the history
  • Loading branch information
janndriessen committed Jul 23, 2024
1 parent f2c7e56 commit 7b9ddc6
Show file tree
Hide file tree
Showing 13 changed files with 3 additions and 547 deletions.
1 change: 0 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ jobs:
# - run: npm run test:eth2x
# - run: npm run test:gtceth
# - run: npm run test:iceth
# - run: npm run test:icreth
# run last - as it alters the block number
# skip as it can't be minted or redeemed with 0x
# - run: npm run test:eth2xfli
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"test:gtceth": "npm test src/tests/gtceth",
"test:hyeth": "npm test src/tests/hyeth.test.ts",
"test:iceth": "npm test src/tests/iceth",
"test:icreth": "npm test src/tests/icreth",
"test:watch": "jest --watch"
},
"keywords": [
Expand Down
5 changes: 0 additions & 5 deletions src/constants/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,6 @@ export const InterestCompoundingETHIndex: Token = {
address: '0x7C07F7aBe10CE8e33DC6C5aD68FE033085256A84',
}

export const LeveragedrEthStakingYield: Token = {
symbol: 'icRETH',
address: '0xcCdAE12162566E3f29fEfA7Bf7F5b24C644493b5',
}

export const MetaverseIndex: Token = {
address: '0x72e364F2ABdC788b7E918bc238B21f109Cd634D7',
addressPolygon: '0xfe712251173A2cd5F5bE2B46Bb528328EA3565E1',
Expand Down
39 changes: 2 additions & 37 deletions src/flashmint/builders/leveraged.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { BigNumber } from '@ethersproject/bignumber'

import {
ExchangeIssuanceLeveragedMainnetAddress,
FlashMintLeveragedAddress,
} from 'constants/contracts'
import { ExchangeIssuanceLeveragedMainnetAddress } from 'constants/contracts'
import {
collateralDebtSwapData,
debtCollateralSwapData,
Expand All @@ -26,7 +23,7 @@ const chainId = 1
const provider = LocalhostProvider
const rpcUrl = LocalhostProviderUrl

const { iceth, icreth, reth, usdc } = QuoteTokens
const { iceth, usdc } = QuoteTokens

const eth = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'
const indexToken = iceth
Expand Down Expand Up @@ -175,38 +172,6 @@ describe('LeveragedTransactionBuilder()', () => {
expect(tx.value).toEqual(buildRequest.inputOutputTokenAmount)
})

test('returns a tx for minting icRETH (rETH)', async () => {
const isMinting = true
const buildRequest = {
isMinting,
indexToken: icreth.address,
indexTokenSymbol: icreth.symbol,
inputOutputToken: reth.address,
inputOutputTokenSymbol: reth.symbol,
indexTokenAmount: wei(1),
inputOutputTokenAmount: BigNumber.from(194235680),
swapDataDebtCollateral: isMinting
? collateralDebtSwapData['icETH']
: debtCollateralSwapData['icETH'],
swapDataPaymentToken: isMinting
? inputSwapData[indexToken.symbol]['ETH']
: outputSwapData[indexToken.symbol]['ETH'],
}
const refTx = await contract.populateTransaction.issueExactSetFromERC20(
buildRequest.indexToken,
buildRequest.indexTokenAmount,
buildRequest.inputOutputToken,
buildRequest.inputOutputTokenAmount,
buildRequest.swapDataDebtCollateral,
buildRequest.swapDataPaymentToken
)
const builder = new LeveragedTransactionBuilder(rpcUrl)
const tx = await builder.build(buildRequest)
if (!tx) fail()
expect(tx.to).toBe(FlashMintLeveragedAddress)
expect(tx.data).toEqual(refTx.data)
})

test('returns a tx for redeeming dsETH (ERC20)', async () => {
const buildRequest = createBuildRequest(false)
const refTx = await contract.populateTransaction.redeemExactSetForERC20(
Expand Down
9 changes: 0 additions & 9 deletions src/quote/provider/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
IndexCoopInverseBitcoinIndex,
IndexCoopInverseEthereumIndex,
InterestCompoundingETHIndex,
LeveragedrEthStakingYield,
MetaverseIndex,
} from 'constants/tokens'

Expand Down Expand Up @@ -136,12 +135,4 @@ describe('getContractType()', () => {
)
expect(contractType).toBe(FlashMintContractType.leveraged)
})

test('returns correct contract type for icRETH', async () => {
const contractType = getContractType(
LeveragedrEthStakingYield.symbol,
ChainId.Mainnet
)
expect(contractType).toBe(FlashMintContractType.leveraged)
})
})
4 changes: 1 addition & 3 deletions src/quote/provider/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
IndexCoopInverseBitcoinIndex,
IndexCoopInverseEthereumIndex,
InterestCompoundingETHIndex,
LeveragedrEthStakingYield,
MetaverseIndex,
RealWorldAssetIndex,
} from 'constants/tokens'
Expand Down Expand Up @@ -56,8 +55,7 @@ export function getContractType(
token === ETH2xFlexibleLeverageIndex.symbol ||
token === IndexCoopBitcoin2xIndex.symbol ||
token === IndexCoopEthereum2xIndex.symbol ||
token === InterestCompoundingETHIndex.symbol ||
token === LeveragedrEthStakingYield.symbol
token === InterestCompoundingETHIndex.symbol
)
return FlashMintContractType.leveraged
return null
Expand Down
152 changes: 0 additions & 152 deletions src/tests/icreth/index.test.ts

This file was deleted.

Loading

0 comments on commit 7b9ddc6

Please sign in to comment.