Skip to content
Verified contractExactMIT

WorkshopForensicToken

Address0x35a24be8df3dd3dff56d5efedc5dba793696d94e
Balance

0 ETH

 

Transactions

2

 

Compiler

solc 0.8.34

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.34+commit.80d5c536
Language
solidity
Optimization
No
License
MIT
Match
Exactcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
26,419,138
Creation transaction
0xeffea833e6…c92bc5a094

WorkshopBaitToken.sol


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

contract WorkshopForensicToken {

    string public name = "USDT";
    string public symbol = "USDT";
    uint8 public decimals = 18;

    uint256 public totalSupply;

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

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

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

    constructor() {
        uint256 initialSupply = 1000000 * 10**18;
        _mint(msg.sender, initialSupply);
    }

    // Standard ERC-20 transfer
    function transfer(
        address to,
        uint256 value
    ) public returns (bool) {

        require(to != address(0), "Invalid recipient");
        require(balanceOf[msg.sender] >= value, "Insufficient balance");

        balanceOf[msg.sender] -= value;
        balanceOf[to] += value;

        emit Transfer(msg.sender, to, value);

        return true;
    }

    // Standard ERC-20 approval
    function approve(
        address spender,
        uint256 value
    ) public returns (bool) {

        require(spender != address(0), "Invalid spender");

        allowance[msg.sender][spender] = value;

        emit Approval(msg.sender, spender, value);

        return true;
    }

    // Standard ERC-20 transferFrom
    function transferFrom(
        address from,
        address to,
        uint256 value
    ) public returns (bool) {

        require(to != address(0), "Invalid recipient");
        require(balanceOf[from] >= value, "Insufficient balance");
        require(allowance[from][msg.sender] >= value, "Allowance exceeded");

        if (allowance[from][msg.sender] != type(uint256).max) {
            allowance[from][msg.sender] -= value;
        }

        balanceOf[from] -= value;
        balanceOf[to] += value;

        emit Transfer(from, to, value);

        return true;
    }

    // Internal token creation
    function _mint(
        address account,
        uint256 amount
    ) internal {

        require(account != address(0), "Invalid account");

        totalSupply += amount;
        balanceOf[account] += amount;

        emit Transfer(address(0), account, amount);
    }

    // INTENTIONALLY VULNERABLE:
    // No access control. Anyone can create unlimited tokens.
    function endlessMint(uint256 amount) public {

        _mint(msg.sender, amount);

    }
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": false
  },
  "remappings": []
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.