-
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
86c90e5
commit 9eb44e0
Showing
6 changed files
with
72 additions
and
1 deletion.
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
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
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,61 @@ | ||
import { | ||
getMainnetTestFactory, | ||
QuoteTokens, | ||
SignerAccount4, | ||
TestFactory, | ||
transferFromWhale, | ||
wei, | ||
wrapETH, | ||
} from './utils' | ||
|
||
const { eth, ic21, usdc, weth } = QuoteTokens | ||
|
||
describe('ic21 (mainnet)', () => { | ||
const signer = SignerAccount4 | ||
let factory: TestFactory | ||
beforeEach(async () => { | ||
factory = getMainnetTestFactory(signer) | ||
}) | ||
|
||
test('can mint with ETH', async () => { | ||
await factory.fetchQuote({ | ||
isMinting: true, | ||
inputToken: eth, | ||
outputToken: ic21, | ||
indexTokenAmount: wei('1'), | ||
slippage: 0.5, | ||
}) | ||
await factory.executeTx() | ||
}) | ||
|
||
test('can mint with USDC', async () => { | ||
const quote = await factory.fetchQuote({ | ||
isMinting: true, | ||
inputToken: usdc, | ||
outputToken: ic21, | ||
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 mint with WETH', async () => { | ||
const quote = await factory.fetchQuote({ | ||
isMinting: true, | ||
inputToken: weth, | ||
outputToken: ic21, | ||
indexTokenAmount: wei('1'), | ||
slippage: 0.5, | ||
}) | ||
await wrapETH(quote.inputOutputAmount, factory.getSigner()) | ||
await factory.executeTx() | ||
}) | ||
}) |
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
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
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