币安BSC智能链发币教程——通缩燃烧加池分红基金会地址回流合约代码【pdf+视频BSC发币教程下载】

  • A+
所属分类:币安BSC
imtoken

币安BSC智能链发币教程——通缩燃烧加池分红基金会地址回流合约代码【pdf+视频BSC发币教程下载】

BSC链上主流的代币模式越发的丰富起来,下面提供一份包含当前主流的代币模式的合约代码。包括:通缩燃烧+限制通缩+基金会地址回流+加池分红。具体模式功能详细介绍如下:

1、通缩燃烧:单向通缩,只在买币时通缩,卖币时不通缩,保证用户兑换代币时可以获得实际的bnb收益。线下转账时通缩,增加代币的燃烧销毁速率。每笔交易都会有4%的代币被燃烧掉。币的总量随着燃烧逐级减少。在区块链浏览器上可以查询代币的总量逐级减少

2、限制通缩:当代币燃烧到一定数量以后,停止通缩,恒定流通。

3、基金会地址回流:每笔交易都会有部分比例的代币回流到资金池地址,资金池地址的代币可以用于社区推广,运营,项目开发等,正向促进项目的良性发展。合约代码中是2%回流资金池地址。

4、加池分红:用户添加流动性,除了获得代币价格增长产生的收益外,还可以额外获取每笔交易4%的代币数量回流到资金池,根据用户加池占据资金池体量的比例,获得对应的加池分红。

本合约代码仅供学习研究交流区块链技术使用,不得用于商业用途。任何违规或者违法使用该合约代码造成的后果和作者没有任何关系。本作者不承担任何法律责任,特此声明。

具体合约代码如下:

接口文件:IERC20.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;

/**
 * @title ERC20 interface
 */
interface IERC20 {
  function transfer(address to, uint256 value) external returns (bool);
  function approve(address spender, uint256 value) external returns (bool);
  function transferFrom(address from, address to, uint256 value) external returns (bool);
  function totalSupply() external view returns (uint256);
  function balanceOf(address who) external view returns (uint256);
  function allowance(address owner, address spender) external view returns (uint256);
  event Transfer(address indexed from, address indexed to, uint256 value);
  event Approval(address indexed owner, address indexed spender, uint256 value);
}

SafeMath.sol(数学安全算法文件

// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;

/**
 * @title SafeMath
 * @dev Unsigned math operations with safety checks that revert on error
 */
library SafeMath {

  /**
   * @dev Multiplies two unsigned integers, reverts on 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-solidity/pull/522
    if (a == 0) {
      return 0;
    }

    uint256 c = a * b;
    require(c / a == b, "SafeMath#mul: OVERFLOW");

    return c;
  }

Context.sol(上下文文件)

// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;

abstract contract Context {
    function _msgSender() internal view virtual returns (address payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

Ownable.sol (属主文件)

// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;

import "./Context.sol";

contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    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;
    }

Token.sol(代币合约文件)

// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;

import "./IERC20.sol";
import "./Context.sol";
import "./Ownable.sol";
import "./SafeMath.sol";

contract Token is Context, IERC20, Ownable {

    using SafeMath for uint256;

    mapping (address => uint256) private _balances;
    mapping (address => mapping (address => uint256)) private _allowances;

    string private _name = 'SH TOKEN';
    string private _symbol = 'SH';
    uint8 private _decimals = 6;
    uint256 private _totalSupply = 88888 * 10**uint256(_decimals);

    address private _burnPool = address(0);
    address private _fundAddress;

    uint256 public _burnFee = 4;
    uint256 private _previousBurnFee = _burnFee;
    uint256 public _liquidityFee = 4;
    uint256 private _previousLiquidityFee = _liquidityFee;
    uint256 public _fundFee = 2;
    uint256 private _previousFundFee = _fundFee;
    uint256 public  MAX_STOP_FEE_TOTAL = 8888 * 10**uint256(_decimals);
    mapping(address => bool) private _isExcludedFromFee;

    uint256 private _burnFeeTotal;
    uint256 private _liquidityFeeTotal;
    uint256 private _fundFeeTotal;

    bool private inSwapAndLiquify = false;
    bool public swapAndLiquifyEnabled = true;

    address public _exchangePool;
    uint256 public constant delay = 15 minutes;

    event SwapAndLiquifyEnabledUpdated(bool enabled);
    event SwapAndLiquify(
        uint256 tokensSwapped,
        uint256 trxReceived,
        uint256 tokensIntoLiqudity
    );
    event InitLiquidity(
        uint256 tokensAmount,
        uint256 trxAmount,
        uint256 liqudityAmount
    );

    modifier lockTheSwap {
        inSwapAndLiquify = true;
        _;
        inSwapAndLiquify = false;
    }

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The defaut value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor (address fundAddress) public {
        _fundAddress = fundAddress;
        _isExcludedFromFee[owner()] = true;
        _isExcludedFromFee[address(this)] = true;

        _balances[_msgSender()] = _totalSupply;

        emit Transfer(address(0), _msgSender(), _totalSupply);
    }
    
    receive () external payable {}

代币部署时动态输入基金会地址。

上线pancakeswap薄饼交易所后,获取资金池地址,动态传入合约,完成加池分红。

pdf+视频币安智能链BSC发币教程下载:
币安BSC智能链发币教程——通缩燃烧加池分红基金会地址回流合约代码【pdf+视频BSC发币教程下载】

pdf+视频币安智能链BSC发币教程下载地址:

此处为隐藏的内容!
登录后才能查看!

扫码微信获取全程线上免费指导:

币安BSC智能链发币教程——通缩燃烧加池分红基金会地址回流合约代码【pdf+视频BSC发币教程下载】

 

至此,通缩燃烧加池分红基金会地址回流合约代码完成。

免责声明

发文时比特币价格:$49249

当前比特币价格: $66,545.02

当前比特币涨幅: 3.64%

免责声明:

本文不代表漫兮网立场,且不构成投资建议,请谨慎对待。用户由此造成的损失由用户自行承担,与漫兮网没有任何关系;

漫兮网不对网站所发布内容的准确性,真实性等任何方面做任何形式的承诺和保障;

网站内所有涉及到的区块链(衍生)项目,漫兮网对项目的真实性,准确性等任何方面均不做任何形式的承诺和保障;

网站内所有涉及到的区块链(衍生)项目,漫兮网不对其构成任何投资建议,用户由此造成的损失由用户自行承担,与漫兮网没有任何关系;

漫兮区块链研究院声明:漫兮区块链研究院内容由漫兮网发布,部分来源于互联网和行业分析师投稿收录,内容为漫兮区块链研究院加盟专职分析师独立观点,不代表漫兮网立场。

  • 我的微信
  • 这是我的微信扫一扫
  • weinxin
  • App下载
  • 漫兮网App下载
  • weinxin
Pi Network 中国
漫兮

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: