Skip to content

Security model

Non-custodial by design: what the contracts and app can and cannot do.

Stargaze Finance is an interface to public smart contracts. It never holds user funds, seed phrases or private keys, and every transaction is signed in the user's own wallet. This page summarises what the code enforces; docs/SECURITY.md in the repository is the longer version.

Launched tokens

  • StargazeToken is OpenZeppelin ERC20 + ERC20Permit with the full supply minted once in the constructor.
  • No admin keys: no owner, no mint, no pause, no blacklist, no transfer tax, no max-wallet, not upgradeable. The launch contracts' emergency pause cannot reach launched tokens.
  • creator, launcher and metadataURI are informational; none of them grants any privilege, and metadataURI cannot be changed.

Launch contracts

PropertyStargazeLaunchFactoryStargazeFairLaunch
Owner powerssetLaunchFee (≤ 0.05 ETH), setFeeRecipient, pause / unpausesetPlatformFeeBps (≤ 5 %), setFeeRecipient, pause / unpause
Pause blockscreateToken onlycreateSale and commit only — never finalize, claim or refund
Fee changes affectthe next createToken callonly sales created afterwards (fee snapshotted per sale)
LiquidityLP to creator or 0x…dEaD, emitted as liquidityBurnedpool opens at the clearing price; ≥ 20 % of the raise is paired
Funds heldnone — unused ETH / tokens are returned in the same txcommitted ETH and the supply until finalize
Escape hatch—finalize is permissionless; failed sales refund 100 %
  • Both contracts use ReentrancyGuard on every state-changing entry point, Ownable2Step for ownership transfers and OpenZeppelin Pausable for the emergency pause.
  • Allocation, supply (≤ uint112 max), name/symbol length and timing are validated on-chain — see the contracts reference.
  • settled[saleId][wallet] makes claims and refunds settle-once.

Emergency pause

If a problem is found, the owner can pause new activity so no new funds are exposed, while everyone already involved can still leave. Pausing never touches launched tokens, their pools or LP tokens.

While pausedStatus
New instant launches (createToken)❌ blocked — reverts EnforcedPause()
New fair-launch sales (createSale) and new commitments (commit)❌ blocked — reverts EnforcedPause()
finalize, claim, refund✅ always work — not pausable
Trading, transfers and approvals of launched tokens✅ unaffected — tokens have no owner
  • Only the owner can call pause() / unpause(); both emit OpenZeppelin Paused(account) / Unpaused(account) events and paused() is public.
  • A live sale keeps its fixed endTime; after it, finalize settles it against the reserve as usual, so committed ETH can never be trapped (fuzz-tested).
  • The app reads paused() and shows a banner, disabling only the create and commit buttons.
  • Before mainnet, ownership moves to a Safe multisig through Ownable2Step (transferOwnership → the Safe calls acceptOwnership).

Transactions from the app

  1. The wallet is switched to the target chain if needed.
  2. Bytecode is checked at the Stargaze contract or Uniswap router address on that chain (getCode).
  3. The exact call is simulated (simulateContract) so reverts — bad parameters, a fee change, slippage, an expired deadline — appear before the wallet prompt.
  4. The user signs in their own wallet (writeContract).
  5. Success is shown only after waitForTransactionReceipt returns status: "success".

Server side

  • Provider keys and RPC URLs without the NEXT_PUBLIC_ prefix never reach the browser; API routes proxy the providers.
  • /api/tx re-reads each submitted transaction from the chain, so clients cannot inject fake history.
  • next.config.mjs sets X-Content-Type-Options: nosniff, Referrer-Policy: strict-origin-when-cross-origin, X-Frame-Options: SAMEORIGIN and a restrictive Permissions-Policy on every route.
  • The Foundry deploy script refuses mainnet unless ALLOW_MAINNET_DEPLOY=true.

Known limitations

  • Anyone can createPair for a predictable token address before a launch; with zero reserves this does not change the opening price, and donated WETH would only benefit the LP recipient.
  • The web indexer trusts the configured RPC for logs and block timestamps.