Description:
Smart contract deployed on Ethereum.
Blockchain: Ethereum
Source Code: View Code On The Blockchain
Solidity Source Code:
/**
*Submitted for verification at Etherscan.io on 2025-10-07
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
contract RocketMenaCoin {
string public name;
string public symbol;
uint8 public constant 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(string memory name_, string memory symbol_, uint256 initialSupplyWhole) {
name = name_;
symbol = symbol_;
uint256 amount = initialSupplyWhole * 10**decimals;
totalSupply = amount;
balanceOf[msg.sender] = amount;
emit Transfer(address(0), msg.sender, amount);
}
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]; require(allowed >= value, "allowance");
if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - value;
_transfer(from, to, value); return true;
}
function _transfer(address from, address to, uint256 value) internal {
require(to != address(0), "to zero");
uint256 bal = balanceOf[from]; require(bal >= value, "balance");
unchecked { balanceOf[from] = bal - value; balanceOf[to] += value; }
emit Transfer(from, to, value);
}
}
Submitted on: 2025-10-14 11:21:04
Comments
Log in to comment.
No comments yet.