团队收取手续费基本上是和打进黑洞的转账操作是差不多的
// SPDX-License-Identifier: MIT pragma solidity ^0.6.2; import "./ERC20.sol"; contract Token is ERC20{ string private _name; //币名字 string private _symbol; //币符号 address public deadwallet = 0x0000000000000000000000000000000000000000; //销毁地址 address public LiquityWallet; //铸币钱包 mapping(address => bool) public _isBlacklisted; //是否是黑名单,true表示这个地址是黑名单 uint256 public tradingEnabledTimestamp = 1627779600; //10:00pm //2021-08-1 9:00:00的时间戳,这里设置开盘时间,开盘时间逻辑后面再提,这里先注重防机器人 uint256 public launchedAt; address private _marketingWalletAddress; //营销钱包,收手续费的 uint256 marketingFee = 4; //营销钱包收进的手续费 mapping(address => bool) private _isExcludedFromFees; //判断是否此账号需要手续费,true为不需要手续费 /* * @dev 返回代币的名字 */ function name() public view virtual returns (string memory) { return _name; } /** * @dev 返回代币的符号 */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * 返回代币精度 */ function decimals() public pure virtual returns (uint8) { return 18; } constructor() public{ _name='Token'; _symbol='Tk'; _mint(msg.sender, 10000000000000 * (10 ** 18)); //铸币给连接此合约的账号于10000000000000个币; LiquityWallet=msg.sender; // exclude from paying fees or having max transaction amount 排除支付费用或拥有最大交易金额 excludeFromFees(LiquityWallet, true); //排除流动性钱包的支付手续费和最大交易金额 excludeFromFees(address(this), true); //排除铸币钱包的支付手续费和最大交易金额 excludeFromFees(_marketingWalletAddress, true); //排除营销钱包的支付手续费和最大交易金额 } //交易函数 function _transfer(address recipient, uint256 amount) public returns (bool) { require(!_isBlacklisted[msg.sender], 'Blacklisted address'); //如果发送方是黑名单则禁止交易 if(LiquityWallet!=msg.sender) return super.transfer(recipient, amount); //如果铸币方是发送方则不需要销毁 if(block.timestamp