Contract Interaction ( Testnet)
This document will help you to build on chain applications using create, buy & sell methods on the tokens created on pump.flow.
PumpFlowTokenFactory Documentation
Fundamental Functions
createMemeToken
createMemeToken
Description
Creates a new meme token on the PumpFlow platform. A platform fee (3 FLOW) is required, and users can optionally provide initial funding to receive tokens immediately.
Parameters
name
: The name of the new meme token.symbol
: The symbol of the meme token.fundingRaised
: Amount of native blockchain currency (FLOW) allocated for initial funding.uniqueId
: A unique identifier to prevent duplicate token creation.
Requirements
User must send at least
memetokenCreationPlatformFee + fundingRaised
asmsg.value
.uniqueId
must be unique.
Process
Verify sufficient
msg.value
.Ensure
uniqueId
has not been used before.Deduct platform fee and send it to the fee collector.
Deploy new meme token contract.
If
fundingRaised > 0
:Deduct trading fee.
Calculate token amount using the bonding curve.
Transfer tokens to the creator.
Store token details and update platform records.
Emit events.
Events Emitted
MemeTokenCreated
: Contains details of the new token.BoundingCurveCreated
: Details the bonding curve setup.BondingCurveReached
: Emitted if initial funding exceeds the bonding curve threshold.
buyTokens
buyTokens
Description
Allows users to purchase meme tokens using a bonding curve pricing model.
Parameters
memeTokenAddress
: Address of the meme token.totalCost
: Amount (in native currency) the user is willing to spend.
Requirements
User must send
msg.value
≥totalCost
.Token must not be blocked or have reached its bonding curve limit.
Maximum of 805 million tokens can be sold before DEX integration.
Process
Verify
msg.value
is sufficient.Ensure token is not blocked and hasn't exceeded bonding curve limits.
Deduct trading fee.
Calculate tokens purchasable using bonding curve.
Transfer tokens to the user and update metrics.
Emit events.
Events Emitted
TokensPurchased
: Contains details of the purchase.BondingCurveReached
: Emitted if token reaches bonding curve limit.
sellTokens
sellTokens
Description
Allows users to sell their meme tokens back to the platform in exchange for native currency based on the bonding curve.
Parameters
memeTokenAddress
: Address of the meme token.numTokens
: Number of tokens to sell.
Requirements
Caller must own at least
numTokens
of the specified token.Bonding curve must not have been reached.
Platform contract must have enough funds for refund.
Caller must approve the contract to transfer tokens on their behalf.
Process
Ensure token is not blocked and hasn't reached bonding curve.
Verify caller's token balance and contract's funds.
Calculate refund amount using bonding curve formula.
Deduct trading fee from refund.
Transfer tokens from user to contract.
Send refund (minus fees) to user.
Update bonding curve metrics.
Emit events.
Events Emitted
TokensSold
: Contains details of the sale.
getBoundingCurvePercentage
getBoundingCurvePercentage
Description
Retrieves the percentage progress of a meme token’s current supply relative to its bonding curve threshold.
Parameters
memeTokenAddress
: Address of the meme token.
Returns
A percentage value (scaled by 100) indicating bonding curve progress.
getRemainingTokensInLaunchpad
getRemainingTokensInLaunchpad
Description
Fetches the remaining token balance in the launchpad for a specific meme token.
Parameters
memeTokenAddress
: Address of the meme token.
Returns
The number of tokens remaining in the launchpad.
getAllMemeTokens
getAllMemeTokens
Description
Returns a list of all meme tokens created through the platform, excluding blocked tokens.
Returns
An array of
MemeToken
structs containing token details.
Important Notes for Developers
Token Approval
Before calling sellTokens
, ensure you call the approve
function of the respective meme token contract to allow the factory to handle the tokens on your behalf.
Contract Addresses (Testnet)
PumpFlowTokenFactory
0xBBfA869CF253aB76742AB9bc7902f783546BC830
PumpFlowTokenFactory Contract ABI
Meme Token Contract ABI
Last updated