relevant tag icon
UniswapV2Factory
copy icon
Uniswap-Labs
• version 1.0.0
ERC20
Token
DEX

UniswapV2Factory

Smart contract for the Uniswap V2 factory on the Ethereum blockchain. It implements the IUniswapV2Factory interface and creates new Uniswap V2 liquidity pool pairs, which are represented by UniswapV2Pair smart contracts. It keeps track of the Uniswap V2 liquidity pool pairs that have been created, and it allows for the creation of new pairs by mapping two ERC-20 tokens together.

*Visit desktop site to download or deploy

Version

1.0.0

Last Publish

1/13/2023
Any contract you deploy is yours.
Fully owned and controlled by your wallet.
Documentation
Source Code
allPairsLength() :
This function returns the length of the allPairs array. It does this by accessing the length property of the allPairs array and returning it as a uint. (autogenerated documentation)
createPair(address,address) :
This function creates a new UniswapV2Pair contract between two tokens, tokenA and tokenB. It first checks that the two tokens are not the same, and that the pair does not already exist. It then creates a new contract using the create2 function, passing in the bytecode of the UniswapV2Pair contract, a salt, and the two tokens. The new contract is then initialized with the two tokens, and the pair is added to the getPair mapping and the allPairs array. Finally, an event is emitted to signal that the pair has been created. (autogenerated documentation)
setFeeTo(address) :
This function allows the feeToSetter address to set the feeTo address. The feeTo address is the address that will receive the fees from the UniswapV2 contract. This function requires that the msg.sender is the feeToSetter address, and if it is, it sets the feeTo address to the address passed in as an argument. (autogenerated documentation)
setFeeToSetter(address) :
This function allows the feeToSetter address to set the feeToSetter address. This is done by requiring that the msg.sender is equal to the feeToSetter address, and then setting the feeToSetter address to the address passed in as an argument. (autogenerated documentation)

Get Cookin'
share iconShare

copy iconDownload Source
copy iconnpx cookbookdev i UniswapV2Factory
copy icon

Last Publish

1/13/2023

Version

1.0.0

Cookbook is free.
Any contract you deploy is yours.
Your contract is owned and controlled by you.