As I discovered, there is a problem in INIT_CODE_HASH value. Here is another way, but not perfect, as I thought:
1. Find IUniswapV2Pair.json on the artifacts folder
2. Find the bytecode on the file
3. Copy it on Keccak 256 Online 18 (Don't forget to change the input type to "hex" and delete the "0x" at the start)
4. Hash it and copy the hash in the pairFor function
Jun 27, 2022, 6:48 PM
you could generate the init code hash on factory contract so it can be queried, so u dont need to hardcode the init code hash but for that u would need to change the code and im not sure if you want to do that
Jun 27, 2022, 6:51 PM
Yeah, but generating it does not help
There are 2 variants:
1) changing createPair function from @uniswap/v2-core
2) Hardcoding INIT_CODE_HASH
1) changing createPair function from @uniswap/v2-core
2) Hardcoding INIT_CODE_HASH
I think, it could be some better solutions
router.connect(owner).addLiquidity ...
I get this error
I get this error
I thought bout logging non-contract account in the error
Just made changes into Pair, almost same(added treasury address), yeah
Jun 27, 2022, 7:19 PM