Skip to content
Verified contractPartialMIT

TaclauncherToken

Address0xa938c2b4f8ffe6b7714091daa2f3309bca31a363
Balance

0 ETH

 

Transactions

0

 

Compiler

solc 0.8.24

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.24+commit.e11b9ed9
Language
solidity
Optimization
Yes, 200 runs
EVM version
cancun
Via IR
yes
License
MIT
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
26,444,296
Creation transaction
0xd727830f96…fe5d772a82

src/TaclauncherToken.sol

// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

/// @title TaclauncherToken
/// @notice Plain fixed-supply ERC-20 used for every Taclauncher launch (as an EIP-1167 clone).
///         No owner, no mint, no burn hook, no tax, no blacklist, no pause, no upgrade. 18 decimals.
///         Transfers move exactly `value` (Tacit's ConfidentialPool rejects fee-on-transfer tokens).
/// @dev    The factory creates and initializes each clone in the same transaction, so nobody else can
///         ever call `initialize` on a live token. The implementation contract itself can never be
///         initialized (it is not a token).
contract TaclauncherToken {
    string public name;
    string public symbol;
    uint8 public constant decimals = 18;
    uint256 public totalSupply;

    mapping(address => uint256) public balanceOf;
    mapping(address => mapping(address => uint256)) public allowance;

    /// @dev address of the implementation; a clone's `address(this)` differs, so only clones can initialize.
    address private immutable SELF;

    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);

    error AlreadyInitialized();

    constructor() {
        SELF = address(this);
    }

    /// @notice One-time setup (factory only, same tx as the clone's creation).
    /// @param supply     total supply in wei units (fixed forever)
    /// @param creator    receives `devTokens`
    /// @param devTokens  creator allocation (may be 0)
    /// @param spender    gets an allowance from the caller for exactly the caller's minted share
    ///                   (the factory pre-approves the AMM so the seed needs no separate approve call)
    function initialize(
        string calldata name_,
        string calldata symbol_,
        uint256 supply,
        address creator,
        uint256 devTokens,
        address spender
    ) external {
        if (address(this) == SELF || totalSupply != 0) revert AlreadyInitialized();
        name = name_;
        symbol = symbol_;
        totalSupply = supply; // factory guarantees supply > 0 and devTokens <= supply
        uint256 rest = supply - devTokens;
        balanceOf[msg.sender] = rest;
        emit Transfer(address(0), msg.sender, rest);
        if (devTokens != 0) {
            balanceOf[creator] = devTokens;
            emit Transfer(address(0), creator, devTokens);
        }
        allowance[msg.sender][spender] = rest;
        emit Approval(msg.sender, spender, rest);
    }

    function approve(address spender, uint256 value) external returns (bool) {
        allowance[msg.sender][spender] = value;
        emit Approval(msg.sender, spender, value);
        return true;
    }

    function transfer(address to, uint256 value) external returns (bool) {
        _transfer(msg.sender, to, value);
        return true;
    }

    function transferFrom(address from, address to, uint256 value) external returns (bool) {
        uint256 allowed = allowance[from][msg.sender];
        if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - value;
        _transfer(from, to, value);
        return true;
    }

    function _transfer(address from, address to, uint256 value) private {
        balanceOf[from] -= value;
        unchecked {
            balanceOf[to] += value; // sum of all balances == totalSupply, so this can never overflow
        }
        emit Transfer(from, to, value);
    }
}
Compiler settingsShow
{
  "viaIR": true,
  "metadata": {
    "appendCBOR": true,
    "bytecodeHash": "none",
    "useLiteralContent": false
  },
  "libraries": {},
  "optimizer": {
    "runs": 200,
    "enabled": true
  },
  "evmVersion": "cancun",
  "remappings": [
    "forge-std/=lib/forge-std/src/"
  ]
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.