Developer docs

Rigs developer docs

git clone <repo> && cd engine && npm install && npm test

What Rigs is

Rigs launches coins on Pons V2 from its own launcher so that each coin's creator fees are split automatically: 80% to the creator, 20% to the Rigs treasury. It also ships a Uniswap v4 hook with five switchable rule blocks for pools opened directly on v4.

Architecture

LayerContractsRole
Pons launchesPonsLauncher, CreatorFeeSplitterLaunch on Pons V2; route creator fees 80/20.
v4 hookRigsHookRule blocks for Uniswap v4 pools.
Direct v4 launchesRigsLauncher, RigsTokenMint a token and seed a locked v4 pool on the hook.
Siteweb3.js, config.jsStatic pages that read and write the contracts with viem.

How a launch works

  1. PonsLauncher.launch clones a CreatorFeeSplitter and initializes it with the caller as creator.
  2. It calls Pons launchToken with creatorFeeRecipient = splitter, paying the Pons launch fee.
  3. Any ETH above the launch fee buys on the new curve for the creator.
  4. The launch is stored: token, curve, splitter, creator, time.

PonsLauncher

function launch(LaunchParams p) payable returns (uint256 id)   // msg.value = launchFee + optional buy
function launches(uint256 id) view returns (address token, address curve, address splitter, address creator, uint64 launchedAt)
function launchesOf(address creator) view returns (uint256[])
function idOf(address token) view returns (uint256)
function launchCount() view returns (uint256)
function setTreasury(address) // owner only

Pass expectedEconomics = pons.previewLaunchEconomics(0, address(0)). Pons reverts if its terms changed, instead of silently launching on different ones.

CreatorFeeSplitter

function harvest()                 // anyone: sweep curve โ†’ claim escrow โ†’ 20% treasury, 80% owed to creator
function claim() returns (uint256) // creator: harvest, then pay everything owed
function setCreator(address next)  // creator: hand over the share
function claimable() view returns (uint256)
function totalToCreator() view returns (uint256)
function totalToTreasury() view returns (uint256)

The splitter has no function to change the Pons fee recipient and no admin withdraw.

Fee model

StreamWho paysWhere it goes
Pons launch feeCreator, oncePons
Creator tax (0 to Pons max)Traders on the curve and poolSplitter โ†’ 80% creator, 20% Rigs treasury
Pons protocol feesTradersPons, per its own terms
v4 hook takes and royaltiesTraders in Rigs v4 poolsBurn, LPs, pot or block authors (see below)

Rule blocks

BlockBitConfig fields
Anti-Snipe1snipeBlocks, snipeMaxBuy, snipeFee
Surge Fee2surgeMaxFee, surgeRefSize
Auto Burn4burnBps
LP Rewards8lpBps
Nth-Buy Pot16potBps, potEvery, potMinBuy

Fees are in pips (3000 = 0.30%) and takes in basis points. LP fee is capped at 10%; takes plus up to 0.25% royalty per block are capped at 10% of the swap's unspecified amount.

Hook permissions

Uniswap v4 reads a hook's permissions from the last 14 bits of its address. RigsHook needs beforeInitialize (bit 13), beforeSwap (7), afterSwap (6) and afterSwapReturnDelta (2), so it is deployed with CREATE2 at a mined salt. Decode any address on Scan.

Direct v4 launcher

RigsLauncher.launch(name, symbol, supply, startTick, config) mints a fixed supply, opens an ETH/token pool on RigsHook and seeds the whole supply as single-sided liquidity locked in the launcher. collectCreatorFees(token) sends the position's LP fees to the creator.

Existing assets

RigsLauncher.openExisting(token, amount, startTick, config) pulls amount of an existing ERC-20 from the caller (approve first), opens an ETH/token pool on RigsHook and locks those tokens as single-sided liquidity. Fee-on-transfer tokens are measured by balance; rounding dust is returned. One Rigs pool per token.

Auctions

RigsAuctions runs Dutch auctions. The seller deposits tokens with a start price and a floor (ETH per whole token) and a duration up to 30 days; the price falls linearly and then holds at the floor. buy(id, tokens) pays the current price and refunds any excess. The seller calls withdraw(id) for ETH at any time and for unsold tokens once it ends, and can end(id) early. No fees.

Contracts & addresses

ContractRobinhood Chain (4663)
Pons V2 factory0x7eD598BcEf8bd9Edd8C97A195C6d13f40801EC7e
PonsLaunchernot deployed yet
RigsHooknot deployed yet
RigsLaunchernot deployed yet
RigsAuctionsnot deployed yet

Deploy everything from the browser on deploy.html, then paste the generated config.js.

Events

PonsLauncher:       Launched(uint256 indexed id, address indexed creator, address indexed token, address curve, address splitter, uint256 devBuy)
CreatorFeeSplitter: Harvested(uint256 toCreator, uint256 toTreasury)
                    Withdrawn(address indexed creator, uint256 amount)
                    CreatorChanged(address indexed previous, address indexed next)

Wallets & config

The site connects browser wallets directly, and mobile wallets through Reown AppKit when reownProjectId is set in config.js. It switches the wallet to Robinhood Chain right before a transaction.

Known limitations

  • Not audited.
  • Before graduation, fees sit on the curve until swept, so claimable() can read low until someone harvests.
  • After graduation, pool fees reach the splitter only when Pons' sweep operator credits them.
  • The Nth-Buy Pot counter is public; its winner falls back to tx.origin when a router passes no recipient.
  • Auto Burn only applies to exact-input buys.

Trust assumptions

  • The Rigs owner can change the treasury address for future harvests. It cannot touch creators' 80%.
  • Pons controls its own factory, curve and escrow and can change its terms.
  • The RigsHook owner sets block-author royalties (max 0.25% each) and the one-time launcher address.