Skip to content

UPDATED V2 - Four.meme multi-token launcher. Create and launch multiple tokens in parallel via pre-filled templates.

Notifications You must be signed in to change notification settings

Openwired/fourMemeLauncherV2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Token Creator

Create and launch multiple four.meme tokens from Node.js.
Uploads your image, prepares the token on the four.meme API, calls the on-chain createToken (paying the 0.01 BNB creation fee + optional presale BNB), and (optionally) approves a spender to fast sell the supply for the deploying wallet.


Features

  • See local references in docs/ for API/ABI details.

  • NEW: Blank template generator that can also prefill fresh BSC wallets.

  • Single command to launch one or many tokens FAST (from templates).

  • Sends 0.01 BNB creation fee + presaleBNB in the same transaction.

  • Optional post-create approve for fast selling later.

  • Parallel or sequential launches (env-controlled).


Requirements

  • Node.js 18+ (works with ESM + ethers@6).
  • Some BNB on each deployer wallet:
    required ≈ 0.01 (fee) + presaleBNB + gas.

Configure

1) .env

# Primary RPC used to SEND transactions (required)
BSC_RPC_URL=https://your-primary-bsc-rpc.example

# Optional: a different RPC used only for polling receipts (recommended for free tier rpc plans to avoid rate limits)
SECONDARY_RPC_URL=https://your-secondary-bsc-rpc.example

# Path to your templates file
TEMPLATES_PATH=./data/templates.json

# Polling cadence for receipt checks (tune if hitting rate limits)
POLL_INTERVAL_MS=3000
POLL_JITTER_MS=400

# How to launch multiple templates: 'parallel' or 'sequential'
LAUNCH_MODE=parallel

# If LAUNCH_MODE=parallel, cap concurrency (0 = unbounded)
CONCURRENCY=0

Notes

  • If you only have one RPC, you can omit SECONDARY_RPC_URL and polling will use BSC_RPC_URL.
  • If you ever see provider rate-limit errors, increase POLL_INTERVAL_MS or add a SECONDARY_RPC_URL.

2) templates.json

An array of token templates. Each template includes both the token content and the wallet that will deploy it.

Schema (per template)

Field Type Required Example / Notes
name string "CATJAM"
symbol string "CJAM"
desc string Short description
imagePath string Local path to PNG/JPG
label string One of: Meme/AI/Defi/Games/Infra/De-Sci/Social/Depin/Charity/Others
presaleBNB string/number e.g. "0.01" (added to msg.value)
onlyMPC boolean false for regular wallet
webUrl string Optional, leave "" to omit
twitterUrl string Optional
telegramUrl string Optional
launchDelayMs number Default 60000 (ms from “now”)
rpcUrl string Per-template override (else uses BSC_RPC_URL)
approveAfterCreate boolean Default true
approveSpender string Address to receive allowance (defaults to TokenManager2) recommended NOT to change
approveAmountTokens string/number Default "1000000000" (full supply)
wallet.accountAddress string Must match private key
wallet.privateKey string 0x... (keep secure!)

Example

[
  {
    "name": "Example Token",     //required - token name
    "symbol": "EXMPL",    //required - token symbol (recommended to use CAPTIAL LETTERS)
    "desc": "Demo token used to illustrate configuration fields.",    //required - token description
    "imagePath": "./assets/sample-token.png",   //required - token image
    "label": "Meme", //required - Choose one Meme/AI/Defi/Games/Infra/De-Sci/Social/Depin/Charity/Others 
    "presaleBNB": "0.01", //required - this is the amount in BNB the dev wallet buys
    "onlyMPC": false,   //DONT CHANGE FROM FALSE - read docs for more info - must be included in the json
    "webUrl": "https://example.com", //optional - leave "" empty if not needed
    "twitterUrl": "https://twitter.com/example",//optional - leave "" empty if not needed
    "telegramUrl": "https://t.me/example",//optional - leave "" empty if not needed
    "launchDelayMs": 6000, //delay between launches in ms (6000ms = 6 seconds)
    "rpcUrl": "https://..quiknode.pro/<your-endpoint>/", //optional - you ca add differnt rpcUrl's per token or leave blank to use global rpcUrl in env
    "approveAfterCreate": true, //optional - approve spending (allows you to sell tokens straight away)
    "approveSpender": "0x5c952063c7fc8610FFDB798152D69F0B9550762b", //DONT CHANGE - TokenManager2 contract - Verfiy contract in docs/
    "approveAmountTokens": "1000000000", //optional - amount of tokens to approve spending
    "wallet": {
      "accountAddress": "0xYourWalletAddress", //required
      "privateKey": "0xYourPrivateKey" //required
    }
  }
]

