# Creating a Coin

This guide covers how to create coins directly using the **Basememe Factory** contract.

**Basememe** **Factory** contract creates Coins, setting up Bonding Curves and initializing Uniswap pools. Coins created before December 5, 2025 are configured to use Uniswap V3 pools, while coins created on or after December 5, 2025 are using Uniswap V4 pools. Each **Coin** is configured to have a Bonding Curve and a Liquidity pool setup with a coin pair of its backing currency on each chain.

## Create Coin

To create a new coin with selected collateral pair, you send a transaction to call the `createBasememeTokenWithCollateral` method.

You may create token with following collateral:

<table><thead><tr><th width="209.484375">Collateral Pair</th><th>Address</th></tr></thead><tbody><tr><td>ETH</td><td><code>0x0000000000000000000000000000000000000000</code></td></tr><tr><td>USDC</td><td><code>0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913</code></td></tr><tr><td>SOL</td><td><code>0x311935Cd80B76769bF2ecC9D8Ab7635b2139cf82</code></td></tr></tbody></table>

### Method Interface

<pre class="language-solidity"><code class="lang-solidity">// solidity interface 

<strong>/// @notice Create a new token with required params
</strong>///
/// @param _name The name of the token
/// @param _symbol The symbol/ticker of the token
/// @param _tokenURI The IPFS URI of token metadata
/// @param _nonce Random number for salt generation
/// @param _signature The verify-able signature for token creation
/// @param _platformReferrer The Creator Referrer address to receive reward
/// @param _payoutRecipient The Creator address to receive reward
/// @param _tokenSalt Salt for deterministic CREATE2 deployment. Enables predictable token addresses.
/// @param _collateralToken Selected collateral pair for created token
///
/// @return token The address of the created token
function createBasememeTokenWithCollateral(
    string memory _name,
    string memory _symbol,
    string memory _tokenURI,
    uint256 _nonce,
    bytes memory _signature,
    address _platformReferrer,
    address _payoutRecipient,
    bytes32 _tokenSalt,
    address _collateralToken
) 
    external 
    returns (address);
</code></pre>

### Events

The factory emit an event upon successful coin creation

In addition, a `NewBasememeTokenCurveParams` event is emitted at creation time to publish the token's economic parameters, including the selected `collateralToken` and `v4LpFee`.

```solidity
/// @notice emitted when a new token is created
///
/// @param addr The token contract address
/// @param bondingCurve The Bonding Curve address of the token
/// @param creator The sender address of token creation
/// @param signature The signature used to create the token
/// @param platformReferrer The Creator Referrer address to receive reward
/// @param payoutReceipent The Creator address to receive reward
/// @param owner The owner address of token contract
/// @param nonce Random number for salt generation
/// @param name The name of the token
/// @param symbol The symbol/ticker of the token
/// @param tokenURI The IPFS URI of token metadata
/// @param version The BasememeToken version created
event NewBasememeToken(
    address addr,
    address bondingCurve,
    address creator, 
    bytes signature, 
    address platformReferrer, 
    address payoutRecipient, 
    address owner,
    uint256 nonce,
    string name,
    string symbol,
    string tokenURI,
    string version      
);
```

***

## Create and Buy Coin

To create and buy a new coin with a selected collateral pair, you send a transaction to call the `createBasememeTokenAndBuyWithCollateral` method.

You may create token with following collateral:

<table><thead><tr><th width="209.484375">Collateral Pair</th><th>Address</th></tr></thead><tbody><tr><td>ETH</td><td><code>0x0000000000000000000000000000000000000000</code></td></tr><tr><td>USDC</td><td><code>0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913</code></td></tr><tr><td>SOL</td><td><code>0x311935Cd80B76769bF2ecC9D8Ab7635b2139cf82</code></td></tr></tbody></table>

### Method Interface

