@@ -36,11 +36,9 @@ makeSuite('ParaSwap adapters', (testEnv: TestEnv) => {
36
36
let evmSnapshotId : string ;
37
37
38
38
before ( async ( ) => {
39
- const { addressesProvider, deployer, faucetMintable } = testEnv ;
39
+ const { addressesProvider, deployer } = testEnv ;
40
40
41
- mockAugustus = await new MockParaSwapAugustus__factory ( await getFirstSigner ( ) ) . deploy (
42
- faucetMintable . address
43
- ) ;
41
+ mockAugustus = await new MockParaSwapAugustus__factory ( await getFirstSigner ( ) ) . deploy ( ) ;
44
42
mockAugustusRegistry = await new MockParaSwapAugustusRegistry__factory (
45
43
await getFirstSigner ( )
46
44
) . deploy ( mockAugustus . address ) ;
@@ -95,20 +93,20 @@ makeSuite('ParaSwap adapters', (testEnv: TestEnv) => {
95
93
96
94
describe ( 'executeOperation' , ( ) => {
97
95
beforeEach ( async ( ) => {
98
- const { users, weth, dai, pool, deployer, faucetMintable } = testEnv ;
96
+ const { users, weth, dai, pool, deployer } = testEnv ;
99
97
const userAddress = users [ 0 ] . address ;
100
98
101
99
// Provide liquidity
102
- await faucetMintable . mint ( dai . address , deployer . address , parseEther ( '20000' ) ) ;
100
+ await dai [ ' mint(uint256)' ] ( parseEther ( '20000' ) ) ;
103
101
await dai . approve ( pool . address , parseEther ( '20000' ) ) ;
104
102
await pool . deposit ( dai . address , parseEther ( '20000' ) , deployer . address , 0 ) ;
105
103
106
- await faucetMintable . mint ( weth . address , deployer . address , parseEther ( '10000' ) ) ;
104
+ await weth [ ' mint(uint256)' ] ( parseEther ( '10000' ) ) ;
107
105
await weth . approve ( pool . address , parseEther ( '10000' ) ) ;
108
106
await pool . deposit ( weth . address , parseEther ( '10000' ) , deployer . address , 0 ) ;
109
107
110
108
// Make a deposit for user
111
- await faucetMintable . mint ( weth . address , deployer . address , parseEther ( '100' ) ) ;
109
+ await weth [ ' mint(uint256)' ] ( parseEther ( '100' ) ) ;
112
110
await weth . approve ( pool . address , parseEther ( '100' ) ) ;
113
111
await pool . deposit ( weth . address , parseEther ( '100' ) , userAddress , 0 ) ;
114
112
} ) ;
@@ -339,7 +337,7 @@ makeSuite('ParaSwap adapters', (testEnv: TestEnv) => {
339
337
} ) ;
340
338
341
339
it ( 'should work correctly with tokens of different decimals' , async ( ) => {
342
- const { users, usdc, oracle, dai, aDai, pool, deployer, faucetMintable } = testEnv ;
340
+ const { users, usdc, oracle, dai, aDai, pool, deployer } = testEnv ;
343
341
const user = users [ 0 ] . signer ;
344
342
const userAddress = users [ 0 ] . address ;
345
343
@@ -350,12 +348,12 @@ makeSuite('ParaSwap adapters', (testEnv: TestEnv) => {
350
348
const flashloanTotal = amountUSDCtoSwap . add ( flashloanPremium ) ;
351
349
352
350
// Provider liquidity
353
- await faucetMintable . mint ( usdc . address , deployer . address , liquidity ) ;
351
+ await usdc [ ' mint(uint256)' ] ( liquidity ) ;
354
352
await usdc . approve ( pool . address , liquidity ) ;
355
353
await pool . deposit ( usdc . address , liquidity , deployer . address , 0 ) ;
356
354
357
355
// Make a deposit for user
358
- await faucetMintable . mint ( usdc . address , userAddress , flashloanTotal ) ;
356
+ await usdc . connect ( user ) [ ' mint(uint256)' ] ( flashloanTotal ) ;
359
357
await usdc . connect ( user ) . approve ( pool . address , flashloanTotal ) ;
360
358
await pool . connect ( user ) . deposit ( usdc . address , flashloanTotal , userAddress , 0 ) ;
361
359
@@ -509,7 +507,7 @@ makeSuite('ParaSwap adapters', (testEnv: TestEnv) => {
509
507
} ) ;
510
508
511
509
it ( 'should revert when min amount to receive exceeds the max slippage amount (with tokens of different decimals)' , async ( ) => {
512
- const { users, usdc, oracle, dai, pool, deployer, faucetMintable } = testEnv ;
510
+ const { users, usdc, oracle, dai, pool, deployer } = testEnv ;
513
511
const user = users [ 0 ] . signer ;
514
512
const userAddress = users [ 0 ] . address ;
515
513
@@ -520,12 +518,12 @@ makeSuite('ParaSwap adapters', (testEnv: TestEnv) => {
520
518
const flashloanTotal = amountUSDCtoSwap . add ( flashloanPremium ) ;
521
519
522
520
// Provider liquidity
523
- await faucetMintable . mint ( usdc . address , deployer . address , liquidity ) ;
521
+ await usdc [ ' mint(uint256)' ] ( liquidity ) ;
524
522
await usdc . approve ( pool . address , liquidity ) ;
525
523
await pool . deposit ( usdc . address , liquidity , deployer . address , 0 ) ;
526
524
527
525
// Make a deposit for user
528
- await faucetMintable . mint ( usdc . address , userAddress , flashloanTotal ) ;
526
+ await usdc . connect ( user ) [ ' mint(uint256)' ] ( flashloanTotal ) ;
529
527
await usdc . connect ( user ) . approve ( pool . address , flashloanTotal ) ;
530
528
await pool . connect ( user ) . deposit ( usdc . address , flashloanTotal , userAddress , 0 ) ;
531
529
@@ -915,16 +913,16 @@ makeSuite('ParaSwap adapters', (testEnv: TestEnv) => {
915
913
} ) ;
916
914
917
915
it ( 'should not touch any token balance already in the adapter' , async ( ) => {
918
- const { users, weth, oracle, dai, aDai, aWETH, pool, faucetMintable , deployer } = testEnv ;
916
+ const { users, weth, oracle, dai, aDai, aWETH, pool } = testEnv ;
919
917
const user = users [ 0 ] . signer ;
920
918
const userAddress = users [ 0 ] . address ;
921
919
922
920
// Put token balances in the adapter
923
921
const adapterWethBalanceBefore = parseEther ( '123' ) ;
924
- await faucetMintable . mint ( weth . address , deployer . address , adapterWethBalanceBefore ) ;
922
+ await weth [ ' mint(uint256)' ] ( adapterWethBalanceBefore ) ;
925
923
await weth . transfer ( paraswapLiquiditySwapAdapter . address , adapterWethBalanceBefore ) ;
926
924
const adapterDaiBalanceBefore = parseEther ( '234' ) ;
927
- await faucetMintable . mint ( dai . address , deployer . address , adapterDaiBalanceBefore ) ;
925
+ await dai [ ' mint(uint256)' ] ( adapterDaiBalanceBefore ) ;
928
926
await dai . transfer ( paraswapLiquiditySwapAdapter . address , adapterDaiBalanceBefore ) ;
929
927
930
928
const amountWETHtoSwap = await parseUnitsFromToken ( weth . address , '10' ) ;
@@ -1000,28 +998,28 @@ makeSuite('ParaSwap adapters', (testEnv: TestEnv) => {
1000
998
1001
999
describe ( 'executeOperation with borrowing' , ( ) => {
1002
1000
beforeEach ( async ( ) => {
1003
- const { users, weth, dai, pool, deployer, faucetMintable } = testEnv ;
1001
+ const { users, weth, dai, pool, deployer } = testEnv ;
1004
1002
const userAddress = users [ 0 ] . address ;
1005
1003
const borrower = users [ 1 ] . signer ;
1006
1004
const borrowerAddress = users [ 1 ] . address ;
1007
1005
1008
1006
// Provide liquidity
1009
- await faucetMintable . mint ( dai . address , deployer . address , parseEther ( '20000' ) ) ;
1007
+ await dai [ ' mint(uint256)' ] ( parseEther ( '20000' ) ) ;
1010
1008
await dai . approve ( pool . address , parseEther ( '20000' ) ) ;
1011
1009
await pool . deposit ( dai . address , parseEther ( '20000' ) , deployer . address , 0 ) ;
1012
1010
1013
- await faucetMintable . mint ( weth . address , deployer . address , parseEther ( '10000' ) ) ;
1011
+ await weth [ ' mint(uint256)' ] ( parseEther ( '10000' ) ) ;
1014
1012
await weth . approve ( pool . address , parseEther ( '10000' ) ) ;
1015
1013
await pool . deposit ( weth . address , parseEther ( '10000' ) , deployer . address , 0 ) ;
1016
1014
1017
1015
// Make a deposit for user
1018
- await faucetMintable . mint ( weth . address , deployer . address , parseEther ( '100' ) ) ;
1016
+ await weth [ ' mint(uint256)' ] ( parseEther ( '100' ) ) ;
1019
1017
await weth . approve ( pool . address , parseEther ( '100' ) ) ;
1020
1018
await pool . deposit ( weth . address , parseEther ( '100' ) , userAddress , 0 ) ;
1021
1019
1022
1020
// Add borrowing
1023
1021
const collateralAmount = parseEther ( '30000000' ) ;
1024
- await faucetMintable . mint ( dai . address , deployer . address , collateralAmount ) ;
1022
+ await dai [ ' mint(uint256)' ] ( collateralAmount ) ;
1025
1023
await dai . approve ( pool . address , collateralAmount ) ;
1026
1024
await pool . deposit ( dai . address , collateralAmount , borrowerAddress , 0 ) ;
1027
1025
await pool
@@ -1382,20 +1380,20 @@ makeSuite('ParaSwap adapters', (testEnv: TestEnv) => {
1382
1380
1383
1381
describe ( 'swapAndDeposit' , ( ) => {
1384
1382
beforeEach ( async ( ) => {
1385
- const { users, weth, dai, pool, deployer, faucetMintable } = testEnv ;
1383
+ const { users, weth, dai, pool, deployer } = testEnv ;
1386
1384
const userAddress = users [ 0 ] . address ;
1387
1385
1388
1386
// Provide liquidity
1389
- await faucetMintable . mint ( dai . address , deployer . address , parseEther ( '20000' ) ) ;
1387
+ await dai [ ' mint(uint256)' ] ( parseEther ( '20000' ) ) ;
1390
1388
await dai . approve ( pool . address , parseEther ( '20000' ) ) ;
1391
1389
await pool . deposit ( dai . address , parseEther ( '20000' ) , deployer . address , 0 ) ;
1392
1390
1393
- await faucetMintable . mint ( weth . address , deployer . address , parseEther ( '10000' ) ) ;
1391
+ await weth [ ' mint(uint256)' ] ( parseEther ( '10000' ) ) ;
1394
1392
await weth . approve ( pool . address , parseEther ( '10000' ) ) ;
1395
1393
await pool . deposit ( weth . address , parseEther ( '10000' ) , deployer . address , 0 ) ;
1396
1394
1397
1395
// Make a deposit for user
1398
- await faucetMintable . mint ( weth . address , deployer . address , parseEther ( '100' ) ) ;
1396
+ await weth [ ' mint(uint256)' ] ( parseEther ( '100' ) ) ;
1399
1397
await weth . approve ( pool . address , parseEther ( '100' ) ) ;
1400
1398
await pool . deposit ( weth . address , parseEther ( '100' ) , userAddress , 0 ) ;
1401
1399
} ) ;
@@ -2202,16 +2200,16 @@ makeSuite('ParaSwap adapters', (testEnv: TestEnv) => {
2202
2200
} ) ;
2203
2201
2204
2202
it ( 'should not touch any token balance already in the adapter' , async ( ) => {
2205
- const { users, weth, oracle, dai, aDai, aWETH, deployer , faucetMintable } = testEnv ;
2203
+ const { users, weth, oracle, dai, aDai, aWETH } = testEnv ;
2206
2204
const user = users [ 0 ] . signer ;
2207
2205
const userAddress = users [ 0 ] . address ;
2208
2206
2209
2207
// Put token balances in the adapter
2210
2208
const adapterWethBalanceBefore = parseEther ( '123' ) ;
2211
- await faucetMintable . mint ( weth . address , deployer . address , adapterWethBalanceBefore ) ;
2209
+ await weth [ ' mint(uint256)' ] ( adapterWethBalanceBefore ) ;
2212
2210
await weth . transfer ( paraswapLiquiditySwapAdapter . address , adapterWethBalanceBefore ) ;
2213
2211
const adapterDaiBalanceBefore = parseEther ( '234' ) ;
2214
- await faucetMintable . mint ( dai . address , deployer . address , adapterDaiBalanceBefore ) ;
2212
+ await dai [ ' mint(uint256)' ] ( adapterDaiBalanceBefore ) ;
2215
2213
await dai . transfer ( paraswapLiquiditySwapAdapter . address , adapterDaiBalanceBefore ) ;
2216
2214
2217
2215
const amountWETHtoSwap = await parseUnitsFromToken ( weth . address , '10' ) ;
@@ -2282,28 +2280,28 @@ makeSuite('ParaSwap adapters', (testEnv: TestEnv) => {
2282
2280
2283
2281
describe ( 'swapAndDeposit with borrowing' , ( ) => {
2284
2282
beforeEach ( async ( ) => {
2285
- const { users, weth, dai, pool, deployer, faucetMintable } = testEnv ;
2283
+ const { users, weth, dai, pool, deployer } = testEnv ;
2286
2284
const userAddress = users [ 0 ] . address ;
2287
2285
const borrower = users [ 1 ] . signer ;
2288
2286
const borrowerAddress = users [ 1 ] . address ;
2289
2287
2290
2288
// Provide liquidity
2291
- await faucetMintable . mint ( dai . address , deployer . address , parseEther ( '20000' ) ) ;
2289
+ await dai [ ' mint(uint256)' ] ( parseEther ( '20000' ) ) ;
2292
2290
await dai . approve ( pool . address , parseEther ( '20000' ) ) ;
2293
2291
await pool . deposit ( dai . address , parseEther ( '20000' ) , deployer . address , 0 ) ;
2294
2292
2295
- await faucetMintable . mint ( weth . address , deployer . address , parseEther ( '10000' ) ) ;
2293
+ await weth [ ' mint(uint256)' ] ( parseEther ( '10000' ) ) ;
2296
2294
await weth . approve ( pool . address , parseEther ( '10000' ) ) ;
2297
2295
await pool . deposit ( weth . address , parseEther ( '10000' ) , deployer . address , 0 ) ;
2298
2296
2299
2297
// Make a deposit for user
2300
- await faucetMintable . mint ( weth . address , deployer . address , parseEther ( '100' ) ) ;
2298
+ await weth [ ' mint(uint256)' ] ( parseEther ( '100' ) ) ;
2301
2299
await weth . approve ( pool . address , parseEther ( '100' ) ) ;
2302
2300
await pool . deposit ( weth . address , parseEther ( '100' ) , userAddress , 0 ) ;
2303
2301
2304
2302
// Add borrowing
2305
2303
const collateralAmount = parseEther ( '30000000' ) ;
2306
- await faucetMintable . mint ( dai . address , deployer . address , collateralAmount ) ;
2304
+ await dai [ ' mint(uint256)' ] ( collateralAmount ) ;
2307
2305
await dai . approve ( pool . address , collateralAmount ) ;
2308
2306
await pool . deposit ( dai . address , collateralAmount , borrowerAddress , 0 ) ;
2309
2307
await pool
0 commit comments