I'm trying to deploy UniswapV2router02 on my local ganache blockchain using truffle. I've written a migration but when I try to deploy using solc 0.6.6 it throws "UniswapV2Router02" -- Invalid number of parameters for "undefined". Got 0 expected 2!.
Does anybody know where I can find these parameters? I'm guessing they are constructors but I'm not sure what arguments they take
Jun 11, 2020, 2:12 PM
Etherscan names these 2 constructor arguments, but they are written in ABI so I'm not sure how to translate that to my migrations file
Jun 11, 2020, 2:13 PM
You can see them in the source code:
constructor(address _factory, address _WETH) public {
factory = _factory;
WETH = _WETH;
}
constructor(address _factory, address _WETH) public {
factory = _factory;
WETH = _WETH;
}
Jun 11, 2020, 2:52 PM
Ah I see
So in order to get the UniswapV2router02 contract to work I need to also have a factory contract and a WETH contract deployed right?
Jun 11, 2020, 2:54 PM
yes
Jun 11, 2020, 2:54 PM
So much work :p I guess I'll just see if I can interact with the existing contracts on ropsten
Jun 11, 2020, 2:54 PM
yeah testnets will be much much easier
Jun 11, 2020, 2:54 PM
Does truffle really add much if I'm trying to interact with existing contracts on Ropsten?
Or is web3 just as easy in this case?
I guess truffle is still an easy way to create all the JSON contract interfaces right?
Jun 11, 2020, 2:59 PM
yeah truffle does a lot of things for you (build pipelines, migrations, network configs, automated tests), ...and it uses web3 internally anyhow
Jun 11, 2020, 3:22 PM