```solidity
// solidity interface 

/// @notice Create a new token and buy upon creation with required params
///
/// @param _name The name of the token
/// @param _symbol The symbol/ticker of the token
/// @param _tokenURI The IPFS URI of token metadata
/// @param _nonce Random number for salt generation
/// @param _collateralAmountIn The exact amount of collateral to spend (before fees)
/// @param _tokenAmountMin Min expected amount of token to receive
/// @param _signature The verify-able signature for token creation
/// @param _platformReferrer The Creator Referrer address to receive reward
/// @param _payoutRecipient The Creator address to receive reward
/// @param _tokenSalt Salt for deterministic CREATE2 deployment. Enables predictable token addresses.
/// @param _collateralToken Selected collateral pair for created token
///
/// @return token The address of the created token
function createBasememeTokenAndBuyWithCollateral(
    string memory _name,
    string memory _symbol,
    string memory _tokenURI,
    uint256 _nonce,
    uint256 _collateralAmountIn,
    uint256 _tokenAmountMin,
    bytes memory _signature,
    address _platformReferrer,
    address _payoutRecipient,
    bytes32 _tokenSalt,
    address _collateralToken
)
    external
    payable
    returns (address);
```

**Payment notes**

* If `_collateralToken` is `ETH` (`address(0)`), send `msg.value == _collateralAmountIn`.
* If `_collateralToken` is an ERC20 collateral token (e.g. USDC / SOL), `msg.value` must be `0` and the caller must approve the Factory to spend `_collateralAmountIn` of the collateral token.

### Events

The factory emit `NewBasememeToken` event upon successful coin creation

In addition, a `NewBasememeTokenCurveParams` event is emitted at creation time to publish the token's economic parameters, including the selected `collateralToken` and `v4LpFee`.

```solidity
/// @notice emitted when a new token is created
///
/// @param addr The token contract address
/// @param bondingCurve The Bonding Curve address of the token
/// @param creator The sender address of token creation
/// @param signature The signature used to create the token
/// @param platformReferrer The Creator Referrer address to receive reward
/// @param payoutReceipent The Creator address to receive reward
/// @param owner The owner address of token contract
/// @param nonce Random number for salt generation
/// @param name The name of the token
/// @param symbol The symbol/ticker of the token
/// @param tokenURI The IPFS URI of token metadata
/// @param version The BasememeToken version created
event NewBasememeToken(
    address addr,
    address bondingCurve,
    address creator, 
    bytes signature, 
    address platformReferrer, 
    address payoutRecipient, 
    address owner,
    uint256 nonce,
    string name,
    string symbol,
    string tokenURI,
    string version      
);
```

Successful purchase of new coin create will emit `Buy` event

```solidity
/// @notice emitted upon successful token purchase
///
/// @param buyer The token buyer address
/// @param token The purchased token address
/// @param tokenAmount The amount of token purhased
/// @param collateralAmount The amount of collateral used to purchase token (depends on the coin's selected collateral pair)
/// @param refund The amount of collateral refunded to buyer if there's leftover
/// @param tradeFee The amount of fee collected by platform for token purchase
/// @param curveProgressBps The updated Bonding Curve progress basis points for token
/// @param virtualCollateralReserves The updated virtual collateral reserves amount in Bonding Curve stage
/// @param virtualTokenReserves The updated virtual token reserves amount in Bonding Curve stage
/// @param collateralReserves The updated real collateral reserves amount in Bonding Curve stage
/// @param tokenReserves The updated real token reserves amount in Bonding Curve stage
event Buy(
    address indexed buyer,
    address indexed token,
    uint256 tokenAmount,
    uint256 collateralAmount,
    uint256 refund,
    uint256 tradeFee,
    uint256 curveProgressBps,
    uint256 virtualCollateralReserves,
    uint256 virtualTokenReserves,
    uint256 collateralReserves,
    uint256 tokenReserves
);
```

***

## Create Coin (Advanced Mode)

Advanced mode lets creators customize the coin’s funding target and token allocation at creation time. To create an advanced-mode coin with a selected collateral pair, call `createBasememeTokenDynamicWithCollateral`.

### Method Interface

```solidity
/// @notice Create a new token using advanced parameters (dynamic-create) and a selected collateral pair.
///
/// @param targetRaise The funding target (in the selected collateral token's units).
function createBasememeTokenDynamicWithCollateral(
    string memory _name,
    string memory _symbol,
    string memory _tokenURI,
    uint256 _nonce,
    bytes memory _signature,
    address _platformReferrer,
    address _payoutRecipient,
    bytes32 _tokenSalt,
    address _collateralToken,
    uint256 targetRaise
)
    external
    returns (address);
```