⚠️ Security: This file contains private keys. Keep it out of source control; add it to .gitignore and restrict file permissions.


References

These files document Four.meme�s API and on-chain ABIs used by this launcher:

  • docs/API-Documents.md � General API docs overview used while building the script.
  • docs/API-CreateToken.md � Create-token REST flow and payload notes used to prepare createArg and signatures.
  • docs/TokenManager2.lite.abi � Minimal ABI for TokenManager2 used by on-chain createToken submission.
  • docs/TokenManagerHelper3.abi � Helper ABI for related contract interactions and discovery.

Official documentation

These references are included to make development auditable and to help users verify behavior against official docs.

Install

npm install

Run

Using Node

node src/tokenCreator.js

Using npm script (optional)

npm run launch

Template Generator

Run this to append blank template entries to data/templates.json (or TEMPLATES_PATH if set). You choose how many to generate. If you choose to generate new BSC wallets, the script writes the public and private keys into each new template and only logs the public keys. The private key log shows [REDEACTED] check templates.json.

npm run template

Wallet Generation Details

Wallets are generated using ethers v6 via Wallet.createRandom(), which internally uses crypto.randomBytes from Node.js to produce cryptographically secure entropy. This means keys are created locally on your machine using standard, well-audited libraries.

Control parallelism

  • Sequential
    LAUNCH_MODE=sequential
  • Parallel (unbounded)
    LAUNCH_MODE=parallel
    CONCURRENCY=0
  • Parallel (bounded)
    LAUNCH_MODE=parallel
    CONCURRENCY=3

What it logs (example)

[1/3] launch TEST1 (TEST ONE) wallet 0x8D5e…8046
[0x8D5e…8046] submit TEST1: 0x2314…c2d3 (value 0.02 BNB)
[0x8D5e…8046] created TEST1: 0x81199A…4444 (block 66081179) https://four.meme/token/0x81199A…4444
[0x8D5e…8046] approve: 0x2705…0e8d → 0x5c9520…762b amount 1000000000
[0x8D5e…8046] approved TEST1 in block 66081183

A Summary of all results prints at the end.


How it works (quick)

  1. Auth with four.meme (message-signing).
  2. Upload the token image (returns hosted imgUrl).
  3. Prepare creation via API (returns createArg + signature).
  4. Send createToken(createArg, sign) on TokenManager2 with
    msg.value = 0.01 BNB (fee) + presaleBNB.
  5. Poll for the receipt; decode TokenCreate to get the token address.
  6. Optional: approve(spender, 1,000,000,000) on the new token.

Environment details

  • BSC_RPC_URL – Primary RPC used to send transactions.
  • SECONDARY_RPC_URL – Optional RPC used only to poll receipts.
  • TEMPLATES_PATH – Path to templates.json.
  • POLL_INTERVAL_MS / POLL_JITTER_MS – Tune if you see rate limits.
  • LAUNCH_MODEparallel or sequential.
  • CONCURRENCY – Cap parallel jobs (only used when parallel).

Troubleshooting

  • Rate-limit errors from your RPC:

    • Increase POLL_INTERVAL_MS (e.g., 3000 → 5000).
    • Set a different SECONDARY_RPC_URL for polling.
    • Reduce CONCURRENCY or switch to sequential.
  • ACCOUNT_ADDRESS mismatch

    • wallet.accountAddress must match the provided privateKey.
  • Insufficient funds

    • Each wallet needs: 0.01 + presaleBNB + gas. Check balances.

Notes

  • The script enforces the platform’s 0.01 BNB creation fee and includes presaleBNB in msg.value by design.
  • The default approve spender is the four.meme TokenManager2 contract (0x5c95…762b). You can set a different approveSpender per template.

About

UPDATED V2 - Four.meme multi-token launcher. Create and launch multiple tokens in parallel via pre-filled templates.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%