Docs

Deployment

What Deploy.s.sol automates, what it deliberately leaves manual, and how the deployer key is supplied.

Deployment is a checkpoint, not a script step

Deploy.s.sol deploys the contracts and wires their config. It deliberately does not seed liquidity or enable trading. Those need real BNB and token amounts decided at deploy time by a human, never baked into a script that runs unattended.

What Deploy.s.sol does

Deploys, in order, and wires them together:

  1. SnowballRegistry(deployer)
  2. FeeRouter(pancakeRouter, deployer)
  3. SnowballToken(name, symbol, supply, deployer)
  4. feeRouter.configureToken(token, 7000, 3000, 0, token), the 70/30 burn/LP default from Fee & Burn Mechanics
  5. token.setFeeRouter(feeRouter)

Dry run against real mainnet state

Running the script without --broadcast simulates the entire deployment against current chain state and estimates real cost, with nothing actually sent:

forge script script/Deploy.s.sol --rpc-url bsc
$ forge script script/Deploy.s.sol --rpc-url bsc
Script ran successfully.
Chain 56
Estimated gas price: 0.05 gwei
Estimated total gas used for script: 7339033
Estimated amount required: 0.00036695165 BNB
SIMULATION COMPLETE. Add --broadcast and wallet configuration(s) to send it for real.

Manual steps after deployment (not automated, on purpose)

1

Seed liquidity

token.approve(pancakeRouter, tokenAmount), then router.addLiquidityETH{value: bnbAmount}(token, tokenAmount, 0, 0, deployer, deadline).
2

Register the pair

token.setPair(pairAddress, true). Get pairAddress from factory.getPair(token, WETH) after seeding.
3

Open trading

token.enableTrading(), one-way and cannot be undone.
4

Decide the swap trigger

Leave permissionlessSwaps off and call swapAndBurn yourself (or via a keeper you set with setKeeper()) until the pool has real depth. See Security Model.

How the deployer key is supplied

Never hardcoded, never in an env file. Broadcast with Foundry's encrypted keystore or an interactive prompt:

the actual broadcast (not run yet)
$ cast wallet import deployer --interactive
$ forge script script/Deploy.s.sol \
--rpc-url bsc --account deployer --broadcast --verify