ClankerPresaleEthToCreator

Clanker's ClankerPresaleEthToCreator extension is a special type of presale where the raised funds go to the creator of the presale instead of being deposited into the liquidity pool. This presale is decentralized from a buying perspective, meaning there are no limitations on who can buy in, and once a presale becomes successful, the token becomes deployable.

This extension is not currently active. The contracts exist and are audited. If your team is interested in using this presale, please reach out to the Clanker team.

Creating a Presale

Presale creators need to provide the following to start a presale:

  • presaleDuration: Maximum amount of time to run the presale for.

  • maxEthGoal: Maximum amount of ETH to raise. If this number is hit, the presale stops accepting new bids and the token can be launched immediately.

  • minEthGoal: Minimum ETH goal to hit for a presale to be considered successful. The token can be launched if this minimum is hit after the presale duration has passed.

  • deploymentConfig: The token to deploy once a presale hits a success condition. This is a normal Clanker v4 deployment config with all features except the DevBuy fully accessible.

  • presaleOwner: Address used to claim raised ETH.

  • lockupDuration (optional): How long to lock up presale tokens for. For example, if this is set to 10 days, presale buyers are able to claim their tokens 10 days after the presale concludes.

  • vestingDuration (optional): How long to vest the presale tokens for. The vesting is linear and starts after the lockup period has ended. For example, if this is set to 10 days and the lockup duration is set to 10 days, on day 15 half of the supply would be claimable and on day 20 the token becomes fully claimable.

Each created presale receives a PresaleId.

function startPresale(
    IClanker.DeploymentConfig memory deploymentConfig,
    uint256 minEthGoal,
    uint256 maxEthGoal,
    uint256 presaleDuration,
    address presaleOwner,
    uint256 lockupDuration,
    uint256 vestingDuration
) external onlyAdmin returns (uint256 presaleId);

Only allowlisted addresses can start presales. If you'd like to use this presale format, please reach out to the Clanker team.

Participating in the Presale

Buying into a Presale

Buying into a presale is tax-free and is done with the buyIntoPresale() function. The msg.value sent is used to buy into the presale. If the amount of ETH sent exceeds a presale's maximum, the sender is refunded the excess.

function buyIntoPresale(uint256 presaleId) external payable;

Withdrawing from a Presale

Users are able to withdraw their funds from a presale if the presale has failed or if the presale has not yet reached the maximum ETH goal. Withdrawing from a non-failed presale faces a 1% tax to prevent spamming.

function withdrawFromPresale(
    uint256 presaleId, 
    uint256 amount, 
    address recipient // address to receive the refunded ETH, can be the same as the msg.sender
) external;

Ending a Presale

Presales can end in either token deployment or with all buyers being able to withdraw their funds tax-free. Presale tokens can be deployed after the max ETH goal has been hit, or if the presale hit the min ETH goal and the presale deadline has been reached.

function endPresale(uint256 presaleId, bytes32 salt) external;

Ending the presale requires providing a salt. This salt is used to determine the token's address. The presaleOwner has a single day where they are the only person who is able to end the presale. After one day, anyone is able to select a salt and end the presale. If two days total have passed without anyone ending the presale, the presale is considered 'failed' and buyers can recover their funds through the withdrawFromPresale() function.

Claiming Tokens

Claiming Tokens

Buyers of successful presales can claim their tokens through the claimTokens() function. These tokens will be immediately available if no lockup or vesting was programmed; otherwise, they will become available as time passes.

function claimTokens(uint256 presaleId) external;

Claiming ETH

The presaleOwner is able to claim the raised ETH funds immediately after a presale has successfully deployed a token.

function claimEth(uint256 presaleId, address recipient) external;

Last updated