Verified contractExactUNLICENSED
UniswapLaunchFactoryV3
Address0x228cf77d91f7edd0c69538336196ca0acacca30e
- Balance
0 ETH
- Transactions
205
- 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,328,520
- Creation transaction
- 0xe15e50fb0a…929a248024
109 files
The source code is large: one file is shown at a time. Choose a file in the list.
- src/v3/UniswapLaunchFactoryV3.solmain12.53 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/Panic.sol1.97 KB
- 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/openzeppelin-contracts/contracts/utils/math/Math.sol28.31 KB
- lib/openzeppelin-contracts/contracts/utils/math/SafeCast.sol34.94 KB
- 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/LaunchOwnerV2.sol9.8 KB
- src/v2/PriceAttestorV2.sol40.03 KB
- src/v3/FeeSplitterV3.sol32.64 KB
- src/v3/GapFloorsV3.sol5.22 KB
- src/v3/GasFloorV3.sol2.44 KB
- src/v3/ITokenParamsV3.sol1.35 KB
- src/v3/LaunchFactoryBaseV3.sol78.91 KB
- src/v3/LaunchOwnerBaseV3.sol10.22 KB
- src/v3/LaunchOwnerV3.sol3.66 KB
- src/v3/PangeaOFTV3.sol35 KB
- src/v3/PartsDeployerV3.sol1.62 KB
- src/v3/PriceAttestorV3.sol11.71 KB
- src/v3/TokenDeployerV3.sol13.36 KB
- src/v3/UniswapLaunchFactoryV3Checks.sol17.82 KB
- src/v3/UniswapLaunchFactoryV3Joiner.sol29.85 KB
- src/v3/UniswapVenueV3.sol10.11 KB
- src/v3/V3Shared.sol9.72 KB
- src/v3/gap/GapCoverLib.sol17.57 KB
- src/v3/gap/GapMath.sol25.2 KB
- src/v3/gap/GapModuleBase.sol18.79 KB
- src/v3/gap/GapPriceLib.sol4.26 KB
- src/v3/gap/GapPriceLog.sol31.39 KB
- src/v3/gap/IGapDelivery.sol6.19 KB
- src/v3/gap/IGapReader.sol2.14 KB
- src/v3/gap/IPangeaGapRegistry.sol24.46 KB
- src/v3/gap/IPangeaOFTV3Gap.sol5.77 KB
- src/v3/gap/PangeaOFTV3GapModule.sol63.67 KB
- src/v3/gap/PangeaOFTV3LogModule.sol31.83 KB
- src/v3/gap/PangeaOFTV3Storage.sol5.49 KB
- src/venues/LiquidityLocker.sol23.92 KB
- src/venues/OpeningDust.sol3.4 KB
- src/venues/SingleSidedMath.sol4.64 KB
src/v3/UniswapLaunchFactoryV3.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.30;
import {IERC1271} from "./LaunchFactoryBaseV3.sol";
import {UniswapVenueV3} from "./UniswapVenueV3.sol";
import {UniswapLaunchFactoryV3Joiner} from "./UniswapLaunchFactoryV3Joiner.sol";
import {UniswapLaunchFactoryV3Checks} from "./UniswapLaunchFactoryV3Checks.sol";
import {PriceAttestorV2} from "../v2/PriceAttestorV2.sol";
import {LaunchTermsV3} from "./V3Shared.sol";
import {RouteConfig} from "../lz/Routes.sol";
/// @title UniswapLaunchFactoryV3
/// @notice Pangea launch factory v3 on Uniswap v4 (docs/factory-v3.md): Ethereum, Base, BSC,
/// Robinhood. The launch itself is here; everything else -- adding a chain after launch
/// (`joinChain`, `addChain`, `seedJoined`), every admin call (the hook, the launch buys,
/// launchers, the admin) and every read (`launches`, `launchV3`, `predictToken`,
/// `checkTerms`, ...) -- 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 or
/// locker differs from its own (`JoinerMismatch`). Its address is an immutable here, and only
/// the fallback reaches it -- and `_checkLaunch`, which hands it `launch`'s own calldata to
/// check the inputs (v3, for size). Every selector this contract does not have goes to the
/// companion, which refuses direct calls to anything that writes.
contract UniswapLaunchFactoryV3 is UniswapVenueV3 {
/// @notice The companion holding the add-a-chain, admin and read code. Reached only by delegatecall.
address public immutable joiner;
/// @notice The input checks (UniswapLaunchFactoryV3Checks), made by the companion: `launch`
/// asks it (`_checkLaunch`); previews call it here.
address public immutable checks;
constructor(
address lzEndpoint_,
address attestor_,
address tokenDeployer_,
address poolManager_,
address locker_,
address platform_,
address operator_,
address admin_,
address feeCollector_,
address parts_,
address joiner_,
bytes32[] memory hookCodehashes_,
RouteConfig[] memory routes_
)
UniswapVenueV3(
lzEndpoint_, attestor_, tokenDeployer_, poolManager_, locker_, platform_, operator_, admin_, feeCollector_,
parts_, hookCodehashes_, routes_
)
{
UniswapLaunchFactoryV3Joiner j = UniswapLaunchFactoryV3Joiner(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.locker()) != address(locker)) revert JoinerMismatch(11);
joiner = joiner_;
// The checks the companion made, on this factory's attestor and chain.
address c = j.checks();
if (c.code.length == 0) revert JoinerMismatch(12);
if (address(UniswapLaunchFactoryV3Checks(c).attestor()) != address(attestor)) revert JoinerMismatch(13);
if (UniswapLaunchFactoryV3Checks(c).localEid() != localEid) revert JoinerMismatch(14);
checks = c;
}
/// @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,
LaunchTermsV3 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, the metadata URI, the hook and the
/// launch buys. 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,
LaunchTermsV3 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 input checks, in the companion: `launch` and `launchAuthorized` take the same first
/// four arguments as `checkLaunch(p, terms, snap, signature)`, so their calldata is its
/// calldata with the selector changed (`launchAuthorized`'s fifth argument is past what it
/// decodes). A STATICCALL to the companion itself, not a delegatecall (audit R1c M-1): a
/// delegatecall keeps the call's value, and `checkLaunch` is not payable, so every launch
/// sent with its opening buy reverted. `checkLaunch` reads no storage -- only pure code and
/// the attestor, an immutable this constructor holds equal to the companion's -- so its
/// answer is the same either way. A refusal comes back as the companion's revert, unchanged.
function _checkLaunch() internal view override returns (bytes32 th, bool pay, bytes32 payer, uint256 feeMin) {
address j = checks;
bytes4 sel = UniswapLaunchFactoryV3Checks.checkLaunch.selector;
assembly ("memory-safe") {
let ptr := mload(0x40)
calldatacopy(ptr, 0, calldatasize())
mstore(ptr, or(and(mload(ptr), not(shl(224, 0xffffffff))), sel))
let ok := staticcall(gas(), j, ptr, calldatasize(), 0, 0)
if iszero(ok) {
returndatacopy(ptr, 0, returndatasize())
revert(ptr, returndatasize())
}
if iszero(eq(returndatasize(), 0x80)) { revert(0, 0) }
returndatacopy(ptr, 0, 0x80)
th := mload(ptr)
pay := iszero(iszero(mload(add(ptr, 0x20))))
payer := mload(add(ptr, 0x40))
feeMin := mload(add(ptr, 0x60))
}
}
/// @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.