-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c7c3ecb
commit adda212
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
}) | ||
}) |