Home > Blockchain >  Contract betbeb intelligence source code
Contract betbeb intelligence source code

Time:09-23

/* *
* Submitted for verification at Etherscan. IO on the 2019-09-09
* BEB dapp for www.betbeb.com
*/
Pragma solidity ^ 0.4.24;
Interface tokenTransfer {
The function transfer (address, receiver, uint amount);
The function transferFrom (address _from, address _to, uint256 _value);
The function balanceOf (address receiver) returns (uint256);
}

Contract Ownable {
Address public owner;

The function Ownable () public {
The owner=MSG. Sender;
}

Modifier onlyOwner {
Require (MSG. Sender==owner);
_;
}

/* *
* @ param newOwner address
*/
The function transferOwnership (address newOwner) onlyOwner public {
If (newOwner!=address (0)) {
The owner=newOwner;
}
}
}

Contract BEBmining is Ownable {
TokenTransfer public bebTokenTransfer;//tokens,
Uint8 decimals=18;
Struct BebUser {
Address customerAddr;
Uint256 amount;
Uint256 bebtime;
Uint256 interest;
}
//the ETH miner
Struct miner {
Uint256 mining,;
Uint256 _mining;
Uint256 lastDate;
Uint256 amountdays;
Uint256 ethbomus;
Uint256 amountTotal;
Uint256 ETHV1;
Uint256 ETHV2;
Uint256 ETHV3;
Uint256 ETHV4;
Uint256 ETHV5;
Uint256 IntegralMining;
}
Struct bebvv {
Uint256 BEBV1;
Uint256 BEBV2;
Uint256 BEBV3;
Uint256 BEBV4;
Uint256 BEBV5;
}
The mapping (address=& gt; Bebvv) public bebvvs;
The mapping (address=& gt; Miner) public miners;
Address [] public minersArray;
Uint256 ethExchuangeRate=210;//the eth - usd
Uint256 bebethexchuang=97000;//beb - eth
Uint256 bebethex=83360;//the eth - beb
Uint256 depreciationTime=86400;
Uint256 SellBeb;//SellBeb MAX 10000 beb
Uint256 BuyBeb;//BuyBeb MAX 100000 beb
Uint256 IncomePeriod=730;//Income period
Address addressDraw;
Uint256 intotime=1579073112;
The event bomus (address to, uint256 amountBouns, string lx);
The function BEBmining (address _tokenAddress, address the Draw) {
BebTokenTransfer=tokenTransfer (_tokenAddress);
AddressDraw=the Draw;
}
//BUY Ethminter
The function EthTomining (address _addr) payable public {
Miner storage user=miners [_addr];
Require (amount> 800000000000000000);
If (usdt> 40000000000000000000) {
Usdt=amount * 150/100;
User. ETHV5 +=1;
} else {
If (usdt & gt; 25000000000000000000) {
Usdt=amount * 130/100;
User. ETHV4 +=1;
}
The else {
If (usdt & gt; 9000000000000000000) {
Usdt=amount * 120/100;
User. ETHV3 +=1;
}
The else {
If (usdt & gt; 4000000000000000000) {
Usdt=amount * 110/100;
User. ETHV2 +=1;
}
The else {
User. ETHV1 +=1;
}
}
}
}
Uint256 _transfer=amount * 15/100;
AddressDraw. Transfer (_transfer);
TotalInvestment +=usdt;
User. Mining, +=usdt;
User. _mining +=_udst;
//user. _mining +=_udst;
User. LastDate=now;
Bomus (MSG) sender, usdt, "Purchase success!" );
}
//BUY BEBminter
The function BebTomining (uint256 _value, address _addr) public {
Uint256 usdt=_value * 10 * * 18;
Uint256 _udst=usdt/bebethex;
Uint256 bebudst=usdt/bebethex;
Miner storage user=miners [_addr];
Bebvv storage _user=bebvvs [_addr];
Require (usdt> 40000000000000000000000);
If (usdt> 2000000000000000000000000) {
_udst usdt/bebethexchuang *=150/100;
_user. BEBV5 +=1;
} else {
If (usdt & gt; 400000000000000000000000) {
_udst usdt/bebethexchuang *=130/100;
_user. BEBV4 +=1;
}
The else {
If (usdt & gt; 200000000000000000000000) {
_udst usdt/bebethexchuang *=120/100;
_user. BEBV3 +=1;
}
The else {
If (usdt & gt; 120000000000000000000000) {
_udst usdt/bebethexchuang *=110/100;
_user. BEBV2 +=1;
} else {
_user. BEBV1 +=1;
}
}
}

}
BebTokenTransfer. TransferFrom (MSG) sender, the address (this), usdt);
TotalInvestment +=_udst;
User. Mining, +=_udst;
User. _mining +=bebudst;
User. LastDate=now;
Bomus (MSG) sender, usdt, "Purchase success!" );
}
//BUY integral minter
The function integralTomining (uint256 _value, address _addr) onlyOwner {
Uint256 eth=_value * 10 * * 18;
Uint256 _eth=eth/bebethex;
Miner storage user=miners [_addr];
BebTokenTransfer. TransferFrom (MSG) sender, the address (this), eth);
TotalInvestment +=_eth;
User. Mining, +=_eth;
If (user. LastDate==0) {
User. LastDate=now;
}
Uint256 jifen=_value/50000;
User. IntegralMining +=jifen;
//user. LastDate=now;
Bomus (_addr _eth, "Purchase success!" );
}
//BUY migration
The function migrateTomining (uint256 _value, uint256 _minin, uint256 time, uint256 _amountTotal, address _addr, uint256 bebv1, uint256 bebv2, uint256 bebv3, uint256 bebv4, uint256 bebv5) onlyOwner {
Require (intotime> Now);//functional expired invalid
Miner storage user=miners [_addr];
Bebvv storage _user=bebvvs [_addr];
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related