Verified contractPartialMIT
ERC20
Address0xc4abeddacfa65e25d6c942861fb3bdc9c00eeb13
- Balance
0 ETH
- Transactions
1,016
- Compiler
solc 0.5.16
- Same code
1 more contract
Details
- Compiler
- solc 0.5.16+commit.9c3226ce
- Language
- solidity
- Optimization
- Yes, 200 runs
- EVM version
- istanbul
- License
- MIT
- Match
- Partialcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 21,616,612
- Creation transaction
- 0x50d06b4ed7…617308533d
- Main copy (most transactions)
- 0xbdb37597…bcac640b
ERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.5.16;
contract ERC20 {
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);
constructor(
string memory _name,
string memory _symbol,
uint8 _decimals,
uint256 _initialSupply
) public {
name = _name;
symbol = _symbol;
decimals = _decimals;
totalSupply = _initialSupply * 10 ** uint256(decimals);
balanceOf[msg.sender] = totalSupply;
emit Transfer(address(0), msg.sender, totalSupply);
}
function transfer(address _to, uint256 _value) public returns (bool) {
_transfer(msg.sender, _to, _value);
return true;
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_value <= allowance[_from][msg.sender], "Insufficient allowance");
allowance[_from][msg.sender] = allowance[_from][msg.sender] - _value;
_transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint256 _value) public returns (bool) {
allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function _transfer(address _from, address _to, uint256 _value) internal {
require(_from != address(0), "Invalid sender address");
require(_to != address(0), "Invalid recipient address");
require(balanceOf[_from] >= _value, "Insufficient balance");
balanceOf[_from] = balanceOf[_from] - _value;
balanceOf[_to] = balanceOf[_to] + _value;
emit Transfer(_from, _to, _value);
}
}Compiler settingsShow
{
"libraries": {},
"optimizer": {
"runs": 200,
"enabled": true
},
"evmVersion": "istanbul",
"remappings": []
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.