Last updated 8 months ago
The Factory smart contract oversees the full functionality of V2 token pair registration and transactions in Fizzswap.
Github Link: (Will be updated after official launch)
Silicon Mainnet :
event ChangeNextOwner(address nextOwner);
Event to pre-register new owner
owner will be governance smart contract (In Intial period before KSP distributed, DEV team have owner permission)
event ChangeOwner(address owner);
Event that completes changing the owner
Governance Contract Address
The next Governance Contract Address set in advance.
List of liquidity pool pairings
Each item saves the smart contract address of the liquidity pool
Returns if the contract for the given liquidity pool pair exists
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]
function getPoolCount() public view returns (uint256)
Returns the current number of registered liquidity pools.
function getPoolAddress(uint256 idx) public view returns (address)
Returns the liquidity pair contract address of the pair's index.
function changeNextOwner(address _nextOwner) public
Method to set the next Owner in advance before changing Owner
only owner
function changeOwner() public
Method for the next Owner to change the actual Owner
only nextOwner
function createETHPool(address token, uint256 amount, uint256 fee) public payable
A 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 liquidity
token
amount : the amount of tokens (ERC20) to be provided for the initial liquidity
amount
fee : Sets the initial fee value for liquidity pairs
fee
A value between 0 and 100
Meaning: 0 -> 0%, 100 -> 1%
msg.value : ETH quantity to initially supply liquidity
msg.value
Delivers the transaction value without specifying otherwise
function createTokenPool(address token0, uint256 amount0, address token1, uint256 amount1, uint256 fee) public
Method called to add liquidity pair in case of ERC20 token pair
parameter
token0 : The address of the first token
token0
amount0 : The quantity of the first token that supplies the initial liquidity
amount0
token1 : The address of the second token
token1
amount1 : The quantity of the second token that supplies the initial liquidity
amount1