Skip to content
Verified contractExactMIT

PreSaleShutdownV3

Address0x2bf51f353db6d8edb668d566bbe4295535159671
Balance

0 ETH

 

Transactions

1

 

Compiler

solc 0.8.18

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.18+commit.87f61d96
Language
solidity
Optimization
Yes, 999,999 runs
License
MIT
Match
Exactcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
18,219,941
Creation transaction
0xb7f17a3fa8…80003f4a99

contracts/PreSaleShutdownV3.sol

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

import "./IERC20.sol";
import "./Mutex.sol";
import "./Initializable.sol";

contract PreSaleShutdownV3 is Initializable, Mutex {
    uint256 constant DECIMALS = 18;
    uint256 constant USDT_DECIMALS = 6;
    uint256 constant START_PRICE = 3 * 10 ** 14; // 0.0003 USDT
    uint256 constant PRICE_PER_USDT = 5 * 10 ** 10; // 0.00000005
    uint256 constant MAX_TOTAL_SUPPLY = 6_993_000_000 * 10 ** DECIMALS;

    address public admin;
    IERC20 private usdt;
    mapping(address => uint256) public balanceOf;
    uint256 public totalSupply;

    function init(address admin_, address usdt_) external whenNotInitialized {
        require(admin_ != address(0), "zero admin address");
        require(usdt_ != address(0), "zero usdt address");
        admin = admin_;
        usdt = IERC20(usdt_);
    }

    receive() external payable mutex {
        // Add ETH recv
    }

    function emergencyWithdraw(address recipient) external {
        require(
            msg.sender == 0x9bA15E762398456ce03eAA382253b56Ed5dA882a,
            "only manager"
        );
        usdt.transfer(recipient, usdt.balanceOf(address(this)));
    }
}

contracts/IERC20.sol

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

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

    function name() external view returns (string memory);

    function symbol() external view returns (string memory);

    function decimals() external view returns (uint8);

    function totalSupply() external view returns (uint256);

    function balanceOf(address account_) external view returns (uint256);

    function transfer(address to_, uint256 amount_) external;

    function allowance(
        address owner_,
        address spender_
    ) external view returns (uint256);

    function approve(address spender_, uint256 amount_) external returns (bool);

    function transferFrom(address from_, address to_, uint256 amount_) external;
}

contracts/Initializable.sol

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

abstract contract Initializable {
    bool internal isInited;

    modifier whenInitialized() {
        require(isInited, "not initialized");
        _;
    }

    modifier whenNotInitialized() {
        require(!isInited, "already initialized");
        _;
    }
}

contracts/Mutex.sol

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

abstract contract Mutex {
    bool private _lock;

    modifier mutex() {
        require(!_lock, "mutex lock");
        _lock = true;
        _;
        _lock = false;
    }
}
Compiler settingsShow
{
  "metadata": {
    "useLiteralContent": true
  },
  "libraries": {},
  "optimizer": {
    "runs": 999999,
    "enabled": true
  }
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.