g8keepFactory
g8keepFactory
Inherits: IG8keepFactory, Ownable
Factory for managing deployment parameters, deploying g8keep token contracts, locking initial liquidity, and managing token fees.
State Variables
WETH
Wrapped native token contract for token deployments using native currency.
UNISWAP_V2_ROUTER
Uniswap V2 router address for the chain.
g8keepTokenVesting
Vesting contract to be used when deployer tokens are subject to vesting restrictions.
g8keepFeeWallet
Fee wallet to receive initial liquidity fees.
penaltyReceiver
Address that will receive penalty tax tokens.
g8keepFee
Fee in BPS assessed on token trades, paid to g8keep. Initial value: 1.0%
g8keepInitialLiquidityFee
Fee in BPS assessed on initial liquidity supplied. Initial value: 2.0%
maxBuyFee
Maximum buy fee in BPS assessed on token trades, paid to token deployer. Initial value: 5.0%
maxSellFee
Maximum sell fee in BPS assessed on token trades, paid to token deployer. Initial value: 5.0%
minimumDeployVestTime
Minimum time in seconds that a deployer's share of tokens must be vested over. Initial value: 1 day
minimumSnipeProtectionSeconds
Minimum time in seconds that a deployed token must have snipe protection enabled.
maximumSnipeProtectionSeconds
Maximum time in seconds that a deployed token may have snipe protection enabled.
minimumHeavySnipeProtectionSeconds
Minimum time in seconds that a deployed token must have heavy snipe protection enabled.
maximumHeavySnipeProtectionSeconds
Maximum time in seconds that a deployed token may have heavy snipe protection enabled.
minimumHeavySnipeExponent
Minimum exponent that a deployed token must have for heavy snipe penalties.
maximumHeavySnipeExponent
Maximum exponent that a deployed token may have for heavy snipe penalties.
MAX_SETTING_G8KEEP_FEE
Guardrail for g8keepFee
to prevent it from being set over 100 BPS.
MAX_SETTING_G8KEEP_INITIAL_LIQUIDITY_FEE
Guardrail for g8keepInitialLiquidityFee
to prevent it from being set over 200 BPS.
MAX_SETTING_BUY_FEE
Guardrail for maxBuyFee
to prevent it from being set over 500 BPS.
MAX_SETTING_SELL_FEE
Guardrail for maxSellFee
to prevent it from being set over 500 BPS.
MAX_SETTING_MINIMUM_DEPLOY_VEST_TIME
Guardrail for minimumDeployVestTime
to prevent it from being set over 90 days.
MAX_SETTING_MINIMUM_SNIPE_PROTECTION_SECONDS
Guardrail for minimumSnipeProtectionSeconds
to prevent it from being set over 7 days.
MAX_SETTING_MAXIMUM_SNIPE_PROTECTION_SECONDS
Guardrail for maximumSnipeProtectionSeconds
to prevent it from being set over 365 days.
MAX_SETTING_MINIMUM_HEAVY_SNIPE_PROTECTION_SECONDS
Guardrail for minimumHeavySnipeProtectionSeconds
to prevent it from being set over 1 days.
MAX_SETTING_MAXIMUM_HEAVY_SNIPE_PROTECTION_SECONDS
Guardrail for maximumHeavySnipeProtectionSeconds
to prevent it from being set over 5 days.
MIN_SETTING_MINIMUM_HEAVY_SNIPE_EXPONENT
Guardrail for minimumHeavySnipeExponent
to prevent it from being set under 2.
MAX_SETTING_MINIMUM_HEAVY_SNIPE_EXPONENT
Guardrail for minimumHeavySnipeExponent
to prevent it from being set over 20.
MAX_SETTING_MAXIMUM_HEAVY_SNIPE_EXPONENT
Guardrail for maximumHeavySnipeExponent
to prevent it from being set over 100.
BPS
Constant value for BPS.
allowedPairs
Mapping to flag a token address as an allowed pair token for g8keep token deployments.
pairedTokenMinimumLiquidity
Mapping of the minimum initial liquidity to be provided for a paired token.
lockedTokens
Mapping of tokens that are locked to prevent sale or withdrawal.
Functions
constructor
Constructs the g8keepFactory contract.
Initialization parameters are retrieved from a configuration contract so that the g8keepFactory may be deterministically deployed on EVM chains at the same
address.
Parameters
deployToken
Deploys a g8keepToken contract, creates and funds the LP, locks initial liquidity.
Parameters must be within ranges defined by the factory settings.
Token salt value must be calculated to generate a token deployment address that is greater than the _pairedToken
address.
Parameters
setPairedTokenSettings
Admin function to configure a paired token.
Parameters
setPairedTokenSettingsWithAllowance
Admin function to configure a paired token with a specific allowance amount.
Used for certain ERC20 tokens that have unusual approval methods.
Parameters
setDeploymentSettings
Admin function to configure deployment parameters.
Settings parameters must be within the constant guardrails defined.
Parameters
setG8keepFee
Admin function to set the g8keep fee that will be assessed on token trades.
Fee must be less than the constant guardrail settings.
Parameters
setG8keepInitialLiquidityFee
Admin function to set the g8keep fee that will be assessed on initial liquidity.
Fee must be less than the constant guardrail settings.
Parameters
setG8keepTokenVestingAddress
Admin function to set the g8keep vesting contract address.
The vesting contract address may only be set to the zero address when minimum vesting time is set to zero.
Parameters
setG8keepFeeWallet
Admin function to set the g8keep fee wallet to receive initial liquidity fees.
The fee wallet cannot be set to the zero address.
Parameters
setPenaltyReceiver
Admin function to set the penalty receiver address.
The penalty receiver cannot be set to the zero address.
Parameters
setApprovalToUniswapRouter
Admin function to update approvals to the Uniswap router.
Used to update or revoke approvals in case there is an unusual approval mechanism on a paired ERC20 token.
Parameters
sellTokens
Admin function to sell the tokens collected as fees on the g8keep platform.
Locked tokens supplied in sellParameters
will be skipped without reverting.
Parameters
withdrawToken
Admin function to withdraw a token that is held by the factory contract.
Withdrawing a locked token will revert the transaction.
Will withdraw the entire balance of the token.
Parameters
withdrawToken
Admin function to withdraw a token that is held by the factory contract.
Withdrawing a locked token will revert the transaction.
Will withdraw the specified amount
of token.
Parameters
withdrawETH
Admin function to withdraw native token that is held by the factory contract.
Will withdraw the entire balance.
Parameters
_setPairedTokenSettings
Internal function for setPairedTokenSettings
and setPairedTokenSettingsWithAllowance
.
Parameters
Events
TokenDeployed
Emitted when a token is deployed.
DeploymentSettingsUpdated
Emitted when the g8keepFactory owner updates deployment settings.
PairedTokenSettingsUpdated
Emitted when the g8keepFactory owner updates a paired token settings.
PenaltyReceiverUpdated
Emitted when the g8keepFactory owner updates a penalty receiver.
Errors
ArrayLengthMismatch
Thrown when arrays must match in length and they do not.
DeadlinePassed
Thrown when selling tokens and the deadline for the sale has passed.
FailedToDepositWETH
Thrown when the deposit to the WETH contract for initial liquidity fails.
InvalidDeploymentParameters
Thrown when deploying a token and the parameters are not compliant with deployment settings.
InvalidSettings
Thrown when the g8keepFactory owner is updating deployment settings and they are not compliant with the constant guardrails or when setting a penalty receiver that is the current receiver.
NotEnoughInitialLiquidity
Thrown when deploying a token and the initial liquidity is less than the minimum required.
PairNotAllowed
Thrown when deploying a token with a paired token that is not allowed.
TokenLocked
Thrown when attempting to withdraw a token that is locked.
ValueNotAllowedForNonWETHPairs
Thrown when native value is sent with a token deployment that does not use wrapped native.
ValueSentNotValid
Thrown when deploying a token and the value sent exceeds the initial liquidity specified.
WithdrawalFailed
Thrown when withdrawing native token from the contract and the withdrawal fails.
ZeroAddress
Thrown when a supplied address that must be non-zero is zero.
Structs
TokenSale
Struct used for defining token sale parameters.
Last updated