Verified contractPartial
MyToken
Address0xdc56fe9cdbdfc1c5e94a4f3141870d87aba707e1
- Balance
0 ETH
- Transactions
192
- Compiler
solc 0.4.18
- Same code
8 more contracts
Details
- Compiler
- solc 0.4.18+commit.9cf6e910
- Language
- solidity
- Optimization
- Yes, 200 runs
- License
- Not stated
- Match
- Partialcreation code: no, runtime code: yes
- Verified on Sourcify
- Created in block
- 4,907,192
- Creation transaction
- 0x1f17c10567…e0b8fab05d
MyToken.sol
pragma solidity ^0.4.18;
contract MyOwned {
address public owner;
function MyOwned() public { owner = msg.sender; }
modifier onlyOwner { require(msg.sender == owner ); _; }
function transferOwnership(address newOwner) onlyOwner public { owner = newOwner; }
}
interface tokenRecipient {
function receiveApproval(
address _from,
uint256 _value,
address _token,
bytes _extraData) public;
}
contract MyToken is MyOwned {
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
mapping (address => uint256) public balanceOf;
mapping (address => bool) public frozenAccount;
event FrozenFunds(address target,bool frozen);
event Transfer(address indexed from,address indexed to,uint256 value);
function MyToken(
string tokenName,
string tokenSymbol,
uint8 decimalUnits,
uint256 initialSupply)public{
name = tokenName;
symbol = tokenSymbol;
decimals = decimalUnits;
totalSupply = initialSupply;
balanceOf[msg.sender] = initialSupply;
}
function transfer(address _to, uint256 _value)public{
require(!frozenAccount[msg.sender]);
require (balanceOf[msg.sender] >= _value);
require (balanceOf[_to] + _value >= balanceOf[_to]);
balanceOf[msg.sender] -= _value;
balanceOf[_to] += _value;
Transfer(msg.sender, _to, _value);
}
function freezeAccount(address target,bool freeze)public onlyOwner {
frozenAccount[target] = freeze;
FrozenFunds(target, freeze);
}
function mintToken(address target, uint256 mintedAmount)public onlyOwner {
balanceOf[target] += mintedAmount;
Transfer(0, this, mintedAmount);
Transfer(this, target, mintedAmount);
}
}Compiler settingsShow
{
"libraries": {},
"optimizer": {
"runs": 200,
"enabled": true
},
"remappings": []
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.