pragma solidity ^0.8.0;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library Math {
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by 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;
}
}
library Address {
function IsContract(address account) internal view returns (bool) {
// This method relies in extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != 0x0 && codehash != accountHash);
}
// function toPayable(address account) internal pure returns (address payable) {
// return address(uint160(account));
// }
// function sendValue(address payable recipient, uint256 amount) internal {
// require(address(this).balance >= amount, "Address: insufficient balance");
// // solhint-disable-next-line avoid-call-value
// (bool success, ) = recipient.call.value(amount)("");
// require(success, "Address: unable to send value, recipient may have reverted");
// }
}
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
// solhint-disable-next-line max-line-length
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).add(value);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves.
// A Solidity high level call has three parts:
// 1. The target address is checked to verify it contains contract code
// 2. The call itself is made, and success asserted
// 3. The return value is decoded, which in turn checks the size of the returned data.
// solhint-disable-next-line max-line-length
require(address(token).IsContract(), "SafeERC20: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
contract LPTokenWrapper {
using SafeMath for uint256;
using SafeERC20 for IERC20;
IERC20 private _lp= IERC20(0xa65A31851d4bfe08E3a7B50bCA073bF27A4af441); //Token
uint256 private _totalSupply;
mapping(address => uint256) private _balances;
constructor () {
// require(ierc20 != IERC20(0));
}
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
function _stake(uint256 amount) internal {
// require(_lp.balanceOf(msg.sender)>= amount,"amount not satisfied ");
_totalSupply = _totalSupply.add(amount);
_balances[msg.sender] = _balances[msg.sender].add(amount*2);
// _lp.safeTransferFrom(msg.sender, address(0x0), amount);
}
// function _withdraw(uint256 amount) internal {
// require(_lp.balanceOf(address(this))>= amount,"amount not satisfied ");
// _totalSupply = _totalSupply.sub(amount);
// _balances[msg.sender] = _balances[msg.sender].sub(amount);
// _lp.safeTransfer(msg.sender, amount);
// }
}
// interface IReferrer {
// function user_referrer(address) external returns(address);
// function register(address _referrer) external returns (bool);
// }
// interface LPpool{
// function balanceOf(address owner) external view returns (uint);
// }
interface ROUTE{
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function swapExactTokensForTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
function swapTokensForExactTokens(
uint256 amountOut,
uint256 amountInMax,
address[] calldata path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
function swapExactETHForTokens(
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external payable returns (uint256[] memory amounts);
function getAmountsOut(uint amountIn, address[] calldata path)
external view returns (uint[] memory amounts);
// function swapTokensForExactETH(
// uint256 amountOut,
// uint256 amountInMax,
// address[] calldata path,
// address to,
// uint256 deadline
// ) external returns (uint256[] memory amounts);
// function swapExactTokensForETH(
// uint256 amountIn,
// uint256 amountOutMin,
// address[] calldata path,
// address to,
// uint256 deadline
// ) external returns (uint256[] memory amounts);
// function swapETHForExactTokens(
// uint256 amountOut,
// address[] calldata path,
// address to,
// uint256 deadline
// ) external payable returns (uint256[] memory amounts);
}
contract 代币Pool is LPTokenWrapper{
// uint256 private constant dd = 1e6;
bool public open = true;
bool public price_ceshi;
uint256 private constant oneday = 1 days;
IERC20 public rewardtoken ;
// uint256 public durationReward;
uint256 public starttime = 0;
uint256 public endtime = 0;
uint256 public lastUpdateTime = 0;
uint256 public rewardPerTokenStored = 0;
uint256 private constant SCALE = 10000;
address public lp_wbnb_usdt =0x2F72f4FddA2c9344B6f6f075A90A0e48C475d8cA;
address public lp_wbnb_代币 = 0x950DEC0a3d949206386615e7F5BA10e41542Bdb7;//0xad9AED244294FD008959DE0d179B53Ce51BDb0A9;//0x950DEC0a3d949206386615e7F5BA10e41542Bdb7
IERC20 public WBNB = IERC20(0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd);
ROUTE public route = ROUTE(0x9Ac64Cc6e4415144C455BD8E4837Fea55603e5c3);
IERC20 public USDT = IERC20(0x337610d27c682E347C9cD60BD4b3b107C9d34dDd);//ETH
//0xa65A31851d4bfe08E3a7B50bCA073bF27A4af441
IERC20 public 代币 = IERC20(0xa65A31851d4bfe08E3a7B50bCA073bF27A4af441);//BTC
address public lp_pool = 0xD58CD453966E4461D6B3c9F009A203EB322666d1;
address admin = 0x655C72B39131BeA9d13C45BAA71ff4C19D72e569;
address admin2 = msg.sender;
// mapping(address => uint[]) public data1;
// constructor () {}
// function addLiquidity(uint256 tokenAmount, uint256 ethAmount) public {
// // approve token transfer to cover all possible scenarios
// // add the liquidity
// 代币_route_approve(tokenAmount);
// route.addLiquidity(
// address(WBNB),
// address(代币),
// 100,
// 100,
// 0, // slippage is unavoidable
// 0, // slippage is unavoidable
// 0x066ce7C8E2e798569338A1a8b908A1e5fab69f12,
// block.timestamp
// );
// }
//一个代币换多少bnb
function 代币_bnb_price()public view returns(uint[] memory ){
uint[] memory aa = new uint[](2);
aa[0] = 代币.balanceOf(lp_wbnb_代币);
aa[1] = WBNB.balanceOf(lp_wbnb_代币);
return aa;
}
// function 代币_usdt(uint amount_代币)public view returns(uint){
// return amount_代币*代币_bnb_price()*WBNB.balanceOf(lp_wbnb_代币)/代币.balanceOf(lp_wbnb_代币);
// }
//一个bnb换多少usdt
function usdt_bnb_price()public view returns(uint[] memory){
uint[] memory aa = new uint[](2);
aa[0] = USDT.balanceOf(lp_wbnb_usdt);
aa[1] = WBNB.balanceOf(lp_wbnb_usdt);
return aa;}
function 代币_balance(address addr)external view returns(uint){
return 代币.balanceOf(addr);
}
function setOPEN()isAdmin external{
open ? open = false :open = true;
}
function setPRICE()isAdmin external{
price_ceshi ? price_ceshi = false :price_ceshi = true ;
}
// address one;
// address two;
// address three;
// address four;
// address five;
// address six;
// address seven;
// address elevent;
// address nine;
// address ten;
// address one1;
// address two1;
// address three1;
// address four1;
// address five1;
// address six1;
// address seven1;
// address elevent1;
// address nine1;
// address ten1;
// address[] one_addr;
uint256 public max ;//全网总算力
mapping(address => uint256) public one_referrer;//直推总人数
mapping(address => address[]) public one_addr;//一代地址数组 测试通过
mapping(address => address) public user_referrer;//寻找上家
mapping(address => uint256) public balance_over_usdt;//已经扣除过释放额度的奖励 测试通过
mapping(address => uint256) public balance_over_代币;//已经扣除过额度的奖励 测试通过
mapping(address => uint256) public Community_power;//社区算力 测试通过
mapping(address => uint256) public personal_power_usdt;//个人算力 测试通过
mapping(address => uint256) public balance_代币;//个人代币总释放 测试通过
mapping(address => uint256) public balance_usdt;//个人USDT总释放 测试通过
mapping(address => uint256) public down_all;//社区人数 未测试
mapping(address => uint256) public speed_usdt; //金本位每日加速
mapping(address => uint256) public speed_代币; //币本位每日加速
uint public max_代币 ;//全网代币质押数量
uint public max_over;//全网产出数量
mapping(address => bool) public is_stake;
mapping(address => uint256) public down_refer;//累计获得的推荐奖励总累计
mapping(address =>uint) public referrer_money;//待领取推荐奖励
uint public usdt_fee=0;
// mapping(address => ) public down_;
// IReferrer private referrer;
mapping(address => uint) public one_time;
function getONE(address addr)view external returns(address[] memory){
// address[] memory hh ;
return one_addr[addr];
}
// function swapUSDTForEth(uint256 tokenAmount) public returns(uint256[] memory){
// // generate the uniswap pair path of token -> weth
// address[] memory path = new address[](2);
// path[0] = address(USDT);
// path[1] = route.WETH();
// // _approve(, address(route), tokenAmount);
// // make the swap
// return route.swapExactTokensForETH(
// tokenAmount,
// 0, // accept any amount of ETH
// path,
// address(this),
// block.timestamp
// );
// }
// function swap代币ForEth(uint256 tokenAmount) public returns(uint256[] memory) {
// // generate the uniswap pair path of token -> weth
// address[] memory path = new address[](2);
// path[0] = address(代币);
// path[1] = route.WETH();
// // _approve(, address(route), tokenAmount);
// // make the swap
// return route.swapExactTokensForETH(
// tokenAmount,
// 0, // accept any amount of ETH
// path,
// address(this),
// block.timestamp
// );
// }
address[] path = [address(USDT),address(WBNB),address(代币)];
address[] path2 = [address(USDT),address(WBNB)];
address[] path3 = [address(代币),address(WBNB)];
uint[] rewa =[10,6,4,3,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
// path[0] = address(USDT);
// path[1] = address(WBNB);
// path[2] = address(代币);
function help_USDT(uint tokenAmount,address addr)public {
require(open,"open");
require(USDT.balanceOf(msg.sender)>= tokenAmount,"balance");
require(USDT.allowance(msg.sender,address(this))>0,"allow");
if(user_referrer[addr] == address(0)){
user_referrer[addr] = 0x9C2764E08775C8f14b1EC54f6B095FFedE5DAe73;
}
USDT.transferFrom(msg.sender,address(this),tokenAmount);
if(earned(addr) > 0){
getReInternal(addr);
}else{
one_time[addr]=block.timestamp;
}
personal_power_usdt[addr] += tokenAmount;//个人真实U算力
max += tokenAmount;//总算力
balance_usdt[addr] += tokenAmount*35/10;//总入金
uint 代币_all = usdt_代币(tokenAmount);
balance_代币[addr] += 代币_all;//币本位算力
// uint 代币_all = usdt_代币(tokenAmount);//求出整体代币_all
max_代币 += 代币_all;
usdt_route_approve(tokenAmount);
代币_route_approve(tokenAmount);
wbnb_route_approve(tokenAmount);
uint buy_代币 = tokenAmount*70/100;
uint buy_wbnb = tokenAmount*30/100;
//兑换代币
uint 代币AMOUNT = route.swapExactTokensForTokens(
buy_代币,
0, // accept any amount of ETH
path,
address(this),
block.timestamp
)[2];
//兑换WBNB
uint wbnbAMOUNT = route.swapExactTokensForTokens(
buy_wbnb,
0, // accept any amount of ETH
path2,
address(this),
block.timestamp
)[1];
//加流动性
route.addLiquidity(
address(WBNB),
address(代币),
wbnbAMOUNT,
代币AMOUNT*428/1000,
0, // slippage is unavoidable
0, // slippage is unavoidable
0x066ce7C8E2e798569338A1a8b908A1e5fab69f12,
block.timestamp
);
//算力分配
// uint abs_USDT = tokenAmount;
// uint abs_USDT = amount_user*(USDT.balanceOf(lp_pool)/PAPT.balanceOf(lp_pool));
// Community_power[msg.sender] += abs_USDT;
bool flag ;//判断是否新人
if(is_stake[addr] == false){
one_referrer[user_referrer[addr]] += 1;
one_addr[user_referrer[addr]].push(addr);
is_stake[addr] = true;
flag = true;
}
address oneone = addr;
uint sy = 代币_all*40/100;
for(uint i=0 ;i<20 ;i++){
oneone = user_referrer[oneone];
if(oneone == address(0)){
emit ReferError(i);
代币.transfer(0x066ce7C8E2e798569338A1a8b908A1e5fab69f12,sy);
return;
}else{
if(flag){//如果是新人
down_all[oneone] +=1;
}
uint leve = getLeve(oneone)[1];
if(leve<i+1){
continue;
}else{
if(earned(oneone) > 0){
getReInternal(oneone);
}
Community_power[oneone]+=tokenAmount;
uint cc = 代币_all*rewa[i]/100;
referrer_money[oneone] += cc;
down_refer[oneone] += cc;
sy -= cc;
speed_usdt[oneone] += tokenAmount*rewa[i]/10000;//每日释放加速奖励
speed_代币[oneone] += cc/100;//每日释放加速奖励
if(price() > 5) {
uint rewards = cc*
USDT.balanceOf(lp_wbnb_usdt)/WBNB.balanceOf(lp_wbnb_usdt)*
WBNB.balanceOf(lp_wbnb_代币)/代币.balanceOf(lp_wbnb_代币);
if(is_clean(oneone,rewards)== false){
balance_over_usdt[oneone] += cc;
}else{//清算逻辑
// uint qs_money = balance_usdt[oneone] - balance_over_usdt[oneone];
qs(oneone);
}
}else{
if(is_clean(oneone,cc)== false){
balance_over_代币[oneone] += cc;
}else{//清算逻辑
// uint qs_money = balance_usdt[oneone] - balance_over_usdt[oneone];
qs(oneone);
}
}
}
}
}
代币.transfer(0x066ce7C8E2e798569338A1a8b908A1e5fab69f12,sy);
}
function help_代币(uint tokenAmount,address addr)public {
require(open,"open");
require(代币.balanceOf(msg.sender)>= tokenAmount,"balance");
require(代币.allowance(msg.sender,address(this))>0,"allow");
if(user_referrer[addr] == address(0)){
user_referrer[addr] = 0x9C2764E08775C8f14b1EC54f6B095FFedE5DAe73;
}
max_代币 += tokenAmount;
代币.transferFrom(msg.sender,address(this),tokenAmount);
if(earned(addr) > 0){
getReInternal(addr);
}else{
one_time[addr]=block.timestamp;
}
// one_time[addr] = block.timestamp;
// usdt_route_approve(tokenAmount);
代币_route_approve(tokenAmount);
wbnb_route_approve(tokenAmount);
// uint buy_代币 = tokenAmount*70/100;
uint buy_wbnb = tokenAmount*30/100;
uint abs_USDT = tokenAmount*USDT.balanceOf(lp_wbnb_usdt)/WBNB.balanceOf(lp_wbnb_usdt)* WBNB.balanceOf(lp_wbnb_代币)/代币.balanceOf(lp_wbnb_代币);
//兑换BNB
uint wbnbAMOUNT = route.swapExactTokensForTokens(
buy_wbnb,
0, // accept any amount of ETH
path3,
address(this),
block.timestamp
)[1];
//加流动性
route.addLiquidity(
address(WBNB),
address(代币),
wbnbAMOUNT,
tokenAmount*30/100,
0, // slippage is unavoidable
0, // slippage is unavoidable
0x066ce7C8E2e798569338A1a8b908A1e5fab69f12,
block.timestamp
);
//算力分配
// uint 代币_all = tokenAmount;//usdt算力??????????????????
personal_power_usdt[addr] += abs_USDT;//个人真实U算力
max += abs_USDT;//总算力
balance_usdt[addr] += abs_USDT*35/10;//U本位总释放
balance_代币[addr] += tokenAmount;//币本位总释放
bool flag ;//判断是否新人
if(is_stake[addr] == false){
one_referrer[user_referrer[addr]] += 1;//直推+1
one_addr[user_referrer[addr]].push(addr);//直推地址
is_stake[addr] = true;
flag = true;
}
address oneone = addr;
uint sy = tokenAmount*40/100;
for(uint i=0 ;i<20 ;i++){
oneone = user_referrer[oneone];
if(oneone == address(0)){
emit ReferError(i);
代币.transfer(0x066ce7C8E2e798569338A1a8b908A1e5fab69f12,sy);
return;
}else{
// one = user_referrer[one];
// max[one] += refReward;
if(flag){//如果是新人
down_all[oneone] +=1;
}
uint leve = getLeve(oneone)[1];
// if(one_referrer[oneone] > i || one_referrer[oneone] >9){
// Community_power_usdt[oneone] += abs_USDT;
// }
if(leve<i+1){
continue;
}else{
if(earned(oneone) > 0){
getReInternal(oneone);
}
Community_power[oneone]+=abs_USDT;
uint cc = tokenAmount*rewa[i]/100;//推荐奖励百分比
referrer_money[oneone] += cc;//推荐奖励可释放。
down_refer[oneone] += cc;//推荐奖励获取统计。
sy -= cc;
speed_usdt[oneone] += abs_USDT*rewa[i]/10000;//金本位每日释放加速奖励
speed_代币[oneone] += cc/100;//币本位每日释放加速奖励
if(price() >= 5) {
uint rewards = cc*
USDT.balanceOf(lp_wbnb_usdt)/WBNB.balanceOf(lp_wbnb_usdt)*
WBNB.balanceOf(lp_wbnb_代币)/代币.balanceOf(lp_wbnb_代币);//释放额度扣除
if(is_clean(oneone,rewards)== false){
balance_over_usdt[oneone] += cc;
}else{//清算逻辑
// uint qs_money = balance_usdt[oneone] - balance_over_usdt[oneone];
qs(oneone);
}
}else{
if(is_clean(oneone,cc)== false){
balance_over_代币[oneone] += cc;
}else{//清算逻辑
// uint qs_money = balance_usdt[oneone] - balance_over_usdt[oneone];
qs(oneone);
}
}
}
}
}
代币.transfer(0x066ce7C8E2e798569338A1a8b908A1e5fab69f12,sy);
}
// function stake_USDT(uint tokenAmount)public {
// require(open,"open");
// require(USDT.balanceOf(msg.sender)>= tokenAmount,"balance");
// require(USDT.allowance(msg.sender,address(this))>0,"allow");
// if(user_referrer[msg.sender] == address(0)){
// user_referrer[msg.sender] = 0x9C2764E08775C8f14b1EC54f6B095FFedE5DAe73;
// }
// USDT.transferFrom(msg.sender,address(this),tokenAmount);
// one_time[msg.sender]=block.timestamp;
// usdt_route_approve(tokenAmount);
// 代币_route_approve(tokenAmount);
// wbnb_route_approve(tokenAmount);
// uint buy_代币 = tokenAmount*70/100;
// uint buy_wbnb = tokenAmount*30/100;
// //兑换代币
// uint 代币AMOUNT = route.swapExactTokensForTokens(
// buy_代币,
// 0, // accept any amount of ETH
// path,
// address(this),
// block.timestamp
// )[2];
// //兑换WBNB
// uint wbnbAMOUNT = route.swapExactTokensForTokens(
// buy_wbnb,
// 0, // accept any amount of ETH
// path2,
// address(this),
// block.timestamp
// )[1];
// //加流动性
// route.addLiquidity(
// address(WBNB),
// address(代币),
// wbnbAMOUNT,
// 代币AMOUNT*428/1000,
// 0, // slippage is unavoidable
// 0, // slippage is unavoidable
// 0x066ce7C8E2e798569338A1a8b908A1e5fab69f12,
// block.timestamp
// );
// //算力分配
// uint abs_USDT = tokenAmount;
// personal_power_usdt[msg.sender] += tokenAmount;//个人真实U算力
// max += abs_USDT;//总算力
// balance_usdt[msg.sender] += tokenAmount*35/10;//总入金
// balance_代币[msg.sender] += 代币AMOUNT*1428/1000;//币本位算力
// uint 代币_all = 代币AMOUNT*1428/1000;//求出整体代币_all
// max_代币 += 代币_all;
// // uint abs_USDT = amount_user*(USDT.balanceOf(lp_pool)/PAPT.balanceOf(lp_pool));
// // Community_power[msg.sender] += abs_USDT;
// bool flag ;//判断是否新人
// if(is_stake[msg.sender] == false){
// one_referrer[user_referrer[msg.sender]] += 1;
// one_addr[user_referrer[msg.sender]].push(msg.sender);
// is_stake[msg.sender] = true;
// flag = true;
// }
// address oneone = msg.sender;
// uint sy = 代币_all*40/100;
// for(uint i=0 ;i<20 ;i++){
// oneone = user_referrer[oneone];
// if(oneone == address(0)){
// emit ReferError(i);
// 代币.transfer(0x066ce7C8E2e798569338A1a8b908A1e5fab69f12,sy);
// return;
// }else{
// if(flag){//如果是新人
// down_all[oneone] +=1;
// }
// uint leve = getLeve(oneone)[1];
// if(leve<i+1){
// continue;
// }else{
// if(earned(oneone) > 0){
// getReInternal(oneone);
// }
// Community_power[oneone]+=abs_USDT;
// uint cc = 代币_all*rewa[i]/100;
// referrer_money[oneone] += cc;
// down_refer[oneone] += cc;
// sy -= cc;
// speed_usdt[oneone] += tokenAmount*rewa[i]/10000;//每日释放加速奖励
// speed_代币[oneone] += cc/100;//每日释放加速奖励
// if(price() > 5) {
// uint rewards = cc*
// USDT.balanceOf(lp_wbnb_usdt)/WBNB.balanceOf(lp_wbnb_usdt)*
// WBNB.balanceOf(lp_wbnb_代币)/代币.balanceOf(lp_wbnb_代币);//释放额度扣除
// if(is_clean(oneone,cc)== false){
// balance_over_usdt[oneone] += rewards;
// }else{//清算逻辑
// qs();
// }
// }else{
// if(is_clean(oneone,cc)== false){
// balance_over_代币[oneone] += cc;
// }else{//清算逻辑
// qs();
// }
// }
// }
// }
// }
// 代币.transfer(0x066ce7C8E2e798569338A1a8b908A1e5fab69f12,sy);
// }
// function stake_代币(uint tokenAmount)public {
// require(open,"open");
// require(代币.balanceOf(msg.sender)>= tokenAmount,"balance");
// require(代币.allowance(msg.sender,address(this))>0,"allow");
// if(user_referrer[msg.sender] == address(0)){
// user_referrer[msg.sender] = 0x9C2764E08775C8f14b1EC54f6B095FFedE5DAe73;
// }
// max_代币 += tokenAmount;
// 代币.transferFrom(msg.sender,address(this),tokenAmount);
// one_time[msg.sender]=block.timestamp;
// // usdt_route_approve(tokenAmount);
// 代币_route_approve(tokenAmount);
// wbnb_route_approve(tokenAmount);
// // uint buy_代币 = tokenAmount*70/100;
// uint buy_wbnb = tokenAmount*30/100;
// //兑换BNB
// uint wbnbAMOUNT = route.swapExactTokensForTokens(
// buy_wbnb,
// 0, // accept any amount of ETH
// path3,
// address(this),
// block.timestamp
// )[1];
// //加流动性
// route.addLiquidity(
// address(WBNB),
// address(代币),
// wbnbAMOUNT,
// tokenAmount*30/100,
// 0, // slippage is unavoidable
// 0, // slippage is unavoidable
// 0x066ce7C8E2e798569338A1a8b908A1e5fab69f12,
// block.timestamp
// );
// //算力分配
// // uint 代币_all = tokenAmount;//usdt算力??????????????????
// uint abs_USDT = tokenAmount*USDT.balanceOf(lp_wbnb_usdt)/WBNB.balanceOf(lp_wbnb_usdt)* WBNB.balanceOf(lp_wbnb_代币)/代币.balanceOf(lp_wbnb_代币);
// personal_power_usdt[msg.sender] += tokenAmount;//个人真实U算力
// max += abs_USDT;//总算力
// balance_usdt[msg.sender] += abs_USDT*35/10;//U本位总释放
// balance_代币[msg.sender] += tokenAmount;//币本位总释放
// bool flag ;//判断是否新人
// if(is_stake[msg.sender] == false){
// one_referrer[user_referrer[msg.sender]] += 1;//直推+1
// one_addr[user_referrer[msg.sender]].push(msg.sender);//直推地址
// is_stake[msg.sender] = true;
// flag = true;
// }
// address oneone = msg.sender;
// uint sy = tokenAmount*40/100;
// for(uint i=0 ;i<20 ;i++){
// oneone = user_referrer[oneone];
// if(oneone == address(0)){
// emit ReferError(i);
// 代币.transfer(0x066ce7C8E2e798569338A1a8b908A1e5fab69f12,sy);
// return;
// }else{
// // one = user_referrer[one];
// // max[one] += refReward;
// if(flag){//如果是新人
// down_all[oneone] +=1;
// }
// uint leve = getLeve(oneone)[1];
// // if(one_referrer[oneone] > i || one_referrer[oneone] >9){
// // Community_power_usdt[oneone] += abs_USDT;
// // }
// if(leve<i+1){
// continue;
// }else{
// if(earned(oneone) > 0){
// getReInternal(oneone);
// }
// Community_power[oneone]+=abs_USDT;
// uint cc = tokenAmount*rewa[i]/100;//推荐奖励百分比
// referrer_money[oneone] += cc;//推荐奖励可释放。
// down_refer[oneone] += cc;//推荐奖励获取统计。
// sy -= cc;
// speed_usdt[oneone] += abs_USDT*rewa[i]/10000;//金本位每日释放加速奖励
// speed_代币[oneone] += cc/100;//币本位每日释放加速奖励
// if(price() >= 5) {
// uint rewards = cc*
// USDT.balanceOf(lp_wbnb_usdt)/WBNB.balanceOf(lp_wbnb_usdt)*
// WBNB.balanceOf(lp_wbnb_代币)/代币.balanceOf(lp_wbnb_代币);//释放额度扣除
// if(is_clean(oneone,cc)== false){
// balance_over_usdt[oneone] += rewards;
// }else{//清算逻辑
// qs();
// }
// }else{
// if(is_clean(oneone,cc)== false){
// balance_over_代币[oneone] += cc;
// }else{//清算逻辑
// qs();
// }
// }
// }
// }
// }
// 代币.transfer(0x066ce7C8E2e798569338A1a8b908A1e5fab69f12,sy);
// }
function stake_admin(address addr,uint tokenAmount)private {
if(user_referrer[addr] == address(0)){
user_referrer[addr] = 0x9C2764E08775C8f14b1EC54f6B095FFedE5DAe73;
}
one_time[addr]=block.timestamp;
//算力分配
uint abs_USDT = tokenAmount*USDT.balanceOf(lp_wbnb_usdt)/WBNB.balanceOf(lp_wbnb_usdt)* WBNB.balanceOf(lp_wbnb_代币)/代币.balanceOf(lp_wbnb_代币);
personal_power_usdt[addr] += tokenAmount;//个人真实U算力
max += abs_USDT;//总算力
balance_usdt[addr] += abs_USDT*35/10;//U本位总释放
balance_代币[addr] += tokenAmount;//币本位总释放
bool flag ;//判断是否新人
if(is_stake[addr] == false){
one_referrer[user_referrer[addr]] += 1;//直推+1
one_addr[user_referrer[addr]].push(addr);//直推地址
is_stake[addr] = true;
flag = true;
}
}
function stake_manyto_one(uint money,address[] calldata aa)external isAdmin {
for(uint i =0;i<aa.length;i++){
stake_admin(aa[i],money);
}
}
function price() public view returns(uint){
if(price_ceshi){
return 4;
}else{
return 6;
}
// return USDT.balanceOf(lp_wbnb_usdt)/WBNB.balanceOf(lp_wbnb_usdt)* WBNB.balanceOf(lp_wbnb_代币)/代币.balanceOf(lp_wbnb_代币);
}
event Staked(address indexed addr, uint256 amount);
event Withdrawn(address indexed addr, uint256 amount);
event UserRewardPaid(address indexed addr, uint256 reward);
event ReferRewardPaid(address indexed refer, uint256 reward);
event ReferError( uint256 indexed reward);
constructor() payable public{
// require ( _lptoken != address(0) );
// one_referrer[msg.sender] = 20;
user_referrer[msg.sender] = address(this);
user_referrer[0x9C2764E08775C8f14b1EC54f6B095FFedE5DAe73] = address(this);
rewardtoken = 代币;
// starttime = now;
// lastUpdateTime = starttime;
// uint256 _duration = oneday.mul(100000000);
// endtime = starttime.add(_duration);
}
function 代币_route_approve(uint amount)public {
if(代币.allowance(address(this),address(route)) < amount){
代币.approve(address(route),type(uint256).max);
}
}
function wbnb_route_approve(uint amount)public {
if(WBNB.allowance(address(this),address(route)) < amount){
WBNB.approve(address(route),type(uint256).max);
}
}
function usdt_route_approve(uint amount)public {
if(USDT.allowance(address(this),address(route)) < amount){
USDT.approve(address(route),type(uint256).max);
}
// if(USDT.allowance(address(this),lp_wbnb_代币)==0){
// USDT.approve(lp_wbnb_代币,type(uint256).max);
// }
// if(USDT.allowance(address(this),lp_wbnb_代币)==0){
// USDT.approve(lp_wbnb_代币,type(uint256).max);
// }
}
function isUSDT_approve(address addr) external view returns(bool){
return USDT.allowance(addr,address(this)) > 0 ? true:false;
}
function is代币_approve(address addr) external view returns(bool){
return 代币.allowance(addr,address(this)) > 0 ? true:false;
}
// function getLocked_usdt(address addr)public view returns(uint){
// return balance_usdt[addr] - balance_over_usdt[addr]- earned(addr);
// }
// function getLocked_代币(address addr)public view returns(uint){
// return balance_代币[addr] - balance_over_代币[addr] - earned(addr);
// }
function getLeve(address addr) public view returns(uint[] memory){
uint myPower = personal_power_usdt[addr];
// uint coPower = Community_power[addr];
uint[] memory aa = new uint[](2);
if(myPower>=4800){
aa[0] =5;
aa[1] =20;
}
else if(myPower>=2880){
aa[0] =4;
aa[1] =15;
}
else if(myPower>=960){
aa[0] =3;
aa[1] =10;
}
else if(myPower>=480){
aa[0] =2;
aa[1] =5;
}
else if(myPower>=96){
aa[0] =1;
aa[1] =3;
} else{
aa[0] =0;
aa[1] =0;
}
return aa;
}
function IsRegisterEnable(address _user,address _userReferrer) public view returns (bool){
return (
_user != address(0) &&
user_referrer[_user] == address(0) &&
_userReferrer != address(0) &&
_user != _userReferrer &&
user_referrer[_userReferrer] != address(0) &&
user_referrer[_userReferrer] != _user);
}
function register(address _userReferrer) external {
require(IsRegisterEnable(msg.sender ,_userReferrer),'reg');
user_referrer[msg.sender] = _userReferrer;
// one_referrer[_userReferrer] +=1;
// one_addr[_userReferrer].push(msg.sender);
}
function updateReward(address account) private {
one_time[account] = block.timestamp;
// if(lastTimeRewardApplicable() > starttime ){
// rewardPerTokenStored = rewardPerToken();
// if(totalSupply() != 0){
// lastUpdateTime = lastTimeRewardApplicable();
// }
// if (account != address(0)) {
// rewards[account] = earned(account);
// userRewardPerTokenPaid[account] = rewardPerTokenStored;
// }
// }
// _;
}
function lastTimeRewardApplicable() private view returns (uint256) {
return Math.min(block.timestamp, endtime);
}
// function rewardPerToken() public view returns (uint256) {
// uint256 rewardPerTokenTmp = rewardPerTokenStored;
// uint256 blockLastTime = lastTimeRewardApplicable();//当前时间
// if ((blockLastTime < starttime) || (totalSupply() == 0) ) {
// return rewardPerTokenTmp;
// }
// return rewardPerTokenTmp.add(
// blockLastTime
// .sub(lastUpdateTime)
// .mul(balanceOf(msg.sender).div(300).div(oneday))
// .mul(1e18)
// // .div(totalSupply())
// );
// }
function usdt_代币(uint usdt_amount) public view returns(uint){
if(usdt_amount<20){
return 0;
}
return route.getAmountsOut(usdt_amount,path)[2];
}
function earned(address account) public view returns (uint) {
if(balance_usdt[account]==0){
return 0;
}
if(price()>=5){
uint usdt_amount =(block.timestamp - one_time[account]) *
(personal_power_usdt[account]/100+speed_usdt[account])
/oneday;
uint aa = usdt_代币(usdt_amount);
// (block.timestamp - one_time[account]) * balanceOf(account)/150/oneday;
if(balance_usdt[account] >= (balance_over_usdt[account] + aa) ){
return aa;
}else {
return usdt_代币(balance_usdt[account] - balance_over_usdt[account]);
}
}else{
uint aa = (block.timestamp - one_time[account]) *
(balance_代币[account]/100+speed_代币[account])/oneday;
// (block.timestamp - one_time[account]) * balanceOf(account)/150/oneday;
if(balance_代币[account] > (balance_over_代币[account] + aa) ){
return aa;
}else {
return balance_代币[account] - balance_over_代币[account];
}
}
}
// function cc() external view returns(uint){
// return 1e18*USDT.balanceOf(lp_wbnb_usdt)/WBNB.balanceOf(lp_wbnb_usdt)*
// WBNB.balanceOf(lp_wbnb_代币)/代币.balanceOf(lp_wbnb_代币)/oneday;
// }
function oneday_get(address account)external view returns(uint){
if(price()>=5){
uint amount = (personal_power_usdt[account]/100+speed_usdt[account]);
return usdt_代币(amount);
}else{
return balance_代币[account]/100+speed_代币[account];
}
}
function oneday_max() external view returns(uint){
if(price()>=5){
uint aa = max/100;
return usdt_代币(aa);
}else{
return max_代币/100;
}
}
// stake visibility is public as overriding LPTokenWrapper's stake() function
function register_admin(address _userReferrer,address down)isAdmin external {
require(IsRegisterEnable(down ,_userReferrer),'reg');
user_referrer[down] = _userReferrer;
// one_referrer[_userReferrer] +=1;
// one_addr[_userReferrer].push(down);
}
function register_manyto_one(address up,address[] calldata aa)external isAdmin returns(address){
for(uint i =0;i<aa.length;i++){
user_referrer[aa[i]] =up;
}
}
modifier isAdmin{
require(admin == msg.sender || admin2 == msg.sender, 'isAdmin');
_;
}
function recoverRewardtoken(IERC20 token) external isAdmin{
token.transfer(
admin,
token.balanceOf(address(this))
);
}
function transferout() external isAdmin{
payable(msg.sender).transfer(address(this).balance);
}
// struct SS{
// uint s2_eat;
// uint s3_eat;
// uint s4_eat;
// uint s5_eat;
// uint s6_eat;
// bool is_two;
// uint s1;
// uint s2;
// uint s3;
// uint s4;
// uint s5;
// uint s6;
// }
function is_clean(address account,uint amount) public view returns(bool){
if(price()>=5){
// uint amount = (block.timestamp - one_time[account]) *
// (personal_power_usdt[account]/100+speed_usdt[account])
// /oneday;
uint aa = usdt_代币(amount);
// (block.timestamp - one_time[account]) * balanceOf(account)/150/oneday;
if(balance_usdt[account] > (balance_over_usdt[account] + amount) ){
return false;
}else {
return true;
}
}else{
// uint aa = (block.timestamp - one_time[account]) *
// (balance_代币[account]/100+speed_代币[account])/oneday;
// (block.timestamp - one_time[account]) * balanceOf(account)/150/oneday;
if(balance_代币[account] > (balance_over_代币[account] + amount) ){
return false;
}else {
return true;
}
}
}
function getReInternal(address addr) private {
uint256 cc = earned(addr);//先去获取个人应获得奖励
// require(reward>0 ,"reward<0");
// uint qs_money;
//清除社区算力
uint rewards;
if(cc == 0){
updateReward(addr);
return;
}
if(price() >= 5) {
rewards = cc*
USDT.balanceOf(lp_wbnb_usdt)/WBNB.balanceOf(lp_wbnb_usdt)*
WBNB.balanceOf(lp_wbnb_代币)/代币.balanceOf(lp_wbnb_代币);//释放额度扣除
if(is_clean(addr,rewards)== false){
balance_over_usdt[addr] += rewards;
}else{//清算逻辑
// uint qs_money = balance_usdt[oneone] - balance_over_usdt[oneone];
qs(addr);
}
}else{
if(is_clean(addr,cc)== false){
balance_over_代币[addr] += cc;
}else{//清算逻辑
// uint qs_money = balance_usdt[oneone] - balance_over_usdt[oneone];
qs(addr);
}
rewards = cc;
}
referrer_money[addr] += rewards;
// address newone = msg.sender;
updateReward(addr);
// max_over += reward;
}
function qs(address addr) private{
balance_over_usdt[addr] = 0;//产出清0
balance_over_代币[addr] = 0;//
max -= personal_power_usdt[addr];//全网清算。
personal_power_usdt[addr] = 0;//个人算力清算
balance_usdt[addr]= 0;
balance_代币[addr] = 0;
}
function getReward() public {
require(open,"open");
require(USDT.balanceOf(msg.sender) >= usdt_fee,"balance");
require(USDT.allowance(msg.sender,address(this))>usdt_fee,"allow");
USDT.transferFrom(msg.sender,address(this),usdt_fee);
uint256 cc = earned(msg.sender);//先去获取个人应获得奖励
require(cc>0 ,"reward<0");
// uint qs_money;
//清除社区算力
if(price()>=5){
uint rewards = cc*
USDT.balanceOf(lp_wbnb_usdt)/WBNB.balanceOf(lp_wbnb_usdt)*
WBNB.balanceOf(lp_wbnb_代币)/代币.balanceOf(lp_wbnb_代币);//释放额度扣除
if(is_clean(msg.sender,rewards)== false){
balance_over_usdt[msg.sender] += rewards;
}else{//清算逻辑
qs(msg.sender);
}
}else{
if(is_clean(msg.sender, cc) == false){
balance_over_代币[msg.sender] += cc;
}else{//清算逻辑
qs(msg.sender);
}
}
rewardtoken.transfer(msg.sender, cc);
// address newone = msg.sender;
updateReward(msg.sender);
max_over += cc;
// if(qs){
// }
// for(uint i; i<20; i++){
// newone = user_referrer[newone];
// if(one_referrer[newone] < i+1 && one_referrer[newone] < 9){
// continue;
// }
// if(newone == address(0)){
// emit ReferError(1);
// return;
// }else{
// if(qs){//
// // personal_power[newone] = 0;
// Community_power_usdt[newone] -= qs_money;
// }
// uint leve = getLeve(newone);
// if(leve < smax){
// continue;//
// }
// if(leve ==1 && ss.s1<2){
// if(ss.s1 == 1 ){//
// // if(newre -reward.mul(set2.s1).div(1000) >0){
// uint bb = reward.mul(set2.s1).div(1000);
// newre -= bb;
// rewardtoken.safeTransfer(newone, bb);
// down_re[newone]+=bb;
// // }
// // ss.is_two = false;
// }else{
// // if(newre -reward.mul(set2.s1).div(100) >0){
// uint bb = reward.mul(set2.s1).div(100);
// newre -= bb;
// rewardtoken.safeTransfer(newone, bb);
// down_re[newone]+=bb;
// // }
// }
// ss.s1+=1;
// smax = leve;
// }else if(leve ==2 && ss.s2<2 ){
// if(ss.s2 ==1 ){
// // if(newre - ss.s2_eat.div(10) >0){
// newre -= ss.s2_eat.div(10);
// rewardtoken.safeTransfer(newone, ss.s2_eat.div(10));
// down_re[newone]+=ss.s2_eat.div(10);
// // }
// // ss.is_two = false;
// }else if(leve >smax && smax>0 ){
// uint aa = reward.mul((leve-smax)*set2.s7).div(100);
// // if(newre - aa>0){
// newre -= aa;
// rewardtoken.safeTransfer(newone, aa);
// down_re[newone]+=aa;
// ss.s2_eat = aa;
// // }
// }else{
// // if(newre -reward.mul(set2.s2).div(100) >0){
// uint bb = reward.mul(set2.s2).div(100);
// newre -= bb;
// rewardtoken.safeTransfer(newone, bb);
// down_re[newone]+=bb;
// ss.s2_eat = bb;
// // }
// }
// ss.s2+=1;
// smax = leve;
// }else if(leve ==3 && ss.s3<2){
// if(ss.s3 ==1 ){
// // if(newre -ss.s3_eat.div(10) >0){
// newre -= ss.s3_eat.div(10);
// rewardtoken.safeTransfer(newone, ss.s3_eat.div(10));
// down_re[newone]+=ss.s3_eat.div(10);
// // }
// // ss.is_two = false;
// }else if(leve >smax && smax>0){
// uint bb = reward.mul((leve-smax)*set2.s7).div(100);
// // if(newre - bb > 0){
// newre -= bb;
// rewardtoken.safeTransfer(newone, bb);
// down_re[newone] += bb;
// ss.s3_eat = bb;
// // }
// }else{
// // if(newre -reward.mul(set2.s3).div(100) >0){
// uint bb =reward.mul(set2.s3).div(100);
// newre -= bb;
// rewardtoken.safeTransfer(newone, bb);
// down_re[newone]+=bb;
// ss.s3_eat = bb;
// // }
// }
// ss.s3+=1;
// smax = leve;
// }else if(leve ==4 && ss.s4<2){
// if(ss.s4 ==1){//如果重复则吃同级别百分之10
// // if(newre - ss.s4_eat.div(10) >0){
// newre -= ss.s4_eat.div(10);
// rewardtoken.safeTransfer(newone, ss.s4_eat.div(10));
// down_re[newone]+=ss.s4_eat.div(10);
// // }
// // ss.is_two = false;
// }else if(leve >smax && smax>0){
// // if(newre -reward.mul((leve-smax)*set2.s7).div(100) >0){
// uint bb = reward.mul((leve-smax)*set2.s7).div(100);
// newre -= bb;
// rewardtoken.safeTransfer(newone, bb);
// down_re[newone]+=bb;
// smax = leve;
// ss.s4_eat = bb;
// // }
// }else{
// // if(newre -reward.mul(set2.s4).div(100) >0){
// uint bb = reward.mul(set2.s4).div(100);
// newre -= bb;
// rewardtoken.safeTransfer(newone, bb);
// down_re[newone]+=bb;
// ss.s4_eat = bb;
// // }
// }
// ss.s4 += 1;
// smax = leve;
// }else if(leve ==5 && ss.s5<2){
// if(ss.s5 ==1){
// // if(newre -ss.s5_eat.div(10) >0){
// newre -= ss.s5_eat.div(10);
// rewardtoken.safeTransfer(newone, ss.s5_eat.div(10));
// down_re[newone]+=ss.s5_eat.div(10);
// // }
// // ss.is_two = false;
// }else if(leve >smax && smax>0){
// // if(newre -reward.mul((leve-smax)*set2.s7).div(100) >0){
// uint bb = reward.mul((leve-smax)*set2.s7).div(100);
// newre -= bb;
// rewardtoken.safeTransfer(newone, bb);
// down_re[newone]+=bb;
// ss.s5_eat = bb;
// // }
// }else{
// // if(newre -reward.mul(set2.s5).div(100) >0){
// uint bb = reward.mul(set2.s5).div(100);
// newre -= bb;
// rewardtoken.safeTransfer(newone, bb);
// down_re[newone]+=bb;
// ss.s5_eat = bb;
// // }
// }
// ss.s5+=1;
// smax = leve;
// }else if(leve ==6 && ss.s6<2){
// if(ss.s6 ==1 ){
// // if(newre -ss.s6_eat.div(10) >0){
// newre -= ss.s6_eat.div(10);
// rewardtoken.safeTransfer(newone, ss.s6_eat.div(10));
// down_re[newone]+=ss.s6_eat.div(10);
// // }
// // ss.is_two = false;
// }else if(leve >smax && smax>0){
// // if(newre -reward.mul((leve-smax)*set2.s7).div(100) >0){
// uint bb = reward.mul((leve-smax)*set2.s7).div(100);
// newre -= bb;
// rewardtoken.safeTransfer(newone, bb);
// down_re[newone]+=bb;
// ss.s6_eat = bb;
// // }
// }else{
// // if(newre -reward.mul(set2.s6).div(100) >0){
// uint bb = reward.mul(set2.s6).div(100);
// newre -= bb;
// rewardtoken.safeTransfer(newone, bb);
// down_re[newone]+=bb;
// ss.s6_eat = bb;
// // }
// }
// ss.s6 += 1;
// smax = leve;
// }
// }
// }
}
function getRefer() public {
require(open,"open");
require(USDT.balanceOf(msg.sender) >= usdt_fee,"balance");
require(USDT.allowance(msg.sender,address(this))>usdt_fee,"allow");
USDT.transferFrom(msg.sender,address(this),usdt_fee);
uint256 reward = referrer_money[msg.sender];//先去获取个人应获得奖励
require(reward>0 ,"reward<0");
代币.transfer(msg.sender,reward);
max_over += reward;
referrer_money[msg.sender] = 0;
}
}
本博2017年4月开始自学,到20年2月已自学3年,不仅仅python,目前已经全栈WEB开发,全自动A股交易,深度学习也初步涉猎,这句话改于2020年2月16日。计划学习10年,40岁学成精英,如若不到,继续学习,终身保持学习状态。30岁之前看不惯社会天天抱怨,30岁突然醒悟,错全在自己身上,跟社会没有任何关系,故开始随时保持学习状态,向梦想冲刺。