Appearance
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).
| Parameter | Type | Description |
|---|---|---|
image_url | string | URL or hash of the meme image |
name | string | Name of the meme |
description | string | Optional 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.
| Parameter | Type | Description |
|---|---|---|
index | uint | Sequential index of the meme |
Returns: Address of the Meme Contract.
get_all_memes
Returns the list of all deployed meme contract addresses.
| Parameter | Type | Description |
|---|---|---|
| - | - | No parameters |
Returns: Array<Address> of all Meme Contract addresses.
Meme Contract Functions
buy
Purchase shares by sending TON to the Meme Contract.
| Parameter | Type | Description |
|---|---|---|
amount | coins | TON amount to spend |
min_shares | uint | Minimum shares to receive (slippage protection) |
referral | Address | Optional 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.
| Parameter | Type | Description |
|---|---|---|
share_amount | uint | Number of shares to sell |
min_ton | coins | Minimum TON to receive (slippage protection) |
referral | Address | Optional 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.
| Parameter | Type | Description |
|---|---|---|
| - | - | 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.
| Parameter | Type | Description |
|---|---|---|
shares | uint | Number of shares to price |
Returns: buy_price (coins), sell_price (coins)
get_state
Read the current state of the Meme Contract.
| Parameter | Type | Description |
|---|---|---|
| - | - | No parameters |
Returns:
| Field | Type | Description |
|---|---|---|
creator | Address | Meme creator's wallet |
nft_collection | Address | NFT collection address (1,000 NFTs) |
jetton_address | Address | Share-token Jetton address (1,000,000 shares) |
total_shares | uint | 1,000,000 (fixed supply) |
shares_burned | uint | Total shares burned from NFT mints |
reserve | coins | TON reserve in bonding curve |
nfts_minted | uint | Number of NFTs minted (out of 1,000) |
holders | uint | Number of unique share holders |
Jetton (Share-Token) Functions
The share-token follows the standard TEP-74 Jetton interface with these additional behaviors:
| Function | Behavior |
|---|---|
transfer | Standard Jetton transfer with notification to Meme Contract |
burn | Allowed only during NFT minting (burns 1,000,000 shares at once) or sell operations |
get_wallet_data | Returns 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:
| Function | Behavior |
|---|---|
transfer | Standard NFT transfer (available after mint) |
get_nft_data | Returns owner address, content, and collection info |
get_collection_data | Returns collection size (1,000), next item index, owner address |
Fee Distribution
Fees are distributed as follows on each trade:
| Recipient | Share |
|---|---|
| Protocol Treasury | 1% of trade value |
| Referral (if provided) | Portion of the 1% fee |