支持分红SHIB ETH USDT DOGE等BSC所有代币。

Remix

https://remix.ethereum.org/

编译/开源参数

COMPILER: v0.8.4+commit.e28d00a7.js

Enable optimization: 开启并使用默认值200

Other Settings: default evmVersion, MIT license

合约核心源码


constructor(
    string memory name_,
    string memory symbol_,
    uint256 totalSupply_,
    address[2] memory addrs, // reward, marketing wallet
    uint256[3] memory feeSettings, // rewards, liquidity, marketing
    uint256 minimumTokenBalanceForDividends_
) payable ERC20(name_, symbol_) {
    rewardToken = addrs[0];
    _marketingWalletAddress = addrs[1];
    require(
        msg.sender != _marketingWalletAddress,
        "Owner and marketing wallet cannot be the same"
    );
    totalSupply_ = totalSupply_ * 10**18;
    tokenRewardsFee = feeSettings[0];
    liquidityFee = feeSettings[1];
    marketingFee = feeSettings[2];
    totalFees = tokenRewardsFee.add(liquidityFee).add(marketingFee);
    require(totalFees <= 25, "Total fee is over 25%");
    swapTokensAtAmount = totalSupply_.mul(2).div(10**6); // 0.002%

    // use by default 300,000 gas to process auto-claiming dividends
    gasForProcessing = 300000;

    dividendTracker = BABYTOKENDividendTracker(
        payable(Clones.clone(0xD2EE2Be66DD5Dd596469CDbac00b5Ad2554F80ea))
    );
    dividendTracker.initialize(
        rewardToken,
        minimumTokenBalanceForDividends_
    );

    IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x10ED43C718714eb63d5aA57B78B54704E256024E);
    // Create a uniswap pair for this new token
    address _uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
        .createPair(address(this), _uniswapV2Router.WETH());
    uniswapV2Router = _uniswapV2Router;
    uniswapV2Pair = _uniswapV2Pair;
    _setAutomatedMarketMakerPair(_uniswapV2Pair, true);

    // exclude from receiving dividends
    dividendTracker.excludeFromDividends(address(dividendTracker));
    dividendTracker.excludeFromDividends(address(this));
    dividendTracker.excludeFromDividends(owner());
    dividendTracker.excludeFromDividends(address(0xdead));
    dividendTracker.excludeFromDividends(address(_uniswapV2Router));
    // exclude from paying fees or having max transaction amount
    excludeFromFees(owner(), true);
    excludeFromFees(_marketingWalletAddress, true);
    excludeFromFees(address(this), true);
    /*
        _mint is an internal function in ERC20.sol that is only called here,
        and CANNOT be called ever again
    */
    _mint(owner(), totalSupply_);

    emit TokenCreated(owner(), address(this), TokenType.baby, VERSION);

    payable(serviceFeeReceiver_).transfer(serviceFee_);
}

receive() external payable {}

function updateDividendTracker(address newAddress) public onlyOwner {
    require(
        newAddress != address(dividendTracker),
        "BABYTOKEN: The dividend tracker already has that address"
    );

    BABYTOKENDividendTracker newDividendTracker = BABYTOKENDividendTracker(
        payable(newAddress)
    );

    require(
        newDividendTracker.owner() == address(this),
        "BABYTOKEN: The new dividend tracker must be owned by the BABYTOKEN token contract"
    );

    newDividendTracker.excludeFromDividends(address(newDividendTracker));
    newDividendTracker.excludeFromDividends(address(this));
    newDividendTracker.excludeFromDividends(owner());
    newDividendTracker.excludeFromDividends(address(uniswapV2Router));

    emit UpdateDividendTracker(newAddress, address(dividendTracker));

    dividendTracker = newDividendTracker;
}

 

部署参数

Value填写:200000000000000000
CONTRACT 选择 Babytoken
name_: BTC COIN (代币名称)
symbol_: BTC (代币简称)
totalSupply_: 21000000 (发行量 发多少就写多少)
addds_: [“0x2859e4544C4bB03966803b044A93563Bd2D0DD4D”,”0x2859e4544C4bB03966803b044A93563Bd2D0DD4D”] (要分红的代币合约、营销钱包)
feeSettings_: [4,3,1] (分红、流动性、营销钱包)
minimumTokenBalanceForDividends_: 10000000000000000000000 (持有多少代币参与分红。数量后要加18个0)

BSC常用代币合约地址

SHIB: 0x2859e4544C4bB03966803b044A93563Bd2D0DD4D
USDT: 0x55d398326f99059fF775485246999027B3197955
ETH: 0x2170Ed0880ac9A755fd29B2688956BD959F933F8
DOGE: 0xbA2aE424d960c26247Dd6c32edC70B295c744C43
BUSD: 0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56
CAKE: 0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82

有任何问题请联系QQ:2510472590