Verified contractPartialMIT
PepeKing
Address0x82016f3179575292de8513d7cdf207d41ca01933
- Balance
0 ETH
- Transactions
5
- Compiler
solc 0.8.26
- Same code
Only this contract
Details
- Compiler
- solc 0.8.26+commit.8a97fa7a
- Language
- solidity
- Optimization
- Yes, 200 runs
- EVM version
- cancun
- License
- MIT
- Match
- Partialcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 20,533,231
- Creation transaction
- 0xb3972170e4…bbbd18a487
PepeKing.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.5;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract PepeKing is IERC20 {
using SafeMath for uint256;
string public name = "Pepe King Token";
string public symbol = "PepeKing";
uint8 public decimals = 18;
uint256 public totalSupply;
mapping(address => uint256) public balances;
mapping(address => mapping(address => uint256)) public allowances;
mapping(address => bool) public isBlacklisted;
constructor(uint256 _initialSupply) {
totalSupply = _initialSupply * 10**decimals;
balances[msg.sender] = totalSupply;
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
require(!isBlacklisted[msg.sender] &&!isBlacklisted[recipient], "Address is blacklisted");
require(balances[msg.sender] >= amount, "Insufficient balance");
balances[msg.sender] = balances[msg.sender].sub(amount);
balances[recipient] = balances[recipient].add(amount);
emit Transfer(msg.sender, recipient, amount);
return true;
}
function balanceOf(address account) public view override returns (uint256) {
return balances[account];
}
function allowance(address owner, address spender) public view override returns (uint256) {
return allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
require(!isBlacklisted[sender] &&!isBlacklisted[recipient], "Address is blacklisted");
require(allowances[sender][msg.sender] >= amount, "Insufficient allowance");
require(balances[sender] >= amount, "Insufficient balance");
balances[sender] = balances[sender].sub(amount);
allowances[sender][msg.sender] = allowances[sender][msg.sender].sub(amount);
balances[recipient] = balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
return true;
}
function blacklistAddress(address _address) public {
isBlacklisted[_address] = true;
}
function removeFromBlacklist(address _address) public {
isBlacklisted[_address] = false;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction underflow");
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: division by zero");
uint256 c = a / b;
return c;
}
}Compiler settingsShow
{
"metadata": {
"bytecodeHash": "ipfs"
},
"libraries": {},
"optimizer": {
"runs": 200,
"enabled": true
},
"evmVersion": "cancun",
"remappings": []
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.