Skip to content

Memes.surf Functions

Reference for the primary on-chain functions and messages used by Memes.surf smart contracts.

Master Contract Functions

deploy_meme

Deploys a new meme contract, creates the NFT collection (1,000 NFTs), and issues the share-token Jetton (1,000,000 shares).

ParameterTypeDescription
image_urlstringURL or hash of the meme image
namestringName of the meme
descriptionstringOptional description

Called by: Any user (with launch fee payment)

Result: New Meme Contract deployed, NFT collection created (1,000 NFTs), share-token Jetton created (1,000,000 shares).


get_meme_address

Retrieves the contract address of a deployed meme by its index.

ParameterTypeDescription
indexuintSequential index of the meme

Returns: Address of the Meme Contract.


get_all_memes

Returns the list of all deployed meme contract addresses.

ParameterTypeDescription
--No parameters

Returns: Array<Address> of all Meme Contract addresses.


Meme Contract Functions

buy

Purchase shares by sending TON to the Meme Contract.

ParameterTypeDescription
amountcoinsTON amount to spend
min_sharesuintMinimum shares to receive (slippage protection)
referralAddressOptional referral address for fee sharing

Called by: Any user

Result: Shares minted and sent to buyer's wallet. 1% trading fee deducted.


sell

Sell shares back to the Meme Contract for TON.

ParameterTypeDescription
share_amountuintNumber of shares to sell
min_toncoinsMinimum TON to receive (slippage protection)
referralAddressOptional referral address for fee sharing

Called by: Share holder

Result: Shares burned, TON sent to seller's wallet. 1% trading fee deducted.


mint_nft

Mint an NFT from the collection by burning 1,000,000 shares.

ParameterTypeDescription
--No parameters (caller must hold 1,000,000 shares)

Called by: Holder of 1,000,000 shares

Result: All 1,000,000 shares are burned (permanently destroyed), one NFT is minted from the collection (out of 1,000) and transferred to the caller's wallet.


get_price

Get the current buy/sell prices for shares.

ParameterTypeDescription
sharesuintNumber of shares to price

Returns: buy_price (coins), sell_price (coins)


get_state

Read the current state of the Meme Contract.

ParameterTypeDescription
--No parameters

Returns:

FieldTypeDescription
creatorAddressMeme creator's wallet
nft_collectionAddressNFT collection address (1,000 NFTs)
jetton_addressAddressShare-token Jetton address (1,000,000 shares)
total_sharesuint1,000,000 (fixed supply)
shares_burneduintTotal shares burned from NFT mints
reservecoinsTON reserve in bonding curve
nfts_minteduintNumber of NFTs minted (out of 1,000)
holdersuintNumber of unique share holders

Jetton (Share-Token) Functions

The share-token follows the standard TEP-74 Jetton interface with these additional behaviors:

FunctionBehavior
transferStandard Jetton transfer with notification to Meme Contract
burnAllowed only during NFT minting (burns 1,000,000 shares at once) or sell operations
get_wallet_dataReturns balance, owner address, Jetton master address, code

NFT Functions

The NFT follows the standard TEP-62 NFT interface. Each meme has a collection of 1,000 NFTs:

FunctionBehavior
transferStandard NFT transfer (available after mint)
get_nft_dataReturns owner address, content, and collection info
get_collection_dataReturns collection size (1,000), next item index, owner address

Fee Distribution

Fees are distributed as follows on each trade:

RecipientShare
Protocol Treasury1% of trade value
Referral (if provided)Portion of the 1% fee