Midpoint Cross Testnet

chainId 139420 · tMIDX · temporary explorer

Address

Address
0x4ac806b40d05c075b4a5bf54d6dcdfd4ac46836d
Type
contract
Balance
0 tMIDX (0 wei)
Nonce
1
Code size
2,501 bytes

Contract

Creator
0x59de9c0c9e9ff2e83d21a44ebd4fa83eb9ac1394
Creation tx
0xc9ebf05f0b1517f66d56b909b4a6… (block 9,816)

Source code ✓ verified

Contract
MockStablecoin
Compiler
solc 0.8.36+commit.8a079791
Optimizer
enabled, 200 runs
Verified
2026-09-22 19:45:26 UTC
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

/// @title MockStablecoin
/// @notice Minimal, self-contained ERC-20 for the MIDX **testnet only**. It mimics the shape of a
///         fiat-backed stablecoin (name / symbol / decimals) so integrations can test against
///         USDC / EURC / JPYC / MXNB-shaped tokens.
///
///         This is NOT a real stablecoin: it is unbacked and freely mintable by the owner. Do not
///         deploy to mainnet. The same source is deployed once per currency with different constructor
///         arguments; the deployer becomes the owner and receives the initial supply.
contract MockStablecoin {
    // --- ERC-20 metadata ---
    string public name;
    string public symbol;
    uint8 public immutable decimals;

    // --- ERC-20 state ---
    uint256 public totalSupply;
    mapping(address => uint256) public balanceOf;
    mapping(address => mapping(address => uint256)) public allowance;

    // --- ownership (mint control) ---
    address public owner;

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

    modifier onlyOwner() {
        require(msg.sender == owner, "not owner");
        _;
    }

    /// @param _name         Token name, e.g. "USD Coin".
    /// @param _symbol       Token symbol, e.g. "USDC".
    /// @param _decimals     Decimal precision (USDC/EURC/MXNB = 6, JPYC = 18).
    /// @param _initialHolder Address credited with the initial supply (the tMIDX wallet).
    /// @param _initialSupply Initial amount in base units (whole * 10**decimals).
    constructor(
        string memory _name,
        string memory _symbol,
        uint8 _decimals,
        address _initialHolder,
        uint256 _initialSupply
    ) {
        name = _name;
        symbol = _symbol;
        decimals = _decimals;
        owner = msg.sender;
        emit OwnershipTransferred(address(0), msg.sender);
        if (_initialSupply > 0) {
            _mint(_initialHolder, _initialSupply);
        }
    }

    // --- ERC-20 ---

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

    function approve(address spender, uint256 value) external returns (bool) {
        allowance[msg.sender][spender] = value;
        emit Approval(msg.sender, spender, 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) {
            require(allowed >= value, "insufficient allowance");
            allowance[from][msg.sender] = allowed - value;
        }
        _transfer(from, to, value);
        return true;
    }

    // --- mint / burn (testnet convenience) ---

    /// @notice Owner-only mint, to top up test balances.
    function mint(address to, uint256 amount) external onlyOwner {
        _mint(to, amount);
    }

    /// @notice Burn from the caller's own balance.
    function burn(uint256 amount) external {
        uint256 bal = balanceOf[msg.sender];
        require(bal >= amount, "insufficient balance");
        unchecked { balanceOf[msg.sender] = bal - amount; }
        totalSupply -= amount;
        emit Transfer(msg.sender, address(0), amount);
    }

    /// @notice Hand ownership (mint rights) to another address.
    function transferOwnership(address newOwner) external onlyOwner {
        require(newOwner != address(0), "zero owner");
        emit OwnershipTransferred(owner, newOwner);
        owner = newOwner;
    }

    // --- internal ---

    function _transfer(address from, address to, uint256 value) internal {
        require(to != address(0), "transfer to zero");
        uint256 bal = balanceOf[from];
        require(bal >= value, "insufficient balance");
        unchecked { balanceOf[from] = bal - value; }
        balanceOf[to] += value;
        emit Transfer(from, to, value);
    }

    function _mint(address to, uint256 amount) internal {
        require(to != address(0), "mint to zero");
        totalSupply += amount;
        balanceOf[to] += amount;
        emit Transfer(address(0), to, amount);
    }
}

ABI

