// SPDX-License-Identifier: MIT pragma solidity ^0.8.26; contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor(address initialOwner) { _transferOwnership(initialOwner); } function owner() public view virtual returns (address) { return _owner; } modifier onlyOwner() { require(owner() == msg.sender, "Ownable: caller is not the owner"); _; } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } contract MODX is Ownable { string public name = "MODX"; string public symbol = "MODX"; uint8 public decimals = 18; uint256 public totalSupply; mapping(address => uint256) public balanceOf; event Transfer(address indexed from, address indexed to, uint256 value); constructor(uint256 initialSupply) Ownable(msg.sender) { totalSupply = initialSupply * 10 ** uint256(decimals); balanceOf[msg.sender] = totalSupply; } function transfer(address to, uint256 value) public returns (bool success) { require(balanceOf[msg.sender] >= value, "Insufficient balance"); balanceOf[msg.sender] -= value; balanceOf[to] += value; emit Transfer(msg.sender, to, value); return true; } function mint(address account, uint256 amount) public onlyOwner { totalSupply += amount; balanceOf[account] += amount; emit Transfer(address(0), account, amount); } }
0.4.18