Skip to content

Commit

Permalink
test: prepare tests for icUSD
Browse files Browse the repository at this point in the history
  • Loading branch information
janndriessen committed Sep 30, 2024
1 parent c7c3ecb commit adda212
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions src/tests/icusd.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import {
getMainnetTestFactory,
QuoteTokens,
SignerAccount4,
TestFactory,
transferFromWhale,
wei,
} from './utils'

const { eth, icusd, usdc } = QuoteTokens

// TOOD: activate once FMWrapped contract is ready
describe.skip('icUSD (mainnet)', () => {
const indexToken = icusd
const signer = SignerAccount4
let factory: TestFactory
beforeEach(async () => {
factory = getMainnetTestFactory(signer)
})

test('can mint with USDC', async () => {
const quote = await factory.fetchQuote({
isMinting: true,
inputToken: usdc,
outputToken: indexToken,
indexTokenAmount: wei('1'),
slippage: 0.5,
})
const usdcWhale = '0x7713974908Be4BEd47172370115e8b1219F4A5f0'
await transferFromWhale(
usdcWhale,
factory.getSigner().address,
wei('100000', quote.inputToken.decimals),
quote.inputToken.address,
factory.getProvider()
)
await factory.executeTx()
})

test('can redeem to USDC', async () => {
await factory.fetchQuote({
isMinting: false,
inputToken: indexToken,
outputToken: eth,
indexTokenAmount: wei('1'),
slippage: 0.5,
})
await factory.executeTx()
})
})

0 comments on commit adda212

Please sign in to comment.