[
 {
  "type": "constructor",
  "inputs": [
   {
    "name": "_name",
    "type": "string",
    "internalType": "string"
   },
   {
    "name": "_symbol",
    "type": "string",
    "internalType": "string"
   },
   {
    "name": "_decimals",
    "type": "uint8",
    "internalType": "uint8"
   },
   {
    "name": "_initialHolder",
    "type": "address",
    "internalType": "address"
   },
   {
    "name": "_initialSupply",
    "type": "uint256",
    "internalType": "uint256"
   }
  ],
  "stateMutability": "nonpayable"
 },
 {
  "name": "Approval",
  "type": "event",
  "inputs": [
   {
    "name": "owner",
    "type": "address",
    "indexed": true,
    "internalType": "address"
   },
   {
    "name": "spender",
    "type": "address",
    "indexed": true,
    "internalType": "address"
   },
   {
    "name": "value",
    "type": "uint256",
    "indexed": false,
    "internalType": "uint256"
   }
  ],
  "anonymous": false
 },
 {
  "name": "OwnershipTransferred",
  "type": "event",
  "inputs": [
   {
    "name": "previousOwner",
    "type": "address",
    "indexed": true,
    "internalType": "address"
   },
   {
    "name": "newOwner",
    "type": "address",
    "indexed": true,
    "internalType": "address"
   }
  ],
  "anonymous": false
 },
 {
  "name": "Transfer",
  "type": "event",
  "inputs": [
   {
    "name": "from",
    "type": "address",
    "indexed": true,
    "internalType": "address"
   },
   {
    "name": "to",
    "type": "address",
    "indexed": true,
    "internalType": "address"
   },
   {
    "name": "value",
    "type": "uint256",
    "indexed": false,
    "internalType": "uint256"
   }
  ],
  "anonymous": false
 },
 {
  "name": "allowance",
  "type": "function",
  "inputs": [
   {
    "name": "",
    "type": "address",
    "internalType": "address"
   },
   {
    "name": "",
    "type": "address",
    "internalType": "address"
   }
  ],
  "outputs": [
   {
    "name": "",
    "type": "uint256",
    "internalType": "uint256"
   }
  ],
  "stateMutability": "view"
 },
 {
  "name": "approve",
  "type": "function",
  "inputs": [
   {
    "name": "spender",
    "type": "address",
    "internalType": "address"
   },
   {
    "name": "value",
    "type": "uint256",
    "internalType": "uint256"
   }
  ],
  "outputs": [
   {
    "name": "",
    "type": "bool",
    "internalType": "bool"
   }
  ],
  "stateMutability": "nonpayable"
 },
 {
  "name": "balanceOf",
  "type": "function",
  "inputs": [
   {
    "name": "",
    "type": "address",
    "internalType": "address"
   }
  ],
  "outputs": [
   {
    "name": "",
    "type": "uint256",
    "internalType": "uint256"
   }
  ],
  "stateMutability": "view"
 },
 {
  "name": "burn",
  "type": "function",
  "inputs": [
   {
    "name": "amount",
    "type": "uint256",
    "internalType": "uint256"
   }
  ],
  "outputs": [],
  "stateMutability": "nonpayable"
 },
 {
  "name": "decimals",
  "type": "function",
  "inputs": [],
  "outputs": [
   {
    "name": "",
    "type": "uint8",
    "internalType": "uint8"
   }
  ],
  "stateMutability": "view"
 },
 {
  "name": "mint",
  "type": "function",
  "inputs": [
   {
    "name": "to",
    "type": "address",
    "internalType": "address"
   },
   {
    "name": "amount",
    "type": "uint256",
    "internalType": "uint256"
   }
  ],
  "outputs": [],
  "stateMutability": "nonpayable"
 },
 {
  "name": "name",
  "type": "function",
  "inputs": [],
  "outputs": [
   {
    "name": "",
    "type": "string",
    "internalType": "string"
   }
  ],
  "stateMutability": "view"
 },
 {
  "name": "owner",
  "type": "function",
  "inputs": [],
  "outputs": [
   {
    "name": "",
    "type": "address",
    "internalType": "address"
   }
  ],
  "stateMutability": "view"
 },
 {
  "name": "symbol",
  "type": "function",
  "inputs": [],
  "outputs": [
   {
    "name": "",
    "type": "string",
    "internalType": "string"
   }
  ],
  "stateMutability": "view"
 },
 {
  "name": "totalSupply",
  "type": "function",
  "inputs": [],
  "outputs": [
   {
    "name": "",
    "type": "uint256",
    "internalType": "uint256"
   }
  ],
  "stateMutability": "view"
 },
 {
  "name": "transfer",
  "type": "function",
  "inputs": [
   {
    "name": "to",
    "type": "address",
    "internalType": "address"
   },
   {
    "name": "value",
    "type": "uint256",
    "internalType": "uint256"
   }
  ],
  "outputs": [
   {
    "name": "",
    "type": "bool",
    "internalType": "bool"
   }
  ],
  "stateMutability": "nonpayable"
 },
 {
  "name": "transferFrom",
  "type": "function",
  "inputs": [
   {
    "name": "from",
    "type": "address",
    "internalType": "address"
   },
   {
    "name": "to",
    "type": "address",
    "internalType": "address"
   },
   {
    "name": "value",
    "type": "uint256",
    "internalType": "uint256"
   }
  ],
  "outputs": [
   {
    "name": "",
    "type": "bool",
    "internalType": "bool"
   }
  ],
  "stateMutability": "nonpayable"
 },
 {
  "name": "transferOwnership",
  "type": "function",
  "inputs": [
   {
    "name": "newOwner",
    "type": "address",
    "internalType": "address"
   }
  ],
  "outputs": [],
  "stateMutability": "nonpayable"
 }
]

Transactions (5 indexed)

HashBlockAgeFromToValue
0x4c2aa6dbe050620a7d…98602h 46m ago0x8e6bb34e0d…0x4ac806b40d…0 tMIDX (0 wei)
0xc4aeae615e4e3b0b90…98592h 46m ago0x59de9c0c9e…0x4ac806b40d…0 tMIDX (0 wei)
0x3289b711bd9835d306…98193h 54m ago0x8e6bb34e0d…0x4ac806b40d…0 tMIDX (0 wei)
0x8e5fd2719866c90157…98183h 54m ago0x59de9c0c9e…0x4ac806b40d…0 tMIDX (0 wei)
0x7f3f353c2c33bba605…98173h 54m ago0x59de9c0c9e…0x4ac806b40d…0 tMIDX (0 wei)
Temporary placeholder infrastructure for chain registration. Not a production network - state may be reset without notice.