Advanced mode also supports an optional vesting allocation via an additional overload:

```solidity
/// @notice Create a new token using advanced parameters (dynamic-create) with an optional vesting allocation.
///
/// @param lockBps Vesting allocation in basis points (bps).
/// @param lockupDuration Lockup duration in seconds.
/// @param vestingDuration Vesting duration in seconds.
/// @param lockAdmin The admin address for the vesting schedule.
function createBasememeTokenDynamicWithCollateral(
    string memory _name,
    string memory _symbol,
    string memory _tokenURI,
    uint256 _nonce,
    bytes memory _signature,
    address _platformReferrer,
    address _payoutRecipient,
    bytes32 _tokenSalt,
    address _collateralToken,
    uint256 targetRaise,
    uint16 lockBps,
    uint64 lockupDuration,
    uint64 vestingDuration,
    address lockAdmin
)
    external
    returns (address);
```

### Events

In addition to `NewBasememeToken` and `NewBasememeTokenCurveParams`, advanced-mode creation emits `NewBasememeTokenDynamicParams` to publish the selected/derived advanced parameters for indexers and integrators.

```solidity
/// @notice Emitted when an advanced-mode token is created, including derived parameters.
event NewBasememeTokenDynamicParams(
    address indexed addr,
    address indexed bondingCurve,
    bytes32 indexed profileId,
    uint256 targetRaise,
    uint16 sellBps,
    uint256 lockAmount,
    uint256 virtualTokenReservesInitial,
    uint256 virtualCollateralReservesInitial,
    uint256 endPriceNum,
    uint256 endPriceDen,
    int24 upperBelow,
    int24 lowerAbove,
    int24 lowBelowTick,
    uint256 pairedToMigrateMin
);
```

***

## Create Coin (ETH Pair only)

To create a new coin that is paired with ETH only, you send a transaction to call the `createBasememeToken` method. For USDC / SOL collateral pairs, use `createBasememeTokenWithCollateral` instead.

### Method Interface

<pre class="language-solidity"><code class="lang-solidity">// solidity interface 

<strong>/// @notice Create a new token with required params
</strong>///
/// @param _name The name of the token
/// @param _symbol The symbol/ticker of the token
/// @param _tokenURI The IPFS URI of token metadata
/// @param _nonce Random number for salt generation
/// @param _signature The verify-able signature for token creation
/// @param _platformReferrer The Creator Referrer address to receive reward
/// @param _payoutRecipient The Creator address to receive reward
/// @param _tokenSalt Salt for deterministic CREATE2 deployment. Enables predictable token addresses.
///
/// @return token The address of the created token
function createBasememeToken(
    string memory _name,
    string memory _symbol,
    string memory _tokenURI,
    uint256 _nonce,
    bytes memory _signature,
    address _platformReferrer,
    address _payoutRecipient,
    bytes32 _tokenSalt
)
    external
    returns (address);


</code></pre>

### Events

The factory emit an event upon successful coin creation

```solidity
/// @notice emitted when a new token is created
///
/// @param addr The token contract address
/// @param bondingCurve The Bonding Curve address of the token
/// @param creator The sender address of token creation
/// @param signature The signature used to create the token
/// @param platformReferrer The Creator Referrer address to receive reward
/// @param payoutReceipent The Creator address to receive reward
/// @param owner The owner address of token contract
/// @param nonce Random number for salt generation
/// @param name The name of the token
/// @param symbol The symbol/ticker of the token
/// @param tokenURI The IPFS URI of token metadata
/// @param version The BasememeToken version created
event NewBasememeToken(
    address addr,
    address bondingCurve,
    address creator, 
    bytes signature, 
    address platformReferrer, 
    address payoutRecipient, 
    address owner,
    uint256 nonce,
    string name,
    string symbol,
    string tokenURI,
    string version      
);
```

***

## Create and Buy Coin (ETH Pair only)

