Hello, someone can share example of test with hardhat for forked mainnet?
I’m trying to understood how to connect to existing contracts of routers and makes swaps.

Dec 9, 2021, 1:11 PM
I can share that file
Wait few minutes
Dec 9, 2021, 2:42 PM
👍
So no one here, who knows how to write tests with hardhat in forked mainnet with connection to existing DEX’s contracts?
If its bad question, tell me how you test tokens contract with DEX’s transactions? Manualy in testnets…?
Dec 9, 2021, 4:33 PM
the answer is ib the quesion
just fork the mainnet
Dec 9, 2021, 4:34 PM
yeap, do you have example of testing any contract with dex like that?
im trying to do it first time and have some problem with connecting to existing contracts, i download contracts abi and then put it with contract address,
(new ethers.Contract(address, abi)
but… then… beforeEach something…? idk 🙂
Dec 9, 2021, 4:37 PM
so the question is how to interact with a deployed contract
Dec 9, 2021, 4:39 PM
Yeah, but it will be very nice if you can show me the full picture of how to write tests for forked mainnet in the right way…
This is why i asked for some example…
imports
declare contracts
beforeEach
deploy
it(‘’)
something like that… ?
Dec 9, 2021, 4:43 PM
Bruh I am just coming from your Github repo 😄


Good stuffs you have there
Dec 9, 2021, 4:45 PM
Nice👍
I haven't seen yet 😑
What is your GitHub profile link
Dec 9, 2021, 4:46 PM
Hey
Which dex
Are you forking
Dec 9, 2021, 4:50 PM
don't have an example for mainnet forking but if you look at examples for testing in general you will understand easily
than just do the same while using the forked chain
Dec 9, 2021, 4:52 PM

© 2024 Draquery.com All rights reserved.