Hardhat testing contracts with swaps

Hello.
Someone can share some example of hardhat testing contracts with swaps on dexes like pcs?

Glad to see something with creating LP and swaps from two or more wallets.
But at least good to see any swap transaction with dex example with two different wallets.
Thanks for any help.

Actually, hardhat integrates the ethers.js, if you want to use different addresses to call a function, you can write like this:

ERC20.connect(Signer1).mint(to, amount);
ERC20.connect(Signer2).mint(to, amount);

For more details, maybe you can have a look at the documentation of the Ethers.js

1 Like

Maybe you can select a framework at first, and then check the documentation of it.
OpenZeppelin also has some test case, you can have a look.

Emmmm, I think you can look through other people's code and try to write the code by yourself and then try to update again and again, then you will get the good wrote code

yeah, its basic way bro
i want to make it faster, this is why i ask about it here.