To create and buy a new coin that is paired with ETH only, you send a transaction to call the `createBasememeTokenAndBuy` method. For USDC / SOL collateral pairs, use `createBasememeTokenAndBuyWithCollateral` instead.

### Method Interface

```solidity
// solidity interface 

/// @notice Create a new token and buy upon creation with required params
///
/// @param _name The name of the token
/// @param _symbol The symbol/ticker of the token
/// @param _tokenURI The IPFS URI of token metadata
/// @param _nonce Random number for salt generation
/// @param _tokenAmountMin Min expected amount of token to receive
/// @param _signature The verify-able signature for token creation
/// @param _platformReferrer The Creator Referrer address to receive reward
/// @param _payoutRecipient The Creator address to receive reward
/// @param _tokenSalt Salt for deterministic CREATE2 deployment. Enables predictable token addresses.
///
/// @return token The address of the created token
function createBasememeTokenAndBuy(
    string memory _name,
    string memory _symbol,
    string memory _tokenURI,
    uint256 _nonce,
    uint256 _tokenAmountMin,
    bytes memory _signature,
    address _platformReferrer,
    address _payoutRecipient,
    bytes32 _tokenSalt
)
    external
    payable
    returns (address);
```

### Events

The factory emit `NewBasememeToken` event upon successful coin creation

```solidity
/// @notice emitted when a new token is created
///
/// @param addr The token contract address
/// @param bondingCurve The Bonding Curve address of the token
/// @param creator The sender address of token creation
/// @param signature The signature used to create the token
/// @param platformReferrer The Creator Referrer address to receive reward
/// @param payoutReceipent The Creator address to receive reward
/// @param owner The owner address of token contract
/// @param nonce Random number for salt generation
/// @param name The name of the token
/// @param symbol The symbol/ticker of the token
/// @param tokenURI The IPFS URI of token metadata
/// @param version The BasememeToken version created
event NewBasememeToken(
    address addr,
    address bondingCurve,
    address creator, 
    bytes signature, 
    address platformReferrer, 
    address payoutRecipient, 
    address owner,
    uint256 nonce,
    string name,
    string symbol,
    string tokenURI,
    string version      
);
```

Successful purchase of new coin create will emit `Buy` event

```solidity
/// @notice emitted upon successful token purchase
///
/// @param buyer The token buyer address
/// @param token The purchased token address
/// @param tokenAmount The amount of token purhased
/// @param collateralAmount The amount of collateral used to purchase token (depends on the coin's selected collateral pair)
/// @param refund The amount of collateral refunded to buyer if there's leftover
/// @param tradeFee The amount of fee collected by platform for token purchase
/// @param curveProgressBps The updated Bonding Curve progress basis points for token
/// @param virtualCollateralReserves The updated virtual collateral reserves amount in Bonding Curve stage
/// @param virtualTokenReserves The updated virtual token reserves amount in Bonding Curve stage
/// @param collateralReserves The updated real collateral reserves amount in Bonding Curve stage
/// @param tokenReserves The updated real token reserves amount in Bonding Curve stage
event Buy(
    address indexed buyer,
    address indexed token,
    uint256 tokenAmount,
    uint256 collateralAmount,
    uint256 refund,
    uint256 tradeFee,
    uint256 curveProgressBps,
    uint256 virtualCollateralReserves,
    uint256 virtualTokenReserves,
    uint256 collateralReserves,
    uint256 tokenReserves
);
```

## Additional Info

There're 2 params in both create token method that need extra attention:

* `_tokenURI` : All the metadata about created coins are stored on IPFS. You need to upload your image and the meta of your token to IPFS following example below:

```json
{
    name: "My Base Memecoin",
    description: "Base for everyone!",
    symbol: "MYBASECOIN",
    image: "ipfs://CID/base_coin.png",
    website: "https://example.com",
    x: "https://x.com/my_base_coin",
    telegram: "https://t.me/my_base_coin",
}
```

* `_signature` : For the moment, there's no signature required to create a coin using Basememe Factory, pass in empty bytes value for \_signature will do the job.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.base.meme/for-developers/creating-a-coin.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
