-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVestalPoolFactory.sol
More file actions
29 lines (24 loc) · 1 KB
/
Copy pathVestalPoolFactory.sol
File metadata and controls
29 lines (24 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// SPDX-License-Identifier: MIT
pragma solidity 0.8.28;
import {LaunchPool} from "./LaunchPool.sol";
/**
* Permissionless registry of LaunchPools: one native-paired pool per
* token, discoverable on-chain so the frontend can resolve token →
* market with a single read. Deployed separately from the launch
* factory so existing launches get markets without redeploying the
* protocol.
*/
contract VestalPoolFactory {
error PoolExists(address pool);
error ZeroAddress();
event PoolCreated(address indexed token, address indexed pool, address indexed creator);
/// token → its LaunchPool (zero if no market yet).
mapping(address => address) public poolOf;
function createPool(address token) external returns (address pool) {
if (token == address(0)) revert ZeroAddress();
if (poolOf[token] != address(0)) revert PoolExists(poolOf[token]);
pool = address(new LaunchPool(token));
poolOf[token] = pool;
emit PoolCreated(token, pool, msg.sender);
}
}