Verified contractExactUNLICENSED
UniswapLaunchFactoryV2
Address0xf7052a4e38e241bc66bfae6eb27d10b2a42cacb4
- Balance
0 ETH
- Transactions
176
- Compiler
solc 0.8.30
- Same code
Only this contract
Details
- Compiler
- solc 0.8.30+commit.73712a01
- Language
- solidity
- Optimization
- Yes, 200 runs
- EVM version
- cancun
- Via IR
- yes
- License
- UNLICENSED
- Match
- Exactcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 26,280,552
- Creation transaction
- 0x998f0fb894…ec5aead5a4
87 files
The source code is large: one file is shown at a time. Choose a file in the list.
- src/v2/UniswapLaunchFactoryV2.solmain11.36 KB
- lib/layerzero/oapp-evm/contracts/oapp/OApp.sol1.53 KB
- lib/layerzero/oapp-evm/contracts/oapp/OAppCore.sol3.36 KB
- lib/layerzero/oapp-evm/contracts/oapp/OAppReceiver.sol5.41 KB
- lib/layerzero/oapp-evm/contracts/oapp/OAppSender.sol5.63 KB
- lib/layerzero/oapp-evm/contracts/oapp/interfaces/IOAppCore.sol1.86 KB
- lib/layerzero/oapp-evm/contracts/oapp/interfaces/IOAppMsgInspector.sol909 B
- lib/layerzero/oapp-evm/contracts/oapp/interfaces/IOAppOptionsType3.sol1.44 KB
- lib/layerzero/oapp-evm/contracts/oapp/interfaces/IOAppReceiver.sol1.08 KB
- lib/layerzero/oapp-evm/contracts/oapp/libs/OAppOptionsType3.sol4.9 KB
- lib/layerzero/oapp-evm/contracts/precrime/OAppPreCrimeSimulator.sol5.36 KB
- lib/layerzero/oapp-evm/contracts/precrime/interfaces/IOAppPreCrimeSimulator.sol1.92 KB
- lib/layerzero/oapp-evm/contracts/precrime/interfaces/IPreCrime.sol1.11 KB
- lib/layerzero/oapp-evm/contracts/precrime/libs/Packet.sol2.47 KB
- lib/layerzero/oft-evm/contracts/OFT.sol3.4 KB
- lib/layerzero/oft-evm/contracts/OFTCore.sol20.65 KB
- lib/layerzero/oft-evm/contracts/interfaces/IOFT.sol6.28 KB
- lib/layerzero/oft-evm/contracts/libs/OFTComposeMsgCodec.sol2.99 KB
- lib/layerzero/oft-evm/contracts/libs/OFTMsgCodec.sol2.91 KB
- lib/layerzero/protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol2.59 KB
- lib/layerzero/protocol-v2/contracts/interfaces/ILayerZeroReceiver.sol519 B
- lib/layerzero/protocol-v2/contracts/interfaces/IMessageLib.sol805 B
- lib/layerzero/protocol-v2/contracts/interfaces/IMessageLibManager.sol2.76 KB
- lib/layerzero/protocol-v2/contracts/interfaces/IMessagingChannel.sol1.54 KB
- lib/layerzero/protocol-v2/contracts/interfaces/IMessagingComposer.sol1.03 KB
- lib/layerzero/protocol-v2/contracts/interfaces/IMessagingContext.sol239 B
- lib/layerzero/protocol-v2/contracts/interfaces/ISendLib.sol923 B
- lib/layerzero/protocol-v2/contracts/libs/AddressCast.sol1.47 KB
- lib/layerzero/protocol-v2/contracts/messagelib/libs/PacketV1Codec.sol3.67 KB
- lib/openzeppelin-contracts/contracts/access/Ownable.sol3.1 KB
- lib/openzeppelin-contracts/contracts/interfaces/IERC1363.sol4.45 KB
- lib/openzeppelin-contracts/contracts/interfaces/IERC165.sol192 B
- lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol181 B
- lib/openzeppelin-contracts/contracts/interfaces/draft-IERC6093.sol6.54 KB
- lib/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol10.9 KB
- lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol2.78 KB
- lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol684 B
- lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol9.44 KB
- lib/openzeppelin-contracts/contracts/utils/Address.sol6.03 KB
- lib/openzeppelin-contracts/contracts/utils/Context.sol963 B
- lib/openzeppelin-contracts/contracts/utils/Errors.sol896 B
- lib/openzeppelin-contracts/contracts/utils/ReentrancyGuardTransient.sol2.06 KB
- lib/openzeppelin-contracts/contracts/utils/TransientSlot.sol5.07 KB
- lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol870 B
- lib/uniswap-v4-core/src/interfaces/IExtsload.sol1.02 KB
- lib/uniswap-v4-core/src/interfaces/IExttload.sol699 B
- lib/uniswap-v4-core/src/interfaces/IHooks.sol8.23 KB
- lib/uniswap-v4-core/src/interfaces/IPoolManager.sol12.84 KB
- lib/uniswap-v4-core/src/interfaces/IProtocolFees.sol2.49 KB
- lib/uniswap-v4-core/src/interfaces/callback/IUnlockCallback.sol488 B
- lib/uniswap-v4-core/src/interfaces/external/IERC20Minimal.sol3.04 KB
- lib/uniswap-v4-core/src/interfaces/external/IERC6909Claims.sol3.16 KB
- lib/uniswap-v4-core/src/libraries/BitMath.sol2.61 KB
- lib/uniswap-v4-core/src/libraries/CustomRevert.sol5.17 KB
- lib/uniswap-v4-core/src/libraries/FixedPoint128.sol297 B
- lib/uniswap-v4-core/src/libraries/FullMath.sol5.46 KB
- lib/uniswap-v4-core/src/libraries/Hooks.sol16.51 KB
- lib/uniswap-v4-core/src/libraries/LPFeeLibrary.sol3.6 KB
- lib/uniswap-v4-core/src/libraries/LiquidityMath.sol742 B
- lib/uniswap-v4-core/src/libraries/ParseBytes.sol1.2 KB
- lib/uniswap-v4-core/src/libraries/Position.sol4.81 KB
- lib/uniswap-v4-core/src/libraries/SafeCast.sol2.27 KB
- lib/uniswap-v4-core/src/libraries/StateLibrary.sol16.03 KB
- lib/uniswap-v4-core/src/libraries/TickMath.sol12.38 KB
- lib/uniswap-v4-core/src/types/BalanceDelta.sol2.34 KB
- lib/uniswap-v4-core/src/types/BeforeSwapDelta.sol1.47 KB
- lib/uniswap-v4-core/src/types/Currency.sol5.46 KB
- lib/uniswap-v4-core/src/types/PoolId.sol539 B
- lib/uniswap-v4-core/src/types/PoolKey.sol805 B
- lib/uniswap-v4-core/src/types/PoolOperation.sol907 B
- src/FactoryList.sol3.63 KB
- src/ITokenParams.sol2.39 KB
- src/lz/GasFloor.sol3.83 KB
- src/lz/Routes.sol5.92 KB
- src/v2/FeeSplitterV2.sol26.3 KB
- src/v2/LaunchFactoryBaseV2.sol70.31 KB
- src/v2/LaunchOwnerV2.sol9.8 KB
- src/v2/PangeaOFTV2.sol19.62 KB
- src/v2/PartsDeployerV2.sol1.37 KB
- src/v2/PriceAttestorV2.sol40.03 KB
- src/v2/TokenDeployerV2.sol11.11 KB
- src/v2/UniswapLaunchFactoryV2Joiner.sol10.05 KB
- src/v2/UniswapVenueV2.sol9.17 KB
- src/venues/LiquidityLocker.sol23.92 KB
- src/venues/OpeningDust.sol3.4 KB
- src/venues/PangeaFeeHook.sol32.85 KB
- src/venues/SingleSidedMath.sol4.64 KB
src/v2/UniswapLaunchFactoryV2.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.30;
import {IERC1271} from "./LaunchFactoryBaseV2.sol";
import {UniswapVenueV2} from "./UniswapVenueV2.sol";
import {UniswapLaunchFactoryV2Joiner} from "./UniswapLaunchFactoryV2Joiner.sol";
import {PriceAttestorV2} from "./PriceAttestorV2.sol";
import {RouteConfig} from "../lz/Routes.sol";
/// @title UniswapLaunchFactoryV2
/// @notice Pangea launch factory v2 on Uniswap v4 (docs/factory-v2.md): Ethereum, Base, BSC,
/// Robinhood. The launch itself is here; adding a chain after launch (`joinChain`,
/// `addChain`, `seedJoined`) is the companion's code, run here by delegatecall, on this
/// contract's storage, as this contract.
/// @dev THE COMPANION IS DEPLOYED FIRST, with the same arguments, and named here (`joiner_`). It
/// runs on this contract's storage, so what must agree is what it holds as immutables: this
/// constructor reads every one of them back from it and refuses a companion whose endpoint,
/// attestor, deployer, platform, operator, collector, parts deployer, chain, pool manager, hook
/// locker or either tokenomics implementation differs from its own (`JoinerMismatch`). (It was made here once, which put this
/// contract's init code past the 49,152-byte limit with four routes.) Its address is an
/// immutable here, and only the fallback reaches it: every selector this contract does not have
/// goes to the companion, which has the three add-a-chain functions and refuses direct calls.
contract UniswapLaunchFactoryV2 is UniswapVenueV2 {
/// @notice The companion holding the add-a-chain code. Reached only by delegatecall.
address public immutable joiner;
constructor(
address lzEndpoint_,
address attestor_,
address tokenDeployer_,
address poolManager_,
address feeHook_,
address locker_,
address platform_,
address operator_,
address admin_,
address feeCollector_,
address parts_,
address joiner_,
address tokenomicsImplementation_,
address tokenomicsV2Implementation_,
RouteConfig[] memory routes_
) UniswapVenueV2(lzEndpoint_, attestor_, tokenDeployer_, poolManager_, feeHook_, locker_, platform_, operator_, admin_, feeCollector_, parts_, tokenomicsImplementation_, tokenomicsV2Implementation_, routes_) {
UniswapLaunchFactoryV2Joiner j = UniswapLaunchFactoryV2Joiner(payable(joiner_));
if (joiner_.code.length == 0) revert JoinerMismatch(0);
if (j.lzEndpoint() != lzEndpoint) revert JoinerMismatch(1);
if (address(j.attestor()) != address(attestor)) revert JoinerMismatch(2);
if (address(j.tokenDeployer()) != address(tokenDeployer)) revert JoinerMismatch(3);
if (j.platform() != platform) revert JoinerMismatch(4);
if (j.operator() != operator) revert JoinerMismatch(5);
if (address(j.feeCollector()) != address(feeCollector)) revert JoinerMismatch(6);
if (address(j.parts()) != address(parts)) revert JoinerMismatch(7);
if (j.localEid() != localEid) revert JoinerMismatch(8);
if (j.poolManager() != poolManager) revert JoinerMismatch(9);
if (address(j.feeHook()) != address(feeHook)) revert JoinerMismatch(10);
if (address(j.locker()) != address(locker)) revert JoinerMismatch(11);
if (j.tokenomicsImplementation() != tokenomicsImplementation) revert JoinerMismatch(12);
if (j.tokenomicsV2Implementation() != tokenomicsV2Implementation) revert JoinerMismatch(13);
joiner = joiner_;
}
/// @notice The companion named at construction disagrees with this factory: `field` is which
/// immutable (0: it has no code).
error JoinerMismatch(uint256 field);
/// @notice Launch, as the creator themselves or as the platform on their behalf -- its admin,
/// or a launcher its admin has listed.
///
/// @dev NOT PERMISSIONLESS, and the reason is specific to launching on five chains at once. The
/// snapshot's signature is the real authorisation -- it names the token, the price, the fee
/// and the peer set, so a caller can change nothing about the launch except the tick,
/// inside a tolerance capped at 1%. But that signature becomes public the moment the first
/// chain is launched, and with this open to anyone, whoever watches that transaction could
/// take the remaining four chains and bundle the launch with the first buy atomically on
/// each. The creator would be front-run on their own token, on the chains they had not
/// reached yet, and could do nothing about it.
///
/// A listed launcher is how the platform does this for a creator who holds funds on one
/// chain and has signed nothing. `launchAuthorized` is how a creator hands it to somebody
/// the platform has not listed.
function launch(
LaunchParams calldata p,
LaunchTerms calldata terms,
PriceAttestorV2.Snapshot calldata snap,
bytes calldata signature
) external payable returns (Launch memory out) {
if (msg.sender != p.creator && msg.sender != admin && !isLauncher[msg.sender]) {
revert NotLauncher(p.creator);
}
return _launch(p, terms, snap, signature);
}
/// @notice Launch on behalf of a creator who signed for it, paying their gas for them.
///
/// ## Why this exists
///
/// A creator cannot be `msg.sender` on four chains without first holding ETH on Ethereum, ETH
/// on Base, ETH on Robinhood and BNB on BSC. That is four funded balances in three assets
/// before they can begin, which is not a launchpad, and it is why `launch` being
/// creator-or-admin was only half an answer: the admin half meant the platform paying for
/// every launch with nothing tying its hands.
///
/// So the creator signs, once, for free, and anyone they authorised broadcasts. Gas is the
/// launcher's problem, which is the platform's, which is what a launch fee is for.
///
/// ## Why the signature names the launcher
///
/// Because it is the one thing that makes a PUBLIC authorisation safe. This signature is
/// visible from the moment the first chain is launched -- the same exposure that stops `launch`
/// being open -- and binding `launcher` into what is signed means seeing it is worthless to
/// anyone else: a bot replaying it is not the named launcher, so the recovery still matches but
/// the gate does not open.
///
/// That is also what lets ONE signature cover all four chains. The domain omits `chainId` and
/// `verifyingContract` for the same reason `PriceAttestor`'s does: a chain-specific domain
/// would mean four signatures, four prompts, and nothing tying them together. Replay is bounded
/// by `launchId`, which every chain consumes exactly once.
///
/// ## What it does not permit
///
/// Nothing the creator did not already control. The signature carries no price, no fee and no
/// supply -- all of those are in the snapshot the platform's price signer signed, and the token
/// address commits to the creator, the name, the symbol and the metadata URI. A launcher
/// holding this signature can launch THAT launch, or nothing.
///
/// ## A creator that is a contract (v2)
///
/// A multisig, a smart account or a tokenomics contract cannot produce an ECDSA signature, so
/// for a creator with code the same digest -- `attestor.launchAuthHash(launchId, msg.sender)`,
/// so a Safe signs exactly what an EOA signs -- is put to the creator's own EIP-1271
/// `isValidSignature`, as a static call with at most `ERC1271_GAS`, and must return the magic
/// value. An EIP-7702 delegated EOA has code and takes this path; a delegation that does not
/// implement EIP-1271 fails closed.
///
/// @param creatorAuth A 65-byte ECDSA signature by `p.creator` over `launchAuthHash(launchId,
/// msg.sender)`, or, for a creator with code, whatever its `isValidSignature` accepts.
function launchAuthorized(
LaunchParams calldata p,
LaunchTerms calldata terms,
PriceAttestorV2.Snapshot calldata snap,
bytes calldata signature,
bytes calldata creatorAuth
) external payable returns (Launch memory out) {
if (p.creator.code.length == 0) {
// Verified by the attestor, which owns EIP-712 and the malleability rule for this
// system: two implementations of one signature scheme are two things that can drift.
address signer = attestor.recoverLaunchAuth(snap.launchId, msg.sender, creatorAuth);
if (signer != p.creator) revert BadCreatorAuth(signer, p.creator);
} else {
bytes32 digest = attestor.launchAuthHash(snap.launchId, msg.sender);
(bool ok, bytes memory ret) = p.creator.staticcall{gas: ERC1271_GAS}(
abi.encodeCall(IERC1271.isValidSignature, (digest, creatorAuth))
);
if (!ok || ret.length < 32 || abi.decode(ret, (bytes32)) != bytes32(IERC1271.isValidSignature.selector)) {
revert ContractCreatorRefused(p.creator);
}
}
return _launch(p, terms, snap, signature);
}
/// @dev The vault half of the payee check, run in the companion for size (EIP-170: with B26's
/// second vault kind this contract's runtime was 24,869 bytes). A static call to this
/// contract, which the fallback below delegates to the joiner's `checkVaultPayee`: the
/// same logic (LaunchFactoryBaseV2 `_checkVaultPayee`), as this contract, with immutables
/// the constructor held equal to this contract's (JoinerMismatch 12 and 13). Its revert --
/// `PayeeNotAllowed(payee)` -- comes back unchanged.
function _checkVaultPayee(
address payee,
address creator,
bytes32 launchId,
PriceAttestorV2.Leg[] calldata legs,
address[] calldata quotes
) internal view override {
(bool ok, bytes memory ret) = address(this).staticcall(
abi.encodeCall(UniswapLaunchFactoryV2Joiner.checkVaultPayee, (payee, creator, launchId, legs, quotes))
);
if (!ok) {
assembly ("memory-safe") {
revert(add(ret, 0x20), mload(ret))
}
}
}
/// @dev Everything else is the companion's: delegatecall, with this contract's storage and
/// identity, and its answer or revert passed back unchanged. Not payable: none of the
/// companion's functions takes value, and `receive` takes the dust float.
fallback() external {
address j = joiner;
// Memory-safe in the compiler's sense: it works only past the free memory pointer, and
// never comes back to Solidity code.
assembly ("memory-safe") {
let ptr := mload(0x40)
calldatacopy(ptr, 0, calldatasize())
let ok := delegatecall(gas(), j, ptr, calldatasize(), 0, 0)
returndatacopy(ptr, 0, returndatasize())
if iszero(ok) { revert(ptr, returndatasize()) }
return(ptr, returndatasize())
}
}
}
Compiler settingsShow
{
"viaIR": true,
"metadata": {
"bytecodeHash": "ipfs"
},
"libraries": {},
"optimizer": {
"runs": 200,
"enabled": true
},
"evmVersion": "cancun",
"remappings": [
"@layerzerolabs/lz-evm-protocol-v2/=lib/layerzero/protocol-v2/",
"@layerzerolabs/oapp-evm/=lib/layerzero/oapp-evm/",
"@layerzerolabs/oft-evm/=lib/layerzero/oft-evm/",
"@openzeppelin/=lib/openzeppelin-contracts/",
"@uniswap/v4-core/=lib/uniswap-v4-core/",
"ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/",
"erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
"forge-std/=lib/forge-std/src/",
"halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
"layerzero/=lib/layerzero/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/",
"solmate/=lib/solmate/",
"uniswap-v4-core/=lib/uniswap-v4-core/src/"
]
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.