V2Factory
The Factory smart contract oversees the full functionality of V2 token pair registration and transactions in Fizzswap.
Code
Github Link: (Will be updated after official launch)
Address
Silicon Mainnet : 0xCB72354080A1d3B8A48425B889025d0799c52095
Events, Read-Only Functions, and State-Changing Functions
Read-Only Functions
owner
Governance Contract Address
nextOwner
The next Governance Contract Address set in advance.
pools
List of liquidity pool pairings
Each item saves the smart contract address of the liquidity pool
poolExist
Returns if the contract for the given liquidity pool pair exists
tokenToPool
The contract address corresponding to the tokenA, tokenB pair
When the addresses of tokenA and tokenB are inputted, this returns the contract address of the corresponding pairing
Returns the same contract address regardless of the order of the liquidity pool pairing tokens:
tokenToPool[tokenA][tokenB] == tokenToPool[tokenB][tokenA]
getPoolCount
function getPoolCount() public view returns (uint256)Returns the current number of registered liquidity pools.
getPoolAddress
function getPoolAddress(uint256 idx) public view returns (address)Returns the liquidity pair contract address of the pair's index.
State-Changing Functions
changeNextOwner
function changeNextOwner(address _nextOwner) publicMethod to set the next Owner in advance before changing Owner
only owner
changeOwner
function changeOwner() publicMethod for the next Owner to change the actual Owner
only nextOwner
createETHPool
function createETHPool(address token, uint256 amount, uint256 fee) public payableA method called to add a liquidity pair with one side as ETH
Token for when the ETH-ERC20 pair to be registered has never been registered before
Parameters
token: ERC20 token address to add liquidityamount: the amount of tokens (ERC20) to be provided for the initial liquidityfee: Sets the initial fee value for liquidity pairsA value between 0 and 100
Meaning: 0 -> 0%, 100 -> 1%
msg.value: ETH quantity to initially supply liquidityDelivers the transaction value without specifying otherwise
createTokenPool
function createTokenPool(address token0, uint256 amount0, address token1, uint256 amount1, uint256 fee) publicMethod called to add liquidity pair in case of ERC20 token pair
parameter
token0: The address of the first tokenamount0: The quantity of the first token that supplies the initial liquiditytoken1: The address of the second tokenamount1: The quantity of the second token that supplies the initial liquidityfee: Sets the initial fee value for liquidity pairs
Last updated