Talos Launch App

03 · Build

Integrate

The calls a launchpad makes, in the order the contracts expect.

Point the pool at the hub. Point the modules at the hub. Then hand the hub the list.

createMarket
wave.attachHub(address(hub));
cohort.attachHub(address(hub));

wave.createLaunch(key, waveParams);
cohort.createLaunch(key, cohortParams);

address[] memory modules = new address[](2);
modules[0] = address(wave);
modules[1] = address(cohort);
hub.createMarket(key, modules);
manager.initialize(key, sqrtPriceX96);

key.hooks is the hub in every one of those calls. waveParams and cohortParams still name your trusted router and your launch token. Do this before anyone else can initialize the same key, in one transaction.

One transaction

attachHub is once per module, from the wallet that deployed it. Every pool after that can open in a single call. TalosLaunch.open runs createLaunch for each module, then createMarket, then initialize. The launcher becomes the controller for that pool. There is no owner after the call returns.

TalosLaunch.open
bytes[] memory calls = new bytes[](2);
calls[0] = abi.encodeCall(WaveScheduleHook.createLaunch, (key, waveParams));
calls[1] = abi.encodeCall(CohortCapHook.createLaunch, (key, cohortParams));

new TalosLaunch().open(manager, hub, key, modules, calls, sqrtPriceX96);

What a module must not do

Do not call poolManager.take yourself while the hub is in the middle of the swap. The debt would sit on your contract, and the credit would sit on the hub. Call the hub's pull, which LaunchHook already does for you when it is attached.

Do not call updateDynamicLPFee yourself either. The pool only accepts that call from its hook. LaunchHook relays it through the hub.