Description:
Smart contract deployed on Ethereum with Factory features.
Blockchain: Ethereum
Source Code: View Code On The Blockchain
Solidity Source Code:
{{
"language": "Solidity",
"sources": {
"contracts/TokenABI.sol": {
"content": "// SPDX-License-Identifier: MIT
// This token was generated on Web3.Market https://web3.market
pragma solidity ^0.8.20;
/**
* @title ERC-20 Token
* @dev ERC-20 Token Standard implementation with customizable parameters
* Generated on Web3.Market - https://web3.market
*/
contract Token {
string public name;
string public symbol;
uint8 public decimals;
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);
/**
* @dev Constructor that sets token parameters and mints initial supply
* @param _name Token name (e.g., "My Awesome Token")
* @param _symbol Token symbol (e.g., "MAT")
* @param _decimals Token decimals (usually 18)
* @param _totalSupply Total supply to mint to deployer
*/
constructor(
string memory _name,
string memory _symbol,
uint8 _decimals,
uint256 _totalSupply
) {
name = _name;
symbol = _symbol;
decimals = _decimals;
totalSupply = _totalSupply * (10 ** uint256(_decimals));
// Mint entire supply to the deployer (msg.sender)
balanceOf[msg.sender] = totalSupply;
emit Transfer(address(0), msg.sender, totalSupply);
}
/**
* @dev Transfer tokens to a specified address
* @param _to The address to transfer to
* @param _value The amount to be transferred
*/
function transfer(address _to, uint256 _value) public returns (bool success) {
require(_to != address(0), "Invalid address");
require(balanceOf[msg.sender] >= _value, "Insufficient balance");
balanceOf[msg.sender] -= _value;
balanceOf[_to] += _value;
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens
* @param _spender The address which will spend the funds
* @param _value The amount of tokens to be spent
*/
function approve(address _spender, uint256 _value) public returns (bool success) {
require(_spender != address(0), "Invalid address");
allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_from != address(0), "Invalid from address");
require(_to != address(0), "Invalid to address");
require(balanceOf[_from] >= _value, "Insufficient balance");
require(allowance[_from][msg.sender] >= _value, "Allowance exceeded");
balanceOf[_from] -= _value;
balanceOf[_to] += _value;
allowance[_from][msg.sender] -= _value;
emit Transfer(_from, _to, _value);
return true;
}
}
"
}
},
"settings": {
"optimizer": {
"enabled": false,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"remappings": []
}
}}
Submitted on: 2025-10-30 20:21:26
Comments
Log in to comment.
No comments yet.