Factory
The Factory
contract contains functions to create, buy, sell and launch tokens. This is the main entrypoint of the protocol; creators and traders will mostly interact with this contract.
The user flow of the protocol is:
Creator calls
createToken()
to launch a new token.Traders call
buyTokens()
andsellTokens()
to trade the token.A sufficient amount of tokens is sold and the bonding curve is fulfilled.
Anyone calls
launchToken()
to launch the token to Uniswap V2.
Public Functions
createToken
Create a new token with a name
, symbol
, metadata
and a unique salt
.
Must be called with an amount of ETH equal to or greater than the creation fee; any excess ETH will be used to buy an initial amount of tokens for the creator.
Note that the new token is non-transferable and can only be traded through this contract.
buyTokens
Buy tokens in exchange for ETH. Reverts if the amount of tokens received for the ETH provided is less than minAmountOut
.
sellTokens
Sell amountIn
of tokens in exchange for ETH. Reverts if the amount of ETH received is less than minAmountOut
.
launchToken
Launch a token to Uniswap V2. Can only be called when the bonding curve is fulfilled.
Note that the token also becomes transferable post-launch.
Last updated