CashCatTokenDeployer

0xc0c0f8d38be406d65dc001afdaa32df05ab06ed0

Verification
Verified
v0.8.26+commit.8a97fa7a
Type
Contract
7,689 bytes
ABI entries
6
2 read · 1 write
License
none

Contract information

Address
0xc0c0f8d38be406d65dc001afdaa32df05ab06ed0
Chain
Robinhood Chain (4663)
Compiler
v0.8.26+commit.8a97fa7a
Optimization
Enabled
Creation tx
0xd0a1651d9a…5e384915ec

Token

Not a token

This contract does not expose ERC-20 metadata.

Read contract (2)

launchpad()address
predictTokenAddress(tuple, bytes32)address

ABI

[
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "launchpad_",
        "type": "address"
      }
    ],
    "stateMutability": "nonpayable",
    "type": "constructor"
  },
  {
    "inputs": [],
    "name": "NotLaunchpad",
    "type": "error"
  },
  {
    "inputs": [],
    "name": "ZeroAddress",
    "type": "error"
  },
  {
    "inputs": [
      {
        "components": [
          {
            "internalType": "string",
            "name": "name",
            "type": "string"
          },
          {
            "internalType": "string",
            "name": "symbol",
            "type": "string"
          },
          {
            "internalType": "string",
            "name": "logo",
            "type": "string"
          },
          {
            "internalType": "string",
            "name": "description",
            "type": "string"
          },
          {
            "components": [
              {
                "internalType": "string",
                "name": "twitter",
                "type": "string"
              },
              {
                "internalType": "string",
                "name": "telegram",
                "type": "string"
              },
              {
                "internalType": "string",
                "name": "discord",
                "type": "string"
              },
              {
                "internalType": "string",
                "name": "website",
                "type": "string"
              },
              {
                "internalType": "string",
                "name": "farcaster",
                "type": "string"
              }
            ],
            "internalType": "struct CashCatToken.Socials",
            "name": "socials",
            "type": "tuple"
          },
          {
            "internalType": "address",
            "name": "launchpad",
            "type": "address"
          },
          {
            "internalType": "address",
            "name": "deployer",
            "type": "address"
          },
          {
            "internalType": "uint256",
            "name": "supply",
            "type": "uint256"
          }
        ],
        "internalType": "struct CashCatToken.InitParams",
        "name": "params",
        "type": "tuple"
      },
      {
        "internalType": "bytes32",
        "name": "salt",
        "type": "bytes32"
      }
    ],
    "name": "deployToken",
    "outputs": [
      {
        "internalType": "address",
        "name": "token",
        "type": "address"
      }
    ],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "launchpad",
    "outputs": [
      {
        "internalType": "address",
        "name": "",
        "type": "address"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "components": [
          {
            "internalType": "string",
            "name": "name",
            "type": "string"
          },
          {
            "internalType": "string",
            "name": "symbol",
            "type": "string"
          },
          {
            "internalType": "string",
            "name": "logo",
            "type": "string"
          },
          {
            "internalType": "string",
            "name": "description",
            "type": "string"
          },
          {
            "components": [
              {
                "internalType": "string",
                "name": "twitter",
                "type": "string"
              },
              {
                "internalType": "string",
                "name": "telegram",
                "type": "string"
              },
              {
                "internalType": "string",
                "name": "discord",
                "type": "string"
              },
              {
                "internalType": "string",
                "name": "website",
                "type": "string"
              },
              {
                "internalType": "string",
                "name": "farcaster",
                "type": "string"
              }
            ],
            "internalType": "struct CashCatToken.Socials",
            "name": "socials",
            "type": "tuple"
          },
          {
            "internalType": "address",
            "name": "launchpad",
            "type": "address"
          },
          {
            "internalType": "address",
            "name": "deployer",
            "type": "address"
          },
          {
            "internalType": "uint256",
            "name": "supply",
            "type": "uint256"
          }
        ],
        "internalType": "struct CashCatToken.InitParams",
        "name": "params",
        "type": "tuple"
      },
      {
        "internalType": "bytes32",
        "name": "salt",
        "type": "bytes32"
      }
    ],
    "name": "predictTokenAddress",
    "outputs": [
      {
        "internalType": "address",
        "name": "",
        "type": "address"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  }
]

Source code

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;

import {CashCatToken} from "./CashCatToken.sol";

/**
 * @title CashCatTokenDeployer
 * @notice Deterministically deploys {CashCatToken} instances for the CashCat
 * launchpad. Lives as its own contract so the token creation code is not
 * embedded in the launchpad, keeping the launchpad comfortably under the
 * EIP-170 contract-size limit.
 * @dev Permanently bound 1:1 to a single launchpad: `launchpad` is immutable and
 * `deployToken` is `onlyLaunchpad`. A launchpad redeploy therefore requires a
 * fresh deployer and yields different token addresses — this split does NOT make
 * token addresses survive a launchpad redeploy.
 */
contract CashCatTokenDeployer {
    error NotLaunchpad();
    error ZeroAddress();

    /// @notice The only address allowed to deploy tokens through this contract.
    address public immutable launchpad;

    constructor(address launchpad_) {
        if (launchpad_ == address(0)) revert ZeroAddress();
        launchpad = launchpad_;
    }

    /**
     * @notice Deploys a token via CREATE2. The token's full supply is minted
     * to the launchpad and its privileged role is pinned to the launchpad.
     * @dev The launchpad passes a salt already scoped to the launching wallet.
     */
    function deployToken(CashCatToken.InitParams calldata params, bytes32 salt) external returns (address token) {
        if (msg.sender != launchpad) revert NotLaunchpad();
        token = address(new CashCatToken{salt: salt}(params));
    }

    /**
     * @notice Computes the deterministic address a token would deploy to.
     */
    function predictTokenAddress(CashCatToken.InitParams calldata params, bytes32 salt)
        external
        view
        returns (address)
    {
        bytes32 initCodeHash = keccak256(abi.encodePacked(type(CashCatToken).creationCode, abi.encode(params)));
        return address(uint160(uint256(keccak256(abi.encodePacked(bytes1(0xff), address(this), salt, initCodeHash)))));
    }
}
Chain explorer3936msChain node91ms