Post Auction Launcher
Post Auction Launcher as name says, is a contract for creation and migration of liquidity pools to Sushiswap exchange. To launch the Liquidity Pool we deposit the auction token and payment token and call finalize function.

Address

Launch a liquidity pool

1
function depositETH() public payable
Copied!
Deposits WETH to the contract to build a pair with a token for launching a pool.
1
function depositToken1(uint256 _amount) external
Copied!
Deposit token 1 where, token 1 is the payment currency through which we buy the auctioned token. Typically ETH otherwise, any existing ERC20 Token that is used as Payment Currency for the market
1
function depositToken2(uint256 _amount) external
Copied!
Deposit token 2 where, token 2 is the auction token that is to be auctioned.
1
function finalize() external nonReentrant returns (uint256 liquidity)
Copied!
Launches a liquidity pool. First it checks whether a market has been finalized, if not finalized it finalizes the market! Once called, it launches token1/token2 paired liquidity pool.It intializes the period till which we want the LP tokens to be locked in the contract

Withdraw functions

1
function withdrawDeposits() external
Copied!
After the liquidity has been launched, there can be remaining token1 and token2 balance in the contract. This function withdraws the remaining balance to the respective wallet
1
function withdrawLPTokens() external returns (uint256 liquidity)
Copied!
All the lp tokens from liquidity pool is transferred to the wallet by the account having operator role after the lock period

Init Function

1
function initAuctionLauncher(
2
address _market,
3
address _factneedsory,
4
address _admin,
5
address _wallet,
6
uint256 _liquidityPercent,
7
uint256 _locktime
8
)
9
public
Copied!
Name
Description
_market
Address of the market for which we want to have post auction launcher
_factory
Uniswap V2 factory
_admin
Address with admin priviledges
_wallet
The address that gets the remaining fund and LP tokens after locktime
_liquidityPercent
Percent of initial auction token liquidity you want to launch.
_locktime
Period that we want to lock the liquidity pool before withdrawing

Read Only Functions

1
function getTokenAmounts() public view returns (uint256 token1Amount, uint256 token2Amount)
Copied!
Returns balanced amounts of token1 and token2 to be launched. It performs calculations so that, the relationship between both the token is normal and not skewed.
1
function getLPBalance() public view returns (uint256)
Copied!
Returns amount of LP token generated and locked in the contract
1
function getLPTokenAddress() public view returns (address)
Copied!
Returns token1 token2 paired LP token
Last modified 5mo ago