deploy_uniswap_v2_like

Documentation for eth_defi.uniswap_v2.deployment.deploy_uniswap_v2_like function.

deploy_uniswap_v2_like(web3, deployer, give_weth=10000, init_code_hash=None)[source]

Deploy v2=

See this StackOverflow question for commentary.

Example:

deployment = deploy_uniswap_v2_like(web3, deployer)
factory = deployment.factory
print(f"Uniswap factory is {factory.address}")
Parameters
  • web3 (web3.main.Web3) – Web3 instance

  • deployer (str) – Deployer account

  • init_code_hash – The factory code hash needed to derive pair addresses. If None use Sushiswap default.

  • give_weth – Automatically give some Wrapped ETH to the deployer. Express as ETH units.

Returns

Deployment details

Return type

eth_defi.uniswap_v2.deployment.UniswapV2Deployment